x-api-key header at all, so you can make your first call right now. GET /health is always
public regardless of tier.
Calling from a browser
CORS is enabled on every endpoint, so a wallet widget, dapp frontend, or any other browser-side integration can call the API directly, with no server-side proxy required.x-request-id, ravn-version and the rate-limit headers below are exposed via
Access-Control-Expose-Headers, so your client-side code can read them. Quote x-request-id if you ever report a bad quote to us; it
is how we find your exact request.
Put only your public key (
rvn_live_…) in browser code. It quotes, executes, submits and
tracks swaps, and nothing else: it can’t change your fee, payout addresses or webhook. Your
secret key (rvn_sk_…) can, so it never goes in a browser, an app bundle or a public repo.
See Public and secret keys. A key issued before secret keys existed
still has full rights until you claim its secret: if yours is in browser code, claim it now, see
Keys without a secret key./status polls count against a budget of their own, four times your
limit, so tracking swaps never eats into the budget your quotes and executes share. Over MCP, each
agent gets its own IP’s anonymous budget.
To use a self-serve or enterprise key, pass it in the x-api-key header:
401 UNAUTHORIZED. A public key sent where the
secret key is needed, or from a site outside its allowed origins, returns 403 FORBIDDEN. If RAVN can’t check keys at
all for a moment, it answers 503 UNAVAILABLE with details.retryAfterSec and a Retry-After
header: retry, your key is fine. Exceeding your tier’s limit returns 429 RATE_LIMITED, with a
retryAfterSec value in details and a Retry-After header.
Every quote, execute, submit, status, tokens, chains and keys response, success or error, carries
the budget it was counted against (/health, /x402/execute, a keyless /x402/quote and unlimited enterprise keys get none):
Public and secret keys
Every self-serve key comes as a pair. Get an API key shows both, once.
Both keys count against the same rate limit and earn the same fee: they are one partner.
Keep your public key on your own sites. Set
allowedOrigins on
PATCH /v1/keys to the sites your app runs on
(for example ["https://app.example.com"]). A browser request carrying any other Origin is
refused with 403 FORBIDDEN, and never spends your rate limit. Requests with no Origin (your
servers) always work. This keeps other sites from using your key; it isn’t a password.
Leaked your secret key? Rotate it with POST /v1/keys/secret, sending the current secret. The
old one stops managing your key at once and stops working within a minute.
Keys without a secret key
Keys issued before public and secret keys existed have no secret yet. Until 1 December 2026 00:00 UTC such a key keeps doing everything it did, includingPATCH /v1/keys, so nothing
breaks. To get your secret key, call POST /v1/keys/secret
from your server with your current key as x-api-key. From that moment your current key is your
public key: it keeps working for quotes, executes and status, but PATCH /v1/keys needs the new
secret.
After 1 December, a key that never claimed a secret is a public key; contact RAVN for its secret.
RAVN itself charges 0 bps, always. Self-serve keys can set their own swap fee (0% by default,
up to a cap); enterprise fees are set directly by RAVN as part of your arrangement. Full
breakdown, the quote fee object, and how this differs from optional x402 call fees: see
Pricing.

