Create a chat completion
OpenAI-compatible Chat Completions API. Set stream=true to receive Server-Sent Events. The response and error envelope follow the Chat Completions/OpenAI-compatible shape.
- Тип: array object[] · ChatMessage[] 1…messagesобязательно
- contentможет быть nullобязательно
- Тип: string
- roleТип: string enumобязательнозначения
- system
- developer
- user
- assistant
- tool
- nameТип: string
- toolТип: string
_call _id - toolТип: array object[]
_calls - propertyТип: anything
Name
- propertyТип: anything
Name
- Тип: stringmodelобязательно
- Тип: integermax
_completion _tokens мин.:1Integer numbers.
- Тип: integermax
_tokens мин.:1Integer numbers.
- Тип: integernмин.:1
Integer numbers.
- Тип: objectresponse
_format - propertyТип: anything
Name
- может быть nullstop
- Тип: string
- Тип: booleanstream
- Тип: numbertemperatureмин.:0
- tool
_choice - Тип: string
- Тип: array object[]tools
- propertyТип: anything
Name
- Тип: numbertop
_p мин.:0макс.:1 - Тип: anythingproperty
Name
- Тип: stringuser
- Тип: anythingproperty
Name
- Тип: object · ChatCompletionResponse200
Chat completion or streaming response
- Тип: array object[] · ChatChoice[]choicesобязательно
- finishТип: string | null
_reason - indexТип: integer
Integer numbers.
- logprobsТип: object | null
- propertyТип: anything
Name
- messageТип: object · ChatMessage
- contentможет быть nullобязательно
- Тип: string
- roleТип: string enumобязательнозначения
- system
- developer
- user
- assistant
- tool
- nameТип: string
- toolТип: string
_call _id - toolТип: array object[]
_calls - propertyТип: anything
Name
- propertyТип: anything
Name
- propertyТип: anything
Name
- Тип: stringidобязательно
- Тип: stringobjectобязательно
Usually chat.completion for non-streaming responses.
- Тип: integer Формат: int64created
Signed 64-bit integers (long type).
- Тип: stringmodel
- Тип: stringsystem
_fingerprint - Тип: object · Usageusage
Provider usage object. Fields vary by endpoint and provider.
- propertyТип: anything
Name
- Тип: anythingproperty
Name
- Тип: object · OpenAIErrorResponse400
Invalid request, model, or provider mapping
OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.
- Тип: objecterrorобязательно
- messageТип: stringобязательно
- codeТип: string | null
- paramТип: string | null
- typeТип: string
OpenAI-compatible error type when supplied.
- propertyТип: anything
Name
- Тип: anythingproperty
Name
application/json - Тип: object · OpenAIErrorResponse401
Invalid or missing Felo API key
OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.
- Тип: objecterrorобязательно
- messageТип: stringобязательно
- codeТип: string | null
- paramТип: string | null
- typeТип: string
OpenAI-compatible error type when supplied.
- propertyТип: anything
Name
- Тип: anythingproperty
Name
application/json - Тип: object · OpenAIErrorResponse402
Insufficient balance
OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.
- Тип: objecterrorобязательно
- messageТип: stringобязательно
- codeТип: string | null
- paramТип: string | null
- typeТип: string
OpenAI-compatible error type when supplied.
- propertyТип: anything
Name
- Тип: anythingproperty
Name
application/json - Тип: object · OpenAIErrorResponse403
Account is not permitted to use the model. Disabled models are also rejected before upstream calls. Existing accepted requests and tasks continue.
OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.
- Тип: objecterrorобязательно
- messageТип: stringобязательно
- codeТип: string | null
- paramТип: string | null
- typeТип: string
OpenAI-compatible error type when supplied.
- propertyТип: anything
Name
- Тип: anythingproperty
Name
application/json - Тип: object · OpenAIErrorResponse429
Spending or request limit reached
OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.
- Тип: objecterrorобязательно
- messageТип: stringобязательно
- codeТип: string | null
- paramТип: string | null
- typeТип: string
OpenAI-compatible error type when supplied.
- propertyТип: anything
Name
- Тип: anythingproperty
Name
application/json - Тип: object · OpenAIErrorResponse502
Upstream provider request failed
OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.
- Тип: objecterrorобязательно
- messageТип: stringобязательно
- codeТип: string | null
- paramТип: string | null
- typeТип: string
OpenAI-compatible error type when supplied.
- propertyТип: anything
Name
- Тип: anythingproperty
Name
application/json - Тип: object · OpenAIErrorResponse503
Provider or billing service unavailable
OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.
- Тип: objecterrorобязательно
- messageТип: stringобязательно
- codeТип: string | null
- paramТип: string | null
- typeТип: string
OpenAI-compatible error type when supplied.
- propertyТип: anything
Name
- Тип: anythingproperty
Name
application/json
curl https://openapi.felo.ai/api/v1/chat/completions \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"model": "gpt-5.5",
"messages": [
{
"role": "user",
"content": "Write a one-sentence greeting."
}
],
"stream": false
}'
{
"id": "string",
"object": "string",
"created": 1,
"model": "string",
"choices": [
{
"index": 1,
"message": {
"role": "system",
"content": "string",
"name": "string",
"tool_call_id": "string",
"tool_calls": [
{
"additionalProperty": "anything"
}
],
"additionalProperty": "anything"
},
"finish_reason": null,
"logprobs": null,
"additionalProperty": "anything"
}
],
"usage": {
"additionalProperty": "anything"
},
"system_fingerprint": "string",
"additionalProperty": "anything"
}