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 列舉必填值
- 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 列舉必填值
- 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"
}