Your API key worked yesterday and fails today: five things to check
A key that worked yesterday and fails today narrows the problem fast, because nothing in your code changed. That means one of five external states did.
1. The key was rotated or revoked
Anyone with console access can revoke a key in one click, and rotation is normal hygiene. Your application keeps sending the old string and gets 401.
Check: compare the first and last four characters of the key in your running process with the console. If you deploy through environment variables, confirm the new value actually reached the process — a stale container is the usual culprit.
2. The key's group changed
Keys belong to groups, and groups decide which model families the key can call. Move a key between groups and yesterday's model name becomes a 404 today.
Check: list the models for that key, not the models the console shows globally.
3. The balance ran out
402 is the obvious one, but there is a quieter variant: the balance is positive and still too small for one large request. A long context job that succeeded last week can fail today on the same balance.
Check: balance, and the cost line of the failing request.
4. The model name was deprecated upstream
Providers retire names. A retired name returns 404, and the fix is to move to the current name. Model families keep stable names across builds specifically so this does not happen often — but aliases do get cleaned up.
Check: whether the name still appears in the models list for that key.
5. Your traffic changed shape
The key is fine, but the usage is not: a new job fans out parallel requests and trips 429, or an agent loops and drains the balance in an hour. Nothing looks broken in the console until you look at the request rate.
Check: requests per minute over the last day, and whether a single user or job dominates them.
What to capture before you ask for help
- the status code and the full error body
- the request id, if the response includes one
- the model name exactly as sent
- the first and last four characters of the key
- whether the same request works from a different key
Those five items answer most of the question before anyone opens a console. Key and group behaviour is documented in the docs.
Questions people actually ask
Why would a working key suddenly return 401?
It was revoked or rotated, or the process is still holding the old value. Compare the first and last four characters in the running process with the console.
Can a key stop working because of its group?
Yes. Groups decide which model families a key can call, so a key moved to another group returns 404 for the old model name.
Is 402 always an empty balance?
No. A positive balance that is too small for one large request also returns 402. Check the cost line of the failing request.
How do I know if a 429 is my fault?
Look at requests per minute and whether one user or job dominates them. Parallel fan-out is the usual cause.
What should I send support?
Status code, full error body, request id, the model name as sent, the key's first and last four characters, and whether another key works.
Reference: DeepSeek API documentation. Error semantics and build history are from the official source.
Nova