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

# Anyone REST 端点：概览与 Base URL

> Anyone 提供统一 REST API，兼容 OpenAI、Anthropic Claude 和 Google Gemini 格式。使用一个 API key 访问所有端点。

Anyone 提供单一 HTTP 网关，接受 OpenAI、Anthropic Claude 和 Google Gemini 格式的请求，并将其路由到相应的上游服务商。你使用在控制台创建的 API key 进行认证，Anyone 自动处理格式转换——你可以将现有的 OpenAI 客户端指向 Anyone，无需任何代码修改。

## Base URL

```
https://api.anyone.ai
```

以下所有端点相对于此 base URL。所有请求在 `Authorization` 头中使用你的 API key。

## 端点

<CardGroup cols={2}>
  <Card title="对话与补全" icon="message" href="/zh/api-reference/chat-completions">
    OpenAI 兼容的对话和文本补全，通过 `POST /v1/chat/completions` 和 `POST /v1/completions`。
  </Card>

  <Card title="OpenAI Responses" icon="bolt" href="/zh/api-reference/responses">
    OpenAI Responses 格式，通过 `POST /v1/responses`。
  </Card>

  <Card title="Claude Messages" icon="robot" href="/zh/api-reference/claude-messages">
    Anthropic Claude Messages 格式，通过 `POST /v1/messages`。
  </Card>

  <Card title="Gemini 对话" icon="google" href="/zh/api-reference/gemini-chat">
    Google Gemini generateContent 格式，通过 `POST /v1beta/models/{model}:generateContent`。
  </Card>

  <Card title="图片" icon="image" href="/zh/api-reference/images">
    图片生成和编辑，通过 `POST /v1/images/generations` 和 `POST /v1/images/edits`。
  </Card>

  <Card title="音频" icon="microphone" href="/zh/api-reference/audio">
    语音转文字、翻译和文字转语音，通过 `/v1/audio/*` 端点。
  </Card>

  <Card title="视频" icon="video" href="/zh/api-reference/video">
    视频生成任务，通过 Sora 兼容、Kling、即梦、豆包和 Vidu 服务商。
  </Card>

  <Card title="向量嵌入" icon="brackets-curly" href="/zh/api-reference/embeddings">
    文本向量嵌入，通过 `POST /v1/embeddings`。
  </Card>

  <Card title="重排序" icon="arrow-up-wide-short" href="/zh/api-reference/rerank">
    文档重排序（Cohere/Jina 格式），通过 `POST /v1/rerank`。
  </Card>

  <Card title="实时对话" icon="waveform" href="/zh/api-reference/realtime">
    基于 WebSocket 的实时对话，通过 `GET /v1/realtime`。
  </Card>

  <Card title="模型列表" icon="list" href="/zh/api-reference/models">
    列出可用模型，通过 `GET /v1/models`。
  </Card>
</CardGroup>

## 通用请求头

| 头字段                 | 是否必需         | 说明                                              |
| ------------------- | ------------ | ----------------------------------------------- |
| `Authorization`     | 是（大多数端点）     | Bearer token：`Authorization: Bearer YOUR_TOKEN` |
| `Content-Type`      | 是            | 所有 JSON 请求体设为 `application/json`                |
| `x-api-key`         | 是（Claude 端点） | 调用 `/v1/messages` 时使用你的 Anyone API key          |
| `anthropic-version` | 是（Claude 端点） | 使用 Claude Messages 格式时必须为 `2023-06-01`          |
| `x-goog-api-key`    | 是（Gemini 端点） | 调用 `/v1beta/models/*` 时使用你的 Anyone API key      |

详见 [认证](/api-reference/authentication) 了解每个端点应使用哪种头。

## HTTP 状态码

| 状态码   | 含义                         |
| ----- | -------------------------- |
| `200` | 请求成功。响应体包含模型输出。            |
| `400` | 请求错误。请求体格式错误或缺少必填字段。       |
| `401` | 未授权。Token 缺失或无效。           |
| `403` | 禁止访问。Token 无权使用请求的模型。      |
| `429` | 请求过多。你已超过该 API key 或模型的限速。 |
| `500` | 服务器内部错误。Anyone 服务器发生意外错误。  |
| `503` | 服务不可用。没有上游渠道可用于请求的模型。      |
