Skip to content
TukaiDevelopers

Search the documentation

Console
Documentation menu

Get started

OpenAI and Anthropic compatibility

What the Tukai API takes from the OpenAI and Anthropic APIs, what it does not, and what to change in an existing integration.

Verified on 4 October 2026Markdown versionReport a problem on this page

The Tukai API imitates four operations of the OpenAI and Anthropic APIs, so that the official SDKs work without modification. It is not a full copy of those APIs: any operation missing from this page does not exist at Tukai.

What changes in your integration

SettingOpenAI SDKAnthropic SDK
Base URLhttps://chat.tuk-ai.com/v1https://chat.tuk-ai.com (the SDK adds /v1 itself)
Keytuk_sk_… in apiKeytuk_sk_… in apiKey
Model identifierA Tukai identifier, for example chat-anthropic-claude-haiku-4-5The same Tukai identifier

Model identifiers are Tukai's own, never those of the original provider: gpt-… or claude-… on their own are refused. The list is on the Models (French) page.

The rest of the code (messages, max_tokens, reading the response) does not change for a simple text call.

Available operations

OperationShapeStatus
POST /v1/chat/completionsOpenAISupported text, with or without stream
POST /v1/messagesAnthropicSupported text, with or without stream; max_tokens required
POST /v1/messages/count_tokensAnthropicSupported local estimate, free, no model call
GET /v1/modelsTukai catalogPartial public and without a key; the objects have Tukai fields (display_name, available…) in addition to id
POST /v1/responses, embeddings, images, audio, files, batches, assistantsOpenAINot supported
GET /v1/models/{id}, Message Batches, FilesAnthropicNot supported

Advanced features

FeatureStatusDetails
Streaming (SSE)PartialImplemented and covered by the repository's tests; not yet run against production as part of this documentation. On the OpenAI side, the stream ends with data: [DONE].
Image or audio inputNot supportedimage_url or input_audio parts are ignored: the request still gets a response, based on the text alone. Do not send an image expecting it to be analyzed.
Tools (tools), OpenAI sideNot supportedThe chat.completion response contains only text (message.content), never tool_calls.
Tools (tools), Anthropic sideNot testedThe tool_use ↔ tool_calls translation exists in the code; it has not been verified end to end here.
finish_reason, OpenAI sidePartialAlways stop, even when the output was cut off by max_tokens.
Structured output (response_format, JSON schema)Not supportedSilently ignored: only model, messages (text) and max_tokens are passed to the model.
temperature, top_p, stop and other OpenAI settingsNot supportedAccepted by validation but silently ignored.
thinking, cache_control, Anthropic server-side toolsNot supportedNot supported; reported as a warning on the server side.
Direct calls from a browserNot supportedUnsupported use: a key must never be in code that runs on your users' devices.

Headers

HeaderEffect
Authorization: Bearer tuk_sk_…Canonical form (OpenAI SDK).
x-api-key: tuk_sk_…Accepted (Anthropic SDK). Send one or the other, not both: through the published URL, only Authorization is kept when both are present.
anthropic-version, anthropic-betaAccepted, not passed on to the provider.
x-request-id (response)Request identifier, on every response. The OpenAI SDK exposes it (requestID in TypeScript); the Anthropic SDK does not read it, so you have to pick it up from the HTTP headers.
ratelimit-limit, ratelimit-remaining, ratelimit-reset (response)Rate limit status of the key.

Errors

Errors keep the envelope of the imitated provider ({"error": {...}} for OpenAI, {"type": "error", "error": {...}} for Anthropic), so that the SDK reads them normally. Depending on the cause, the message is in English or in French: read the type field. Code details: Errors.

Verified versions

On October 3, 2026, against production, without any paid call (deliberately invalid key):

  • openai 7.27.0 (Node.js): models.list() responds; chat.completions.create() reaches the right route and raises AuthenticationError (401).
  • @anthropic-ai/sdk 0.131.0 (Node.js): messages.create() reaches the right route and raises AuthenticationError (401).