1. 注册 1. Register
进入 console.trustapi.app/register 完成注册。
Complete signup at console.trustapi.app/register.
Docs
从注册到首次调用,只需三步。本文档覆盖你完成首次 API 调用所需的全部信息。 Three steps from sign-up to your first API call. Everything you need to get started is here.
Documentation surface
进入 console.trustapi.app/register 完成注册。
Complete signup at console.trustapi.app/register.
支付宝、微信、Stripe 或对公转账进入统一钱包。 Use Alipay, WeChat, Stripe, or bank transfer to fund the shared wallet.
创建 sk-trustapi-xxx,后续 CLI、SDK 与 curl 全部复用。
Create sk-trustapi-xxx and reuse it across CLI, SDK, and curl.
通过 model 字段选择模型,base URL 按协议切换。
Select the model via model and choose the base URL by protocol.
适合 Codex CLI、OpenAI SDK、curl 与大多数已有代理兼容代码。把请求统一指向 https://trustapi.app/api/v1。
Use this path for Codex CLI, OpenAI SDKs, curl, and most existing OpenAI-compatible code. Point requests to https://trustapi.app/api/v1.
一键配置 trustapi profile,开箱即用。 One command to configure the trustapi profile.
快速验证连接与鉴权。 Quickest way to verify connectivity and auth.
Python / Node SDK 只需替换一行入口。 Swap one line in your Python or Node SDK.
示例默认使用 gpt-5.4,可替换为任意在线模型。
Examples default to gpt-5.4. Replace with any live model.
curl -fsSL https://trustapi.app/trustapi-setup/setup.sh \
| bash -s -- --api-key sk-trustapi-xxx
curl -fsSL https://trustapi.app/trustapi-setup/verify.sh \
| bash
codex exec --profile trustapi \
--skip-git-repo-check -C /tmp \
"Reply with exactly OK."
curl https://trustapi.app/api/v1/chat/completions \
-H "Authorization: Bearer sk-trustapi-xxx" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.4",
"messages":[{"role":"user","content":"Hello"}]}'
from openai import OpenAI
client = OpenAI(
base_url="https://trustapi.app/api/v1",
api_key="sk-trustapi-xxx",
)
resp = client.chat.completions.create(
model="gpt-5.4",
messages=[{"role": "user", "content": "Hello"}],
)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://trustapi.app/api/v1",
apiKey: "sk-trustapi-xxx",
});
适合 Claude Code 和直接走 Anthropic 协议的客户端。把 Anthropic base URL 指向 https://trustapi.app/api,实际 Messages 请求走 /v1/messages。
Use this route for Claude Code and clients that speak the Anthropic protocol directly. Point the Anthropic base URL to https://trustapi.app/api, then send Messages requests to /v1/messages.
设置两个环境变量即可使用 TrustAPI。 Set two env vars and Claude Code uses TrustAPI.
快速验证 Anthropic 协议连接。 Quickest way to verify the Anthropic protocol.
保留现有代码,只改 base_url 一行。 Keep your existing code. Change only base_url.
当前公开目录 Current public catalog --
export ANTHROPIC_BASE_URL=https://trustapi.app/api
export ANTHROPIC_API_KEY=sk-trustapi-xxx
curl https://trustapi.app/api/v1/messages \
-H "x-api-key: sk-trustapi-xxx" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-sonnet-4-6",
"max_tokens":256,
"messages":[{"role":"user","content":"Hello"}]}'
from anthropic import Anthropic
client = Anthropic(
api_key="sk-trustapi-xxx",
base_url="https://trustapi.app/api",
)
Anthropic base URL stays at /api.
HTTP Messages requests go to /v1/messages.
Gemini 原生协议支持开发中。上线后将在此提供完整的接入示例与文档。 Gemini native protocol support is in development. Complete integration examples and documentation will appear here when available.
| Field | Value |
|---|---|
| Base URL | https://trustapi.app/api/v1 |
| Auth | Authorization: Bearer sk-trustapi-xxx |
| Model | gpt-5.4 |
| Routing note |
若错误里出现 https://api.openai.com/v1/responses,说明当前 CLI 还在走默认 provider。
If an error still points to https://api.openai.com/v1/responses, your client is still using the default provider.
|
| Field | Value |
|---|---|
| Base URL | https://trustapi.app/api |
| Auth | x-api-key: sk-trustapi-xxx |
| Protocol | Anthropic native |
| Recommended client | Claude Code / Anthropic SDK |
Gemini API 文档将在原生协议支持上线后提供。 Gemini API documentation will be available when native protocol support goes live.
Loading live model catalog...
Cloudflare Turnstile 只作用于网页注册/登录,不改变 OpenAI / Anthropic SDK、Claude Code、Codex CLI 的 API 合同。 Cloudflare Turnstile only protects web registration and login. It does not change OpenAI or Anthropic SDK contracts, nor Claude Code or Codex CLI behavior.