← Blog

Claude API Key Rotation Schedule: Best Practices

2026-10-23 · 5 min read · SubToAPI Team

There's no single magic number for how often to rotate a Claude API key — but there is a defensible default: rotate production keys every 90 days, rotate keys for any contractor or short-term project immediately after the engagement ends, and rotate instantly whenever a key is exposed in logs, a repo, or a client bundle. That's the schedule most security teams converge on once they've actually thought it through, and it balances operational overhead against the real risk window a leaked key creates.

The rest of this is about why that schedule works, how to adapt it to your team size, and how to avoid the two failure modes everyone hits: rotating so rarely it's pointless, or rotating so often that nobody can keep track of which key is live.

Why 90 days is the right default

A rotation schedule exists to limit the blast radius of a key that's been copied somewhere it shouldn't be — a screenshot, a support ticket, a .env file committed by accident, a browser devtools tab left open on a shared machine. Most of these leaks are discovered within weeks, not months. A 90-day cycle means that even a leak nobody notices gets closed automatically within a quarter, which is short enough to matter and long enough that your team isn't fighting rotation fatigue every few weeks.

If you're in a regulated industry (fintech, healthcare, anything handling PII through Claude), 60 days is a more common baseline, often mandated by a SOC 2 or ISO 27001 policy rather than chosen freely. If you're a small team shipping a side project, 90–180 days is reasonable — just don't go past six months, because by then nobody remembers which services are using which key.

A rotation schedule needs more than a date on the calendar

The date is the easy part. What actually breaks rotations in practice is not knowing:

A workable policy answers all three before you touch a single key.

Build a key inventory first

Before setting any schedule, write down every place a key lives: CI/CD secrets, server environment variables, local .env files for development, third-party integrations (Zapier, Make.com, internal dashboards), and anywhere it might be hardcoded for a demo and never cleaned up. If you can't produce this list in five minutes, that's the actual problem — fix it before worrying about rotation cadence.

Use overlapping validity instead of hard cutovers

The safest rotation pattern issues a new key while the old one is still valid, updates all consumers, confirms traffic has shifted, and only then revokes the old key. A hard cutover — kill the old key the instant you generate a new one — guarantees an outage somewhere you forgot about.

# 1. Generate the new key (old key still active)
curl -X POST https://api.subtoapi.app/v1/keys \
  -H "Authorization: Bearer $SUBTOAPI_ADMIN_TOKEN" \
  -d '{"name": "prod-backend-2024-q2"}'

# 2. Roll the new key out to all consumers, verify traffic

# 3. Revoke the old key only after confirming the switch
curl -X DELETE https://api.subtoapi.app/v1/keys/sub_live_old_key_id \
  -H "Authorization: Bearer $SUBTOAPI_ADMIN_TOKEN"

SubToAPI's dashboard supports exactly this flow: you can issue a fresh sub_live_... application key, keep the old one live, and revoke it once you've confirmed every service is using the new one. That overlap window is what makes scheduled rotation safe to automate rather than something a human has to babysit during an incident window.

Separate scheduled rotation from emergency rotation

These are two different processes and should be treated that way:

Teams that only have a scheduled rotation process tend to freeze when an actual leak happens, because they've never practiced the "revoke now, sort out the fallout after" version of the workflow.

Per-seat rotation in team environments

If you're managing Claude access for a team rather than a single backend, rotation needs an extra dimension: who leaves gets their key revoked that day, not at the next quarterly cycle. Offboarding is the single most common source of stale, forgotten API keys, and it's also the easiest to automate away if your access layer supports per-seat keys instead of one shared key for the whole team.

This is one of the places where a managed API layer earns its cost. SubToAPI issues a separate key per team member or per service under /pricing's Team and Scale plans, so revoking one person's access doesn't require rotating the key everyone else depends on. Combined with usage metadata per key (visible in the dashboard), you can also spot a key that's suddenly making calls outside its normal pattern — a decent early warning sign that it's been copied somewhere unintended.

A simple schedule to actually adopt

For most teams, this is enough:

Write this down somewhere your team actually reads (a runbook, not a Notion page nobody opens), assign an owner, and put the 90-day date on a recurring calendar reminder. The schedule only works if someone is accountable for running it — see /docs/quickstart if you're setting this up on SubToAPI for the first time.

FAQ

How often should I rotate Claude API keys for a solo project? Every 90–180 days is reasonable for low-risk personal projects, but rotate immediately regardless of schedule if a key ever touches a public repo, screenshot, or support ticket.

Does rotating a key break requests that are already in flight? Not if you use an overlap window — keep the old key valid until you've confirmed the new one is live everywhere, then revoke the old one. A hard, instant cutover is what causes dropped requests.

Should every team member have their own key instead of sharing one? Yes. Per-seat keys mean offboarding one person doesn't require rotating a shared key for the entire team, and it lets you see per-key usage if something looks off. See /docs for how application keys work.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →