Authentication and API Keys

How to issue, rotate, and scope your Carto-Art API keys.

Every request to the Carto-Art API must include a bearer token. Tokens are bound to a Carto-Art account and inherit the role of the issuing user.

Issuing a key

API keys are managed from the signed-in Developer Dashboard. The /api/v1/auth/keys endpoints require the browser session cookie (sb-access-token); a bearer API key cannot create, list or revoke keys, and gets a 401 whose body says so. The created key is returned once, as { "key": { "token": "...", ... } } — store it immediately.

Using the key

Pass the key in the Authorization header. Always call the www host: the apex domain redirects cross-origin, and HTTP clients drop the Authorization header on a cross-origin redirect, so apex calls fail with 401.

curl https://www.cartoart.net/api/v1/posters/generate \
  -H "Authorization: Bearer ca_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"location": {"lat": 40.7128, "lng": -74.0060}, "style": "minimal"}'

Key scopes

Keys inherit the role of the issuing user. A free-tier user cannot exceed free-tier quotas even with a brand-new key; a Carto Plus subscriber's keys use the Carto Plus allowance for as long as the subscription (or grant) is active and revert to the free allowance when it lapses.

Rotation

Rotate keys at least every 90 days. The dashboard shows the last_used_at timestamp for each key so you can spot stale ones.