Skip to content

Preface — Model Compatibility (Important)

Model Compatibility

Our API is fully compatible with the OpenAI API protocol and supports seamless integration with applications that support the OpenAI API.

Note: All chat models (including non-OpenAI models) support the official OpenAI SDK. Please follow OpenAI's request URLs and formats. Reference: OpenAI Documentation

Chat interface typeEndpointDescription
OpenAI (common format)/v1/chat/completionsCan be used to call all chat-type models on this site (including non-OpenAI models)
OpenAI (new format)/v1/responsesSupported by some newer OpenAI models; using the common format above is recommended
Claude (native)/v1/messagesOnly available for models that support Claude native format; other models will not work with this endpoint
Gemini (native)/v1beat/models/...Only for Gemini models; other models will not work. Gemini uses camelCase parameter names (e.g. imageSize), not snake_case (image_size).

WARNING

Claude models support caching only when using the native /v1/messages endpoint.

Authentication

All API requests should include your API key (token) in the HTTP headers as shown below:

Data formatHeader
OpenAI (common)Authorization: Bearer sk-xxx
Claude (native)x-api-key: sk-xxx
anthropic-version: 2023-06-01
Gemini (native)x-goog-api-key: sk-xxx

API Base URL

Please check the API base URL for this site in the site's API Console.

Do not bind the wrong API URL or key to avoid request failures that are difficult to diagnose.

References