OpenAI chat completions
OpenAI-compatible chat completion endpoint for multi-turn conversations, tool calling, and streaming responses.
Body·
required
application/json
- Type: array object[] ·messagesrequired
- Type: stringmodelrequired
- Type: booleanstream
- Type: number Format: doubletemperaturemin:0max:2
Sampling temperature. Type: double. Valid range: 0-2.
Responses
- application/json
- application/json
Request Example for post/v1/chat/completions
curl https://api.apigo.ai/v1/chat/completions \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": ""
}
],
"temperature": 0,
"stream": true
}'
{
"id": "string",
"object": "chat.completion",
"choices": [
{
"index": 1,
"message": {
"role": "system",
"content": "string"
},
"finish_reason": "string"
}
],
"usage": {
"prompt_tokens": 1,
"completion_tokens": 1,
"total_tokens": 1
}
}