Models and voice
Chat completions
POST /v1/chat/completions in the OpenAI format, with streaming and tool calls.
Request
Send the stock OpenAI request. Setu forwards these fields and ignores the rest:
| Field | Notes |
|---|---|
| model | A public model id, e.g. quantum-lite. |
| messages | Required, non-empty. Roles system, user, assistant, tool. |
| max_tokens | Default 8,192, capped at 16,384. |
| stream | true for Server-Sent Events. |
| tools / tool_choice | OpenAI function tools; tool_choice defaults to auto when tools are sent. |
| temperature | Optional. |
curl https://setu.supremeai.services/api/setu/v1/chat/completions \
-H "Authorization: Bearer $SETU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "quantum-lite",
"messages": [{ "role": "user", "content": "Say hello in Nepali." }]
}'import OpenAI from 'openai';
// Your OpenAI code, pointed at Setu.
const client = new OpenAI({
baseURL: 'https://setu.supremeai.services/api/setu/v1',
apiKey: process.env.SETU_API_KEY,
});
const reply = await client.chat.completions.create({
model: 'quantum-lite',
messages: [{ role: 'user', content: 'Say hello in Nepali.' }],
});
console.log(reply.choices[0].message.content);import os
from openai import OpenAI
# Your OpenAI code, pointed at Setu.
client = OpenAI(
base_url="https://setu.supremeai.services/api/setu/v1",
api_key=os.environ["SETU_API_KEY"],
)
reply = client.chat.completions.create(
model="quantum-lite",
messages=[{"role": "user", "content": "Say hello in Nepali."}],
)
print(reply.choices[0].message.content)Tool calls
Tool calls come back in the OpenAI format (message.tool_calls). Your code runs the tool and sends the result back as a role: "tool" message.
import OpenAI from 'openai';
const client = new OpenAI({ baseURL: 'https://setu.supremeai.services/api/setu/v1', apiKey: process.env.SETU_API_KEY });
const reply = await client.chat.completions.create({
model: 'quantum-lite',
messages: [{ role: 'user', content: 'What is the weather in Pokhara?' }],
tools: [{
type: 'function',
function: {
name: 'get_weather',
description: 'Current weather for a city',
parameters: { type: 'object', properties: { city: { type: 'string' } }, required: ['city'] },
},
}],
});
// Your code runs the tool, then sends the result back with role: 'tool'.
console.log(reply.choices[0].message.tool_calls);If a provider fails
When a DeepSeek-based model fails or is unavailable, the request is retried on a Gemini model automatically. The response still names the model you asked for.
Billing
Each call uses credits for the tokens in and out, from the provider’s reported usage. With a Setu key, the estimated credits are held before the call and released if it fails.