Chat
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
Authorizations
AuthorizationstringRequired
API key as bearer token in Authorization header
Body
providerone of · nullableOptional
When multiple model providers are available, optionally indicate your routing preference.
routeone of · nullableOptional
string · enumOptionalPossible values:
userstringOptional
session_idstringOptional
A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
modelstringOptional
modelsstring[]Optional
frequency_penaltynumber · double · nullableOptional
logprobsboolean · nullableOptional
top_logprobsnumber · double · nullableOptional
max_completion_tokensnumber · double · nullableOptional
max_tokensnumber · double · nullableOptional
presence_penaltynumber · double · nullableOptional
response_formatone ofOptional
or
or
or
or
seedinteger · nullableOptional
stopone of · nullableOptional
stringOptional
string[]Optional
streambooleanOptionalDefault:
falsestream_optionsone of · nullableOptional
temperaturenumber · double · nullableOptionalDefault:
1tool_choiceone ofOptional
string · enumOptionalPossible values:
top_pnumber · double · nullableOptionalDefault:
1Responses
200
Successful chat completion response
application/json
idstringRequired
creatednumber · doubleRequired
modelstringRequired
objectstring · enumRequiredPossible values:
system_fingerprintstring · nullableOptional
400
Bad request - invalid parameters
application/json
401
Unauthorized - invalid API key
application/json
429
Too many requests - rate limit exceeded
application/json
500
Internal server error
application/json
post/chat/completions
POST /api/v1/chat/completions HTTP/1.1
Host: app.interactive.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 51
{
"messages": [
{
"role": "system",
"content": "string"
}
]
}{
"id": "text",
"choices": [
{
"finish_reason": "tool_calls",
"index": 1,
"message": {
"role": "assistant",
"content": "text",
"name": "text",
"tool_calls": [
{
"id": "text",
"type": "function",
"function": {
"name": "text",
"arguments": "text"
}
}
],
"refusal": "text",
"reasoning": "text"
},
"reasoning_details": [
{
"type": "reasoning.summary",
"summary": "text",
"id": "text",
"format": "unknown",
"index": 1
}
],
"logprobs": {
"content": [
{
"token": "text",
"logprob": 1,
"bytes": [
1
],
"top_logprobs": [
{
"token": "text",
"logprob": 1,
"bytes": [
1
]
}
]
}
],
"refusal": [
{
"token": "text",
"logprob": 1,
"bytes": [
1
],
"top_logprobs": [
{
"token": "text",
"logprob": 1,
"bytes": [
1
]
}
]
}
]
}
}
],
"created": 1,
"model": "text",
"object": "chat.completion",
"system_fingerprint": "text",
"usage": {
"completion_tokens": 1,
"prompt_tokens": 1,
"total_tokens": 1,
"completion_tokens_details": {
"reasoning_tokens": 1,
"audio_tokens": 1,
"accepted_prediction_tokens": 1,
"rejected_prediction_tokens": 1
},
"prompt_tokens_details": {
"cached_tokens": 1,
"audio_tokens": 1,
"video_tokens": 1
}
}
}Last updated
Was this helpful?

