BridgeNode

透過x402進行AI推論。使用Solana USDC支付。無需註冊。無需API金鑰。

文件

BridgeNode — Full Agent Guide

AI inference bridge for AI agents. No API keys, no registration, no subscriptions. Free models are included, and the first calls on paid models are free — after that you pay per request with Solana USDC via x402 (HTTP 402). Transaction fees are sponsored — the agent only needs USDC to pay.

Free access (start here — no wallet required)

  • Free models: gpt-oss-20b, gpt-oss-120b, glm-4.7-flash, glm-4.5-flash, glm-4.6v-flash — served free of charge, no wallet, no gas. Free model notes (read before choosing one):
  • glm-4.7-flash — ⚠️ temporarily unreliable: z.ai free model: slower than the Groq free models — a reply can take up to a minute, and the provider is sometimes overloaded. If it returns an error (rate limit / temporarily overloaded), retry once or switch to gpt-oss-20b, the most reliable free model.
  • glm-4.5-flash — ⚠️ temporarily unreliable: z.ai free model: slower than the Groq free models — a reply can take up to a minute, and the provider is sometimes overloaded. If it returns an error (rate limit / temporarily overloaded), retry once or switch to gpt-oss-20b, the most reliable free model.
  • glm-4.6v-flash: z.ai free model: slower than the Groq free models — a reply can take up to a minute, and the provider is sometimes overloaded. If it returns an error (rate limit / temporarily overloaded), retry once or switch to gpt-oss-20b, the most reliable free model.
  • Free trials on paid models: the first 2 call(s) to ANY paid model are free per client, so you can experience a full answer before paying. Trial responses carry X-Bridgenode-Free-Trial: 1 and X-Bridgenode-Free-Trials-Remaining: <n>.
  • When the trials run out, an unpaid request returns 402 whose extensions.bridgenode object tells you exactly what to do next: free_models (list), free_trials_remaining, how_to_pay, docs.
  • Every 402 also carries request_hint. For a valid request it lists the facts you would be paying for (model, context_window, max_output_tokens, clamping). If the request cannot succeed, the 402 says so before you sign: request_hint.ok = false with problem and message (for example unknown_model, empty_messages, invalid_json, unknown_mode) — fix that and retry, no signature is ever wasted on a request that would be rejected.

Limits (published — counted per client, and enforced exactly like this)

  • One client = a wallet with payment history, otherwise your network (daily budget: /24 IPv4, /64 IPv6; trials: /16 IPv4, /48 IPv6).
  • Free trials: 2 calls on PAID models (one-off, per client).
  • Daily free budget: 200 calls and 100,000 tokens per client per day (FREE MODELS AND TRIALS together, resets 00:00 UTC). Over it → 429 free_daily_quota_exhausted with Retry-After.
  • Per free model, our own daily ceiling: gpt-oss-120b 160,000, gpt-oss-20b 160,000 tokens/day (shared by all clients). Reached → 429 free_budget_exhausted naming a model that still works — we stop before the provider does.
  • Rate: 30 free requests/minute per client; 10 payment challenges/minute.
  • Concurrency: 20 free calls at once across all clients. Over it → 503 free_path_busy + Retry-After (never a silent queue).
  • Every free answer carries the numbers: X-Bridgenode-Free-Quota-Limit, X-Bridgenode-Free-Quota-Remaining, X-Bridgenode-Free-Quota-Reset, X-Bridgenode-Free-Quota-Tokens-Limit, X-Bridgenode-Free-Quota-Tokens-Remaining, X-Bridgenode-Free-Trials-Remaining.
  • Paid requests (x402) are never affected by any of these limits — they neither wait for free traffic nor share its budgets.
  • Free models and free trials share a per-client rate limit; paid requests do not.
  • You do not need to send a special header to use a trial — just send a normal request with a paid model and no payment header. Trials and the daily free budget (X-Bridgenode-Free-Quota-* on every free answer) are counted per client identity: an anonymous client is its network (/24 IPv4, /64 IPv6), and a wallet (SIGN-IN-WITH-X, no payment) becomes its own identity once it has payment history with us — a brand-new wallet does not buy a fresh budget, but a client that has paid is never punished for its neighbours.

Endpoints

Models & Pricing

Prices are in USDC per token (6 decimals). Live prices: GET https://bridgenode.cc/v1/models.

ModelInput / tokenOutput / tokenContext windowMax outputTools
gpt-oss-20b 🆓$0.00000000$0.000000008,0008,000✅
gpt-oss-120b 🆓$0.00000000$0.000000008,0008,000✅
glm-4.7-flash 🆓$0.00000000$0.00000000131,0728,192✅
glm-4.5-flash 🆓$0.00000000$0.00000000131,0728,192✅
glm-4.6v-flash 🆓$0.00000000$0.00000000131,0728,192✅
deepseek-flash$0.00000018$0.000000701,048,5768,192✅
glm-4.7-flashx$0.00000008$0.000000471,048,5768,192✅
glm-5.2$0.00000164$0.000005151,048,5768,192✅
glm-5.1$0.00000164$0.000005151,048,5768,192✅
glm-5$0.00000117$0.000003741,048,5768,192✅
glm-5-turbo$0.00000122$0.00000453200,0008,192✅
glm-4.7$0.00000070$0.000002571,048,5768,192✅
glm-4.6$0.00000070$0.000002571,048,5768,192✅
glm-4.5$0.00000070$0.000002571,048,5768,192✅
glm-4.5-x$0.00000257$0.000010411,048,5768,192✅
glm-4.5-air$0.00000023$0.000001291,048,5768,192✅
glm-4.5-airx$0.00000129$0.000005271,048,5768,192✅
glm-4-32b-0414-128k$0.00000012$0.00000012131,0728,192✅
glm-5v-turbo$0.00000122$0.00000453200,0008,192✅
glm-4.6v$0.00000035$0.000001051,048,5768,192✅
glm-4.6v-flashx$0.00000005$0.000000471,048,5768,192✅
glm-4.5v$0.00000070$0.000002111,048,5768,192✅
kimi-k2.7-code$0.00000111$0.00000468262,14432,768✅
kimi-k2.7-code-highspeed$0.00000222$0.00000936262,14432,768✅
kimi-k2.6$0.00000111$0.00000468262,14432,768✅
MiniMax-M2.7$0.00000035$0.000001401,048,5768,192✅
MiniMax-M2.7-highspeed$0.00000070$0.000002811,048,5768,192✅
MiniMax-M2.5$0.00000035$0.000001401,048,5768,192✅
MiniMax-M2.5-highspeed$0.00000070$0.000002811,048,5768,192✅
MiniMax-M2.1$0.00000035$0.000001401,048,5768,192✅
MiniMax-M2.1-highspeed$0.00000070$0.000002811,048,5768,192✅
MiniMax-M2$0.00000035$0.000001401,048,5768,192✅
deepseek-v4-pro$0.00000077$0.000002321,048,5768,192✅
kimi-k3$0.00000351$0.000017551,048,57632,768✅
glm-5.3$0.00000164$0.000005151,048,5768,192✅
minimax-m3$0.00000035$0.000001401,048,5768,192✅

Pricing model: exact scheme — the agent pays for input tokens + max_tokens before processing. Minimum charge per request: 2000 atomic units = $0.002 USDC.

Tool calling (function calling)

Send OpenAI-style tools (+ optional tool_choice) with the request — they are forwarded to the model unchanged, on free models and paid ones, over HTTP and MCP, streaming and non-streaming. The response is the provider's own answer: either text, or choices[0].message.tool_calls with finish_reason: "tool_calls".

Continue the loop the OpenAI way: send the assistant turn back with content: null and its tool_calls, followed by one role: "tool" message per call carrying tool_call_id. (A tool-call turn has no text content — that is normal, not an error.)

Two things to know before you send a big tool list:

  • The tool schema is input tokens — it is counted in the price and in the context-window fit exactly like your messages. Trim descriptions you do not need.
  • Free models have a small token budget (see the table above): a large tool list will not fit. Use a paid model for agentic loops.

The Tools column above marks models verified to accept tool calling (live-checked by us). An unmarked model is unverified, not necessarily unsupported — if a model refuses tools, the error names the cause.

Payment Flow (x402 V2, exact scheme)

  1. Send the request without payment headers.
  2. Server responds 402 Payment Required with a PAYMENT-REQUIRED header (base64 JSON): price, payTo address, USDC mint, memo, recent blockhash.
  3. Agent constructs a partial transaction: USDC TransferChecked (amount = required) + Memo instruction, signs with its own wallet. Fee payer is NOT signed by the agent.
  4. Agent retries the request with PAYMENT-SIGNATURE header (base64 JSON payload with the signed transaction).
  5. Server verifies the payment and processes the request (fees sponsored — gasless for the agent).
  6. Response is 200 with PAYMENT-RESPONSE header (settlement receipt).
  • Network: solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp (Solana mainnet)
  • Asset: USDC EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
  • The agent must have an existing USDC ATA; it does not need SOL (BridgeNode sponsors fees).
  • Use official x402 SDKs (@x402/svm, x402[svm]) or any x402-capable client — they handle 402 → sign → retry automatically.

Conformance (x402 v2, exact)

Facts you can check, not a badge:

  • x402Version 2, scheme exact, network solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp (Solana mainnet, CAIP-2).
  • Asset: USDC EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v (6 decimals). amount is an atomic string — "2000" is 0.002 USDC.
  • payTo = BHMDv3ri3LBEZjEzJgDZeUiguVX7LmsCstTXbM3dL8rN; extra.feePayer = the same address, so the agent needs no SOL (gasless).
  • The 402 body is a PaymentRequired envelope — the validator is the official x402 SDK (x402 2.22.0) and the live check passes 17/17 (envelope, /supported, /verify semantics, and a real settle verified on-chain).
  • Self-facilitated: there is no third party between you and us — GET /supported, POST /verify, POST /settle are served by BridgeNode itself, declared in https://bridgenode.cc/.well-known/x402.
  • /verify follows the spec: a payment that does not verify is answered 200 with {"isValid": false, "invalidReason": ...}; a malformed request body is the only 400.

Quick Start (curl)

Step 0 — first call, free (copy this one): no wallet, no 402, and keep max_tokens >= 200 — a smaller limit can be eaten by reasoning and return an empty answer:

curl https://bridgenode.cc/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-oss-20b","messages":[{"role":"user","content":"hello"}],"max_tokens":200}'

Response: 200 directly.

Step 1 — a PAID model (same endpoint, same body):

curl https://bridgenode.cc/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-flash","messages":[{"role":"user","content":"hello"}],"max_tokens":200}'

Response: 402 with PAYMENT-REQUIRED header. Sign the partial transaction with an x402-capable client and retry with PAYMENT-SIGNATURE header. Response: 200 with the completion.

SDKs

All SDKs handle the x402 payment handshake automatically, with fail-closed spending limits (BRIDGENODE_MAX_PER_CALL, BRIDGENODE_DAILY_CAP).

MCP Usage

  • One-line install: claude mcp add bridgenode -s user -- npx -y @bridgenode/mcp@latest
  • Server URL: https://bridgenode.cc/mcp (streamable-http)
  • Tool: chat_completions (model, mode, messages, max_tokens)
  • Payment: x402 handshake per tool call; always check the actual amount in the 402 response before signing.

Errors

StatusMeaning
400Bad request (unknown model, invalid body). A non-stream max_tokens above the model's non_stream_max_tokens is CLAMPED to it, never rejected.
402Payment required — see PAYMENT-REQUIRED header
413Request body too large (limit 2 MB)
429Too many requests (queue limit)
503Service busy — retry with backoff

Discovery

Notes

  • Refunds: if the provider fails before any content is delivered, the payment is refunded automatically (reverse USDC transfer).
  • Reasoning/thinking models: use max_tokens >= 200 (reasoning tokens share the max_tokens budget; a too-small limit can produce an EMPTY answer — we retry once with a bigger budget and refund in full if it stays empty). Thinking is disabled on: glm-4.7-flash, deepseek-flash, deepseek-v4-pro.