add-openrouter-model

Fetch OpenRouter model details and provide guidance for adding models to acai-ts provider configuration.

181 stars

Best use case

add-openrouter-model is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Fetch OpenRouter model details and provide guidance for adding models to acai-ts provider configuration.

Teams using add-openrouter-model should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/add-openrouter-model/SKILL.md --create-dirs "https://raw.githubusercontent.com/majiayu000/claude-skill-registry/main/skills/data/add-openrouter-model/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/add-openrouter-model/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How add-openrouter-model Compares

Feature / Agentadd-openrouter-modelStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Fetch OpenRouter model details and provide guidance for adding models to acai-ts provider configuration.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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.

```bash
./add-model.js google/gemini-3-flash-preview
```

## How It Works

1. **Fetches model data** from `https://openrouter.ai/api/v1/models`
2. **Locates the exact model** by the provided OpenRouter ID
3. **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)
4. **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

```json
{
  "modelKey": "gemini-3-flash-preview",
  "openrouterId": "google/gemini-3-flash-preview",
  "providerFile": "./source/models/openrouter-provider.ts",
  "registryId": "openrouter:gemini-3-flash-preview",
  "registryEntry": {
    "id": "openrouter:gemini-3-flash-preview",
    "provider": "openrouter",
    "contextWindow": 1048576,
    "maxOutputTokens": 65535,
    "defaultTemperature": 0.5,
    "promptFormat": "markdown",
    "supportsReasoning": true,
    "supportsToolCalling": true,
    "costPerInputToken": 0.0000005,
    "costPerOutputToken": 0.000003
  },
  "clientConfig": {
    "key": "gemini-3-flash-preview",
    "openrouterId": "google/gemini-3-flash-preview"
  },
  "modelInfo": {
    "id": "google/gemini-3-flash-preview",
    "name": "Gemini 3.0 Flash Preview",
    "contextLength": 1048576,
    "maxCompletionTokens": 65535,
    "pricing": {...},
    "supportedParameters": [...]
  }
}
```

## How to Add Model to Provider File

### Step 1: Add to `openrouterModels` object

In `source/models/openrouter-provider.ts`, find the `openrouterModels` const object (starts with `const openrouterModels = {`). Add the new model entry **in alphabetical order by key**:

```typescript
const openrouterModels = {
  "claude-3-5-sonnet": openRouterClient("anthropic/claude-3.5-sonnet"),
  // ... existing models ...
  "gemini-3-flash-preview": openRouterClient("google/gemini-3-flash-preview"),  // ADD THIS
  "sonnet-4.5": openRouterClient("anthropic/claude-sonnet-4.5"),
  // ...
} as const;
```

### Step 2: Add to `openrouterModelRegistry` object

Find the `openrouterModelRegistry` object and add the registry entry **in alphabetical order by `registryId`**:

```typescript
export const openrouterModelRegistry: {
  [K in ModelName]: ModelMetadata<ModelName>;
} = {
  "openrouter:claude-3-5-sonnet": {
    id: "openrouter:claude-3-5-sonnet",
    // ... existing entry ...
  },
  // ... existing entries ...
  "openrouter:gemini-3-flash-preview": {
    id: "openrouter:gemini-3-flash-preview",
    provider: "openrouter",
    contextWindow: 1048576,
    maxOutputTokens: 65535,
    defaultTemperature: 0.5,
    promptFormat: "markdown",
    supportsReasoning: true,
    supportsToolCalling: true,
    costPerInputToken: 0.0000005,
    costPerOutputToken: 0.000003,
  },
  // ...
};
```

### Step 3: Validate changes

Run the project's validation commands:

```bash
npm run typecheck
npm run lint
npm run format
```

## Field Mapping Reference

| JSON Field | Registry Field | Notes |
|------------|----------------|-------|
| `registryEntry.id` | `id` | Full registry ID |
| `registryEntry.provider` | `provider` | Always "openrouter" |
| `registryEntry.contextWindow` | `contextWindow` | Direct mapping from API |
| `registryEntry.maxOutputTokens` | `maxOutputTokens` | From `top_provider.max_completion_tokens` |
| `registryEntry.defaultTemperature` | `defaultTemperature` | Inferred from model ID (-1 for code models) |
| `registryEntry.promptFormat` | `promptFormat` | Inferred: gemini/claude/qwen/mistral → "markdown", gpt/openai → "xml", deepseek → "bracket" |
| `registryEntry.supportsReasoning` | `supportsReasoning` | Checks `supported_parameters` for `include_reasoning` or `reasoning` |
| `registryEntry.supportsToolCalling` | `supportsToolCalling` | Checks `supported_parameters` for `tools` |
| `registryEntry.costPerInputToken` | `costPerInputToken` | From `pricing.prompt` |
| `registryEntry.costPerOutputToken` | `costPerOutputToken` | From `pricing.completion` |

## Default Value Inferences

| Field | Logic |
|-------|-------|
| `defaultTemperature` | Returns `-1` if model ID contains "codex", "coder", or "code"; otherwise `0.5` |
| `promptFormat` | Maps model family to format: gemini/claude/qwen/mistral/moonshotai → "markdown", gpt/openai → "xml", deepseek → "bracket", defaults to "markdown" |
| `maxOutputTokens` | Falls back to `context_length` if `max_completion_tokens` is not available |

## Error Handling

- Validates model ID exists in OpenRouter API
- Shows first 10 available models if ID not found
- Provides clear error messages with suggestions

## Examples

```bash
# Add Gemini 3 Flash Preview
./add-model.js google/gemini-3-flash-preview

# Add Claude 3.5 Sonnet
./add-model.js anthropic/claude-3-5-sonnet

# Add DeepSeek V3
./add-model.js deepseek/deepseek-v3.2
```

Related Skills

adding-models

181
from majiayu000/claude-skill-registry

Guide for adding new LLM models to Letta Code. Use when the user wants to add support for a new model, needs to know valid model handles, or wants to update the model configuration. Covers models.json configuration, CI test matrix, and handle validation.

add-opencode-model

181
from majiayu000/claude-skill-registry

Fetch OpenCode Zen model details and provide guidance for adding models to acai-ts provider configuration.

add-odoo-model

181
from majiayu000/claude-skill-registry

Add integration for an additional Odoo Studio model to an existing Odoo PWA project. Use when user wants to add support for another model, mentions "add new model", "integrate another Odoo model", or similar.

Add Model Property

181
from majiayu000/claude-skill-registry

Add a new property to an existing data model and propagate changes through model generation to client and server. Use when adding fields to entities, extending models, or modifying data structures. Handles source model editing, regeneration, ViewModel updates, and server-side changes.

adapting-transfer-learning-models

181
from majiayu000/claude-skill-registry

Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques. it is triggered when the user requests assistance with fine-tuning a model, adapting a pre-trained model to a new dataset, or performing... Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

accessibility-object-model-integration

181
from majiayu000/claude-skill-registry

Programmatic manipulation of the accessibility tree to support complex custom controls in React.

acc-create-read-model

181
from majiayu000/claude-skill-registry

Generates Read Model/Projection for PHP 8.5. Creates optimized query models for CQRS read side with projections and denormalization. Includes unit tests.

Build Your Model Serving Skill

181
from majiayu000/claude-skill-registry

Create your model-serving skill from Ollama documentation before learning deployment theory

Build Your Model Merging Skill

181
from majiayu000/claude-skill-registry

No description provided.

3d-modeling

181
from majiayu000/claude-skill-registry

Expert 3D modeling specialist with deep knowledge of topology, UV mapping, game-ready and film-ready pipelines, DCC tool workflows (Blender, Maya, ZBrush, 3ds Max, Houdini), retopology, LOD systems, and export pipelines. This skill represents years of production experience distilled into actionable guidance. Use when "3d model, 3d modeling, mesh topology, uv unwrap, uv mapping, retopology, retopo, low poly, high poly, subdivision, subdiv, edge flow, edge loops, polygon modeling, box modeling, hard surface, organic modeling, sculpting, zbrush, blender modeling, maya modeling, 3ds max, LOD, level of detail, game ready mesh, film ready, baking normals, high to low, fbx export, gltf export, texel density, 3d, modeling, topology, uv, game-dev, vfx, blender, maya, zbrush, retopology, lod, hard-surface, organic, sculpting" mentioned.

model-selection

181
from majiayu000/claude-skill-registry

Automatically applies when choosing LLM models and providers. Ensures proper model comparison, provider selection, cost optimization, fallback patterns, and multi-model strategies.

lets-go-rss

159
from majiayu000/claude-skill-registry

A lightweight, full-platform RSS subscription manager that aggregates content from YouTube, Vimeo, Behance, Twitter/X, and Chinese platforms like Bilibili, Weibo, and Douyin, featuring deduplication and AI smart classification.

Content & Documentation