Authorization header. One key works across the REST API, the SDKs,
the CLI, and the MCP server.
The fastest way to confirm a key works is whoami — it returns your userId,
your plan, the key’s scopes as apiKey.scopes, and your current usage. It
answers for any valid key, whatever its scopes.
Create a key
API keys are long-lived credentials for server-side code, CI, agents, and the CLI. Create one from the dashboard, or over the API with a key that carrieskeys:write.
Lock a key to trusted IPs
PassallowedIps at creation — up to 50 IPv4/IPv6 addresses or CIDR ranges —
to bind a key to specific source addresses. Enforcement is deny-by-default:
the correct secret from an unlisted IP is rejected with a 403. See
Audit logs for the full
setup and lockout recovery.
Scope every key to what it needs
Each key carries a set of scopes that decide what it can do. Every resource owns its ownread/write pair, and a read is never gated behind a write
scope. The ones you’ll reach for first:
Bundles save you the enumeration: request
messages and it expands to
messages:read + messages:send; letters and phone bundle the same way,
and admin expands to every scope. See Permissions & scopes
for the full list and the exact scope each endpoint needs.
Grant the narrowest set a workload needs. A key can only mint child keys whose
scopes are a subset of its own — so a messages:send-only key can never
create one with broader access.
Use your key from any surface
- SDKs
- CLI
- MCP server
The Python SDK reads The JavaScript SDK never reads the environment on its own — so browser and
edge runtimes stay predictable — and the other SDKs also take the key
explicitly:
DAIRO_API_KEY from the environment, or takes the key
explicitly:Handle a failed request
Auth failures — and every other error — come back in one shape:{ "error": { "type", "code", "message", "param" } }. Branch on the stable
machine code, never on the prose message. See Errors
for the full code list.
Verify webhook signatures
Webhook deliveries are signed so you can confirm they came from Dairo. Verify the signature against the raw request body — see Verify the signature.Keep your secrets safe
- Store keys in a secret manager — Vault, Doppler, AWS Secrets Manager, or your host’s environment config. Never commit a key or ship one in a client-side bundle.
- Keep keys out of URLs and logs. Keys belong in the
Authorizationheader, never a query string. Scrub them from logs, screenshots, and error reports. - Rotate after tests and on suspicion. Revoke keys used for temporary tests, and rotate immediately if a key may have been exposed.
- Use one key per workload. A separate key per service makes revocation surgical and usage traceable.