构建,从一个请求开始
兼容 OpenAI Chat Completions API。这里提供清晰的人工文档,以及可直接复制给 AI 的 Markdown 和 JSON 结构化资料。
快速开始
只需完成以下步骤,即可使用任何兼容 OpenAI Base URL 的客户端。
- 进入控制台,在“API Key”页面创建密钥。
- 复制并安全保存完整 Key;完整内容只展示一次。
- 将 Base URL 设置为
https://token.3dpclub.com/v1。 - 从模型市场复制准确的模型 ID 并发送请求。
cURL 示例
curl https://token.3dpclub.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-5.2","messages":[{"role":"user","content":"你好"}],"stream":true}'API Key 与服务档位
档位绑定到 Key,可在控制台修改,无需重新生成 Key。修改只影响保存后的新请求。
价格优先,适合批处理或对首字延迟不敏感的任务。
优先低延迟、高稳定渠道;首字 5 秒为服务目标。
根据模型与渠道健康度选路,并按最终成功档位计费。
SDK 接入
Python、Node.js、Claude Code、Codex、Cursor 等支持自定义 OpenAI Base URL 的工具通常可以直接接入。
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://token.3dpclub.com/v1"
)
response = client.chat.completions.create(
model="glm-5.2",
messages=[{"role": "user", "content": "你好"}]
)错误码与排查
请优先记录请求 ID、模型 ID、发生时间和是否为流式请求。
| 状态 | 常见原因 | 建议 |
|---|---|---|
| 400 | 参数或模型能力不兼容 | 检查模型 ID、tools、JSON 模式和 token 上限 |
| 401 | Key 无效或停用 | 确认 Bearer 格式与 Key 状态 |
| 402 | 余额不足 | 充值后重新请求 |
| 429 | 并发、RPM 或上游限流 | 指数退避并降低并发 |
| 503 | 渠道暂不可用或重试耗尽 | 保留请求 ID,稍后重试 |
技术支持与自主排障
遇到调用问题时,建议先在本页搜索错误码、模型 ID、Key 或参数名称,按对应建议检查配置并重试。文档中心覆盖快速接入、错误码、流式行为和路由降级说明,可以先完成大多数常见问题的定位。
如果搜索后仍无法解决,请联系技术支持:admin@3dpclub.com。反馈时请附上 HTTP 状态码、错误码、Request ID、发生时间、模型 ID、是否流式以及客户端或 SDK 版本。请勿发送完整 API Key、私密对话或其他敏感数据。
路由与降级
路由综合模型能力、健康度、优先级、首字延迟、并发和冷却状态。
- 流式内容一旦发送,不会透明切换到其他上游。
- 快速档在开始输出前不可用时,可按明确规则降级。
- 最终档位、倍率和降级原因应在使用记录中留痕。
- 模型、价格及实时状态以控制台“模型市场”为准。
查询接口
通过 API Key 查询账户余额、账单流水、使用记录与消费记录;模型列表与健康状态无需认证即可访问。
接口总览
| 接口 | 认证 | 用途 |
|---|---|---|
| GET /v1/balance | Bearer Key | 账户可用余额 |
| GET /v1/transactions | Bearer Key | 余额变动流水(充值/扣费/返利等) |
| GET /v1/usage-records | Bearer Key | 每次 API 调用明细 |
| GET /v1/consumption | Bearer Key | 消费汇总 + 扣费明细 |
| GET /v1/models | 公开 | 模型列表与定价 |
| GET /v1/model-status | 公开 | 模型健康状态(15 分钟窗口) |
| GET /v1/model-detail/{id} | 公开 | 单模型详情 + 各档位渠道统计 |
1 · 余额 GET /v1/balance
curl https://token.3dpclub.com/v1/balance \ -H "Authorization: Bearer YOUR_API_KEY"
| 返回字段 | 类型 | 说明 |
|---|---|---|
| currency | string | 币种(CNY) |
| available | number | 可用余额 |
| user_id / key_id | string | 账户与 Key 标识 |
2 · 账单流水 GET /v1/transactions
| 参数 | 类型 | 说明 |
|---|---|---|
| limit | int | 每页条数,默认 50,最大 500 |
| offset | int | 偏移,默认 0 |
| type | string | 流水类型过滤:usage_deduct 扣费 / referral_reward 返利 / redeem 兑换 / signup_bonus 赠送 / adjust 调整 |
| start / end | string | 时间范围,YYYY-MM-DD 或 ISO 时间(北京时间) |
curl "https://token.3dpclub.com/v1/transactions?limit=20&type=usage_deduct" \ -H "Authorization: Bearer YOUR_API_KEY"
返回字段:id、type、amount(变动金额,负数表示扣费)、balance_after(变动后余额)、note、created_at。
3 · 使用记录 GET /v1/usage-records
| 参数 | 类型 | 说明 |
|---|---|---|
| limit / offset | int | 分页 |
| model | string | 按模型过滤 |
| status | int | 按 HTTP 状态码过滤(如 200、429) |
| start / end | string | 时间范围 |
curl "https://token.3dpclub.com/v1/usage-records?limit=20&status=200" \ -H "Authorization: Bearer YOUR_API_KEY"
返回字段:id、model、prompt_tokens、completion_tokens、cached_tokens、cost、status_code、error_type、ttft_ms、tps、created_at。
4 · 消费记录 GET /v1/consumption
| 参数 | 类型 | 说明 |
|---|---|---|
| limit / offset | int | 分页(仅影响明细 records) |
| start / end | string | 时间范围 |
curl "https://token.3dpclub.com/v1/consumption?limit=20" \ -H "Authorization: Bearer YOUR_API_KEY"
返回:summary(total_charged 总消费、total_requests 总请求、by_model 按模型汇总)+ records(扣费明细)。
5 · 模型查询(公开)
# 模型列表(含定价与档位) curl https://token.3dpclub.com/v1/models # 模型健康状态(15 分钟实时窗口) curl https://token.3dpclub.com/v1/model-status # 单模型详情 + 各档位渠道统计 curl https://token.3dpclub.com/v1/model-detail/deepseek-v4-pro