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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- zh
|
| 4 |
+
- en
|
| 5 |
+
license: mit
|
| 6 |
+
tags:
|
| 7 |
+
- tutorial
|
| 8 |
+
- omniakey
|
| 9 |
+
- ai-coding
|
| 10 |
+
- claude-code
|
| 11 |
+
- codex
|
| 12 |
+
- cursor
|
| 13 |
+
- cline
|
| 14 |
+
- continue
|
| 15 |
+
- aider
|
| 16 |
+
- openai-compatible
|
| 17 |
+
- anthropic
|
| 18 |
+
- llm
|
| 19 |
+
- vscode
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# OmniaKey AI Coding Tools
|
| 23 |
+
|
| 24 |
+
> 在 Claude Code、Codex、Cursor、Cline、Continue、Aider 等 AI 编程工具中使用 Claude、GPT、Gemini、Grok 等模型。
|
| 25 |
+
|
| 26 |
+
[OmniaKey](https://omniakey.com/) 为 AI 编程工具提供一把统一 API Key,同时支持 Anthropic Messages、OpenAI Chat Completions 和 OpenAI Responses 等协议。按实际用量计费,无需为每个工具分别管理订阅。
|
| 27 |
+
|
| 28 |
+
> This repository is a configuration guide, not a downloadable model checkpoint. English quick start is included below.
|
| 29 |
+
|
| 30 |
+
## 快速入口
|
| 31 |
+
|
| 32 |
+
- [创建 OmniaKey API Key](https://omniakey.com/dashboard/tokens)
|
| 33 |
+
- [查看模型目录](https://omniakey.com/models)
|
| 34 |
+
- [AI 编程工具完整指南](https://docs.omniakey.com/cn/coding)
|
| 35 |
+
- OpenAI-compatible Base URL:`https://api.omniakey.com/v1`
|
| 36 |
+
- Anthropic Base URL:`https://api.omniakey.com`
|
| 37 |
+
|
| 38 |
+
请勿把真实 API Key 提交到 Git、截图、Issue 或日志中。示例统一使用 `sk-your-omniakey-key`。
|
| 39 |
+
|
| 40 |
+
## 先检查当前可用模型
|
| 41 |
+
|
| 42 |
+
模型和权限会持续更新。不要依赖旧教程中的静态价格表,先用自己的 Key 查询:
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
curl https://api.omniakey.com/v1/models \
|
| 46 |
+
-H "Authorization: Bearer sk-your-omniakey-key"
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
从返回结果复制准确的 model ID,再填入对应工具。
|
| 50 |
+
|
| 51 |
+
## Claude Code
|
| 52 |
+
|
| 53 |
+
Claude Code 使用 Anthropic Messages API,因此 Base URL **不要带 `/v1`**:
|
| 54 |
+
|
| 55 |
+
```bash
|
| 56 |
+
export ANTHROPIC_BASE_URL="https://api.omniakey.com"
|
| 57 |
+
export ANTHROPIC_AUTH_TOKEN="sk-your-omniakey-key"
|
| 58 |
+
claude
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
Claude Code 会自行请求 `/v1/messages`。如果把 Base URL 写成 `https://api.omniakey.com/v1`,最终会变成错误的 `/v1/v1/messages`。
|
| 62 |
+
|
| 63 |
+
进入会话后可以用 `/model` 显式选择当前可用的 Claude 模型。OmniaKey 不会静默把你指定的模型替换成其他模型。
|
| 64 |
+
|
| 65 |
+
## OpenAI Codex CLI
|
| 66 |
+
|
| 67 |
+
Codex 自定义 provider 使用 Responses API。编辑 `~/.codex/config.toml`:
|
| 68 |
+
|
| 69 |
+
```toml
|
| 70 |
+
model = "gpt-5.6-sol"
|
| 71 |
+
model_provider = "omniakey"
|
| 72 |
+
|
| 73 |
+
[model_providers.omniakey]
|
| 74 |
+
name = "OmniaKey"
|
| 75 |
+
base_url = "https://api.omniakey.com/v1"
|
| 76 |
+
env_key = "OMNIAKEY_API_KEY"
|
| 77 |
+
wire_api = "responses"
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
然后设置 Key 并启动:
|
| 81 |
+
|
| 82 |
+
```bash
|
| 83 |
+
export OMNIAKEY_API_KEY="sk-your-omniakey-key"
|
| 84 |
+
codex
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
示例 model ID 可能随目录更新;排障时先确认它出现在当前 Key 的 `/v1/models` 返回中。
|
| 88 |
+
|
| 89 |
+
## Cursor
|
| 90 |
+
|
| 91 |
+
在 Cursor 的模型或自定义 OpenAI 设置中填写:
|
| 92 |
+
|
| 93 |
+
| 配置项 | 值 |
|
| 94 |
+
| --- | --- |
|
| 95 |
+
| OpenAI API Key | `sk-your-omniakey-key` |
|
| 96 |
+
| Override OpenAI Base URL | `https://api.omniakey.com/v1` |
|
| 97 |
+
| Model | 从 `/v1/models` 复制一个当前可用 ID |
|
| 98 |
+
|
| 99 |
+
Cursor 不同版本对自定义模型、Agent 模式和 Tab Completion 的支持可能不同。若某功能仍走 Cursor 自有服务,这是客户端能力边界,并不代表 API Key 无效。
|
| 100 |
+
|
| 101 |
+
## Cline
|
| 102 |
+
|
| 103 |
+
在 Cline 设置中选择 **OpenAI Compatible**,然后填写:
|
| 104 |
+
|
| 105 |
+
| 配置项 | 值 |
|
| 106 |
+
| --- | --- |
|
| 107 |
+
| Base URL | `https://api.omniakey.com/v1` |
|
| 108 |
+
| API Key | `sk-your-omniakey-key` |
|
| 109 |
+
| Model ID | 从 `/v1/models` 复制 |
|
| 110 |
+
|
| 111 |
+
保存后建议先用一个小任务测试 streaming 和工具调用,再开始大型代码修改。
|
| 112 |
+
|
| 113 |
+
## Continue
|
| 114 |
+
|
| 115 |
+
在 Continue 中新增一个 OpenAI-compatible 模型:
|
| 116 |
+
|
| 117 |
+
```yaml
|
| 118 |
+
name: OmniaKey
|
| 119 |
+
version: 1.0.0
|
| 120 |
+
schema: v1
|
| 121 |
+
models:
|
| 122 |
+
- name: OmniaKey Coding
|
| 123 |
+
provider: openai
|
| 124 |
+
model: YOUR_MODEL_ID
|
| 125 |
+
apiBase: https://api.omniakey.com/v1
|
| 126 |
+
apiKey: sk-your-omniakey-key
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
Continue 的配置格式会随版本变化;如果你的版本使用 UI 配置,填入相同的 Base URL、Key 和 Model ID 即可。
|
| 130 |
+
|
| 131 |
+
## Aider
|
| 132 |
+
|
| 133 |
+
先设置 OpenAI-compatible 凭证和端点:
|
| 134 |
+
|
| 135 |
+
```bash
|
| 136 |
+
export OPENAI_API_KEY="sk-your-omniakey-key"
|
| 137 |
+
export OPENAI_API_BASE="https://api.omniakey.com/v1"
|
| 138 |
+
aider --model openai/YOUR_MODEL_ID
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
Aider 通过 LiteLLM 识别 provider 前缀。若模型需要不同前缀或参数,请以当前 Aider/LiteLLM 文档和 `/v1/models` 返回为准。
|
| 142 |
+
|
| 143 |
+
## OpenAI SDK
|
| 144 |
+
|
| 145 |
+
### Python
|
| 146 |
+
|
| 147 |
+
```python
|
| 148 |
+
from openai import OpenAI
|
| 149 |
+
|
| 150 |
+
client = OpenAI(
|
| 151 |
+
base_url="https://api.omniakey.com/v1",
|
| 152 |
+
api_key="sk-your-omniakey-key",
|
| 153 |
+
)
|
| 154 |
+
|
| 155 |
+
response = client.chat.completions.create(
|
| 156 |
+
model="YOUR_MODEL_ID",
|
| 157 |
+
messages=[
|
| 158 |
+
{"role": "user", "content": "Review this function for correctness."}
|
| 159 |
+
],
|
| 160 |
+
)
|
| 161 |
+
|
| 162 |
+
print(response.choices[0].message.content)
|
| 163 |
+
```
|
| 164 |
+
|
| 165 |
+
### Node.js
|
| 166 |
+
|
| 167 |
+
```javascript
|
| 168 |
+
import OpenAI from "openai";
|
| 169 |
+
|
| 170 |
+
const client = new OpenAI({
|
| 171 |
+
baseURL: "https://api.omniakey.com/v1",
|
| 172 |
+
apiKey: "sk-your-omniakey-key",
|
| 173 |
+
});
|
| 174 |
+
|
| 175 |
+
const response = await client.chat.completions.create({
|
| 176 |
+
model: "YOUR_MODEL_ID",
|
| 177 |
+
messages: [
|
| 178 |
+
{ role: "user", content: "Write tests for this TypeScript module." },
|
| 179 |
+
],
|
| 180 |
+
});
|
| 181 |
+
|
| 182 |
+
console.log(response.choices[0].message.content);
|
| 183 |
+
```
|
| 184 |
+
|
| 185 |
+
## 常见问题
|
| 186 |
+
|
| 187 |
+
| 现象 | 检查 |
|
| 188 |
+
| --- | --- |
|
| 189 |
+
| `401 Unauthorized` | Key 是否正确、是否带 `Bearer `、是否复制了多余空格 |
|
| 190 |
+
| `404 Not Found` | OpenAI-compatible 工具是否使用 `/v1`;Claude Code 是否错误地多加了 `/v1` |
|
| 191 |
+
| Model not found | 用当前 Key 请求 `/v1/models`,复制准确 ID |
|
| 192 |
+
| 工具调用失败 | 先确认客户端使用的协议和该模型的工具调用能力 |
|
| 193 |
+
| Streaming 中断 | 检查本地代理、企业网络和客户端超时设置;保留 request ID 便于排查 |
|
| 194 |
+
| `429` | 按响应中的 retry/reset 信息等待后重试,避免无上限自动循环 |
|
| 195 |
+
|
| 196 |
+
## 为什么选择 OmniaKey
|
| 197 |
+
|
| 198 |
+
- 一把 Key 连接 Claude、GPT、Gemini、Grok 等模型
|
| 199 |
+
- 同时提供 Anthropic 原生协议与 OpenAI-compatible 接口
|
| 200 |
+
- 支持 Chat Completions、Responses、streaming 和工具调用
|
| 201 |
+
- 模型 ID 显式可见,不静默替换
|
| 202 |
+
- 一个 Dashboard 管理 Key、余额和用量
|
| 203 |
+
|
| 204 |
+
---
|
| 205 |
+
|
| 206 |
+
## English quick start
|
| 207 |
+
|
| 208 |
+
Create a key at [OmniaKey Dashboard](https://omniakey.com/dashboard/tokens), then choose the protocol your coding tool actually uses.
|
| 209 |
+
|
| 210 |
+
### Claude Code
|
| 211 |
+
|
| 212 |
+
```bash
|
| 213 |
+
export ANTHROPIC_BASE_URL="https://api.omniakey.com"
|
| 214 |
+
export ANTHROPIC_AUTH_TOKEN="sk-your-omniakey-key"
|
| 215 |
+
claude
|
| 216 |
+
```
|
| 217 |
+
|
| 218 |
+
Do not append `/v1`; Claude Code appends `/v1/messages` itself.
|
| 219 |
+
|
| 220 |
+
### OpenAI-compatible tools
|
| 221 |
+
|
| 222 |
+
Use these values in Cursor, Cline, Continue, Aider, SDKs, and other compatible clients:
|
| 223 |
+
|
| 224 |
+
```text
|
| 225 |
+
Base URL: https://api.omniakey.com/v1
|
| 226 |
+
API Key: sk-your-omniakey-key
|
| 227 |
+
Model: choose an ID returned by GET /v1/models
|
| 228 |
+
```
|
| 229 |
+
|
| 230 |
+
### Codex
|
| 231 |
+
|
| 232 |
+
```toml
|
| 233 |
+
model = "gpt-5.6-sol"
|
| 234 |
+
model_provider = "omniakey"
|
| 235 |
+
|
| 236 |
+
[model_providers.omniakey]
|
| 237 |
+
name = "OmniaKey"
|
| 238 |
+
base_url = "https://api.omniakey.com/v1"
|
| 239 |
+
env_key = "OMNIAKEY_API_KEY"
|
| 240 |
+
wire_api = "responses"
|
| 241 |
+
```
|
| 242 |
+
|
| 243 |
+
Always verify the current model catalog before relying on an example ID:
|
| 244 |
+
|
| 245 |
+
```bash
|
| 246 |
+
curl https://api.omniakey.com/v1/models \
|
| 247 |
+
-H "Authorization: Bearer sk-your-omniakey-key"
|
| 248 |
+
```
|
| 249 |
+
|
| 250 |
+
## Links
|
| 251 |
+
|
| 252 |
+
- [OmniaKey](https://omniakey.com/)
|
| 253 |
+
- [Get an API Key](https://omniakey.com/dashboard/tokens)
|
| 254 |
+
- [Model catalog](https://omniakey.com/models)
|
| 255 |
+
- [Coding tools guide](https://docs.omniakey.com/en/coding)
|
| 256 |
+
|
| 257 |
+
This repository contains documentation only and is not affiliated with Anthropic, OpenAI, Cursor, Cline, Continue, or Aider. Product names belong to their respective owners.
|