Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

openrouter.md 8.7 KB

You have to be logged in to leave a comment. Sign In
sidebar_label description
OpenRouter Access 100+ LLM providers through OpenRouter's unified API gateway with automatic routing and cost optimization features

OpenRouter

OpenRouter provides a unified interface for accessing various LLM APIs, including models from OpenAI, Meta, Perplexity, and others. It follows the OpenAI API format - see our OpenAI provider documentation for base API details.

Setup

  1. Get your API key from OpenRouter
  2. Set the OPENROUTER_API_KEY environment variable or specify apiKey in your config

Available Models

Latest releases:

Model ID Context (tokens)
amazon/nova-lite-v1 300,000
amazon/nova-micro-v1 128,000
anthracite-org/magnum-v4-72b 16,384
anthropic/claude-3-haiku 200,000
anthropic/claude-3-opus 200,000
anthropic/claude-3.5-sonnet 200,000
anthropic/claude-3.5-sonnet:beta 200,000
cohere/command-r-08-2024 128,000
deepseek/deepseek-r1 64,000
deepseek/deepseek-r1-distill-llama-70b 131,072
deepseek/deepseek-v3-base:free 131,072
google/gemini-2.0-flash-exp:free 1,048,576
google/gemini-2.5-pro-preview 1,000,000
google/gemini-flash-1.5 1,000,000
google/gemini-flash-1.5-8b 1,000,000
google/gemini-pro-1.5 2,000,000
gryphe/mythomax-l2-13b 4,096
meta-llama/llama-3-70b-instruct 8,192
meta-llama/llama-3-8b-instruct 8,192
meta-llama/llama-3-8b-instruct:extended 16,384
meta-llama/llama-3.1-70b-instruct 131,072
meta-llama/llama-3.1-8b-instruct 131,072
meta-llama/llama-3.2-1b-instruct 131,072
meta-llama/llama-3.2-3b-instruct 131,000
meta-llama/llama-3.2-11b-vision-instruct 131,072
meta-llama/llama-3.3-70b-instruct 131,072
meta-llama/llama-4-scout:free 512,000
meta-llama/llama-4-scout 131,072
meta-llama/llama-4-maverick:free 256,000
meta-llama/llama-4-maverick 131,072
microsoft/phi-4 16,384
microsoft/wizardlm-2-8x22b 65,536
mistralai/codestral-2501 256,000
mistralai/mistral-8b 128,000
mistralai/mistral-nemo 131,072
mistralai/ministral-8b 131,072
neversleep/llama-3-lumimaid-8b:extended 24,576
openai/gpt-4.1-mini 128,000
openai/gpt-4.1-mini-2024-07-18 128,000
openhands/openhands-lm-32b-v0.1 16,384
openrouter/quasar-alpha 1,000,000
eva-unit-01/eva-qwen-2.5-72b 16,384
eva-unit-01/eva-qwen-2.5-32b 16,384
qwen/qwen-2.5-coder-32b-instruct 33,000
qwen/qwen-2.5-7b-instruct 32,768
qwen/qwen-2.5-72b-instruct 32,768
qwen/qwq-32b-preview 32,768
qwen/qvq-72b-preview 128,000
scb10x/typhoon2-8b-instruct 8,192
scb10x/typhoon2-70b-instruct 8,192

For a complete list of 300+ models and detailed pricing, visit OpenRouter Models.

Basic Configuration

# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
providers:
  - id: openrouter:meta-llama/llama-4-scout:free
    config:
      temperature: 0.7
      max_tokens: 1000

  - id: openrouter:meta-llama/llama-4-maverick:free
    config:
      temperature: 0.5
      max_tokens: 2000

  - id: openrouter:google/gemini-2.5-pro-preview
    config:
      temperature: 0.7
      max_tokens: 4000

Features

  • Access to 300+ models through a single API
  • Mix free and paid models in your evaluations
  • Support for text and multimodal (vision) models
  • Compatible with OpenAI API format
  • Pay-as-you-go pricing

Thinking/Reasoning Models

Some models like Gemini 2.5 Pro include thinking tokens in their responses. You can control whether these are shown using the showThinking parameter:

providers:
  - id: openrouter:google/gemini-2.5-pro
    config:
      showThinking: false # Hide thinking content from output (default: true)

When showThinking is true (default), the output includes thinking content:

Thinking: <reasoning process>

<actual response>
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...