> ## 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.

# API Reference

> YouRouter 模型 API 集成的参考页面。

当你直接将应用接入 YouRouter API 时，请使用这一部分。主要模型调用端点采用 OpenAI 兼容格式，base URL 为 `https://api.yourouter.ai/v1`。

## 核心端点

<Card title="Create Chat Completion" icon="message" href="/zh/api-reference/chat/create">
  使用 `model` 和 `messages` 发送文本或图片输入请求，并从 `choices[0].message.content` 读取回复。
</Card>

<Card title="多模态指南" icon="image" href="/zh/guides/multimodal">
  查看图片输入、上游提供商原生多模态格式以及视频生成示例。
</Card>

## 上游提供商原生兼容接口

当你的应用已经依赖某个上游提供商特定的请求格式时，请使用这些页面。

<CardGroup cols={2}>
  <Card title="Anthropic Messages" icon="message" href="/zh/api-reference/messages/create">
    通过 Anthropic 的 Messages 请求格式调用 Claude。
  </Card>

  <Card title="Google Generate Content" icon="sparkles" href="/zh/api-reference/google/generate-content">
    通过 Google 的 `generateContent` 请求格式调用 Gemini。
  </Card>
</CardGroup>

## 搜索接口

当你需要网页搜索结果，或希望得到 Google Programmable Search Engine 的响应格式时，请使用这个接口。

<Card title="Custom Search" icon="magnifying-glass" href="/zh/api-reference/search/customsearch">
  使用 `GET /customsearch/v1` 搜索整个网页或指定的可编程搜索引擎。
</Card>

## 集成基础信息

| 项目       | 值                                                |
| -------- | ------------------------------------------------ |
| Base URL | `https://api.yourouter.ai/v1`                    |
| 鉴权方式     | `Authorization: Bearer <YOUROUTER_API_KEY>`      |
| 内容类型     | `Content-Type: application/json`                 |
| 默认路由     | 省略 `vendor`，或发送 `vendor: auto`                   |
| 固定上游     | 发送如 `openai`、`anthropic` 或 `google` 等 `vendor` 值 |

如果你想按步骤完成接入，请先阅读 [API 快速开始](/zh/quickstart)。
