> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yourouter.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Models

> Call many model families through the YouRouter model API.

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.

<Note>
  For the latest enabled model IDs in your account, check the [YouRouter Dashboard](https://platform.yourouter.ai/dashboard).
</Note>

## Basic Model Call

All Chat Completions requests use the same API shape:

```bash theme={null}
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.

```json theme={null}
{
  "model": "claude-sonnet-4-20250514",
  "messages": [
    {
      "role": "user",
      "content": "Summarize this request in one sentence."
    }
  ]
}
```

## Model Field

| Field      | Required | Description                                                                                |
| ---------- | -------- | ------------------------------------------------------------------------------------------ |
| `model`    | Yes      | The model ID to call, such as `gpt-4o`, `claude-sonnet-4-20250514`, or `gemini-2.5-flash`. |
| `messages` | Yes      | The conversation messages for chat models.                                                 |
| `stream`   | No       | Set to `true` to receive incremental response chunks.                                      |

## Model API Capabilities

| Capability               | API path                             | Where to start                                                    |
| ------------------------ | ------------------------------------ | ----------------------------------------------------------------- |
| Text chat                | `/v1/chat/completions`               | [Chat Completions](/guides/chat-completions)                      |
| Image input / vision     | `/v1/chat/completions`               | [Multimodal](/guides/multimodal)                                  |
| Text embeddings          | `/v1/embeddings`                     | [Embeddings](/guides/embeddings)                                  |
| Gemini native multimodal | `/v1/projects/...:generateContent`   | [Google Generate Content](/api-reference/google/generate-content) |
| Claude native messages   | `/v1/messages`                       | [Anthropic Messages](/api-reference/messages/create)              |
| Video generation tasks   | `/api/v3/contents/generations/tasks` | [Ark Text-to-Video](/guides/ark-video)                            |

## Supported Model Families

YouRouter is designed for broad model access. Use one API integration to call models across major providers and model families.

| Family            | Example model IDs                                                                        |
| ----------------- | ---------------------------------------------------------------------------------------- |
| OpenAI GPT        | `gpt-4o`, `gpt-4o-mini-2024-07-18`, `gpt-4.1-2025-04-14`                                 |
| OpenAI reasoning  | `o3-2025-04-16`, `o4-mini-2025-04-16`, `o1-2024-12-17`                                   |
| Anthropic Claude  | `claude-sonnet-4-20250514`, `claude-opus-4-20250514`, `claude-3-7-sonnet-20250219`       |
| Google Gemini     | `gemini-2.5-pro`, `gemini-2.5-flash`                                                     |
| DeepSeek          | `deepseek-r1-250528`, `deepseek-v3-250324`                                               |
| xAI Grok          | `grok-3`, `grok-3-mini`, `grok-3-fast`                                                   |
| Volcengine Doubao | `doubao-seed-1-6-250615`, `doubao-seed-1-6-thinking-250615`, `doubao-1-5-pro-32k-250115` |
| Moonshot Kimi     | `kimi-k2-250711`                                                                         |

<Tip>
  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.
</Tip>

## Switch Models in Code

Use the same client and change only `model`.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    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)
    ```
  </Tab>

  <Tab title="Node.js">
    ```javascript theme={null}
    import OpenAI from 'openai';

    const openai = new OpenAI({
      apiKey: process.env.YOUROUTER_API_KEY,
      baseURL: 'https://api.yourouter.ai/v1',
    });

    const modelId = 'gemini-2.5-flash';

    const completion = await openai.chat.completions.create({
      model: modelId,
      messages: [{ role: 'user', content: 'Reply with exactly: connected' }],
    });

    console.log(completion.choices[0].message.content);
    ```
  </Tab>
</Tabs>

## Route to a Provider

By default, YouRouter automatically routes the request. If you need a specific upstream provider, send the `vendor` header.

```bash theme={null}
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:

| Provider          | `vendor` value |
| ----------------- | -------------- |
| Automatic routing | `auto`         |
| OpenAI            | `openai`       |
| Azure OpenAI      | `azure`        |
| Anthropic         | `anthropic`    |
| Google            | `google`       |
| AWS Bedrock       | `aws`          |
| DeepSeek          | `deepseek`     |
| Mistral AI        | `mistral`      |
| Volcengine        | `volcengine`   |
| xAI               | `x`            |

See the [Router guide](/guides/router) for automatic routing and provider pinning details.

## Recommended Integration Pattern

Keep these values configurable:

| Setting           | Example                       |
| ----------------- | ----------------------------- |
| API base URL      | `https://api.yourouter.ai/v1` |
| API key           | `YOUROUTER_API_KEY`           |
| Default model     | `gpt-4o`                      |
| Fallback model    | `gemini-2.5-flash`            |
| Optional provider | `auto`                        |

This makes it easy to add, remove, or switch models without changing your application code.

## Related Guides

<CardGroup cols={2}>
  <Card title="API Quickstart" icon="rocket" href="/quickstart">
    Make your first model API request.
  </Card>

  <Card title="Chat Completions" icon="message" href="/guides/chat-completions">
    Use chat, streaming, tools, and multimodal input.
  </Card>

  <Card title="Multimodal" icon="image" href="/guides/multimodal">
    Send image inputs and call provider-native multimodal APIs.
  </Card>

  <Card title="Router Guide" icon="route" href="/guides/router">
    Choose automatic routing or provider pinning.
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Review endpoint details and request formats.
  </Card>
</CardGroup>
