Authentication
Pass your Solrouter API key as a Bearer token in the Authorization header. Generate keys at solrouter.com/sdk — no email or credit card required.
Solrouter authenticates REST API requests using Bearer tokens. Every request you make must include your API key in the Authorization header. Keys are tied to a prepaid balance denominated in USDC or $ROUTER, and usage is metered per call — there are no subscriptions or seat fees.
Request Format
Include your API key as a Bearer token in every request:
Authorization: Bearer sk_solrouter_...Getting an API Key
- Go to solrouter.com/sdk.
- Connect your Solana wallet — no email or credit card is required.
- Copy the generated API key. All keys follow the format
sk_solrouter_.... - Top up your balance in USDC or
$ROUTERto start making calls.
Full Request Example
The following curl command shows a complete authenticated request to the /agent endpoint:
curl -X POST "https://api.solrouter.com/agent" \
-H "Authorization: Bearer sk_solrouter_..." \
-H "Content-Type: application/json" \
-d '{"prompt": "Hello", "model": "gpt-oss:20b", "useTools": false}'x402 Keyless Authentication
If you are building an agent that does not hold an API key, Solrouter supports x402 per-call USDC payment. Instead of a long-lived API key, each request is settled individually on Solana mainnet via a Coinbase facilitator — no account or prepaid balance required.
To discover the x402 payment manifest and per-call pricing, send a request to:
GET /.well-known/x402Any x402-aware agent can use this manifest to self-fund calls autonomously. The x402 inference endpoint (POST /api/v1/x402/chat/completions) is Arcium-encrypted end-to-end and priced at $0.005 per call.
For agent-to-agent interoperability, Solrouter also publishes an A2A protocol v1.0 discovery card at:
GET /.well-known/agent-card.jsonThis card describes the full skill list available to agents integrating with the Solrouter Agent Privacy API.
Error Responses
| Status | Meaning |
|---|---|
| 401 Unauthorized | Missing or invalid API key. Check that your Authorization header is present and that the key begins with sk_solrouter_. |
| 402 Payment Required | x402 payment is required, or your prepaid balance is insufficient. Top up at solrouter.com/sdk or use x402 per-call settlement. |
| 403 Forbidden | Your API key does not have permission to access this endpoint. |
Never expose your API key in client-side code, public repositories, or browser bundles. If your key is compromised, anyone can drain your prepaid balance. Rotate it immediately at solrouter.com/sdk and treat the new key as a secret environment variable on your server or in a secrets manager.
Overview
The Solrouter REST API gives you encrypted AI chat, agent reasoning, TEE attestation, and private on-chain swaps. Base URL: https://api.solrouter.com
POST /agent
The /agent endpoint runs your prompt through SERV guided reasoning with access to web search, on-chain data, DEX quotes, and Solana tools.