foxora

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."}
    ]
  }'
  1. Fetch the current model list instead of hardcoding a provider model.
  2. Send ordered messages with a non-empty model.
  3. Read the assistant result from choices and the metering details from usage.
  4. 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.