Junie CLI is an agentic coding tool by JetBrains that provides an interactive terminal interface for developers to review, write, and modify code. By connecting Junie to OpenRouter, you can access hundreds of AI models from a single API key instead of managing separate keys for each provider.
Verify the installation:
Junie supports OpenRouter as a built-in BYOK (Bring Your Own Key) provider. Set the JUNIE_OPENROUTER_API_KEY environment variable to connect Junie to OpenRouter:
Add the environment variable to your shell profile for persistent configuration:
After saving, restart your terminal or run source ~/.zshrc for changes to take effect.
Replace <your-openrouter-api-key> with your actual OpenRouter API key from the API Keys page. Keys start with sk-or-v1-.
Navigate to your project directory and start Junie:
Type your prompt in the interactive CLI:
Use @ to attach files or folders to the request context, and type / to see available slash commands.
Junie supports a headless mode for non-interactive use in CI/CD pipelines. Combined with OpenRouter, this gives you centralized billing and model access for automated coding tasks:
Follow the
setup instructions
to configure the Junie Workspace project, then add
JUNIE_OPENROUTER_API_KEY as a CI/CD variable. Once
set up, trigger reviews by commenting on any MR:
After starting a session, check the OpenRouter Activity Dashboard to confirm your requests are being routed through OpenRouter.