Skip to main content
The XRoute gateway supports three primary calling protocols for conversational and text generation:
  1. OpenAI Unified Format: POST https://api.xroute.ai/v1/chat/completions
  2. Anthropic Unified Format: POST https://api.xroute.ai/v1/messages
  3. Provider Native Formats: POST https://api.xroute.ai/{Provider}/... (Supporting native protocols for OpenAI, Anthropic, Google, Byteplus, Deepseek, GLM, etc.)
  • Text Models: Support all 3 calling formats (OpenAI / Anthropic / Native).
  • Image Models: Native format only (e.g. https://api.xroute.ai/OpenAI/images/generations, https://api.xroute.ai/Byteplus/images/generations).
  • Video Models: Native asynchronous task format only (e.g. Byteplus and WAN task creation and polling endpoints).

1. OpenAI Unified Invocation

Standard OpenAI-compatible request payloads and authorization headers. Compatible with all text generation models.
  • Endpoint: POST https://api.xroute.ai/v1/chat/completions
  • Auth Header: Authorization: Bearer <XROUTE_API_KEY>

2. Anthropic Unified Invocation

Standard Anthropic Messages protocol. The gateway translates payloads across underlying model providers.
  • Endpoint: POST https://api.xroute.ai/v1/messages
  • Auth Header: x-api-key: <XROUTE_API_KEY>
  • Protocol Header: anthropic-version: 2023-06-01

3. Provider Native Invocation

Directly interface with native vendor endpoints and protocols via the {Provider} routing prefix.

Google Gemini Native

  • Endpoint: POST https://api.xroute.ai/Google/models/{model_id}:generateContent
  • Streaming: POST https://api.xroute.ai/Google/models/{model_id}:streamGenerateContent?alt=sse

Byteplus Native

  • Endpoint: POST https://api.xroute.ai/Byteplus/chat/completions
Python (Byteplus Ark SDK)

Deepseek & GLM Native (DashScope Protocol)

  • Endpoint: POST https://api.xroute.ai/{Provider}/services/aigc/text-generation/generation
cURL

4. Multimodal Image & Video Endpoints Reference

Image and video models do not use the Chat Completions endpoint. Use dedicated native endpoints: