Get Started
API Keys
A Developer API key authenticates/v1 calls (Authorization: Bearer lcai_...). Each key belongs to the wallet that minted it, and every completion made with it is paid from that wallet's prepaid balance. A wallet may hold up to 25 active keys: one per app or environment is the idea. Every key can call every /v1 route.
Keys are managed with a wallet sign-in, not with a key: the routes below take the sign-in token as Authorization: Bearer <token>.
Sign in with your wallet
Sign-in is Sign-In with Ethereum (EIP-4361): an ordinary message signature that any wallet can make. No transaction, no gas.GET /api/auth/challenge?address=<your address>returns{ "nonce", "message" }.- Sign
messagewith the wallet (personal_sign). POST /api/auth/verifywith{ "message", "signature" }returns{ "token", "expiresAt", ... }. The token lasts an hour.
CodeTYPESCRIPT
Mint a key
CodeTYPESCRIPT
key appears in this response and never again. Only a hash of it is stored; store it like a password, server-side. A key has two settings, both optional; any other field of the request is ignored:
Rate and concurrency are the server's: every key is held to the same limits, and each key has its own budget at them. See Limits.
Spend cap
A completion reserves its job fee against the key'sspendCapWei before it runs; a call that fails takes its reservation back. Once the next fee would pass the cap, completions answer 402 with code spend_cap_exceeded and the cap in error.spend_cap_wei.
PATCH /api/api-keys/{id} with { "spendCapWei": "<wei>" } changes an active key's cap, and { "spendCapWei": null } removes it; the answer is the key as listed. A raised cap lets the key spend again from its next call. A cap may be set below what the key has already spent: its next completion is refused with spend_cap_exceeded. Any other field of the request is ignored, and a revoked key's cap no longer changes (409, error api_key_revoked). Only the wallet's sign-in changes a cap, never a key.
The cap bounds what one key can spend. What the API can spend for your wallet in total is bounded on chain by the allowance you gave it: see Payment.
List, change, revoke and delete
A revoked or unknown key gets401 with code invalid_api_key. A call already running when its key is revoked or deleted finishes and is answered.
The request and response shapes of every route are in the API Reference.