Skip to content

Authentication

Every API and MCP request requires an API key passed in the Authorization header.

Terminal window
# Org-level key
Authorization: Bearer chr_sk_a1b2c3d4e5f6...
# Agent-scoped key
Authorization: Bearer chr_ak_a1b2c3d4e5f6...

Chronary supports two key types:

Key typePrefixScope
Organization keychr_sk_*Full organization access
Agent keyschr_ak_*One agent’s calendars, events, availability, and iCal subscriptions

Treat the part after the prefix as opaque: new keys are longer than older ones and end in a built-in check value, and older keys keep working. Don’t validate a key’s length or characters in your own code; store it as a string of up to 64 characters.

  1. Sign up at console.chronary.ai
  2. The API keys page shows your Organization key’s prefix; the full key is shown once, when it is created.
  3. Use your Organization key to create Agent keys with POST /v1/keys
  4. Copy the raw key when it is created because it is only shown in full once

Only Organization keys can create, list, or revoke Agent keys. The management surface is Bearer-authenticated under /v1/keys.

Terminal window
curl https://api.chronary.ai/v1/keys \
-X POST \
-H "Authorization: Bearer chr_sk_your_org_key" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agt_abc123",
"label": "Sales agent production key"
}'

Agent keys are read/write for that agent’s resources, but they cannot access org-only surfaces such as agent creation, cross-agent availability, webhooks, usage, or scheduling.

Terminal window
# Org key
curl https://api.chronary.ai/v1/agents \
-H "Authorization: Bearer chr_sk_your_key_here"
# Agent key
curl https://api.chronary.ai/v1/agents/agt_abc123/availability \
-H "Authorization: Bearer chr_ak_your_key_here"

The Chronary CLI stores credentials locally so you don’t need to pass your key on every command.

Terminal window
chronary auth login

The CLI prompts for your key, validates it against the API, and saves it to ~/.config/chronary/config.json.

Keep separate profiles for different environments or accounts:

Terminal window
# Login to a named profile
chronary auth login --profile production
# Switch between profiles
chronary auth switch production
# List all profiles
chronary auth list

You can also set CHRONARY_API_KEY in your shell environment. The CLI checks, in order, the --api-key flag, CHRONARY_API_KEY, then the config file profile.

  • Keys are hashed with SHA-256 before storage; Chronary never stores the raw key
  • Only the key prefix is shown after initial creation
  • Rolling an Organization key replaces it; the old key stops working at once or after the grace period you choose
  • Deleting an Organization key immediately revokes it
  • Deleting an Agent key immediately revokes that key
  • Never commit keys to source control; use environment variables
  • Keys have a recognizable format, so secret scanners can spot one that was published by mistake. If a key leaks, roll or delete it right away from the API keys page
StatusCauseFix
401 UnauthorizedMissing or invalid API keyCheck the Authorization: Bearer header
403 ForbiddenAgent key tried to access an org-only or out-of-scope resourceUse an Organization key or the matching Agent key
429 Too Many RequestsPer-key rate limit exceeded (10 requests/second on Free, 25 requests/second on Developer, 50 requests/second on Pro)Respect the Retry-After header
429 Too Many RequestsMonthly quota exhaustedUpgrade your plan or wait for monthly reset

See Error Codes for the full error reference.