Hello OpenRouter Support,
I'm experiencing an issue where my API key works perfectly from my local development environment but returns a 401 "User not found" error when used from my production server.
Details:
API Key (first 20 chars): sk-or-v1-sk-or-v1-fb67...
Error: {"error":{"message":"User not found.","code":401}}Status Code: 401
What I've verified:
The API key works correctly from my local development machine
The same API key returns "User not found" when called directly from my production server using curlThe key is correctly set in the production environment (verified via docker exec m2d-api printenv)
Direct curl test from production server:
curl -X POST https://openrouter.ai/api/v1/chat/completions
-H "Authorization: Bearer [API_KEY]"
-H "Content-Type: application/json"
-d '{"model": "google/gemini-2.0-flash-exp", "messages": [{"role": "user", "content": "test"}]}'
Returns: {"error":{"message":"User not found.","code":401}}
Production Server Details:
Server Type: Azure VM
Public IP: xxxxxxxxxx.162 (Blocked it out on discord)The server is making direct outbound HTTPS requests to openrouter.ai
Questions:
Is my production server's IP address blocked or flagged in your system?
Are there any IP restrictions by openrouter?Is there an account status issue that would cause this error?What steps can I take to resolve this?
The API key works fine from development, so this appears to be IP or account-related rather than a key validity issue.
Thank you for your assistance.
Best regards,