# Chat Completions API

Send an OpenAI-compatible messages payload to /v1/chat/completions using a model identifier returned by /v1/models .

Terminal



```
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 `messages` with a non-empty `model`.

- Read the assistant result from `choices` and the metering details from `usage`.

- Preserve `x-request-id` when 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.

Source: https://www.foxora.ai/docs/ko/api/chat-completions-api
