Skip to main content
POST
/
chat
/
completions
Create a chat completion
curl --request POST \
  --url https://api.sailresearch.com/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "openai/gpt-oss-20b",
  "messages": [
    {
      "role": "system",
      "content": "You are a concise assistant."
    },
    {
      "role": "user",
      "content": "Summarize retrieval-augmented generation in 3 bullets."
    }
  ],
  "max_completion_tokens": 300
}
'
{
  "id": "<string>",
  "object": "chat.completion",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "assistant",
        "content": "<string>",
        "reasoning_content": "<string>",
        "refusal": "<string>"
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123,
    "prompt_tokens_details": {},
    "completion_tokens_details": {}
  }
}

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
messages
object[]
required
Minimum array length: 1
temperature
number | null
Required range: 0 <= x <= 2
top_p
number | null
Required range: 0 <= x <= 1
max_completion_tokens
integer | null
Required range: x >= 1
response_format
object
reasoning_effort
enum<string> | null
Available options:
low,
medium,
high
n
enum<integer>

Only n=1 is currently supported.

Available options:
1
modalities
enum<string>[]
Required array length: 1 element
Available options:
text
stream
enum<boolean>

Streaming is not currently supported.

Available options:
false
store
enum<boolean>

Only true is supported.

Available options:
true
user
string
Maximum string length: 256
metadata
object

Optional string metadata. completion_window controls scheduling; completion_webhook/webhook_token configure completion webhooks.

Response

Chat completion response.

id
string
required
object
enum<string>
required
Available options:
chat.completion
created
integer
required
model
string
required
choices
object[]
required
Minimum array length: 1
usage
object