Skip to content
TukaiDevelopers

Search the documentation

Console
Documentation menu

API reference

Generated from the repository’s OpenAPI contract (version 1.0.0). Full file: openapi.json. Actual behaviour, what is and is not supported, is described in Compatibility.

post/v1/chat/completions

OpenAI's chat completions, served by Tukai.

Authentication: Authorization: Bearer tuk_sk_…

FieldTypeRequiredDescription
max_tokensintegerno
messagesarrayyes
modelstringyes
streambooleanno
temperaturenumberno
toolsarrayno

Responses

  • 200 — `stream:false` — one `chat.completion` object.
  • 400 — OpenAI-shaped `invalid_request_error`.
  • 401 — OpenAI-shaped.
  • 402 — OpenAI-shaped `insufficient_quota`.
  • 403 — OpenAI-shaped `permission_error`.
  • 404 — OpenAI-shaped `not_found_error`.
  • 422 — OpenAI-shaped `invalid_request_error`.
  • 429 — OpenAI-shaped `rate_limit_error`.
  • 502 — OpenAI-shaped `server_error`.
  • 503 — OpenAI-shaped `server_error`.

post/v1/messages

Anthropic's messages, served by Tukai — on ANY provider in the registry.

Authentication: Authorization: Bearer tuk_sk_…

FieldTypeRequiredDescription
max_tokensintegeryes
messagesarrayyes
modelstringyes
streambooleanno
systemvariesno
temperaturenumberno
toolsarrayno

Responses

  • 200 — `stream:false` — one `message` object.
  • 401 — Anthropic-shaped.
  • 402 — Anthropic-shaped `billing_error`.
  • 403 — Anthropic-shaped `permission_error`.
  • 404 — Anthropic-shaped `not_found_error`.
  • 413 — Anthropic-shaped `request_too_large`.
  • 422 — Anthropic-shaped `invalid_request_error`.
  • 429 — Anthropic-shaped `rate_limit_error`.
  • 503 — Anthropic-shaped `api_error`.
  • 529 — Anthropic-shaped `overloaded_error`.

post/v1/messages/count_tokens

How many input tokens is this? — locally, cheaply, before anything is spent.

Authentication: Authorization: Bearer tuk_sk_…

FieldTypeRequiredDescription
messagesarrayyes
modelstringyes
systemvariesno
toolsarrayno

Responses

  • 200 —
  • 401 — Anthropic-shaped `authentication_error`.
  • 403 — Anthropic-shaped `permission_error`.
  • 404 — Anthropic-shaped `not_found_error`.
  • 422 — Anthropic-shaped `invalid_request_error`.
  • 429 — Anthropic-shaped `rate_limit_error`.

get/v1/models

The model catalogue.

Authentication: none (public)

Responses

  • 200 —
  • 304 — The catalogue has not changed for this caller (ETag match).
  • 429 — Throttled per IP (RATE_LIMIT_IP, details.retry_after_ms)
  • 503 — The catalogue could not be read (SYS_SERVICE_UNAVAILABLE).