openrouter

Configure OpenRouter API access for APX engines, OpenCode, and OpenAI-compatible clients.

6|1|Updated May 8, 2026
One-click install
npx skills add https://github.com/agentprojectcontext/apx --skill openrouter-agentprojectcontext
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: openrouter
Source: https://github.com/agentprojectcontext/apx/tree/main/src/core/runtime-skills/openrouter
Command: npx skills add https://github.com/agentprojectcontext/apx --skill openrouter-agentprojectcontext

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up OpenRouter as an LLM provider involves scattered configuration across APX engines, OpenCode providers, and OpenAI-compatible clients, with the risk of accidentally committing API keys to git. This Skill guides safe, correct OpenRouter configuration for each client. ## Core Features & Use Cases - Key Safety Checks: Verifies OPENROUTER_API_KEY presence without exposing the secret, and keeps keys out of committed project config. - APX Engine Configuration: Uses apx config set --global for API keys and project-level settings for model selection. - OpenCode Provider Setup: Walks through OpenCode's provider and model commands to wire up OpenRouter. - Use Case: You want to run an APX agent on an OpenRouter-hosted model. The Skill checks your key, sets the global engine config, and pins the model for the current project. ## Quick Start Ask the assistant to configure OpenRouter as the APX engine provider using your OPENROUTER_API_KEY and a chosen model.

Frequently Asked Questions about openrouter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure OpenRouter with APX?▼

Set the API key globally with `apx config set --global engines.openrouter.api_key '<KEY>'` so it stays in ~/.apx/config.json, then set the model per project with `apx config set engines.openrouter.model <model-id>`. Check `apx config --help` and `apx status` first.

How do I use OpenRouter with OpenCode?▼

Run `opencode providers` and `opencode models` to inspect the current provider flow, then configure OpenRouter through OpenCode's provider commands. OpenRouter exposes an OpenAI-compatible API at https://openrouter.ai/api/v1.

What is the OpenRouter base URL for OpenAI-compatible clients?▼

Set OPENAI_BASE_URL=https://openrouter.ai/api/v1 and provide your OPENROUTER_API_KEY. This works with the OpenAI SDK, LiteLLM, and other OpenAI-compatible tools.

How do I check my OpenRouter API key without exposing it?▼

Run `test -n "$OPENROUTER_API_KEY" && echo "OPENROUTER_API_KEY present"` to confirm the environment variable is set. Never print the key value or write it into .apc/ or any git-committed config.

Why should OpenRouter keys not go in project config?▼

The `apx config set` command without `--global` writes to the project's committed config, which would leak the secret into git. Keys belong in the global ~/.apx/config.json or environment variables.