Nexus402 is a metering gateway for MCP tools. It sits between two parties who never need an account with each other: a developer, whose AI agent calls tools from an ordinary MCP client, and a creator, who runs the server that does the work. The gateway decides who may call, charges a fixed price per call from a wallet the developer funded in advance, forwards the call to the creator's own server, and keeps the books for both sides.
The parts #
| Part | What it does |
|---|---|
The gateway (api.nexus402.dev) | One remote MCP server for every tool. Authenticates the key, rate-limits it, meters the call, signs and forwards it to the creator, checks the answer, and relays it. Answers initialize, tools/list and ping itself from the published catalogue |
| The meter | Redis holds each wallet's spendable balance and each key's rolling 24-hour spend. One atomic script checks both and deducts the price, so two calls can never spend the same cent. If Redis is unreachable, every paid call is refused with 503 rather than let through |
| The charge queue | Every charge is written to a durable queue, and the gateway waits for that write before contacting the creator. A charge that cannot be recorded is a refused call, never a free one |
| The ledger | PostgreSQL, double-entry and append-only: database triggers refuse edits and deletes. A worker nets charges into five-minute rollups. It is the only source of truth; Redis is rebuilt from it |
| The registry | Every published version, with its fixed price and endpoint. Gateways keep a copy in memory and refresh it about every five minutes, so no database is read on a call |
| Stripe | Card top-ups into a developer's wallet (Checkout with 3D Secure, no automatic top-up), and payouts to creators through Stripe Connect |
| The creator's server | Any HTTPS endpoint the creator runs, anywhere. It receives signed MCP tools/call requests and returns results. Nexus402 never hosts it, deploys it or holds its code |
How creators bring their servers in #
A creator does not move anything onto our infrastructure. They publish a pointer to a server they already run, at a price, and the gateway starts sending it paid calls.
- Sign in creator role Google, GitHub or Apple. No password. (in your Nexus402 account)
- Claim a handle get nx_crt_ key Your name in every tool's address. The key is shown once. (in your Nexus402 account)
- Build your endpoint A starter kit in your language checks each request is ours. (on your own server)
- Host it anywhere, HTTPS Any host that serves HTTPS. Nothing of ours to install. (on your own server)
- Publish price + proofs Set a fixed price per call; we check the endpoint answers. (in your Nexus402 account)
- Get called metered, paid Each call is charged up front; you are owed your share. (in your Nexus402 account)
Then, on every paid call
- An agent calls with its key
- Nexus402 charges the price, signs the request
- Your endpoint checks the signature, answers
- You are owed your share of every paid call
- Sign in with Google, GitHub or Apple and take the creator role.
- Claim a handle, the namespace every tool lives under (
acme/…). The answer carries the creator key,nx_crt_…, shown once, which every forwarded call carries so the server knows it came from us. - Build the endpoint: a small HTTPS handler that checks our signature and key, runs the tool, and returns the MCP result with a proof header. See Build a Server.
- Host it anywhere with a public HTTPS address on port 443: a VPS, a container platform, a serverless function.
- Publish a version with its fixed price, endpoint, description and input schema. The first publish at a host proves the creator controls it with one static file, and every publish sends a signed "hello" the endpoint must answer. The version is callable within about five minutes.
- Get called. Optionally give free calls per day, week or month to let developers try the tool.
How developers connect through MCP #
A developer adds one remote MCP server to the client they already use — Cursor, Claude Code, OpenAI Codex or any other — at https://api.nexus402.dev/v1/mcp, with their key in the X-Nexus-Api-Key header. There is no SDK. The client's tools/list returns every published tool with its description and schema, free; the agent then calls whichever it needs. Each key has its own spend cap, so one agent's mistakes are bounded by what someone decided to give that key. See Connect with MCP.
How a tool call flows #
- The client sends an MCP
tools/callwith the key. - The gateway verifies the key and its rate limit, finds the tool's version and price in memory, and deducts the price in one atomic step that also checks the wallet and the key's rolling 24-hour cap. A wallet or cap that cannot cover it is a
402, and nothing is charged. - It writes the charge to the durable queue and waits for the acknowledgement.
- It forwards the request to the creator's endpoint over HTTPS, signed with Ed25519 over the method, host, path, timestamp, correlation id and body hash, with the creator key beside it.
- The creator's server answers with the tool's result and a proof header derived from that request, which shows the answer came from the endpoint that received it.
- The gateway checks the proof before relaying a byte, wraps the result as the JSON-RPC response to the developer's request, and streams it back. A call may run for up to two minutes.
The gateway reads only the envelope it needs to route and bill — the method and the tool name — and computes a one-way hash. It does not store or log the contents of tool calls. See the Privacy Policy.
What a call costs, by outcome #
| What happened | Developer charged | Creator earns |
|---|---|---|
The creator answered 2xx with a valid proof | Yes, the fixed price | Yes |
| A free call (the tool's allowance, not yet used up) | No | No |
The creator answered 4xx or 5xx | No, refunded; the status and body are relayed | No |
The creator timed out, could not be reached, or answered 2xx without a valid proof | No, voided; the developer gets 502 | No |
| The response was cut off after it had started streaming | Yes: bytes reached the developer | Yes |
| The wallet or the key's cap could not cover it | No; 402 | No |
| Our own infrastructure could not authorize it | No; 503, never a silent debit | No |
How metering works #
- Fixed prices. A creator sets a price per call on each version, in integer micro-USD (up to $5.00 a call by default). A published version's price never changes; a new price is a new version. A price more than twice what unpinned callers were paying waits seven days before unpinned callers reach it.
- Pre-funded wallets. Developers add funds by card before they spend. There is no automatic top-up, so the balance is the ceiling.
- Per-key caps. Every key can carry a rolling 24-hour spend cap, checked in the same atomic step as the balance.
- Exactly once. An
Idempotency-Keymakes a retry safe: a key that already paid for a call is refused with422, never charged twice. - Free calls and trial credit. A creator can give every account a number of free calls per UTC day, week or month. A new account may get trial credit from an operator offer, which pays only for those free calls and ends at the first top-up. Neither is money: a free call debits nothing and earns nothing.
- Settlement. A worker posts charges to the ledger in five-minute rollups. The creator's share is the price less our margin, 10% today and effective-dated, so a change applies only from the date it takes effect.
- Payouts. Earnings become withdrawable after holds that protect against chargebacks, from a $5.00 minimum, by Stripe Connect transfer, each withdrawal confirmed with an emailed code. See Payouts.
What we handle, and what creators handle #
| Nexus402 handles | The creator handles |
|---|---|
| Developer accounts, keys, wallets, card top-ups, caps and rate limits | The server: its code, hosting, uptime, scaling and TLS certificate |
MCP discovery: initialize, tools/list, ping, from the published catalogue | The tool's behaviour, and its description and input schema |
| Metering, the charge, refunds and voids, and idempotency | Choosing a price per version, and any free calls |
| Signing every forwarded request, and checking every answer's proof | Verifying our signature and key, and returning the proof |
| The ledger, settlement, holds and payouts | Connecting a Stripe account to be paid |
| Marking an endpoint unhealthy: five failures in a row pause it for 30 seconds, and twenty de-list the version until it is re-published | Fixing the endpoint, and re-publishing a de-listed version |
| Never storing or logging the contents of tool calls | Whatever the tool does with the arguments it receives, under the creator's own terms |