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.
- Type: array object[] · ChatMessage[] 1…messagesrequired
- contentnullablerequired
- Type: string
- roleType: string enumrequiredvalues
- system
- developer
- user
- assistant
- tool
- nameType: string
- toolType: string
_call _id - toolType: array object[]
_calls - propertyType: anything
Name
- propertyType: anything
Name
- Type: stringmodelrequired
- Type: integermax
_completion _tokens min:1Integer numbers.
- Type: integermax
_tokens min:1Integer numbers.
- Type: integernmin:1
Integer numbers.
- Type: objectresponse
_format - propertyType: anything
Name
- nullablestop
- Type: string
- Type: booleanstream
- Type: numbertemperaturemin:0
- tool
_choice - Type: string
- Type: array object[]tools
- propertyType: anything
Name
- Type: numbertop
_p min:0max:1 - Type: anythingproperty
Name
- Type: stringuser
- Type: anythingproperty
Name
- Type: object · ChatCompletionResponse200
Chat completion or streaming response
- Type: array object[] · ChatChoice[]choicesrequired
- finishType: string | null
_reason - indexType: integer
Integer numbers.
- logprobsType: object | null
- propertyType: anything
Name
- messageType: object · ChatMessage
- contentnullablerequired
- Type: string
- roleType: string enumrequiredvalues
- system
- developer
- user
- assistant
- tool
- nameType: string
- toolType: string
_call _id - toolType: array object[]
_calls - propertyType: anything
Name
- propertyType: anything
Name
- propertyType: anything
Name
- Type: stringidrequired
- Type: stringobjectrequired
Usually chat.completion for non-streaming responses.
- Type: integer Format: int64created
Signed 64-bit integers (long type).
- Type: stringmodel
- Type: stringsystem
_fingerprint - Type: object · Usageusage
Provider usage object. Fields vary by endpoint and provider.
- propertyType: anything
Name
- Type: anythingproperty
Name
- Type: object · OpenAIErrorResponse400
Invalid request, model, or provider mapping
OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.
- Type: objecterrorrequired
- messageType: stringrequired
- codeType: string | null
- paramType: string | null
- typeType: string
OpenAI-compatible error type when supplied.
- propertyType: anything
Name
- Type: anythingproperty
Name
application/json - Type: object · OpenAIErrorResponse401
Invalid or missing Felo API key
OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.
- Type: objecterrorrequired
- messageType: stringrequired
- codeType: string | null
- paramType: string | null
- typeType: string
OpenAI-compatible error type when supplied.
- propertyType: anything
Name
- Type: anythingproperty
Name
application/json - Type: object · OpenAIErrorResponse402
Insufficient balance
OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.
- Type: objecterrorrequired
- messageType: stringrequired
- codeType: string | null
- paramType: string | null
- typeType: string
OpenAI-compatible error type when supplied.
- propertyType: anything
Name
- Type: anythingproperty
Name
application/json - Type: 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.
- Type: objecterrorrequired
- messageType: stringrequired
- codeType: string | null
- paramType: string | null
- typeType: string
OpenAI-compatible error type when supplied.
- propertyType: anything
Name
- Type: anythingproperty
Name
application/json - Type: object · OpenAIErrorResponse429
Spending or request limit reached
OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.
- Type: objecterrorrequired
- messageType: stringrequired
- codeType: string | null
- paramType: string | null
- typeType: string
OpenAI-compatible error type when supplied.
- propertyType: anything
Name
- Type: anythingproperty
Name
application/json - Type: object · OpenAIErrorResponse502
Upstream provider request failed
OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.
- Type: objecterrorrequired
- messageType: stringrequired
- codeType: string | null
- paramType: string | null
- typeType: string
OpenAI-compatible error type when supplied.
- propertyType: anything
Name
- Type: anythingproperty
Name
application/json - Type: object · OpenAIErrorResponse503
Provider or billing service unavailable
OpenAI-compatible error envelope. The Router may include code and message without all optional upstream fields.
- Type: objecterrorrequired
- messageType: stringrequired
- codeType: string | null
- paramType: string | null
- typeType: string
OpenAI-compatible error type when supplied.
- propertyType: anything
Name
- Type: 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"
}