China Bridge API Reference
China Bridge gives you one API key to access GPT-4, Claude, Gemini, and free models like Llama, Qwen, and DeepSeek — fully OpenAI-compatible.
Getting Started
Follow these four simple steps to go from zero to making your first AI inference request in under two minutes:
Get 50,000 Free Tokens
Every newly registered account automatically receives 50,000 free starter tokens instantly credited to your balance.
Create an API Key
Navigate to the Keys Dashboard and generate a new secure secret key (prefixed with cb-).
Make Your First Request
Send an HTTP request to our OpenAI-compatible endpoint using curl, Python, or Node.js.
Authentication
Authenticate requests using the standard HTTP Authorization header. Exactly like OpenAI's API, pass your API key as a Bearer token:
Authorization: Bearer cb-live_xxxxxxxxxxxxxxxxxxxxxxxxSecurity note: Keep your API key secret. Store it in environment variables (CHINA_BRIDGE_API_KEY) and never expose it in client-side browser code or public git repositories.
Base URL
All OpenAI-compatible endpoints are served under the public production base URL:
To use China Bridge with any OpenAI-compatible SDK or tool (such as LangChain, LlamaIndex, Cursor, or Cline), simply replace https://api.openai.com/v1 with https://api.v-architect.tech/v1 and use your China Bridge API key.
Chat Completion Examples
Create standard chat completions using POST /v1/chat/completions. Select your language below to view example code:
curl https://api.v-architect.tech/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $CHINA_BRIDGE_API_KEY" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello China Bridge!"}
]
}'Streaming Responses (SSE)
China Bridge fully implements server-sent events (SSE) streaming with immediate reverse-proxy flushing. Pass "stream": true in your payload to receive tokens in real-time.
curl -N https://api.v-architect.tech/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $CHINA_BRIDGE_API_KEY" \
-d '{
"model": "deepseek-r1",
"stream": true,
"messages": [
{"role": "user", "content": "Explain quantum computing in three short sentences."}
]
}'Stream Output Format
Responses are streamed as line-delimited events starting with data: , concluding with the standard termination marker:
data: {"id":"chatcmpl-123","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"Quantum"}}]}
data: {"id":"chatcmpl-123","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":" computing"}}]}
...
data: [DONE]Available Models
Models are resolved automatically by our intelligent upstream router. Free tier models run on optimized infrastructure; premium models route to leading providers.
| Model ID | Tier | Description |
|---|---|---|
| qwen-2.5-coder-32b | Free Tier | High-performance open weights model for code generation and refactoring. |
| llama-3.3-70b | Free Tier | Meta's flagship open-source LLM for general reasoning, analysis, and writing. |
| deepseek-r1 | Free Tier | Leading open-weights reasoning model with state-of-the-art chain-of-thought capabilities. |
| gpt-4o | Premium | OpenAI's flagship multimodal intelligence model with high speed and high accuracy. |
| claude-sonnet-4-6 | Premium | Anthropic's balanced frontier intelligence for complex reasoning, code, and math. |
| gemini-2.5-pro | Premium | Google's next-generation thinking model with deep reasoning and large context. |
| mock-gpt-4o | Simulator | Local testing simulator — returns simulated streaming responses without calling upstream APIs or burning tokens. |
qwen, llama, or deepseek is automatically routed to our free-tier cluster. Any model ID prefixed with mock- routes to the internal test simulator.Error Handling
All API errors are returned as OpenAI-compliant JSON error envelopes with descriptive HTTP status codes:
{
"error": {
"message": "Insufficient balance.",
"type": "error",
"code": "insufficient_balance"
}
}| HTTP Status | Error Code (code) | Meaning & Action |
|---|---|---|
| 401 Unauthorized | unauthorized | Missing or invalid Bearer API key in the Authorization header. Check your key in the dashboard. |
| 400 Bad Request | bad_request | Malformed request body. Ensure required fields (model and messages array) are present. |
| 402 Payment Required | insufficient_balance | Your account token balance is depleted. Top up your balance via USDT on the billing dashboard. |
| 404 Not Found | route_not_found | Endpoint does not exist. Check that you are requesting /v1/chat/completions or /v1/models. |
| 409 Conflict | conflict | Conflict with existing resources (e.g. attempting to register an already registered email). |
| 502 Bad Gateway | upstream_not_configured | The selected model provider is currently disabled or missing upstream credentials. |
| 502 / 5xx | upstream_error | Upstream provider (OpenAI, Anthropic, etc.) failed to respond. Check the message string for upstream details. |
Billing & Tokens
Simple Pay-As-You-Go Token Pricing
China Bridge operates on a pure token-based accounting model with zero recurring subscriptions. You only pay for the tokens your requests consume.
Free tokens granted immediately upon signing up.
Fixed rate of 200,000 tokens for every $1 USD ($0.005 / 1k tokens).
Top up directly with USDT (ERC-20) or NOWPayments.
View Full Pricing Breakdown
Explore pricing details and model comparison on the main site.