Quickstart
Base URL: /v1. There are two ways to pay for a call, and both reach the same models at the same price.
- Prepaid key. Deposit once, get a key that starts with
off_sk_, and use it as a normal bearer token. Best for anything built on an OpenAI SDK. - Pay per call. Send no key. The gateway replies
402with a price and an x402 client pays it. Best for autonomous agents that hold their own wallet.
curl /v1/chat/completions \ -H "Authorization: Bearer $OFFROUTER_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "deepseek-v4.1-flash", "stream": true, "messages": [{"role": "user", "content": "Hello"}]}'
List the models with GET /v1/models, or see them on the models page.
Images and video
Some models read images, and some read video too: input_modalities on each entry of GET /v1/models says which. Send them the OpenAI way, as an array of parts in content. Every model answers in text.
{"model": "gemma-4-31b", "max_tokens": 400,
"messages": [{"role": "user", "content": [
{"type": "text", "text": "What does this chart show?"},
{"type": "image_url", "image_url": {"url": "data:image/png;base64,iVBORw0..."}}
]}]}- Inline only. Each image or clip is a base64
data:URL (video goes in avideo_urlpart). A remote link is refused withremote_media_not_allowed: fetching it would send a request out of the enclave to a host that then knows what you asked about. - The price ceiling is the whole context window. A model counts an image by its size on screen, not its bytes, so the request cannot be bounded any tighter before it runs. Pay per call collects that ceiling and refunds the rest; a prepaid key holds it for the length of the call and settles to the real token count.
- It encrypts like text. With end-to-end encryption the whole parts array is one ciphertext, so the gateway never holds the image.
Locksley
OffRouter's own model and the first built for Robinhood Chain. It answers questions about launches, tokenized stocks and what's moving on the chain by looking things up live, so a token launched today works on day one. It runs in its own dedicated H200 GPU enclave, attested by Intel and NVIDIA, and every answer comes with a signed receipt.
| Model id | locksley-27b |
| Price | $0.36 per 1M input tokens, $1.80 per 1M output tokens |
| Context | 32,768 tokens |
| Where it runs | A dedicated NVIDIA H200 in a GPU enclave we deploy on Phala Cloud (Intel TDX plus NVIDIA confidential computing) |
| Base model | Qwen3.6-27B, fine-tuned for Robinhood Chain |
| Open weights | huggingface.co/OffRouter/locksley-27b, Apache-2.0 |
What to ask it
- What's trending. Which narratives are drawing real early buyers this week, and which are just crowded.
- What a call is worth. Sentiment on a token from X, and how bullish calls have actually played out.
- Whether the tech is real. A working product or a landing page, a fork or original code, a verified contract or not.
- Tokenized stocks. Whether a Stock Token is official or a copycat, its price against the Chainlink reference, and company news.
It gives facts and how similar cases have gone. It doesn't tell anyone to buy or sell, and nothing it says is financial advice.
Call it
Use it like any other model: a normal chat completion, with a prepaid key or paid per call with x402. OffRouter runs its live tools for you, so one request comes back as a finished answer.
curl /v1/chat/completions \ -H "Authorization: Bearer $OFFROUTER_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "locksley-27b", "messages": [{"role": "user", "content": "what is trending on Robinhood Chain this week?"}]}'
from openai import OpenAI client = OpenAI(base_url="/v1", api_key="off_sk_...") r = client.chat.completions.create( model="locksley-27b", messages=[{"role": "user", "content": "is SPY on Robinhood Chain the official Stock Token?"}], ) print(r.choices[0].message.content)
- Tools it used.
X-OffRouter-Toolslists the tools that ran, for exampleget_narratives,get_sentiment. A name ending in!failed, and the answer says what it couldn't see. - Your own tools. Send a
toolsarray and OffRouter stays out of the way: the model's tool calls come back to you, as with any other model. - Streaming works. The answer streams once the tools have run.
- Agents. Over MCP, call
askwith"model": "locksley-27b". In OffChat it's the default model.
Verify it
- In five seconds. offrouter.org/verify/locksley-27b runs every check below in your browser, against a fresh report: Intel TDX, NVIDIA GPU attestation, the published code, and the signing key.
- Receipt. Receipt ids start with
own_.GET /v1/private/receipts/:idreturns the signed hashes of the request and response, signed by a key that only exists in the enclave. When the tools take several rounds,X-OffRouter-Receiptslists one receipt per round. - Attestation.
GET /v1/private/attestation?model=locksley-27breturns the enclave's Intel TDX quote and NVIDIA GPU evidence. The quote binds the signing key and the hash of the deployed compose file, which pins the exact container images, so you can check the enclave runs what we published. - Status. Uptime and recent calls are public at status.offrouter.org.
Not end-to-end encrypted yet; that is on the roadmap. The model and your conversation stay sealed in the enclave, but on a Locksley call the OffRouter gateway sees the request in memory while it runs the tools, and does not store it. For full privacy, run the open weights yourself.
Embeddings, rerank and speech to text
Three more endpoints, each in a GPU TEE and paid the same two ways. Their models are listed in GET /v1/models with type embedding, rerank or transcription.
Embeddings
curl /v1/embeddings \ -H "Authorization: Bearer $OFFROUTER_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "qwen3-embedding-0.6b", "input": ["first passage", "second passage"]}'
- Input. A string, up to 256 strings, or token-id arrays; up to 32K tokens each. Vectors have 1024 dimensions;
dimensionsis refused because the model has one size.encoding_formatmay befloatorbase64. - Price. Per input token, with no
max_tokens. Pay per call collects a ceiling of one token per byte of input and refunds the rest. - Proof. The response links the model's attestation (
X-OffRouter-Attestation) but carries no per-call receipt: NEAR, which serves this model, does not sign embeddings. Embeddings are not end-to-end encrypted yet.
Rerank
The second step of search over your own documents: embeddings find the candidates, rerank puts the best first.
curl /v1/rerank \ -H "Authorization: Bearer $OFFROUTER_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "qwen3-reranker-0.6b", "query": "how do I pay per call", "documents": ["Pay per call with x402", "Fund a prepaid key"], "top_n": 1}'
- Input. A
queryand up to 256documents, as strings or{"text": ...}objects (the Cohere and Jina format).top_nkeeps the best n;return_documentsechoes each text back. - Output.
results, best first, each with the document'sindexand arelevance_scorefrom 0 to 1. - Price. Per input token: the model reads the query with each document in turn. Pay per call collects a ceiling from the size of the query and documents and refunds the rest.
- Proof. Like embeddings, the response links the model's attestation (
X-OffRouter-Attestation) but carries no per-call receipt, and is not end-to-end encrypted yet.
Speech to text
curl /v1/audio/transcriptions \
-H "Authorization: Bearer $OFFROUTER_KEY" \
-F model=voxtral-small-24b \
-F file=@meeting.m4a- Models.
voxtral-small-24bis the cheaper one and very accurate in the main European and Asian languages.whisper-large-v3covers about 100 languages and is the one that takesresponse_format: verbose_json(language, duration and timed segments). Both takelanguage,promptandtemperature. - The file. wav, mp3, m4a, ogg, webm or flac, at most 25 MB, sent as multipart like the OpenAI SDK sends it. It goes to the enclave and is never stored.
- Price. Per second of audio, rounded up. The price ceiling comes from the file before it is sent: exact for a PCM WAV, otherwise one second per 1000 bytes, and never more than 30 minutes. You are charged for the seconds transcribed; pay per call refunds the rest.
- Proof. Every answer carries a signed receipt (
X-OffRouter-Receipt-URL). Phala routes Whisper to NEAR AI's enclave and Voxtral to Tinfoil's; the receipt names the route and the verified model.
Prepaid keys
A key is created by a deposit and spends down per call. There are no accounts: the key is the account, and the wallet that paid for it is its owner. The easiest way to make one is the dashboard. The same thing over the API:
POST /v1/keys {"amount_usd": 5} # x402 deposit, returns the key once
POST /v1/keys/topup {"amount_usd": 5} # x402 deposit + Bearer, adds balance
GET /v1/keys/me # balance and recent usage
DELETE /v1/keys/me # revoke, refund what is left
POST /v1/keys/me/pause # stop spending now, balance keptSmart accounts: fund by transfer
x402 needs a signature only a plain wallet can make. A smart account (a robot's, an agent vault's) funds a key with an ordinary USDG transfer on Robinhood Chain instead:
- Sign in with the account:
POST /v1/account/nonce, thenPOST /v1/account/login. Smart-account signatures are checked with ERC-1271, and ERC-6492 for accounts not deployed yet. - Send any amount of USDG to
pay_tofromGET /v1/keys/transfer. - Claim it with the transaction hash. Only the account that sent the transfer can claim it, and each transaction is credited once.
POST /v1/account/keys/transfer {"tx_hash": "0x…"} # session: new key owned by the sender
POST /v1/keys/topup/transfer {"tx_hash": "0x…"} # Bearer key: add a transfer its owner sent
POST /v1/account/keys/:id/topup/transfer {"tx_hash": "0x…"} # the same, with the owner's sessionClosing the key refunds what is left to the account, in USDG on Robinhood Chain.
Pause and resume
A paused key keeps its balance but serves no calls, effective immediately; calls get 403 with "code": "key_paused". It can still be read, topped up and closed. The key can pause itself (POST /v1/keys/me/pause), and the owner's session can pause it too. Only the owner's session can resume it, so a leaked key cannot switch itself back on:
POST /v1/account/keys/:id/pause # session POST /v1/account/keys/:id/resume # session
How a keyed call is charged
Before the call is served, the worst case (your full input plus max_tokens of output) is held against the balance. After it finishes, the hold is settled down to the real token count. A key can never spend more than it holds, even with many calls at once.
If you leave max_tokens out it defaults to 8192. If the balance cannot cover the budget you asked for, the budget is lowered to what it can.
The charge for each call comes back in the X-OffRouter-Charge-USD response header.
Pay per call
With no key, a request is paid for on the spot using x402. The flow is two requests:
POST /v1/chat/completions # 402, price in PAYMENT-REQUIRED POST /v1/chat/completions + PAYMENT-SIGNATURE # settles, then 200 + PAYMENT-RESPONSE
max_tokens is required here. The price in the 402 is a ceiling: your full input plus max_tokens of output. Your client signs that amount, it settles onchain, and the call is served only after settlement.
Refunds
When the call ends, the real charge is worked out from actual usage. The difference between what you signed and what you used is queued as a refund to the paying wallet, on the network you paid on. A failed call or an empty completion is refunded in full. Small refunds are batched and sent together.
If the transfer was sent but has not confirmed yet, you get a 402 with "code": "settlement_pending", "pending": true and a Retry-After. Resend the same request with the same payment header after that many seconds; do not sign a new payment. The call is served once the transfer confirms, and it is never served before.
Refunds mean extra onchain transfers. If you make many calls, a prepaid key is cheaper to run and leaves a smaller onchain trail: one deposit instead of a payment and a refund per call.
Client
import { privateKeyToAccount } from "viem/accounts";
import { x402Client, wrapFetchWithPayment } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm/exact/client";
const account = privateKeyToAccount(process.env.AGENT_KEY);
const client = x402Client.fromConfig({
schemes: [{ network: "eip155:4663", client: new ExactEvmScheme(account) }],
});
const pay = wrapFetchWithPayment(fetch, client);
const res = await pay("/v1/chat/completions", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
model: "gpt-oss-120b",
max_tokens: 512,
messages: [{ role: "user", content: "Hello" }],
}),
});A machine-readable description of every paid endpoint is at /.well-known/x402.
Networks
Every 402 lists each network below in accepts[] at the same amount, except that a Robinhood Chain quote is never under 1 cent (Priors, which settles it, takes nothing smaller; the unused part of a call is refunded). Pay on whichever one your wallet holds a balance on. Each network settles in its own dollar stablecoin, all with 6 decimals. Payments are a signed transfer authorization (EIP-3009), so the payer needs no gas token.
| Network | CAIP-2 | Asset | Paid from | Asset contract |
|---|---|---|---|---|
| Loading from the gateway… | ||||
This table is read live from GET /networks. A deposit is refunded on the network it arrived on.
Arc and Circle Gateway
On Arc, payments go through Circle Gateway. You pay from a Gateway balance, not from the USDC sitting in your wallet, so deposit into Gateway once before your first call. The 402 entry for Arc names Circle's GatewayWalletBatched contract in extra, and the authorization must stay valid for 7 days because Circle settles in batches.
Circle's client handles all of that: new GatewayClient({ chain: "arc", privateKey }) from @circle-fin/x402-batching/client, then client.deposit("5") once and client.pay(url, options) per call. A plain x402 client works unchanged on Base and Robinhood Chain.
Receipts
Every model runs in a GPU enclave (Intel TDX with a confidential NVIDIA GPU) on hardware we do not operate. Each response carries three headers so you can check that for yourself:
X-OffRouter-Receipt: the receipt id. It equals the completionid.X-OffRouter-Receipt-URL: where to fetch the signed receipt,GET /v1/private/receipts/:id. It holds hashes and timestamps, never content, and needs no key.X-OffRouter-Attestation: the enclave's public attestation report. The key that signs the receipt is published in it.
We cannot forge a receipt: it is signed by a key that only exists inside the attested enclave.
What this does and does not cover
The enclave operator cannot read your prompts or outputs. On a plain call the OffRouter gateway does see the request in memory while forwarding it, and does not store it. To take the gateway out of that path too, encrypt to the enclave yourself: see End-to-end encryption.
End-to-end encryption
Encrypt your messages to the enclave and the gateway forwards ciphertext it has no key for. The answer comes back encrypted to a key you make up for that one request. It works with a prepaid key, with pay per call and in OffChat, which does it for every message.
- Fetch
GET /v1/private/attestation?nonce=<32 random bytes in hex>and verify it yourself: the quote up to Intel's root, that it covers your nonce and the key set, and the boot measurement. Take a key frome2ee_public_keysonly if all of that holds. A key from a report you did not verify could be anyone's, ours included. - Encrypt the
contentof every message to that key. Each ciphertext is bound to the model's name as the enclave knows it:e2ee.modelon each entry ofGET /v1/models. Themodelin your request stays the usual id. - Send the request as usual with five headers:
X-E2EE-Version: 2,X-Client-Pub-Key,X-Model-Pub-Key,X-E2EE-NonceandX-E2EE-Timestamp. - Check for
X-E2EE-Applied: trueon the response and decryptcontentandreasoningwith your key, chunk by chunk in a stream. An answer that does not decrypt was not made by the enclave for your request.
The format is the open-source enclave gateway's E2EE v2: X25519 or secp256k1, HKDF-SHA256 and AES-256-GCM, with a fresh key for every field. A ready-made client for browsers and Node is served at /assets/e2ee/e2ee.js.
Locksley: E2EE v3, hybrid post-quantum
Locksley, in our own enclave, takes E2EE v3 only (e2ee.version is "3" in GET /v1/models). The key exchange is X-Wing (ML-KEM-768 and X25519 together), so a message recorded today can't be opened later by breaking X25519 alone. The field layout is v2's.
- Fetch
GET /v1/private/attestation?model=locksley-27b&nonce=<32 random bytes in hex>. Itse2ee_hybridholds the key (public_key, 1216 bytes, andkey_id, its sha256) and a second Intel TDX quote from the same machine whose report data iskey_idfollowed by your nonce. Verify both quotes up to Intel's root, that they carry the same MRTD and RTMR0–3, and thatkey_idis the hash of the key. The ready-made verifier isattestedHybridKeyin/assets/verify/verify.js. - Encapsulate once to the key, derive a request key and an answer key with HKDF-SHA256, and encrypt the
contentof every message under the request key with a fresh IV. - Send five headers:
X-E2EE-Version: 3,X-Model-Pub-Key(thekey_id),X-E2EE-Encap(the X-Wing ciphertext),X-E2EE-NonceandX-E2EE-Timestamp. No client key. - Open
content,reasoningandreasoning_contentunder the answer key, chunk by chunk in a stream.
encryptRequest in /assets/e2ee/e2ee.js does all of this when handed the hybrid key. An encrypted Locksley call can't carry tools or logprobs, which would travel outside the encrypted fields, and it runs without Locksley's live lookups, which happen in our gateway. A 409 e2ee_stale_key means the enclave was redeployed: fetch the report again.
What the gateway still sees
The model, max_tokens and other settings, tool definitions and tool-call arguments, how long each message is, the token counts the enclave reports, your IP address and who paid. It does not see what you asked or what was answered, and it holds no key that could open either.
Pricing
You are charged for the same tokens either way. With pay per call the up-front ceiling is larger, because ciphertext is about twice the size of its text; the difference is refunded with the rest.
Private payments
A prepaid key that no wallet can be linked to. You buy a note with an ordinary payment, then later fund a key with a zero-knowledge proof that one of the notes ever bought is yours, without saying which. The gateway learns that a deposit was made, never which one, so neither the key nor any call on it names a wallet.
- Make a note on your own machine: two random numbers,
nullifierandsecret. Keep them: they are the note. Its commitment isPoseidon(nullifier, secret). POST /v1/noteswith{amount_usd, commitment}is an x402 payment for one of the fixed amounts inGET /v1/notes($5, $20 or $100). The note joins a public tree of every deposit.- Later, make an API key locally, download the whole tree from
GET /v1/notes/leaves(never one leaf's path: asking for it would say which is yours) and prove that you know a note under the tree's root. POST /v1/notes/redeemwith{proof, root, nullifier_hash, amount_usd, key_hash}. No payment, no wallet, no signature. A new key with that hash is funded, or an existing key with no owner is topped up.
In the app it is two forms: buy a note at /dashboard#private (signed in) and redeem it at /dashboard#redeem, which needs no sign-in and proves in your browser. A ready-made client is served at /assets/note/note.js.
The rules
- A note funds only a key with no owner, and such a key is never refunded: there is no wallet to send to.
- Holder discounts do not apply: they are read from a wallet.
- Notes on Base, Arc and Robinhood Chain share one tree, so a deposit on one hides among all of them.
What stays public
Every deposit (payer, amount, time) and that some note of a given amount was redeemed at a given time. A note hides among the deposits of the same amount made before it is spent, so wait between buying and redeeming, and do not redeem from the address you paid from.
Pay with Gloam
Fund a prepaid key from a private Gloam balance, in USDG on Robinhood Chain. The chain shows USDG leaving Gloam's vault for our treasury, never your wallet, and the key carries no wallet either. Your payment is private, and so are your calls.
POST /v1/keyswith{amount_usd}and no payment header. Next to the usual x402 entries, the 402'sacceptslists agloam-cashoutentry:payTo, an exactamountin USDG base units, aquoteIdand anexpiresAt15 minutes out.- Cash out exactly that amount from your Gloam balance to
payTobefore it expires, ideally through Gloam's relay so your wallet never sends it. The Gloam SDK does this in one call:payGloamCashout, orGloamAgent.payX402Cashout. - Send the same request again with
X-PAYMENT: base64 of{"scheme":"gloam-cashout","txHash":"0x…","quoteId":"…"}. We read the receipt on chain and answer with a newoff_sk_key.
A key made this way, or by a private note, is topped up the same way at POST /v1/keys/topup. GET /v1/gloam says whether Gloam payments are on and gives the vault's current fee.
The rules
- The amount is the price grossed up for Gloam's cash-out fee (0.5% today, read live from the vault), plus a few base units that tie the cash out to your quote. Your key is credited the price.
- The key has no owner and is never refunded: there is no wallet we could send it to. A key with an owner cannot be topped up from Gloam.
- Not offered for pay-per-call, because the unused part of a call is refunded and a Gloam payer has no address to refund to.
- One cash out pays one quote, once. A cash out mined outside its quote's window is refused: ask for a new quote.
What stays public
That the treasury received a cash out from Gloam's vault, of what amount and when. Not who sent it, and not which Gloam deposit or payment funded it.
Private Gateway
Any OpenAI-compatible base URL, made private: your own model server, or a router you already use. Make a link once, then point your SDK at the link. Every call goes through an enclave that strips what identifies you, swaps secrets and personal data for placeholders, calls the upstream with your key sealed inside, puts the values back in the answer and signs a receipt of what left.
curl /v1/gateway/links \ -H 'content-type: application/json' \ -d '{"upstream":"https://openrouter.ai/api/v1","api_key":"sk-or-..."}' # {"id":"…","key":"gw_…","base_url":"/g/…/v1"} the key is shown once
Then use base_url and key as the base URL and API key of any OpenAI SDK. Chat completions (streaming too), embeddings and GET /models work as they do on the upstream. The page at /gateway does the same in a browser.
What leaves and what does not
- Dropped:
user,metadata,safety_identifier,prompt_cache_key, your IP and your headers. The upstream sees the enclave calling. - Replaced with placeholders such as
[EMAIL_1]: seed phrases, private keys, API keys and tokens, passwords in URLs, emails, card numbers, IBANs, EVM and Solana addresses, IP addresses and phone numbers. - Not detected: names and other free-form details, images and files. The upstream still reads everything that is not redacted: this keeps your secrets and your identity from it, not your prompt.
The receipt
Each answer carries X-OffRouter-Gateway-Receipt (the hash of what you sent, the hash of what the upstream got, the counts of what was redacted) and X-OffRouter-Gateway-Signature, signed by the key named in the enclave's report at GET /v1/gateway/attestation. POST /v1/gateway/links/{id}/preview shows the exact request the upstream would get.
Free during the beta, up to 60 calls a minute per link and 8 MB per request. An upstream must be a public https host.
Private web search
When an agent searches from its own machine, the search engine learns its IP, its account and every query it ever made. Here the search runs from inside the Private Gateway's enclave. The engine (Brave Search) sees one more query from that enclave, shared by everyone who searches through it, and never your IP, account, cookies or headers. POST /v1/web/fetch reads a result page the same way, so the site never sees you either.
curl /v1/web/search \ -H "Authorization: Bearer $OFFROUTER_KEY" -H 'content-type: application/json' \ -d '{"query":"confidential computing for AI agents","count":5}' curl /v1/web/fetch \ -H "Authorization: Bearer $OFFROUTER_KEY" -H 'content-type: application/json' \ -d '{"url":"https://offrouter.org/"}'
$0.008 a search and $0.002 a page, with a prepaid key or per call with x402. A request that is refused, or a page that cannot be read, is not charged.
Encrypted end to end
Send {"request":"<hex>"} instead: the whole JSON request, encrypted to the web key at GET /v1/web in the E2EE v2 format, with web-search or web-fetch in place of the model name. The answer comes back sealed to your one-time key. OffRouter then sees that you searched and paid, and not what for. Check the key first: the Intel TDX quote at GET /v1/web/attestation names the enclave's signer, and that signer signs the web key. The local MCP server does all of this for you in its web_search and web_fetch tools.
What leaves and what does not
- Taken out of the query before it leaves: seed phrases, private keys, API keys, emails, card numbers, IBANs, IP addresses and phone numbers. Addresses stay in, because looking one up is usually the point;
"redact"picks the kinds, orfalsefor none. The answer says what was taken out and what was sent. - Seen by the search engine: the rest of the query. A query that names you still names you.
- Seen by the site: a request from the enclave, with no cookies, no referrer and a plain user agent. Redirects are followed and checked hop by hop; private networks are refused.
Each answer carries receipt and signature: the hashes of what you sent and what left, signed by the enclave's signer. When the request was encrypted, the receipt is inside the encrypted answer too.
Private Swap
Swap tokens without publishing your order. What you buy, your minimum and where it is paid go to an enclave only; on chain the order is a hash until it is filled, so there is nothing to front-run. The enclave fills open orders of a pair together in one swap through a Uniswap v4 pool and pays each recipient in a later transaction. No key and no payment: the desk's fee (0.1%) comes out of the swap. The page at /swap does all of this from your wallet.
In beta on Robinhood Chain: ETH/$OFFROUTER and ETH/USDG, with a cap on each order (at most 0.02 ETH, 1,250,000 $OFFROUTER or 50 USDG). The contract is PrivateSwap v2, 0x2B64C08086EDe360BA8F25Ea8e7201cade96d7A7. GET /v1/swap lists the pools, the tokens, each token's least and most per order, the fee and the contract.
POST /v1/swap/quotewith{token_in, token_out, amount_in, payer, recipient?, slippage_bps?}. Amounts are atomic units; ETH is0x0000000000000000000000000000000000000000. You get the quote, the order asintent, and what the payer does next, bymethod.- Fund the order from the payer wallet:
native(paying in ETH): sendtxunchanged. It carries the ETH to the contract with the order's hash.approval(a token such as $OFFROUTER): approveapproval.spenderfor the amount once, then signsignas EIP-712 typed data.eip3009(a dollar token such as USDG): signsign. No approval and no transaction.
POST /v1/swap/orderswith{intent, signature}, or for ETH{intent, open_tx}. A payer that is a contract and cannot sign, such as an agent's vault, opens the order itself withopenFrom(token, amount, nonce, deadline)on the contract, then hands it in the same way, as{intent, open_tx}.GET /v1/swap/orders/{id}with the headerX-Order-Key: <intent.salt>untilstatusispaid. Keep the salt: it is the only way to read the order.
Rebuild what you sign or send from the order you asked for before you do it, as the page does: the message's nonce, or the transaction's data, is the hash of your order and nothing else.
The money's only ways out
An order in escrow leaves only into its swap or back to the wallet that paid. One the pool cannot fill at your minimum is sent back; once it expires (10 minutes), anyone can call refund on the contract and it returns to the payer. The executor's key lives in the enclave, and GET /v1/swap/attestation is the hardware report that names it.
What stays public
Your payment into escrow (payer, token, amount), each batch swap and each payout (recipient, token, amount). With few orders in a batch, amounts and timing can link a payment to a payout. Pay out to an address with no history.
Private agents (beta)
A trading agent that runs in an enclave. You give it a strategy in plain words and limits; it looks at the price, asks a private model, and places at most one sealed order per run through Private Swap. The strategy is read only by the enclave and is never sent back or logged.
The money is never on an enclave key. Each agent gets its own vault, a small contract on Robinhood Chain. The enclave operates it; only you can take money out.
| Who | Can | Cannot |
|---|---|---|
| You (the owner) | withdraw(token, amount) or sweep(token) at any time from your own wallet, setPaused, setLimits | Nothing is held back from you |
| The enclave (runner) | Open a Private Swap order paid by the vault, within max per trade and per day; top up a small float that pays the agent's model calls (at most $1 a day) | Withdraw, change your limits, unpause, send money anywhere but the swap contract |
A refund from the desk always returns to the vault. If an enclave's key ever changes, one call moves every vault to the new key, and nothing is stuck; if the runner disappears, your withdraw still works. The current trusted keys are checked on /status under enclave_keys.
GET /v1/agentslists the pairs an agent can trade (today USDG → ETH), the smallest order and the model.POST /v1/agentswith{owner, token_in, token_out, strategy, interval_sec, max_per_run, max_per_day, recipient?, slippage_bps?, model?}. Amounts are atomic units. You get the agent, its vault asaddress, and akeyshown once: keep it.- Send
token_into the vaultaddress. The agent starts on its own once it holds enough for one order. GET /v1/agents/{id}with the headerX-Agent-Keyshows its runs and orders.POST /v1/agents/{id}/pause,resume,withdraworclosecontrol it;withdrawsweeps the vault to the owner and the runner pays the gas.
Contracts: AgentVaultFactory 0x8E3620a754E71C04497E2A9d3Bb745B27E6d784f, PrivateSwap v2 0x2B64C08086EDe360BA8F25Ea8e7201cade96d7A7. Neither is audited yet, so every order is capped. Progress is logged on the roadmap.
Check a vault
Don't take our word for it. Paste any agent vault's address and read it straight from Robinhood Chain: who can take the money out, which enclave key may trade from it, its limits and its balance. A contract that is not a vault made by our factory is rejected, whatever it claims.
Also as JSON: GET /v1/agents/vault/{address}. Link to a vault with /docs?vault=0x…#vault-check.
A2A settlement (beta)
Agents on OffRouter Studio buy and sell work from each other in private, and settle the payment on Bull, the autonomous settlement layer for agents, on Robinhood Chain. Every settlement is listed live, with its receipts, at /a2a.
- Request. The buyer agent turns its goal into a request with its own sealed instructions.
- Sealed terms. The terms (who, what, price, deadline) are encrypted to the buyer and to the arbiter: X25519, HKDF-SHA256, AES-256-GCM, a fresh key per message. On chain there is only a commitment: Bull stores
keccak256("offrouter-deal:v1:" + commitment), wherecommitment = keccak256(terms JSON ‖ 32-byte salt). - Lock. The buyer agent's wallet opens a Bull agreement in USDG with one condition: the arbiter attests. Bull's SDK checks every transaction before it is signed (only Bull's contracts, exactly this payee, amount and terms hash).
- Work. The seller agent does the work with its own sealed instructions, in a private model call, and seals the result to the buyer and to the arbiter. Only its hash is published.
- Check and pay. An arbiter key made inside the enclave opens its copies, checks the delivery against the sealed terms and the agreement on chain, attests, then releases. Bull pays the seller agent's wallet.
| Sealed | Public, on Robinhood Chain |
|---|---|
| The request and the terms | That an agreement exists, and a hash of a commitment to its terms |
| The delivered work | Its amount in USDG |
| Each agent's instructions and reasoning | The buyer, seller and arbiter wallets |
GET /v1/studio/deals lists every settlement and GET /v1/studio/deals/{id} returns one, with the arbiter's Intel TDX quote: its report data is the arbiter's address, so the hardware vouches that the key lives in the enclave. Neither ever returns a request, terms or work in the clear: only sealed boxes, hashes and transactions.
Beta: deals run between agents enabled for them, 1 USDG at a time. Bull's agreement contracts on Robinhood Chain are not audited yet. Bull charges the payer a fee of 0.5% (at least $0.05) in ETH.
Locksley tools (beta)
The live tools Locksley calls instead of remembering tokens, open to any agent. They're in the OpenAI function-calling format, so you can hand them straight to a model that supports tools and run each call here.
| Tool | What it returns |
|---|---|
get_token | A launchpad token's trading since launch, dev-wallet selling, socials, narrative, and how often similar launches bonded |
check_tech | Whether the site is a working product or a landing page, the code's recent activity and whether it's a fork, whether the contract source is verified |
get_sentiment | Calls about the token on X in the last 24 hours, bullish vs bearish, and how bullish calls have played out |
get_narratives | Recent launches by theme, and how many drew 40+ buyers in their first 15 minutes |
check_stock_token | An address or ticker checked against Robinhood's official Stock Token list |
get_stock_quote | A Stock Token's on-chain price next to its Chainlink reference price, the minting window, the multiplier |
get_stock_news | Recent news for the company, by ticker or company name, found by private web search, plus on-chain status: pending corporate actions, paused transfers, new listings |
curl https://offrouter.org/v1/locksley/tools
curl -X POST https://offrouter.org/v1/locksley/tools/check_stock_token -d '{"query":"NVDA"}'
A tool that can't see something says so (an error, a note or a null field). It never fills a gap with a guess. Nothing here is financial advice.
Beta: free for now, cached briefly per call. Similar-launch rates are measured from Robinhood Chain launches and cover a token's first day.
MCP server
POST /mcp is a remote MCP server. There is nothing to install: add the URL with a prepaid key as the bearer.
claude mcp add --transport http offrouter /mcp \
--header "Authorization: Bearer $OFFROUTER_KEY"Tools: list_models (no key needed), ask, compare (the same prompt to several models) and balance. Tool calls are billed exactly like direct API calls. Pay per call is not available over MCP, because a remote server cannot sign for your wallet.
Private Swap adds swap_quote, swap_submit and swap_status, which need no key. The server never signs: your agent signs the quote's message, or sends its transaction, with its own wallet. To encrypt prompts on your own machine before they leave it, and to search the web privately with web_search and web_fetch, run the open-source local server instead: github.com/offrouter/mcp.
Errors
API errors use the OpenAI shape, {"error": {"message", "type", "code"}}. Payment problems use the x402 shape with a code.
| Status | Code | What to do |
|---|---|---|
| 400 | max_tokens_required | Set max_tokens on pay-per-call requests. |
| 400 | unsupported_media | The model does not read images (or video). Pick one whose input_modalities lists it. |
| 400 | remote_media_not_allowed | Send the image or clip inline, as a base64 data: URL. |
| 401 | invalid_api_key | Check the key. Closed keys stop working at once. |
| 402 | insufficient_balance | Top up the key or lower max_tokens. |
| 402 | terms_mismatch | Sign exactly the amount, asset and recipient from the 402. |
| 402 | payment_replayed | That payment was already used. Sign a new one. |
| 404 | model_not_found | Use an id from GET /v1/models. |
| 429 | model_overloaded | Retry in a few seconds. |
| 502 | upstream_error | Retry shortly. A paid call that fails is refunded. |