BitLiquid 文档BitLiquid Docs
一个 API 密钥,调用所有已接入的 AI 模型。一手直连,真实透传,绝不注水。 One API key for every connected model. First-hand upstreams, real passthrough, zero dilution.
介绍Introduction
BitLiquid 是一个 AI API 中转网关。你在这里注册、充值、创建一个 API 密钥,就能用统一的 OpenAI / Anthropic 兼容接口调用我们已接入的所有模型(Claude、Codex 等),无需分别去各家申请账号与密钥。
BitLiquid is an AI API gateway. Sign up, top up, create one API key, and call every connected model (Claude, Codex, and more) through a unified OpenAI- / Anthropic-compatible API — no need to register separately with each provider.
核心特性Core features
https://api.bitliquid.dev/v1 —— 完全兼容 OpenAI 格式;同时提供 Anthropic 的 /v1/messages 接口。
Base URL: https://api.bitliquid.dev/v1 — fully OpenAI-compatible, plus the Anthropic /v1/messages endpoint.
快速开始Quick start
三步即可发出第一个请求。
Send your first request in three steps.
注册并创建密钥Sign up & create a key
前往 注册 → 登录 控制台 → 打开「API 密钥」→ 点「新建密钥」,复制以 sk- 开头的完整密钥并妥善保存。
Go to Sign up → open the Console → API Keys → Create key, then copy and safely store the full key that starts with sk-.
充值余额Top up your balance
在控制台「充值」页选择金额,通过 Stripe 支付(支持微信、支付宝、Apple Pay、银行卡)。余额永不过期。
On the Top up page, choose an amount and pay via Stripe (WeChat Pay, Alipay, Apple Pay, cards). Your balance never expires.
发出第一个请求Make your first request
把下面命令里的 sk-你的密钥 换成你自己的密钥(OpenAI 兼容格式):
Replace sk-YOUR-KEY with your own key (OpenAI-compatible):
curl https://api.bitliquid.dev/v1/chat/completions \ -H "Authorization: Bearer sk-你的密钥" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5-codex", "messages": [{"role": "user", "content": "你好,介绍一下你自己"}] }'
也可以用 Anthropic 的 /v1/messages 接口调用 Claude:
Or call Claude via the Anthropic /v1/messages endpoint:
curl https://api.bitliquid.dev/v1/messages \ -H "x-api-key: sk-你的密钥" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4", "max_tokens": 512, "messages": [{"role": "user", "content": "你好"}] }'
查看可用模型List available models
随时用下面命令拉取当前账户可调用的模型清单(也可在控制台仪表盘查看):
Fetch the models your account can call at any time (also visible on the console dashboard):
curl https://api.bitliquid.dev/v1/models \ -H "Authorization: Bearer sk-你的密钥"
Claude Code
Claude Code 是 Anthropic 官方命令行编程助手。通过两个环境变量把它指向 BitLiquid 即可。
Claude Code is Anthropic's official CLI coding assistant. Point it at BitLiquid with two environment variables.
安装Install
npm install -g @anthropic-ai/claude-code配置指向 BitLiquidPoint it at BitLiquid
在当前终端临时设置(重开终端会失效):
Set for the current shell (resets when you open a new terminal):
export ANTHROPIC_BASE_URL=https://api.bitliquid.dev export ANTHROPIC_AUTH_TOKEN=sk-你的密钥 # 可选:指定默认模型 export ANTHROPIC_MODEL=claude-sonnet-4 claude
ANTHROPIC_BASE_URL 填到域名即可,不要带 /v1 后缀(Claude Code 会自动补 /v1/messages)。
Note: Set ANTHROPIC_BASE_URL to the host only, without a /v1 suffix (Claude Code appends /v1/messages automatically).
永久保存(推荐)Persist (recommended)
写入 ~/.claude/settings.json,之后直接运行 claude 即可:
Write to ~/.claude/settings.json, then just run claude:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.bitliquid.dev",
"ANTHROPIC_AUTH_TOKEN": "sk-你的密钥"
}
}Codex CLI
Codex 是 OpenAI 的命令行编程工具。通过自定义 provider 指向 BitLiquid。
Codex is OpenAI's CLI coding tool. Add a custom provider that points to BitLiquid.
安装Install
npm install -g @openai/codex编辑 ~/.codex/config.tomlEdit ~/.codex/config.toml
model = "gpt-5-codex" model_provider = "bitliquid" [model_providers.bitliquid] name = "BitLiquid" base_url = "https://api.bitliquid.dev/v1" wire_api = "responses" env_key = "BITLIQUID_API_KEY"
wire_api:Codex 默认走 Responses API。若调用报错,改成 wire_api = "chat"(走 /v1/chat/completions)再试。
About wire_api: Codex uses the Responses API by default. If calls fail, switch to wire_api = "chat" (uses /v1/chat/completions).
设置密钥并运行Set the key & run
export BITLIQUID_API_KEY=sk-你的密钥
codexCC Switch
CC Switch 是一个跨平台桌面应用,用图形界面统一管理并一键切换 Claude Code、Codex、Gemini CLI 等工具的供应商配置,无需手改配置文件。
CC Switch is a cross-platform desktop app that manages and one-click-switches provider configs for Claude Code, Codex, Gemini CLI and more — no manual config editing.
安装Install
从 ccswitch.io 下载对应平台安装包;macOS 也可用 Homebrew:
Download from ccswitch.io; on macOS you can also use Homebrew:
brew tap farion1231/ccswitch brew install --cask cc-switch
添加 Claude 供应商Add a Claude provider
打开应用 → 左侧切到 Claude 标签 → 右上「添加供应商」→ 选 自定义(Custom),按下表填写,保存后点「启用」,然后新开终端运行 claude。
Open the app → Claude tab → Add Provider → Custom, fill in as below, save and Activate, then run claude in a new terminal.
| 字段 | Field | 值 | Value |
|---|---|---|---|
| Provider Name | BitLiquid | ||
ANTHROPIC_BASE_URL | https://api.bitliquid.dev | ||
ANTHROPIC_AUTH_TOKEN | sk-你的密钥 |
添加 Codex 供应商Add a Codex provider
切到 Codex 标签 → 添加自定义供应商:Base URL 填 https://api.bitliquid.dev/v1,API Key 填你的 sk- 密钥,模型填 gpt-5-codex。启用后运行 codex。
Switch to the Codex tab → add a custom provider: Base URL https://api.bitliquid.dev/v1, API Key your sk- key, model gpt-5-codex. Activate, then run codex.
claude/codex 不会热更新,需新开终端或重启工具生效。
Tip: After switching, a running claude/codex won't hot-reload — open a new terminal or restart the tool.
Hermes
Hermes Agent 是 NousResearch 出品的终端 AI 智能体,兼容任意 OpenAI 规范端点。把它的「自定义端点」指向 BitLiquid 即可。
Hermes Agent by NousResearch is a terminal AI agent compatible with any OpenAI-spec endpoint. Point its "custom endpoint" at BitLiquid.
向导方式(推荐)Setup wizard (recommended)
hermes model # 选择 "自定义端点(自托管 / VLLM / 等)" # API 基础 URL:https://api.bitliquid.dev/v1 # API 密钥:sk-你的密钥 # 模型名称:gpt-5-codex(或 claude-sonnet-4)
或直接写配置文件Or edit the config file
model: default: gpt-5-codex provider: custom base_url: https://api.bitliquid.dev/v1 api_key: sk-你的密钥
保存后运行 hermes 开始对话;会话内可用 /model custom:claude-sonnet-4 切换模型。
Save and run hermes; inside a session use /model custom:claude-sonnet-4 to switch models.
SDK 与其他客户端SDK & other clients
任何支持自定义 Base URL 的 OpenAI 客户端都能直接用。
Any OpenAI client that supports a custom Base URL works out of the box.
OpenAI Python SDK
from openai import OpenAI client = OpenAI( api_key="sk-你的密钥", base_url="https://api.bitliquid.dev/v1", ) resp = client.chat.completions.create( model="gpt-5-codex", messages=[{"role": "user", "content": "你好"}], ) print(resp.choices[0].message.content)
Node.js
import OpenAI from "openai"; const client = new OpenAI({ apiKey: "sk-你的密钥", baseURL: "https://api.bitliquid.dev/v1", }); const r = await client.chat.completions.create({ model: "gpt-5-codex", messages: [{ role: "user", content: "你好" }], }); console.log(r.choices[0].message.content);
图形客户端(Cherry Studio / NextChat / LobeChat / ChatBox 等)GUI clients (Cherry Studio / NextChat / LobeChat / ChatBox, etc.)
在客户端的「OpenAI 兼容 / 自定义服务商」设置里填:
In the client's "OpenAI-compatible / custom provider" settings, fill in:
| 配置项 | Setting | 值 | Value |
|---|---|---|---|
| 接口地址 / API HostAPI Host / Base URL | https://api.bitliquid.dev/v1 | ||
| API Key | sk-你的密钥 | ||
| 模型Model | gpt-5-codex / claude-sonnet-4 … |
界面概览Console overview
控制台 是你的自助中心,包含以下页面:
The Console is your self-service hub with the following pages:
| 页面 | Page | 作用 | What it does |
|---|---|---|---|
| 仪表盘Dashboard | 查看余额、近期用量与调用记录概览。Balance, recent usage and a call-log overview. | ||
| API 密钥API Keys | 新建 / 复制 / 删除密钥;按行切换密钥所走的分组;可设额度与有效期。Create / copy / delete keys; switch a key's group inline; set quota and expiry. | ||
| 使用记录Usage | 逐笔查看模型、输入/输出 tokens 与消费额度,可对账。Per-call model, prompt/completion tokens and quota spent — fully auditable. | ||
| 充值Top up | 通过 Stripe 充值(微信 / 支付宝 / Apple Pay / 银行卡)。Top up via Stripe (WeChat / Alipay / Apple Pay / cards). | ||
| 订单Orders | 查看历史充值订单与状态。View past top-up orders and their status. | ||
| 个人资料Profile | 修改显示名、查看邀请码等。Edit display name, view your invite code, etc. |
关于「分组」About "groups"
每把密钥可以选择一个分组,决定该密钥的请求走哪条线路与倍率。留空表示「跟随账户默认分组」。在 API 密钥列表里点分组即可随时切换。
Each key can pick a group that decides which route and rate its requests use. Leave it empty to "follow your account's default group". Click the group in the API Keys list to switch anytime.
模型与价格Models & pricing
当前专注代码与对话场景,已接入 Claude(Anthropic)与 Codex / GPT(OpenAI)系列,并持续扩展。可调用的确切模型列表以 /v1/models 与控制台仪表盘为准。
We currently focus on code & chat, with Claude (Anthropic) and Codex / GPT (OpenAI) connected, expanding over time. The exact callable list is whatever /v1/models and the console dashboard show.
计费说明Billing
采用预付费余额模式:先充值,调用时按笔扣费,余额永不过期。
We use a prepaid balance model: top up first, get charged per call, balance never expires.
- 计费公式:单次费用 = (输入 tokens × 输入单价 + 输出 tokens × 输出单价) × 分组倍率。
- Formula: cost = (prompt tokens × input price + completion tokens × output price) × group ratio.
- 真实 usage:tokens 数量以上游官方返回的 usage 为准,逐笔记录在「使用记录」,可对账。
- Real usage: token counts come from the upstream's official usage, logged per call under Usage for auditing.
- 余额不足:余额耗尽后请求会返回额度错误,充值后立即恢复。
- Insufficient balance: requests return a quota error when depleted; top up to resume immediately.
常见问题FAQ
调用返回 401 / 未授权?Getting 401 / unauthorized?
检查:① 密钥是否以 sk- 开头且完整;② OpenAI 格式用 Authorization: Bearer sk-...,Anthropic 格式用 x-api-key: sk-...;③ Base URL 是否正确。
Check: (1) the key starts with sk- and is complete; (2) OpenAI format uses Authorization: Bearer sk-..., Anthropic uses x-api-key: sk-...; (3) the Base URL is correct.
提示模型不存在 / 无权限?Model not found / no access?
先用 /v1/models 查看当前可用模型名,确认拼写与大小写一致。
Call /v1/models to see available model names and confirm exact spelling/case.
Claude Code 配置了却不生效?Claude Code changes not taking effect?
① ANTHROPIC_BASE_URL 不要带 /v1;② 改完配置需新开终端;③ 检查 ~/.zshrc 等是否有旧的环境变量覆盖了配置。
(1) ANTHROPIC_BASE_URL must not include /v1; (2) open a new terminal after changes; (3) check ~/.zshrc for stale env vars overriding your config.
支付 / 充值支持哪些方式?What payment methods are supported?
通过 Stripe 支持微信支付、支付宝、Apple Pay 与银行卡。中国大陆用户推荐微信 / 支付宝。(注意:银联卡无法通过 Apple Pay 走 Stripe。)
Via Stripe: WeChat Pay, Alipay, Apple Pay and cards. For mainland-China users we recommend WeChat / Alipay. (Note: UnionPay cards can't be used through Apple Pay on Stripe.)
还有问题?Still stuck?
请联系管理员或客服协助排查。
Please contact the admin / support for help.