Quick Answer

Use `POST /v1/chat/completions` when you need OpenAI-compatible text generation through Xenodia with one account and one API surface.

Last updated: March 21, 2026

Chat Completions

Xenodia's traditional API keeps the OpenAI-compatible chat surface. Use POST /v1/chat/completionswhen you want direct server-side or workflow integration without the CLI bootstrap.

Endpoint

POST https://api.xenodia.xyz/v1/chat/completions

Authentication

Authorization: Bearer YOUR_LONG_TERM_KEY

Minimal Request

{
  "model": "gpt-5.4",
  "messages": [
    { "role": "user", "content": "Reply with OK only." }
  ]
}

curl Example

curl -X POST "https://api.xenodia.xyz/v1/chat/completions" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $XENODIA_API_KEY" \
  -d '{
    "model": "gpt-5.4",
    "messages": [
      { "role": "system", "content": "You are a precise test assistant." },
      { "role": "user", "content": "Reply with OK only." }
    ],
    "temperature": 0
  }'

Success Response

{
  "id": "chatcmpl-xxx",
  "object": "chat.completion",
  "created": 1760000000,
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "OK" },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 18,
    "completion_tokens": 1,
    "total_tokens": 19
  }
}

When to use

Use this page when you need direct server-side chat integration or a stable OpenAI-compatible request shape.

When not to use

Do not use this page for image generation, media task polling, or model discovery.

FAQ

Is Xenodia chat API OpenAI-compatible?

Yes. The traditional chat surface is intentionally OpenAI-compatible so most server integrations can adapt with minimal changes.

How do I choose the model?

Query `/v1/models` first, then select a model that matches your modality, price, and channel requirements.