OpenRouter Skills

repository·main·Indexed 41 days ago

https://github.com/openrouterteam/skills

A collection of specialized agent capabilities designed for the Agent Skills standard. It provides tools for scaffolding agents via `create-agent-tui` and `create-headless-agent`, interacting with OpenRouter's model ecosystem (images, audio, video, analytics), and managing model migrations. Compatible with Claude Code, Cursor, OpenCode, and other agents via GitHub CLI (gh skill) or direct installation.

Tokens
98K
Snippets
251
Records
369
Agent score
77%

What's inside OpenRouter Skills

  1. Overview of OpenRouter TypeScript SDK capabilities

    main

    The OpenRouter TypeScript SDK provides a type-safe interface for integrating with over 600 AI models. Key capabilities include:

    • Text Generation & Tool Use: Using the callModel pattern for generation, tool calling, and streaming.
    • Tool Definition: Defining tools via tool() and implementing stop conditions such as stepCountIs, hasToolCall, maxCost, maxTokensUsed, and finishReasonIs.
    • Conversation Management: Handling multi-turn conversations and managing message history.
    • Message Formatting: Converting between OpenRouter, Claude, and OpenAI Chat message shapes.
    • Platform Integration: Accessing model listings, checking credits, managing OAuth, and handling API keys.
  2. Overview of openrouter-analytics-schema capabilities

    main

    The openrouter-analytics-schema skill provides the metadata required to map natural-language questions to OpenRouter analytics queries. It covers:

    • Meta discovery: How to call the discovery endpoint.
    • Metrics: Categories including volume, cost, performance, and efficiency.
    • Dimensions: Parameters used to break down data.
    • Filters and Granularities: Available filter operators and time/data granularities.
    • Data Sources: Differences between materialized views and raw generations.
    • Query Logic: Mapping natural language to metric/dimension combinations and understanding query constraints/limits.
  3. Capabilities of openrouter-stt

    main

    The openrouter-stt skill provides access to OpenRouter's POST /api/v1/audio/transcriptions endpoint. Key features include:

    • Transcription: Convert speech to text.
    • Model Discovery: Find available STT models using the /api/v1/models?output_modalities=transcription endpoint.
    • Audio Format Support: Supports wav, mp3, flac, m4a, ogg, webm, and aac.
    • Provider Options: Supports provider-specific passthrough via provider.options.<slug> (e.g., setting a vocabulary prompt for Groq).

    Important Note on API Compatibility: This endpoint is not OpenAI-compatible. It requires a base64-encoded JSON body rather than the standard multipart/form-data format used by OpenAI.

  4. Capabilities of the openrouter-models skill

    main

    The openrouter-models skill provides several tools for interacting with OpenRouter model data:

    • Model Discovery: List and sort models by criteria such as newest, price, or throughput using list-models.ts.
    • Filtering: Filter models by category (e.g., programming, roleplay, vision, etc.).
    • Model Lookup: Retrieve specific details for a model, including pricing, context length, and supported modalities.
    • Performance Monitoring: Access per-provider latency, uptime, and throughput via get-endpoints.ts (requires OPENROUTER_API_KEY).
    • Search: Perform fuzzy model-name resolution to find specific models.
  5. Use the spawn-ori-eval skill for model evaluation

    main

    The spawn-ori-eval skill is used to run a throwaway model evaluation on a pinned harness and model using Ori as a subprocess. This is ideal for comparing models, measuring agent/prompt performance, or catching regressions in agent behavior.

    When to use:

    • When a user asks which model they should use.
    • When a user wants to compare models.
    • When a user wants to measure if their agent or prompt performs correctly.
    • When a user wants to catch regressions in agent behavior.
    • When a user asks how good their current model is.

    When NOT to use:

    • For plain unit tests that do not involve a model.
    • To re-run an evaluation that already exists (use ori eval <file> directly instead).
    • Do not write the evaluation yourself; Ori's create-eval skill runs automatically within the process.
  6. Capabilities of openrouter-oauth

    main

    The openrouter-oauth skill provides a framework-agnostic implementation of the OAuth PKCE flow. It is compatible with React, Vue, Svelte, vanilla JS, and other web stacks. Key features include:

    • Full OAuth PKCE flow: Handles verifier, challenge, authorize URL, and token exchange.
    • Zero-dependency module: A copy-pasteable auth module that uses plain fetch.
    • UI Components: Includes a ready-to-use "Sign In with OpenRouter" button component.
    • Programmatic Access: Supports programmatic API-key acquisition flows without requiring a UI.
  7. Capabilities of the openrouter-images skill

    main

    The openrouter-images skill provides the following capabilities for interacting with OpenRouter's Image API (POST /api/v1/images):

    • Model and Capability Discovery: Uses discover.ts to identify available models and the specific parameters each endpoint accepts before attempting generation.
    • Text-to-Image Generation: Uses generate.ts to create images from text prompts. Supports options for aspect ratio, resolution, quality, and provider-passthrough.
    • Image Editing and Transformation: Uses edit.ts to modify existing images via image-to-image references.
    • Model Selection: Allows selecting specific image models (e.g., google/gemini-3.1-flash-lite-image).
    • Automated Workflow: Includes a decision tree to determine whether to use the discover, generate, or edit flow based on the user's request.
  8. Capabilities of openrouter-tts

    main

    The openrouter-tts skill provides functionality for synthesizing speech from text using OpenRouter's synchronous POST /api/v1/audio/speech endpoint. Key features include:

    • Model/Voice Discovery: Finding available TTS models via /api/v1/models?output_modalities=speech.
    • Format Selection: Support for mp3 and pcm formats (ensure the format matches the file extension to avoid empty audio issues).
    • Provider Passthrough: Ability to pass provider-specific options via provider.options.<slug>, such as OpenAI's instructions for controlling tone and pacing.
    • OpenAI SDK Compatibility: You can use existing OpenAI SDK code by simply swapping the base_url to OpenRouter.
    • Input Handling: Support for splitting and concatenating long text inputs.
    • Bash Workflow: Includes a drop-in script that manages headers, error bodies, and generation ID capture.
  9. Capabilities of the openrouter-video skill

    main

    The openrouter-video skill provides access to OpenRouter's asynchronous video generation API. Key features include:

    • Generation Modes: Text-to-video, image-to-video (using first or last frames), and reference-to-video generation.
    • Workflow Automation: A drop-in bash script that handles the complete submit → poll → download lifecycle.
    • Job Management: Ability to poll for status or download an existing video job using its ID.
    • Model Discovery: Tools to discover available video models and their specific supported parameters.
    • Webhooks: Support for webhook callbacks as an alternative to manual polling.
  10. Query OpenRouter benchmark rankings

    main

    The openrouter-benchmarks skill allows you to query unified benchmark rankings from Artificial Analysis and Design Arena using the GET /api/v1/benchmarks endpoint.

    Capabilities include:

    • Querying rankings from Artificial Analysis and Design Arena.
    • Filtering results by benchmark source, task type, arena, category, and result limit.
    • Interpreting source-specific scores while maintaining scale compatibility.
    • Accessing metadata such as benchmark citations and dataset timestamps.
    • Verifying model availability for benchmark-ranked candidates before making recommendations.
  11. What is Open Responses?

    main

    Open Responses is an open-source specification defining a unified HTTP protocol for multi-provider LLM interactions. It standardizes how clients and servers communicate regarding messages, tool calls, streaming, multimodal inputs, and reasoning. This allows code written against one provider to work with any compliant provider (e.g., OpenAI, Anthropic, Gemini, etc.).

    Key Characteristics:

    • Provider-agnostic: It is a protocol standard, not a specific SDK.
    • Stateless-first: The core protocol does not require server-side session persistence. Multi-turn conversations are handled via the previous_response_id parameter, which instructs the server to reconstruct context from prior responses.
    • Polymorphic items: All model outputs share a common structure discriminated by a type field.
  12. Use Shared Context and Tool Context in @openrouter/agent

    main

    The @openrouter/agent package introduces type-safe shared state and local tool context.

    Shared Context

    Define a sharedContextSchema using Zod in callModel. This state is accessible to all tools in the conversation.

    const result = client.callModel({
      model: 'openai/gpt-5-nano',
      input: 'Process this data',
      sharedContextSchema: z.object({
        userId: z.string(),
        sessionData: z.record(z.unknown()),
      }),
      context: {
        shared: { userId: '123', sessionData: {} },
      },
      tools: [myTool],
    });

    Tool Context

    Tools can declare their own contextSchema and access both local and shared context within the execute function.

    const myTool = tool({
      name: 'my_tool',
      description: 'A tool with context',
      inputSchema: z.object({ query: z.string() }),
      contextSchema: z.object({ apiKey: z.string() }),
      execute: async (params, context) => {
        // context.local — this tool's own context
        // context.shared — shared context across all tools
        // context.setContext({ ... }) — update this tool's context
        // context.setSharedContext({ ... }) — update shared context
        return { result: 'done' };
      },
    });
    import { OpenRouter } from '@openrouter/agent';
    import { tool } from '@openrouter/agent/tool';
    import { z } from 'zod';
    
    const client = new OpenRouter({ apiKey: '...' });
    
    const result = client.callModel({
      model: 'openai/gpt-5-nano',
      input: 'Process this data',
      sharedContextSchema: z.object({
        userId: z.string(),
        sessionData: z.record(z.unknown()),
      }),
      context: {
        shared: { userId: '123', sessionData: {} },
      },
      tools: [myTool],
    });
    
    const myTool = tool({
      name: 'my_tool',
      description: 'A tool with context',
      inputSchema: z.object({ query: z.string() }),
      contextSchema: z.object({ apiKey: z.string() }),
      execute: async (params, context) => {
        // context.local — this tool's own context
        // context.shared — shared context across all tools
        // context.setContext({ ... }) — update this tool's context
        // context.setSharedContext({ ... }) — update shared context
        return { result: 'done' };
      },
    });