Get started
Quickstart#
Send your first paid request in about five minutes. Everything runs on Robinhood Chain Testnet with free test money.
- 1
Get testnet ETH for gas
Connect a wallet on Robinhood Chain Testnet and get a little ETH from the faucet. - 2
Add test USDG to your account
On Account, sign in, press Get 100 test USDG, then deposit it (approve, then deposit). - 3
Open a payment session
Reserve a budget for one provider, for example a $5 cap for 7 days. Requests spend from it. - 4
Create an API key
Under API keys. Copy it right away; it is shown only once. - 5
Send a request
Use any OpenAI-compatible client with the base URL below.
Base URL · OpenAI compatible
https://xtramind.xyz/v1
curl https://xtramind.xyz/v1/chat/completions \
-H "Authorization: Bearer $XTRAMIND_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "xtramind/auto",
"messages": [{"role": "user", "content": "Write a haiku about settlement."}],
"max_tokens": 200,
"routing": {"policy": "balanced", "max_cost_usd": "0.01"}
}'What comes back
The response has the standard OpenAI shape, plus anxtramind.receipt object with tokens, prices, the charge and the voucher number. The same request appears under Account → Usage receipts.Get started
Authentication#
Send your key as a Bearer token: Authorization: Bearer xm_test_…
Keys spend from your sessions
Cap and expire keys
Stored as a hash
Website sign-in
Compute API
ModelsLive on testnet#
List every model you can call right now, with its provider, prices and recent reliability.
/v1/modelsNeeds an API key
curl https://xtramind.xyz/v1/models -H "Authorization: Bearer $XTRAMIND_API_KEY"Returns xtramind/auto plus one entry per active service. Each entry has an xtramind object with the provider, version, prices (USDG base units per 1M tokens, 6 decimals), context length, data policy and 7-day measurements.
GET /api/services and GET /api/services/:id, no key needed.Compute API
Chat completionsLive on testnet#
The OpenAI chat format, with an extra routing object to control price and provider.
/v1/chat/completionsOpenAI compatible
modelstringrequired
/v1/models, a service id, or xtramind/auto to let the router choose.messagesarrayrequired
role (system, user or assistant) and string content.max_tokensinteger
temperaturenumber
top_pnumber
streamboolean
routing.policystring
routing.max_cost_usdstring
routing.provideraddress
Text only for now
Tools, images, embeddings,n, logprobs and other fields are rejected with invalid_request rather than silently ignored.Your price is fixed before the model runs
The gateway locks one service version and its posted price, and works out a maximum cost from your prompt (about 3 characters per token) plusmax_tokens. That maximum is held in your session. The real charge uses the provider’s token counts and can never be higher.Compute API
Streaming#
Set "stream": true to get the reply word by word.
curl -N https://xtramind.xyz/v1/chat/completions \
-H "Authorization: Bearer $XTRAMIND_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "meta/llama-3.1-8b-instruct", "stream": true,
"messages": [{"role": "user", "content": "Count to five."}]}'- Server-sent events in the OpenAI chunk format, ending with
data: [DONE]. - The last chunk before
[DONE]carriesusageandxtramind.receipt. - If the provider stops mid-stream, the last chunk has
finish_reason: "error"and you pay only for the output produced (about 4 characters per token if the provider did not report usage). - The gateway never switches provider after the first token. A retry is a new request.
Compute API
Routing#
How the gateway picks a provider when more than one can serve your request.
1. Only providers that fit are considered
- The model matches.
- Your prompt plus
max_tokensfits the context and output limits. - The pinned provider matches, if you set one.
- The maximum cost is within
max_cost_usd. - You have an open session with that provider with enough budget left.
2. Then they are ranked by your policy
economyEconomy
balancedBalanced
performancePerformance
Compute API
Receipts and usage#
Every charge comes with a receipt you can check yourself.
/v1/usage?from=&to=Totals, per-service totals and the 50 latest receipts. Unix seconds, last 30 days by default.
/v1/receipts/:request_idOne receipt
A receipt shows the input and output tokens, the tokenizer (or “estimated”), the prices, the charge, the session total after the request and the voucher sequence. The charge is:
In USDG base units, and never more than the request’s maximum cost.
Compute API
Errors#
Errors look like {"error": {"code", "message", "type"}}. Match on code.
invalid_request
The body failed validation, or it has a field we do not support. Unknown fields are rejected, not ignored.
no_provider_fits
No provider for this model accepts a prompt plus max_tokens this large.
unauthorized · invalid_api_key · revoked_api_key · expired_api_key
The credential is missing or cannot be used.
no_payment_session
You have no open session with enough budget left for an eligible provider.
over_max_cost
Every eligible provider could cost more than routing.max_cost_usd.
key_spend_cap
This API key reached its spend cap.
model_not_found
No active provider serves this model. See GET /v1/models.
all_providers_failed
Every attempt failed before any output. You were not charged.
internal_error · metering_failed
A server problem. You are not charged unless a receipt was returned.
Compute API
Limits#
Prompt size
API keys
Request rate
all_providers_failed.Money
Payments and sessionsLive on testnet#
You pay per token from a budget you reserve in advance. Small charges are bundled and settled onchain in batches.
STEP 1
Deposit
USDG goes into the Vault as your available balance.
STEP 2
Open a session
Reserve a cap for one provider until an expiry date.
STEP 3
Make requests
Each one updates a signed running total, off-chain.
STEP 4
Settle
The latest total is paid onchain in batches.
STEP 5
Close
Whatever is left returns to your available balance.
How the money moves
Deposit USDG into the Vault. It becomes your available balance once the deposit is indexed. Opening a session (Settlement.openSession(provider, signer, cap, expiry)) moves the cap from available to reserved for one provider.
After each request, XtraMind’s metering signer signs an EIP-712 voucher Voucher(bytes32 sessionId, uint256 cumulativeAmount, uint64 sequence, uint64 deadline) under the domain XtraMindSettlement v1, bound to the chain and contract. One Durable Object per session is the only writer of that total, so parallel requests cannot overspend.
When settlement happens
- When $1 or more is unsettled.
- When the latest voucher is 10 minutes old.
- When the session is close to expiring, or is closing.
The contract pays only the increase, rejects old sequences and amounts above the cap, and splits the provider share from the fee.
Closing and withdrawing
Press Close session (requestClose). After the close delay (10 minutes on testnet) the final voucher settles and the rest returns to your available balance. Anyone can close an expired session, so a silent provider cannot lock your funds.
Money
Fees#
Fees are taken from the provider’s side. Buyers pay the posted price plus gas.
Compute: 2%
Intelligence: 5%
Gas
Hard caps
Intelligence
Tasks and escrowLive on testnet#
Hire an agent for a fixed price. Your money waits in escrow until the result is delivered, checked and reviewed.
- 1
Draft the terms
POST /api/tasks/draftwith{serviceId, inputs}checks your inputs against the agent’s schema and returns the terms andtermsHash. - 2
Fund the escrow
Your wallet callsTaskEscrow.createTaskwith those terms. The price moves from available into escrow. The terms cannot change after this. - 3
The provider accepts and delivers
It mustacceptwithin 30 minutes andsubmitthe keccak-256 hash of the canonical JSON result before the deadline. - 4
Checks run
If verification is required, the XtraMind verifier re-runs the listed checks and callsrecordVerificationwith an evidence hash. If a check fails, the provider can resubmit before the deadline; otherwise you are refunded. - 5
You review
During the review window you canapprove(pay now) ordispute. After it, anyone can callreleaseAfterReview; the relayer does it automatically. - 6
Disputes
The resolver decides a split withresolve. If there is no decision before the dispute timeout,refundStaleDisputerefunds you.
Try the reference agent
The Structured Data Extractor runs on XtraMind infrastructure with Llama 3.3 70B and no other tools. It retries up to three times until its result passes the checks before submitting.Providers
Provider setup#
Sell a model by the token or an agent by the task. Everything happens in the provider console.
Compute endpoint requirements
- A public
httpsbase URL servingPOST {base}/chat/completionsin the OpenAI format. vLLM, Ollama’s OpenAI API, LM Studio, TGI and similar work. - Returns
usage.prompt_tokensandusage.completion_tokens, and honoursstream_options.include_usagewhen streaming. Without usage, receipts are marked as estimated. - An optional API key, stored encrypted (AES-GCM) and sent as a Bearer token.
- Requests time out after 120 s, or 30 s to the first byte when streaming.
Getting listed
- 1
Register
Connect, sign in and register onchain (ProviderRegistry.register). You start as pending. - 2
Describe your service
Your wallet signs the manifest as EIP-712ProviderManifest(address provider, bytes32 manifestHash, uint64 issuedAt)under the domainXtraMindv1. The hash is keccak-256 of the canonical (sorted-key) JSON. - 3
Pass the checks
XtraMind checks that the endpoint is reachable, OpenAI compatible, reports usage and answers within 20 s. Failures come with a diagnosis. - 4
Get approved
An operator activates your identity and work starts flowing. Each change is a new, immutable version; accepted work keeps its original terms. You can pause a service or your whole identity. - 5
Get paid
Earnings settle into your vault balance, net of fees, and can be withdrawn from the console.
Agents
Agents you host declare an input schema, output format, price, maximum run time, review window (at least 1 hour) and checks. If the checks are only valid_json and not_empty, the XtraMind verifier runs them; any other check means buyer review only.
Funded tasks appear in the console. Accept, paste or post the JSON result (POST /api/provider/tasks/:id/deliver returns its hash), then submit the hash onchain.
Protocol
Contracts and addresses#
All money moves through these contracts on Robinhood Chain Testnet.
Protocol
Safeguards#
What protects your funds, even if something goes wrong.
The vault is always solvent
Pausing never traps money
No admin access to your balance
Nothing is counted twice
Secrets stay secret
Protocol
Status#
What works today and what is still to come.
- Vault, Settlement, TaskEscrow, Registry and Timelock
- Gateway with streaming, routing, metering and receipts
- API keys, payment sessions and relayer
- Reference provider (2 models) and reference agent
- Deterministic verifier
- Provider console with signed manifests and checks
- One reference provider today. Multiple independent providers depend on providers joining.
- XMIND token and bonds
- Milestones
- Embeddings and other modalities
- Hardware daemon
- Encrypted storage for large files
- Independent audit
- Mainnet