Create a chat completion (OpenAI-compatible)
const url = 'https://dashboard.quantcdn.io/oai/v1/chat/completions';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"model":"anthropic.claude-sonnet-4-6","messages":[{"role":"system","content":"example"}],"stream":false,"max_tokens":1,"temperature":1,"top_p":1,"tools":[{}],"tool_choice":"example","stream_options":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://dashboard.quantcdn.io/oai/v1/chat/completions \ --header 'Content-Type: application/json' \ --data '{ "model": "anthropic.claude-sonnet-4-6", "messages": [ { "role": "system", "content": "example" } ], "stream": false, "max_tokens": 1, "temperature": 1, "top_p": 1, "tools": [ {} ], "tool_choice": "example", "stream_options": {} }'Drop-in replacement for OpenAI’s POST /v1/chat/completions. Point any OpenAI SDK at base_url=https://stream: true to receive Server-Sent Events (chat.completion.chunk objects terminated by data: [DONE]); otherwise a single chat.completion object is returned. Supports tool/function calling and the standard tool_choice modes.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
A model id from GET /oai/v1/models
Example
anthropic.claude-sonnet-4-6object
Stream the response as SSE chat.completion.chunk events
OpenAI function tool definitions
object
Auto | none | required | {type:function, function:{name}}
{include_usage: true} to emit a final usage chunk when streaming
object
Responses
Section titled “Responses”A chat.completion object (or an SSE stream of chat.completion.chunk objects when stream=true)
object
object
object
object
object
Example
{ "id": "chatcmpl-abc123", "object": "chat.completion", "choices": [ { "finish_reason": "stop" } ]}Missing or invalid API key
Token not scoped to an organisation, or org lacks AI access
Invalid request
