| name | add-openrouter-model |
| description | REQUIRED when adding OpenRouter models - provides a script that fetches accurate context, max tokens, pricing, and capabilities from the API. Use this skill whenever the user asks to add, register, or configure a new OpenRouter model. Do NOT guess model specifications—always fetch real data from the API. |
Add OpenRouter Model
Fetches model details from OpenRouter API and provides structured information for the agent to add the model to source/models/openrouter-provider.ts.
Usage
Run this script from this file's directory.
./add-model.js google/gemini-3-flash-preview
How It Works
- Fetches model data from
https://openrouter.ai/api/v1/models
- Locates the exact model by the provided OpenRouter ID
- Extracts and computes key information:
- Context window length (
context_length)
- Max output tokens (
top_provider.max_completion_tokens)
- Pricing (
pricing.prompt, pricing.completion)
- Supported features (checks
supported_parameters for reasoning/tool calling)
- Outputs JSON with all details needed to add the model
JSON Output Format
The script outputs a JSON object wrapped in markers:
--- MODEL_DETAILS_JSON_START ---
{...}
--- MODEL_DETAILS_JSON_END ---
JSON Structure
{
"modelKey": "gemini-3-flash-preview"
...
...