Skip to content

Eligible new accounts get $0.10 in free API credit. Once per account; abuse limits apply. Create an account

401 Invalid API key in an OpenAI-compatible app

A 401 "Invalid API key" from an OpenAI-compatible API means the key the app sent is missing, mistyped or was replaced. Copy your current key again, paste it into the app's API key field or environment variable, and open a new terminal so the variable is loaded. The app's base URL must be https://api.outrun.to/v1.

Error fix

What causes it?

  • The key was replaced, so the old one no longer works.
  • A space or line break was copied with the key.
  • The environment variable is set in a different terminal or not loaded yet.
  • The app sends another provider's key from its own saved settings.

How do I fix it?

In this order. The Troubleshooting has the full setup.

  1. Copy your current key from API keys on the dashboard.
  2. Paste it into the app's API key field, or set it in your environment variable.
  3. Open a new terminal or restart the app.
  4. Test the key on its own with the request below. It uses a little credit.
Test your key
curl https://api.outrun.to/v1/chat/completions \
  -H "Authorization: Bearer $OUTRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "claude-sonnet-5-5", "messages": [{"role": "user", "content": "Reply with OK only."}], "max_tokens": 16}'

Questions

Does a 401 mean my balance is empty?

No. A low balance returns an insufficient balance error. A 401 is about the key itself.

Why does it still fail after I set the variable?

Programs read environment variables when they start. Close the terminal or app and open it again.

Does Outrun keep my prompts or outputs?

Outrun does not store your prompts, images or outputs unless you choose to save them.

Still stuck?

The troubleshooting table lists every error code, or message support on Telegram.