Skip to main content
YouRouter exposes model APIs through a single gateway. Most integrations should start with the OpenAI-compatible Chat Completions endpoint.

Base URL

https://api.yourouter.ai/v1
OpenAI-compatible and provider-native model calls use this base URL. Video tasks and Custom Search use their own base paths, shown below.

Endpoint Families

FamilyBase pathUse it for
Model APIshttps://api.yourouter.ai/v1Chat Completions, Embeddings, Anthropic Messages, and Google generateContent paths.
Video taskshttps://api.yourouter.ai/api/v3Ark text-to-video and image-to-video task creation and polling.
Custom Searchhttps://api.yourouter.ai/customsearch/v1Google Programmable Search-compatible web search.

Authentication

Send your YouRouter API key as a bearer token:
Authorization: Bearer <YOUROUTER_API_KEY>
For JSON requests, also send:
Content-Type: application/json
Use API keys only from server-side code, backend services, CI jobs, or trusted internal tools. Do not put API keys in browser-side code or mobile clients.

First API Call

curl https://api.yourouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $YOUROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {
        "role": "user",
        "content": "Reply with exactly: connected"
      }
    ]
  }'
Read the generated text from:
choices[0].message.content

Core Concepts

ConceptHow to use it
Model selectionSet the model field in the request body.
Multimodal inputSend text and image content blocks in messages[].content, or use provider-native multimodal endpoints.
Automatic routingOmit the vendor header, or send vendor: auto.
Provider pinningSend vendor: openai, vendor: anthropic, vendor: google, or another supported provider.
StreamingSet stream: true for incremental server-sent event chunks.
Provider-native APIsUse /messages for Anthropic-compatible calls or Google generateContent paths for Gemini-compatible calls.

Main Endpoints

EndpointPurpose
POST /chat/completionsOpenAI-compatible text and image-input model calls. Recommended for most integrations.
POST /embeddingsGenerate text embeddings with compatible embedding models.
POST /messagesAnthropic Messages-compatible model calls.
POST /projects/.../models/{model}:generateContentGoogle Gemini generateContent-compatible model calls.
POST /api/v3/contents/generations/tasksTask-based video generation calls.

Status Codes

StatusMeaning
200Request succeeded.
400The request body, model, or parameter format is invalid.
401The API key is missing or invalid.
429A provider rate limit or concurrency limit was reached.
500The gateway or upstream provider returned an internal error.
See Create Chat Completion for the core request format, or Multimodal for image and video examples.