sync-openrouter-api

sync-openrouter-api is a command for Claude Code from enricoros/big-AGI. It costs 9 tokens per session (784 once invoked), scanned A, original, MIT.

A maintenance task for bringing an OpenRouter API connection up to date with OpenRouter's documentation. OpenRouter is a service that provides access to multiple AI models through an API compatible with common OpenAI-style requests.

In plain words
What is it for?
Use it to review or update model listing, chat requests, reasoning tokens, tool calls, search integration, and image or audio inputs in the OpenRouter integration.
Why use it?
It addresses missing or outdated support for the service's request formats and newer API options. The task covers checking how the application lists models, sends requests, and reads responses.

Command for Claude Code

About the project

Big-AGI is an open-source workspace for using multiple AI models through chat and other AI functions. It is intended for engineers, founders, researchers, and other users who want to work with AI personas, model comparisons, image generation, voice, documents, and code-related features. The catalogue entries provide commands, instructions, and a skill for working with Big-AGI.

enricoros/big-AGI · 7,109 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/enricoros/big-agi/sync-openrouter-api
Clone the repo
git clone --depth 1 https://github.com/enricoros/big-AGI

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sync-openrouter-api

README.md
[![agentmods](https://agentmods.dev/badge/commands/enricoros/big-agi/sync-openrouter-api.svg)](https://agentmods.dev/commands/enricoros/big-agi/sync-openrouter-api)
Your own site
<a href="https://agentmods.dev/commands/enricoros/big-agi/sync-openrouter-api"><img src="https://agentmods.dev/badge/commands/enricoros/big-agi/sync-openrouter-api.svg" alt="Measured on agentmods" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 784 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00009 $0.00784
Opus 5 $0.00005 $0.00392
Sonnet 5 $0.00002 $0.00157
Haiku 4.5 $0.00001 $0.00078

Measured 5d ago against content hash 65ab67f2962e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sync-openrouter-api scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

**Live endpoint (extra signal):** The models list is public - `curl https://openrouter.ai/api/v1/models` - ground-truth for per-model capabilities/metadata. If `.env.api-keys` has `OPENROUTER_API_KEY`, also fire a real s
.claude/commands/aix/sync-openrouter-api.md · 52 lines

What it actually says

Review the OpenRouter implementation:

  • Models list: src/modules/llms/server/openai/openrouter.wiretypes.ts (list API response schema)
  • Chat wire types: src/modules/aix/server/dispatch/wiretypes/openai.wiretypes.ts (OpenAI-compatible)
  • Request adapter: src/modules/aix/server/dispatch/chatGenerate/adapters/openai.chatCompletions.ts ('openrouter' dialect)
  • Response parser: src/modules/aix/server/dispatch/chatGenerate/parsers/openai.parser.ts (shared OpenAI parser)
  • Vendor config: src/modules/llms/vendors/openrouter/openrouter.vendor.ts

GOAL: Ensure complete support for OpenRouter's API including advanced features like reasoning/thinking tokens, tool use, search integration, and multi-modal capabilities. OpenRouter is OpenAI-compatible but has important extensions and differences.

Use Task tool with subagent_type=Explore and thoroughness="very thorough" to discover:

  1. Map API structure - all endpoints, parameters, capabilities from https://openrouter.ai/docs
  2. Advanced features - How to use: reasoning/thinking tokens (o1, DeepSeek R1), tool use/function calling, search integration, multi-modal (vision/audio)
  3. Changelog location - How does OpenRouter communicate API updates and breaking changes?
  4. Model metadata - What capabilities are exposed in the models list API? How to detect feature support?
  5. OpenAI deviations - Extensions, special headers (HTTP-Referer, X-Title), response fields, streaming differences

Then check the latest API information. Try these sources (be creative if blocked):

Primary Sources:

Alternative Sources:

  • GitHub: https://github.com/OpenRouterTeam (SDKs, examples, issues for recent changes)
  • Web Search: "openrouter api changelog" or "openrouter reasoning tokens" or "openrouter tool use"

If blocked: Ask user to provide documentation.

Live endpoint (extra signal): The models list is public - curl https://openrouter.ai/api/v1/models - ground-truth for per-model capabilities/metadata. If .env.api-keys has OPENROUTER_API_KEY, also fire a real streaming POST https://openrouter.ai/api/v1/chat/completions ("stream":true) to inspect reasoning/tool/usage fields and OpenRouter-specific extensions. Never commit or echo the key.

$ARGUMENTS Focus on discrepancies and gaps:

  • Request/Response structure: New fields, changed requirements, streaming event types
  • Feature support: Thinking tokens format, tool calling protocol, search parameters
  • Model capabilities: How to detect and enable advanced features per model
  • OpenRouter extensions: Headers, routing, fallbacks, rate limiting (free vs paid)
  • Breaking changes: Protocol updates, deprecated fields, new required parameters

Report differences in wire types, adapter logic, parser handling, or dialect-specific quirks. Prioritize new capabilities that improve user experience (reasoning visibility, better tool use, etc.).

When making changes, add comments with date: // [OpenRouter, 2026-MM-DD]: explanation

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 52 lines · 9 tokens per session scan A 65ab67f2962e

Subscribe to this mod's changes

sync-openrouter-api is a command published in the GitHub repository enricoros/big-AGI (7,109 stars, last pushed yesterday), licensed MIT. It adds 9 tokens to every session and 784 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.