Oracle can target any OpenAI-compatible model on OpenRouter with minimal setup.
export OPENROUTER_API_KEY="sk-or-..."
# Optional but recommended for attribution:
export OPENROUTER_REFERER="https://your-app.example"
export OPENROUTER_TITLE="Oracle CLI"- If you set
OPENROUTER_API_KEYand don’t provide another provider key, Oracle automatically routes API runs tohttps://openrouter.ai/api/v1. - You can still point explicitly with
--base-url https://openrouter.ai/api/v1(Oracle will trim a trailing/responsesif you include it). - First‑party keys win: if
OPENAI_API_KEY,ANTHROPIC_API_KEY,GEMINI_API_KEY, orXAI_API_KEYis present, Oracle will prefer those providers unless you set an OpenRouter base URL.
--modelaccepts any OpenRouter model id, e.g.minimax/minimax-m2,z-ai/glm-4.6,openai/gpt-4o-mini.--modelscan mix first‑party and OpenRouter ids:
oracle --engine api --models "gpt-5-pro,minimax/minimax-m2,z-ai/glm-4.6,claude-4.5-sonnet" -p "Summarize...".- For built-in models (
gpt-5.1-pro,claude-4.5-sonnet,gemini-3.1-pro,gemini-3-pro), Oracle falls back to OpenRouter automatically when the provider key is missing butOPENROUTER_API_KEYis set. It keeps using first‑party endpoints when their keys are present.
When hitting OpenRouter, Oracle forwards optional attribution headers:
HTTP-RefererfromOPENROUTER_REFERER(orOPENROUTER_HTTP_REFERER)X-TitlefromOPENROUTER_TITLE
- Model ids that contain
/are stored with a safe slug (/→__) for per-model log filenames, but the original id remains visible in session metadata and CLI output.
- If a model id isn’t found in the OpenRouter catalog, Oracle still sends the request with the id you provided.
- Pricing/context limits are pulled from the
/api/v1/modelscatalog when available; otherwise, Oracle uses conservative defaults (200k tokens, cost unknown).