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

# 代理接口调用地址

> API 端点地址说明

> 内容更新: 2026-08-13

## API Base URL

```
https://api.crazyrouter.com
```

`https://api.crazyrouter.com` 已作为默认国际 API 接入入口启用。账号登录、充值和控制台仍使用：

```
https://crazyrouter.com
```

> [!WARNING]
>
> 账户与管理接口必须使用主域名 `https://crazyrouter.com`，包括 `/api/user/self`、`/api/token/*` 和 `/api/log/*`。不要把这些路径发送到 `https://api.crazyrouter.com` 或 `https://cn.crazyrouter.com`；这些域名仅用于模型与媒体 API，误用时会返回 `404 api_only_endpoint`。模型推理接口（如 `/v1/chat/completions`、`/v1/messages`、`/v1/models`）仍使用 API 专用域名。

东亚地区优先使用以下 API 接入地址：

```
https://cn.crazyrouter.com
```

如果你在配置第三方客户端、SDK、IDE 或 Agent，请先确认该工具应该填写根域名还是 `/v1`：

> [card] [查看接入地址说明](https://docs.crazyrouter.com/api-endpoint.md)
>
> 先按这个章节确认应该填写根域名还是 `/v1`，再回到具体工具文档配置。

## 推荐接入地址

默认优先使用国际 API 入口 `https://api.crazyrouter.com`。东亚地区用户优先使用 `https://cn.crazyrouter.com`。这两个地址只用于 API 请求；网页端账号、充值、控制台和定价页面继续使用 `https://crazyrouter.com`。

## 不同客户端应该填写的地址

| 使用方式 | 默认国际入口 | 东亚地区优先入口 | 说明 |
| - | - | - | - |
| OpenAI 兼容 SDK / 客户端 | `https://api.crazyrouter.com/v1` | `https://cn.crazyrouter.com/v1` | 客户端会在该地址后继续拼接 `/chat/completions`、`/models` 等路径 |
| Claude Code / Anthropic 原生客户端 | `https://api.crazyrouter.com` | `https://cn.crazyrouter.com` | 客户端会自己拼接 `/v1/messages`，不要手动加 `/v1` |
| curl / 手写 HTTP 请求 | 使用完整端点，例如 `https://api.crazyrouter.com/v1/chat/completions` | 使用完整端点，例如 `https://cn.crazyrouter.com/v1/chat/completions` | 手写请求时需要把完整 API 路径写出来 |
| 账户、余额、Token 和日志管理接口 | `https://crazyrouter.com` | `https://crazyrouter.com` | 用于 `/api/user/self`、`/api/token/*`、`/api/log/*`；不要使用 API-only 域名 |

> [!WARNING]
>
> 如果日志中出现 `/v1/v1/models`、`/v1/v1/messages` 或 `/v1/messages/v1/messages`，说明客户端配置里重复拼接了 API 路径。Claude Code / Anthropic 原生客户端请改回根域名；OpenAI 兼容客户端请只保留到 `/v1`。

> [!WARNING]
>
> Claude 的原生 `tool_use`、Claude Code 编程能力和部分 IDE Agent 工具调用场景，应优先走 Anthropic Messages 链路，也就是 `POST /v1/messages`。OpenAI 兼容的 `/v1/chat/completions` 更适合普通对话和基础兼容接入，不等价于 Claude 原生 Messages API；把 Claude 模型放到 OpenAI 兼容端点里使用工具调用时，可能无法稳定拉起工具。

## 主要端点

### 聊天 API

| 端点 | 方法 | 说明 |
| - | - | - |
| `/v1/chat/completions` | POST | OpenAI Chat 格式 |
| `/v1/messages` | POST | Anthropic Claude 格式 |
| `/v1/responses` | POST | OpenAI Responses API |
| `/v1/completions` | POST | Legacy Completions |

### Gemini 原生格式

| 端点 | 方法 | 说明 |
| - | - | - |
| `/v1beta/models/{model}:generateContent` | POST | 文本生成 |
| `/v1beta/models/{model}:streamGenerateContent` | POST | 流式生成 |

### 图像 API

| 端点 | 方法 | 说明 |
| - | - | - |
| `/v1/images/generations` | POST | OpenAI 图像生成 |
| `/v1/images/edits` | POST | 图像编辑 |
| `/mj/submit/imagine` | POST | Midjourney 绘图 |
| `/ideogram/v1/ideogram-v3/generate` | POST | Ideogram V3 |
| `/kling/v1/images/generations` | POST | Kling 图像生成 |
| `/kling/v1/images/kolors-virtual-try-on` | POST | Kling 虚拟试穿 |

### 视频 API

| 端点 | 方法 | 说明 |
| - | - | - |
| `/v1/video/create` | POST | 统一视频创建 |
| `/v1/video/query` | GET | 统一视频查询 |
| `/kling/v1/videos/text2video` | POST | Kling 文生视频 |
| `/kling/v1/videos/image2video` | POST | Kling 图生视频 |
| `/kling/v1/videos/multi-image2video` | POST | Kling 参考图生视频 |
| `/kling/v1/videos/omni-video` | POST | Kling Omni 视频 |
| `/jimeng/submit/videos` | POST | 即梦视频提交 |
| `/jimeng/fetch/{task_id}` | GET | 即梦任务查询 |
| `/luma/generations` | POST | Luma 视频生成 |
| `/runwayml/v1/image_to_video` | POST | Runway 图生视频 |
| `/runwayml/v1/tasks/{task_id}` | GET | Runway 任务查询 |

### 音频 API

| 端点 | 方法 | 说明 |
| - | - | - |
| `/v1/audio/speech` | POST | 文本转语音 (TTS) |
| `/v1/audio/transcriptions` | POST | 语音转文字 (STT) |

### 其他 API

| 端点 | 方法 | 说明 |
| - | - | - |
| `/v1/embeddings` | POST | 嵌入向量 |
| `/v1/rerank` | POST | 重排序 |
| `/v1/models` | GET | 模型列表 |
| `/v1/files/uploads` | POST | 本地图片临时上传 |
| `/v1/files/uploads/base64` | POST | Base64 图片临时上传 |
| `/v1/files/uploads/url` | POST | 远程图片转存为临时 URL |
| `/v1/files/uploads/presign` | POST | 预签名直传 R2 上传 |

> [!NOTE]
>
> 所有端点均支持 HTTPS。默认国际 API 入口为 `https://api.crazyrouter.com`；东亚地区优先使用 `https://cn.crazyrouter.com`；账号登录、充值和控制台仍使用 `https://crazyrouter.com`。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.