Skip to content
SETU by SUPREME AI

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:

FieldNotes
modelA public model id, e.g. quantum-lite.
messagesRequired, non-empty. Roles system, user, assistant, tool.
max_tokensDefault 8,192, capped at 16,384.
streamtrue for Server-Sent Events.
tools / tool_choiceOpenAI function tools; tool_choice defaults to auto when tools are sent.
temperatureOptional.
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." }]
  }'

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.