Chat Completions API
Send an OpenAI-compatible messages payload to /v1/chat/completions using a model identifier returned by /v1/models.
curl https://api.foxora.ai/v1/chat/completions \
-H "Authorization: Bearer $FOXORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "<model-id-from-v1-models>",
"messages": [
{"role": "user", "content": "Summarize this in three bullets."}
]
}'- Fetch the current model list instead of hardcoding a provider model.
- Send ordered
messageswith a non-emptymodel. - Read the assistant result from
choicesand the metering details fromusage. - Preserve
x-request-idwhen a request fails.
Set stream: true only when the client can consume server-sent events and handle a stream that ends early.
Expected result: HTTP success returns an assistant choice plus usage data for the completed request.