Skip to main content
Use the model field to choose which model should answer your request. YouRouter supports many model families behind one OpenAI-compatible API, so switching models usually means changing only the model value.
For the latest enabled model IDs in your account, check the YouRouter Dashboard.

Basic Model Call

All Chat Completions requests use the same API shape:
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"
      }
    ]
  }'
To call another supported model, change the model value.
{
  "model": "claude-sonnet-4-20250514",
  "messages": [
    {
      "role": "user",
      "content": "Summarize this request in one sentence."
    }
  ]
}

Model Field

FieldRequiredDescription
modelYesThe model ID to call, such as gpt-4o, claude-sonnet-4-20250514, or gemini-2.5-flash.
messagesYesThe conversation messages for chat models.
streamNoSet to true to receive incremental response chunks.

Model API Capabilities

CapabilityAPI pathWhere to start
Text chat/v1/chat/completionsChat Completions
Image input / vision/v1/chat/completionsMultimodal
Text embeddings/v1/embeddingsEmbeddings
Gemini native multimodal/v1/projects/...:generateContentGoogle Generate Content
Claude native messages/v1/messagesAnthropic Messages
Video generation tasks/api/v3/contents/generations/tasksArk Text-to-Video

Supported Model Families

YouRouter is designed for broad model access. Use one API integration to call models across major providers and model families.
FamilyExample model IDs
OpenAI GPTgpt-4o, gpt-4o-mini-2024-07-18, gpt-4.1-2025-04-14
OpenAI reasoningo3-2025-04-16, o4-mini-2025-04-16, o1-2024-12-17
Anthropic Claudeclaude-sonnet-4-20250514, claude-opus-4-20250514, claude-3-7-sonnet-20250219
Google Geminigemini-2.5-pro, gemini-2.5-flash
DeepSeekdeepseek-r1-250528, deepseek-v3-250324
xAI Grokgrok-3, grok-3-mini, grok-3-fast
Volcengine Doubaodoubao-seed-1-6-250615, doubao-seed-1-6-thinking-250615, doubao-1-5-pro-32k-250115
Moonshot Kimikimi-k2-250711
Model availability can vary by account, provider status, and routing configuration. Keep your integration flexible by storing model IDs in configuration instead of hard-coding them throughout your application.

Switch Models in Code

Use the same client and change only model.
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["YOUROUTER_API_KEY"],
    base_url="https://api.yourouter.ai/v1",
)

model_id = "gemini-2.5-flash"

completion = client.chat.completions.create(
    model=model_id,
    messages=[{"role": "user", "content": "Reply with exactly: connected"}],
)

print(completion.choices[0].message.content)

Route to a Provider

By default, YouRouter automatically routes the request. If you need a specific upstream provider, send the vendor header.
curl https://api.yourouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $YOUROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "vendor: anthropic" \
  -d '{
    "model": "claude-sonnet-4-20250514",
    "messages": [
      {
        "role": "user",
        "content": "Reply with exactly: connected"
      }
    ]
  }'
Common vendor values include:
Providervendor value
Automatic routingauto
OpenAIopenai
Azure OpenAIazure
Anthropicanthropic
Googlegoogle
AWS Bedrockaws
DeepSeekdeepseek
Mistral AImistral
Volcenginevolcengine
xAIx
See the Router guide for automatic routing and provider pinning details. Keep these values configurable:
SettingExample
API base URLhttps://api.yourouter.ai/v1
API keyYOUROUTER_API_KEY
Default modelgpt-4o
Fallback modelgemini-2.5-flash
Optional providerauto
This makes it easy to add, remove, or switch models without changing your application code.

API Quickstart

Make your first model API request.

Chat Completions

Use chat, streaming, tools, and multimodal input.

Multimodal

Send image inputs and call provider-native multimodal APIs.

Router Guide

Choose automatic routing or provider pinning.

API Reference

Review endpoint details and request formats.