Docs
OpenAI-compatible inference with onchain settlement on Robinhood Chain.
Quickstart — zero to first response
- 1. Connect a wallet. Any EVM wallet works (Robinhood Wallet, MetaMask, Rabby). You sign one gas-free message to log in — no email, no password.
- 2. Buy credits on /markets. Pick a model, pick a seller, pay in USDG. Two transfers leave your wallet: the seller's cut and the platform fee.
- 3. Mint an API key on /buy. The
inf_secret is shown once — store it. - 4. Call the API. Point any OpenAI-compatible client at the endpoint below.
curl https://tryapimart.app/api/inference/v1/chat/completions \
-H "Authorization: Bearer inf_..." \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek/deepseek-chat",
"messages": [{ "role": "user", "content": "hello" }]
}'Endpoint & auth
POST /api/inference/v1/chat/completionsDrop-in replacement for the OpenAI Chat Completions endpoint. Send your inf_ key as a bearer token. Streaming (stream: true) and non-streaming both supported; streamed responses include usage in the final chunk.
Model IDs use OpenRouter naming — openai/gpt-4.1, anthropic/claude-3.5-sonnet, deepseek/deepseek-chat. Browse the full list on /markets or GET /api/models.
Use it from any SDK
from openai import OpenAI
client = OpenAI(
base_url="https://tryapimart.app/api/inference/v1",
api_key="inf_...",
)
r = client.chat.completions.create(
model="anthropic/claude-3.5-haiku",
messages=[{"role": "user", "content": "hi"}],
)import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://tryapimart.app/api/inference/v1',
apiKey: 'inf_...',
});
const r = await client.chat.completions.create({
model: 'google/gemini-2.5-flash',
messages: [{ role: 'user', content: 'hi' }],
});# same key, same endpoint — just override the base URL export ANTHROPIC_BASE_URL=https://tryapimart.app/api/inference/v1 export ANTHROPIC_API_KEY=inf_...
Routing
For each request the router tries, in order:
- 1. Your priority key (if set in Router Settings on /buy).
- 2. The cheapest healthy marketplace offer where you hold credits with the seller.
- 3. Your fallback key (if set).
Offers are health-checked; sellers whose upstream key starts failing are skipped automatically until they recover.
Billing & fees
You're charged the seller's quoted price per million tokens, metered per request from real usage. Credits are pre-purchased per seller in USDG.
- · Platform fee: 1% of each credit purchase, paid at top-up time. The other 99% goes straight to the seller's wallet.
- · $APIMart holders pay half fees. Hold $APIMart in your connected wallet and the fee drops to 0.5% — checked on-chain at quote time, automatically.
- · When your credits with a seller run out, the API returns
402 insufficient_credits— top up and the same key keeps working.
How buying settles on-chain
When you confirm a purchase, your wallet sends two USDG transfers on Robinhood Chain: one to the seller, one (the fee) to the platform treasury. The server then reads the Transferevent logs from both transaction receipts and only issues credits once the exact amounts are confirmed on-chain. No custody, no escrow — if the transaction doesn't verify, no credit moves.
ETH on Robinhood Chain pays gas for those transfers (fractions of a cent). Get USDG and ETH onto the chain via the Robinhood app or the official bridge.
Selling capacity
- 1. On /sell, pick your provider (OpenRouter / Venice / Uncensored), paste your upstream API key, set a per-million-token price.
- 2. Your key is validated against the provider's
/modelsendpoint at save time and encrypted at rest (AES-256, envelope key). Bad keys never go live. - 3. Buyers pay you up-front, directly to your wallet when they buy credits. Their requests then run through your upstream key. Your margin = your price − your provider cost.
Wallets & sign-in
Authentication is a signed message, not an account. The server issues a one-time nonce, your wallet signs it (personal_sign, no gas), and a week-long HttpOnly session cookie is set. Log in from any EVM wallet — if the site is opened inside Robinhood Wallet's browser it connects directly.
Your wallet address is your identity: payouts, credits, keys, and offers all hang off it.
Chain details
Explorer: https://robinhoodchain.blockscout.com. The connect flow adds/switches the network in your wallet automatically.
Errors
| Status | Code | Meaning |
|---|---|---|
| 401 | unauthorized | Missing/invalid inf_ key, or wallet session expired (web). |
| 402 | insufficient_credits | No credits left with any seller for this model — top up on /markets. |
| 404 | not_found | Unknown model ID, or no active offer for it. |
| 400 | bad_request | Malformed body / missing messages / invalid params. |
| 502 | upstream_error | Seller's provider failed; the router retries the next offer when possible. |
Trust & verification
- · Payments verified from EVM event logs — credits are only issued for confirmed on-chain transfers.
- · Seller keys encrypted at rest; never returned by any API after save.
- · Marketplace is non-custodial: the platform never holds buyer or seller funds — the 1% fee is the only thing that touches the treasury.
- · Every purchase links to its transactions on the block explorer.
FAQ
Only for gas when buying credits (fractions of a cent per purchase). API calls themselves are off-chain and cost no gas.
Sellers monetize quota they already pay for — bulk discounts, unused subscriptions, provider credits. You pay their marginal price, not list price.
The router health-checks offers and fails over to the next-cheapest seller you hold credits with (or your own fallback key).
Requests are proxied to the seller's upstream provider; the platform meters token counts, not content.
Robinhood Wallet, MetaMask, Rabby, and any injected EVM wallet. WalletConnect support is on the roadmap.