Chat Completions
Use Chat Completions when your application already sends messages with role and content fields.
Request
Section titled “Request”| Field | Value |
|---|---|
| Method | POST |
| Endpoint | /chat/completions |
| Full URL | https://supado.com/v1/chat/completions |
| Auth | Authorization: Bearer <SUPADO_API_KEY> |
Common request fields:
| Field | Type | Notes |
|---|---|---|
model | string | Use a model available in your Supado account. |
messages | array | OpenAI-style chat messages. |
temperature | number | Optional. Support can depend on the model. |
stream | boolean | Optional. Use true for SSE streaming if supported. |
Example
Section titled “Example”Non-streaming curl
Section titled “Non-streaming curl”curl https://supado.com/v1/chat/completions \ -H "Authorization: Bearer $SUPADO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o-mini", "messages": [ { "role": "system", "content": "Answer in one short paragraph." }, { "role": "user", "content": "What should I verify after changing API gateways?" } ] }'TypeScript SDK
Section titled “TypeScript SDK”import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.SUPADO_API_KEY, baseURL: "https://supado.com/v1",});
const completion = await client.chat.completions.create({ model: "gpt-4o-mini", messages: [ { role: "system", content: "Answer in one short paragraph." }, { role: "user", content: "What should I verify after changing API gateways?" }, ],});
console.log(completion.choices[0]?.message?.content);Response
Section titled “Response”For a successful non-streaming request, read the assistant message from:
completion.choices[0]?.message?.contentFor streaming requests, set stream: true and consume Server-Sent Events incrementally. See Streaming Responses for client behavior and proxy considerations.
Errors
Section titled “Errors”Requests must use a messages array, a model available in Supado, and a JSON body. Preserve non-2xx response bodies in server-side logs without logging secrets.
Use the Errors page when a request reaches Supado but does not complete successfully.