Skip to main content
POST
/
chat
/
completions
Create Chat Completion
curl --request POST \
  --url https://platform.qubrid.com/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "openai/gpt-oss-120b",
  "messages": [
    {
      "role": "user",
      "content": "Summarize this support ticket into bullet-point next steps for the agent."
    }
  ],
  "max_tokens": 4096,
  "temperature": 0.7,
  "top_p": 1,
  "stream": true
}
'
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1710000000,
  "model": "openai/gpt-oss-120b",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "- Identify issue\n- Provide solution\n- Confirm resolution with user"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 20,
    "completion_tokens": 10,
    "total_tokens": 30
  },
  "x_metrics": {
    "ttft_seconds": 0.38,
    "tps": 42.1,
    "total_time_seconds": 1.24
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
string
required

The language model to use.

Example:

"openai/gpt-oss-120b"

messages
object[]
required

Conversation messages in chat format.

max_tokens
integer
default:4096

Maximum number of tokens to generate.

temperature
number
default:0.7

Controls randomness in output.

top_p
number
default:1

Nucleus sampling parameter.

stream
boolean
default:true

Whether to stream responses incrementally.

Response

Chat completion generated successfully

Standard OpenAI-compatible chat completion response or streamed chunks.

id
string
Example:

"chatcmpl-abc123"

object
string
Example:

"chat.completion"

created
integer
Example:

1710000000

model
string
Example:

"openai/gpt-oss-120b"

choices
object[]
usage
object
x_metrics
object

Performance metrics for the request.