Providers and keys
See which provider variables the CLI replaces with gateway credentials.
When asked for a provider key, the CLI creates an OpenRouter gateway key instead. It does not create an account or key with that provider.
npx extraorbital add openai✓ Provisioned openrouter/default (small models · $5.00 allowance)
✓ Wrote 4 variables to .env
OPENROUTER_BASE_URL, OPENROUTER_API_KEY, OPENAI_BASE_URL, OPENAI_API_KEY
! openai — an OpenAI key is answered by the AI Gateway
OpenAI models are served through the AI Gateway. OPENAI_BASE_URL and
OPENAI_API_KEY now point at it, so your OpenAI SDK works unchanged — prefix
model ids with the author, e.g. openai/<model>.The substitute only works where the project sends it to the gateway, so the exit code depends on whether anything reads the base URL:
- Warning, exit
0:OPENAI_BASE_URLappears in your source or.env.example, or the project depends on an SDK that reads it by itself (openai,@ai-sdk/openai; for Anthropic,@anthropic-ai/sdk,@ai-sdk/anthropic,@extraorbital/anthropic). - Error, exit
8: nothing reads it, so the key would go to api.openai.com, which refuses it. The credentials are still written. - Error, exit
8: a provider the gateway cannot impersonate (Gemini, Cohere, Bedrock and the others without compatibility variables), whatever the project reads.
Every recognised key
| Provider | Recognised keys | Model ids | Also written |
|---|---|---|---|
| OpenAI | OPENAI_API_KEY | openai/… | OPENAI_BASE_URLOPENAI_API_KEY |
| Anthropic | ANTHROPIC_API_KEYANTHROPIC_AUTH_TOKEN | anthropic/…, ~anthropic/… | ANTHROPIC_BASE_URLANTHROPIC_API_KEY |
| Google Gemini | GEMINI_API_KEYGOOGLE_GENERATIVE_AI_API_KEYGOOGLE_API_KEY | google/… | Nothing — the gateway does not speak this API |
| xAI | XAI_API_KEYGROK_API_KEY | x-ai/… | XAI_BASE_URLXAI_API_KEY |
| Mistral | MISTRAL_API_KEY | mistralai/… | MISTRAL_BASE_URLMISTRAL_API_KEY |
| DeepSeek | DEEPSEEK_API_KEY | deepseek/… | DEEPSEEK_BASE_URLDEEPSEEK_API_KEY |
| Meta Llama | LLAMA_API_KEY | meta-llama/…, meta/… | Nothing — the gateway does not speak this API |
| Qwen | DASHSCOPE_API_KEYQWEN_API_KEY | qwen/… | Nothing — the gateway does not speak this API |
| Moonshot | MOONSHOT_API_KEY | moonshotai/… | MOONSHOT_BASE_URLMOONSHOT_API_KEY |
| Z.ai | ZAI_API_KEYZHIPUAI_API_KEY | z-ai/… | Nothing — the gateway does not speak this API |
| MiniMax | MINIMAX_API_KEY | minimax/… | Nothing — the gateway does not speak this API |
| Nous Research | NOUS_API_KEY | nousresearch/… | Nothing — the gateway does not speak this API |
| Cohere | COHERE_API_KEYCO_API_KEY | cohere/… | Nothing — the gateway does not speak this API |
| Perplexity | PERPLEXITY_API_KEYPPLX_API_KEY | perplexity/… | PERPLEXITY_BASE_URLPERPLEXITY_API_KEY |
| Groq | GROQ_API_KEY | — | GROQ_BASE_URLGROQ_API_KEY |
| Together AI | TOGETHER_API_KEY | — | TOGETHER_BASE_URLTOGETHER_API_KEY |
| Fireworks AI | FIREWORKS_API_KEY | — | FIREWORKS_BASE_URLFIREWORKS_API_KEY |
| Cerebras | CEREBRAS_API_KEY | — | CEREBRAS_BASE_URLCEREBRAS_API_KEY |
| Amazon Bedrock | AWS_BEARER_TOKEN_BEDROCK | amazon/… | Nothing — the gateway does not speak this API |
The Also written column shows compatibility variables. OpenAI and Anthropic SDKs can use gateway URLs. Native Gemini, Cohere, and Bedrock clients cannot; those variables are left unfilled.
To call those models, use an OpenAI-compatible client or a supported SDK.
What autopilot does
extraorbital provision reads the same list. A project declaring
GEMINI_API_KEY in its .env.example gets one gateway resource, an explanation,
and exit 8, since Gemini's own SDK cannot use the gateway:
Provisioning 2 resources for .
openrouter GEMINI_API_KEY · declared in .env.example · via the AI Gateway
mongo MONGODB_URI · declared in .env.example
✓ Provisioned openrouter/default
✓ Provisioned mongo/default
✗ GEMINI_API_KEY — cannot be provisioned
Google Gemini models are served through the AI Gateway, which does not speak
Google Gemini's own API. Call them through the gateway with an
OpenAI-compatible client or the Vercel AI SDK.Multiple detected providers share one gateway resource.
What gets written where
The environment block records the requested providers so later runs preserve their compatibility variables:
# >>> extraorbital resource=openrouter project=cosmic-otter slug=default compat=openai
OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
OPENROUTER_API_KEY=sk-or-v1-9c4e17b2…
OPENAI_BASE_URL=https://openrouter.ai/api/v1
OPENAI_API_KEY=sk-or-v1-9c4e17b2…
# <<< extraorbital resource=openrouterBoth key variables hold the same gateway credential. OPENAI_API_KEY is the name the OpenAI SDK reads.
Placeholder lines are commented out before new values are added. This prevents dotenv from reading an empty first definition.
Next
- Models — what each provider offers, with prices
- SDK recipes — the code for each