← Docs

API reference

OpenAI-compatible chat completions. See openapi.yaml for the full schema.

POST /v1/chat/completions

Request body mirrors OpenAI Chat Completions. Streaming uses SSE.

Key fields

  • model — TokenHub model ID (author/name)
  • messages — role/content pairs
  • stream — boolean
  • tools — when supported by the model

Errors

4xx for client issues (auth, invalid model); 5xx for upstream or platform errors. Retry with backoff.