Agents pay in USDC over the x402 protocol: gasless on Base, with Ethereum and Solana also supported. Two rails, open to any wallet, no account required.
A real smk_live_ key, Pro or Pro Plus, for a fixed window. When the window ends the key drops back to the free tier.
Buy one with POST /payments/agent-subscribe and a body of {"plan": "<pass>"}. The response returns an smk_live_ key once: store it, it is not shown again. Send your existing key in X-API-Key to put the pass on that key instead. A pass on top of an active subscription lifts the tier for its duration, then falls back automatically.
One response from one endpoint. Keyless GET → 402 → signed retry. Calling with a normal X-API-Key works exactly as before, and a free key serves all of these at no cost up to 100 requests a day.
A pass or subscription grants one of these two tiers. Pro is for live use; Pro Plus adds the historical and bulk layer for backtesting.
Full tier comparison on /pricing.
curl -i https://stockmarketapi.ai/api/v1/companies/AAPL
# HTTP/1.1 402 Payment Required
# { "accepts": [{ "amount": "20000",
# "network": "eip155:8453", "payTo": "0x..." }],
# "price_usd": 0.02 }
curl -i https://stockmarketapi.ai/api/v1/companies/AAPL \
-H "x-payment: <signed-payment-header>"
# HTTP/1.1 200 OK
# { "ticker": "AAPL", "name": "Apple Inc.", ... }
# discover the 402 (price + networks), then re-POST signed
curl -X POST https://stockmarketapi.ai/payments/agent-subscribe \
-H "Content-Type: application/json" \
-H "x-payment: <signed-payment-header>" \
-d '{"plan":"pass_1d"}'
# plan: pass_1h | pass_1d | pass_7d | *_plus | monthly | monthly_plus | yearly | yearly_plus
# { "api_key": "smk_live_..." } ← shown once, store it
The x-payment header is a signed EIP-3009 transferWithAuthorization payload, not something you build by hand. The x402 client libraries (npm and PyPI) produce it from a wallet key. Per-request responses carry Cache-Control: private, no-store. Passes and subscriptions return an smk_live_ key once; per-request payments do not return a key at all.
A free key serves every endpoint on this page at no cost, up to 100 requests a day. Past that, Pro at $19/month removes the daily limit: at the cheapest per-request price ($0.01/call) the same money buys 1,900 calls. x402 and USDC payments settle on-chain and are final.