Authentication
API keys, the x-api-key header, and how keyed and anonymous calls differ.
StackResolve uses one credential everywhere: a StackResolve API key tied to a workspace. The same key works for the REST API, the hosted MCP server, and the CLI.
#Get a key
Create a key in two ways.
- Dashboard: sign in at app.stackresolve.dev and create a key. The key is shown once. Save it.
- CLI:
npx stackresolve keys create "my agent"mints a key and a workspace and prints the key once.
#Send your key
curl "https://api.stackresolve.dev/v1/audit?domain=stripe.com" \
-H "x-api-key: $STACKRESOLVE_API_KEY"The REST API and the hosted MCP both read the key from the x-api-key header. The CLI
reads it from the STACKRESOLVE_API_KEY environment variable. The older
AGENTREADY_API_KEY variable still works as a fallback in the CLI.
#What a key unlocks
| Call type | Anonymous | Keyed |
|---|---|---|
| Open reads: registry, profile, categories, search, compare, badge | Yes | Yes |
| Metered primitives: audit, company, pricing, competitors, compare-companies, research, find-tools | Small IP trial (8 / hour) | Billed against your plan |
| Account and billing: usage, entitlements, limits, billing, invoices | No | Yes |
| Vendor claim: claim, claim/verify | No | Yes |
Hosted MCP (POST /mcp) | No | Yes (required) |
The metered primitives run a billing entitlement check for keyed callers and record a usage event. See Rate Limits and Billing & metering.
x-api-key header first. A missing or invalid key returns a JSON-RPC
error with code -32001.#Workspaces
A key belongs to one workspace. Usage, entitlements, limits, and invoices are all scoped
to that workspace. Create separate keys for separate workspaces when you want separate
usage and billing. Read your current workspace usage with GET /v1/usage or
npx stackresolve usage.
#Revoke or rotate
Rotate a key by creating a new one and updating your environment, then revoking the old
one from the dashboard. Revoking a key takes effect immediately: calls with that key start
returning 401.