Chat
Chat Completions
Get Started
Developer Guide
- Providers
- Code Integration
Configure Gateway
- Access Control
- Rate Limiting
- Load Balancing
- Fallback
- Guardrails
Observability
Deployment
Embeddings
Rerank
Responses
Moderations
Chat
Chat Completions
Generate chat-based completions using the specified model.
POST
/
chat
/
completions
curl --request POST \
--url https://{controlPlaneURL}/api/llm/api/inference/openai/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "<string>",
"messages": [
{
"role": "system",
"content": "<string>"
}
],
"tools": [
{
"type": "<string>",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {}
}
}
],
"tool_choice": "none",
"temperature": 123,
"top_p": 123,
"n": 123,
"stream": true,
"logprobs": 123,
"stop": "<string>",
"max_tokens": 123,
"presence_penalty": 123,
"frequency_penalty": 123,
"logit_bias": {},
"user": "<string>"
}'
{
"id": "<string>",
"object": "<string>",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>"
},
"logprobs": "<any>",
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {
"cached_tokens": 123,
"audio_tokens": 123
},
"completion_tokens_details": {
"reasoning_tokens": 123,
"audio_tokens": 123,
"accepted_prediction_tokens": 123,
"rejected_prediction_tokens": 123
}
},
"service_tier": "<string>",
"system_fingerprint": "<string>"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Parameters for generating chat completions.
The body is of type object
.
Response
200
application/json
Chat completions generated successfully.
The response is of type object
.
Was this page helpful?
curl --request POST \
--url https://{controlPlaneURL}/api/llm/api/inference/openai/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "<string>",
"messages": [
{
"role": "system",
"content": "<string>"
}
],
"tools": [
{
"type": "<string>",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {}
}
}
],
"tool_choice": "none",
"temperature": 123,
"top_p": 123,
"n": 123,
"stream": true,
"logprobs": 123,
"stop": "<string>",
"max_tokens": 123,
"presence_penalty": 123,
"frequency_penalty": 123,
"logit_bias": {},
"user": "<string>"
}'
{
"id": "<string>",
"object": "<string>",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"message": {
"role": "<string>",
"content": "<string>"
},
"logprobs": "<any>",
"finish_reason": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {
"cached_tokens": 123,
"audio_tokens": 123
},
"completion_tokens_details": {
"reasoning_tokens": 123,
"audio_tokens": 123,
"accepted_prediction_tokens": 123,
"rejected_prediction_tokens": 123
}
},
"service_tier": "<string>",
"system_fingerprint": "<string>"
}