API Documentation

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:

01

Sign Up

Create your account at /signup using your email address. No credit card required.

02

Get 50,000 Free Tokens

Every newly registered account automatically receives 50,000 free starter tokens instantly credited to your balance.

03

Create an API Key

Navigate to the Keys Dashboard and generate a new secure secret key (prefixed with cb-).

04

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:

http
Authorization: Bearer cb-live_xxxxxxxxxxxxxxxxxxxxxxxx

Security 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:

https://api.v-architect.tech/v1

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:

bash
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.

bash
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:

json
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 IDTierDescription
qwen-2.5-coder-32bFree TierHigh-performance open weights model for code generation and refactoring.
llama-3.3-70bFree TierMeta's flagship open-source LLM for general reasoning, analysis, and writing.
deepseek-r1Free TierLeading open-weights reasoning model with state-of-the-art chain-of-thought capabilities.
gpt-4oPremiumOpenAI's flagship multimodal intelligence model with high speed and high accuracy.
claude-sonnet-4-6PremiumAnthropic's balanced frontier intelligence for complex reasoning, code, and math.
gemini-2.5-proPremiumGoogle's next-generation thinking model with deep reasoning and large context.
mock-gpt-4oSimulatorLocal testing simulator — returns simulated streaming responses without calling upstream APIs or burning tokens.
💡 Dynamic routing: Any model name matching 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:

json
{
  "error": {
    "message": "Insufficient balance.",
    "type": "error",
    "code": "insufficient_balance"
  }
}
HTTP StatusError Code (code)Meaning & Action
401 UnauthorizedunauthorizedMissing or invalid Bearer API key in the Authorization header. Check your key in the dashboard.
400 Bad Requestbad_requestMalformed request body. Ensure required fields (model and messages array) are present.
402 Payment Requiredinsufficient_balanceYour account token balance is depleted. Top up your balance via USDT on the billing dashboard.
404 Not Foundroute_not_foundEndpoint does not exist. Check that you are requesting /v1/chat/completions or /v1/models.
409 ConflictconflictConflict with existing resources (e.g. attempting to register an already registered email).
502 Bad Gatewayupstream_not_configuredThe selected model provider is currently disabled or missing upstream credentials.
502 / 5xxupstream_errorUpstream 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.

50,000
Starter Bonus

Free tokens granted immediately upon signing up.

200,000
Tokens Per $1 USD

Fixed rate of 200,000 tokens for every $1 USD ($0.005 / 1k tokens).

Crypto (USDT)
Instant Top-Ups

Top up directly with USDT (ERC-20) or NOWPayments.

View Full Pricing Breakdown

Explore pricing details and model comparison on the main site.

Go to Pricing