OpenRouter error
OpenRouter 401 authentication: what it means and how to fix it
401 authenticationRetry? Not statedLast verified 1 documented fix1 source
What it means
Invalid credentials: the API key is missing, invalid, or revoked, or the OAuth session expired. On the Anthropic Messages skin this maps to authentication_error; on the Responses API it collapses to server_error with error_type authentication.
Causes
- Missing, invalid, disabled or revoked API key
- Expired OAuth session
How to fix it
- Fix 1.
Check the API key or re-authenticate the OAuth session.
More OpenRouter errors
All 32 OpenRouter errors400 invalid_requestRetry? Not stated400 invalid_promptRetry? Not stated400 context_length_exceededRetry? Not stated400 max_tokens_exceededRetry? Not stated400 token_limit_exceededRetry? Not stated400 string_too_longRetry? Not stated400 invalid_imageRetry? Not stated400 image_too_largeRetry? Not stated
HTTP 401 at other providers
Compare 401 across providers401 authentication_errorRetry? Not statedAnthropic API401 UnauthorizedRetry? Not statedAzure OpenAI401 UnauthorizedRetry? Not statedCohere API401 - Authentication FailsRetry? Not statedDeepSeek API401 authenticationRetry? NoGemini API401 UnauthorizedRetry? Not statedGroq API401 UnauthorizedRetry? Not statedMistral API401 Invalid AuthenticationRetry? Not statedOpenAI API401 Incorrect API key providedRetry? Not statedOpenAI API401 You must be a member of an organization to use the APIRetry? Not statedOpenAI API401 IP not authorizedRetry? Not statedOpenAI API401 UNAUTHENTICATEDRetry? NoVertex AI
FAQ
What does the OpenRouter error "401 authentication" mean?
Invalid credentials: the API key is missing, invalid, or revoked, or the OAuth session expired. On the Anthropic Messages skin this maps to authentication_error; on the Responses API it collapses to server_error with error_type authentication.
How do I fix OpenRouter "401 authentication"?
Check the API key or re-authenticate the OAuth session.
Should I retry OpenRouter "401 authentication"?
Not stated. The official docs do not say whether this error is retryable.
Which other AI APIs return HTTP 401?
Per their official error docs: Anthropic API (401 authentication_error), Azure OpenAI (401 Unauthorized), Cohere API (401 Unauthorized), DeepSeek API (401 - Authentication Fails), Gemini API (401 authentication), Groq API (401 Unauthorized), Mistral API (401 Unauthorized), OpenAI API (401 Invalid Authentication; 401 Incorrect API key provided; 401 You must be a member of an organization to use the API; 401 IP not authorized), Vertex AI (401 UNAUTHENTICATED), xAI API (401 Unauthorized).
Sources
Last verified against 1 source: OpenRouter's official docs and official SDK repositories.
Newsletter
Know when the APIs change
One email per week. New model releases, API changes, what broke, and how developers are working around it.