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

> ## Agent Instructions
> Public hosts only: console https://omnimux.ai/dashboard · API https://api.omnimux.ai · docs https://docs.omnimux.ai.
> Gateway auth is Authorization: Bearer sk-… on https://api.omnimux.ai/v1 (OpenAI-compatible Chat Completions and related paths).
> Discover pages from /llms.txt; full site dump /llms-full.txt; product skill /skill.md; docs search MCP /mcp. Prefer .md page URLs for Markdown.
> Default docs locale is en; zh mirrors the same relative paths. Do not invent model ids not present on live pricing or the complete API pages.

# 连接与使用

> Base URL、鉴权与常见 HTTP 错误

## Base URL 填错？

| 场景                  | Base                                                        |
| ------------------- | ----------------------------------------------------------- |
| AI 网关 / 社交数据（`sk-`） | `https://api.omnimux.ai` 或客户端常用 `https://api.omnimux.ai/v1` |
| 社媒发布 / 设备码用户 API    | `https://omnimux.ai`（需 access token + `New-Api-User`）       |

不要混用两套域名与两套凭证。

## 401 / 403 / 402 / 429 分别是什么？

| 状态      | 常见原因                                      |
| ------- | ----------------------------------------- |
| **401** | Key/token 无效或未带 `Authorization: Bearer …` |
| **403** | 当前 token 无该 model 权限、分组限制等                |
| **402** | 余额不足，预扣失败（`insufficient_quota`）           |
| **429** | 触发限流，稍后重试                                 |

各模型/合同页的 Response 示例含上述状态。

## OpenAI 文本接口的账户额度错误

`POST /v1/completions`、`/v1/chat/completions`、`/v1/responses` 和 `/v1/responses/compact` 在本地账户余额或订阅额度不足以完成预扣时，返回 **402**，`error.type` 和 `error.code` 均为 `insufficient_quota`。零余额和正余额但不足以覆盖预扣金额都属于此类。

```json theme={null}
{
  "error": {
    "message": "insufficient_quota: Account balance or subscription quota is insufficient for this request. 用户余额或订阅额度不足，无法完成此次请求。 (request id: ...)",
    "type": "insufficient_quota",
    "param": "",
    "code": "insufficient_quota"
  }
}
```

流式请求在 SSE 建立**之前**返回同样的 JSON 错误。应将其作为不可自动重试的额度失败：先检查账户余额或订阅额度，再决定是否重新请求。不要仅因这个响应刷新密钥、切换渠道或退避重试。消息保留请求 ID，具体额度数字留在服务端诊断日志中。

此规范化仅适用于上述接口的本地账户额度失败。token 有效性/额度错误、上游渠道错误及其他 API 协议保持原合同。真正的 401 或权限 403 仍需检查认证/访问权限；普通 429 仍表示限流。

## 有响应但内容不对？

* 确认 `model` 为 live 列表中的 id
* Chat 需合法 `messages`；社交数据还需业务字段（如 `aweme_id`）
* 任务类：创建走 `POST /v1/video/generations`，轮询走 `GET /v1/video/generations/{task_id}`，不要与 `/v1/videos/*` 混淆

## 客户端连不上？

* 检查 TLS/代理/公司防火墙是否拦截 `api.omnimux.ai`
* OpenAI SDK 类工具必须带 `/v1` 的 base（视客户端而定）
* 先用 `GET /v1/models` + Key 验证网关可达
