# OpenRouter API

> OpenRouter returns AI model details, prices, and hosting options as a workflow and API.

OpenRouter lists public models with prices, context sizes, supported inputs, and release dates; filter or sort results. Get model returns details, prices, and hosting options; enter a model name, OpenRouter link, or slug.

- Page: https://fous.com/workflows/openrouter
- Handle: `@openrouter`
- Category: [AI](https://fous.com/workflows/category/ai)
- Source website: https://openrouter.ai
- Last verified: Sep 29, 2026
- Fous is not affiliated with OpenRouter.

## Methods

### Get model

Operation `get_model`, version 1. 1 credit per call.

Get a model’s prices, limits, supported inputs, release date, and hosting providers from its name or OpenRouter link. Prices are base USD rates per million tokens; provider uptime is the reported one-day percentage when available.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `model` | string | yes | `"Claude Sonnet 4.5"` | Model name, OpenRouter model link, or model slug, for example Claude Sonnet 4.5. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "model"
  ],
  "properties": {
    "model": {
      "type": "string",
      "description": "Model name, OpenRouter model link, or model slug, for example Claude Sonnet 4.5.",
      "examples": [
        "Claude Sonnet 4.5",
        "Llama 3.3 70B",
        "https://openrouter.ai/models/openai/gpt-5"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "model": "Claude Sonnet 4.5"
    },
    {
      "model": "Llama 3.3 70B"
    },
    {
      "model": "https://openrouter.ai/models/openai/gpt-5"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `provider` | string | `"Anthropic"` | Organization offering the model. |
| `providers` | array |  | Available hosting options and their prices, context windows, and one-day uptime where reported. A host may have multiple options. |
| `providers[].provider_name` | string | `"Claude Platform on AWS"` |  |
| `providers[].uptime_percent` | number or null | `99.98659004366617` |  |
| `providers[].context_length_tokens` | integer or null | `1000000` |  |
| `providers[].input_price_usd_per_million_tokens` | number or null | `3` |  |
| `providers[].output_price_usd_per_million_tokens` | number or null | `15` |  |
| `model_name` | string | `"Anthropic: Claude Sonnet 4.5"` | Model’s display name. |
| `model_slug` | string | `"anthropic/claude-sonnet-4.5"` | OpenRouter model identifier. |
| `description` | string or null | `"Claude Sonnet 4.5 is Anthropic’s most advanced Sonnet model to date, optimized for real-world agents and coding workflo` | Published model summary. |
| `release_date` | string or null | `"2025-09-29"` | Model listing release date (YYYY-MM-DD). |
| `model_page_link` | string | `"https://openrouter.ai/models/anthropic/claude-sonnet-4.5"` | OpenRouter model page. |
| `supported_inputs` | array |  | Supported input types. |
| `context_length_tokens` | integer or null | `1000000` | Maximum context window in tokens. |
| `maximum_output_tokens` | integer or null | `64000` | Maximum output in tokens. |
| `input_price_usd_per_million_tokens` | number or null | `3` | Base input price in USD per million tokens. |
| `output_price_usd_per_million_tokens` | number or null | `15` | Base output price in USD per million tokens. |

**Example input**

```json
{
  "model": "Claude Sonnet 4.5"
}
```

**Example output**

```json
{
  "provider": "Anthropic",
  "providers": [
    {
      "provider_name": "Claude Platform on AWS",
      "uptime_percent": 99.98659004366617,
      "context_length_tokens": 1000000,
      "input_price_usd_per_million_tokens": 3,
      "output_price_usd_per_million_tokens": 15
    },
    {
      "provider_name": "Azure",
      "uptime_percent": 95.1048951048951,
      "context_length_tokens": 200000,
      "input_price_usd_per_million_tokens": 3,
      "output_price_usd_per_million_tokens": 15
    },
    {
      "provider_name": "Amazon Bedrock",
      "uptime_percent": 99.88574415479586,
      "context_length_tokens": 1000000,
      "input_price_usd_per_million_tokens": 3,
      "output_price_usd_per_million_tokens": 15
    }
  ],
  "model_name": "Anthropic: Claude Sonnet 4.5",
  "model_slug": "anthropic/claude-sonnet-4.5",
  "description": "Claude Sonnet 4.5 is Anthropic’s most advanced Sonnet model to date, optimized for real-world agents and coding workflows. It delivers state-of-the-art performance on coding benchmarks such as SWE-ben…",
  "release_date": "2025-09-29",
  "model_page_link": "https://openrouter.ai/models/anthropic/claude-sonnet-4.5",
  "supported_inputs": [
    "text",
    "image",
    "file"
  ],
  "context_length_tokens": 1000000,
  "maximum_output_tokens": 64000,
  "input_price_usd_per_million_tokens": 3,
  "output_price_usd_per_million_tokens": 15
}
```

### List models

Operation `list_models`, version 1. 1 credit per call.

List public OpenRouter models with per-million-token prices, context size, input types, release date, and model page. Sort by newest, input price, or popularity; unavailable prices are null. Input types list text, image, audio and file only.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `sort` | string | no | `"newest"` | Order of models, such as cheapest for lowest input token price first. |
| `query` | string | no | `"vision"` | Provider name or model keyword, such as Anthropic or vision. Leave blank for all models. |
| `max_results` | integer | no | `4` | Maximum models to return, such as 50. |

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "sort": {
      "enum": [
        "newest",
        "cheapest",
        "most_used"
      ],
      "type": "string",
      "default": "newest",
      "description": "Order of models, such as cheapest for lowest input token price first.",
      "examples": [
        "newest",
        "cheapest",
        "most_used"
      ]
    },
    "query": {
      "type": "string",
      "default": "",
      "description": "Provider name or model keyword, such as Anthropic or vision. Leave blank for all models.",
      "examples": [
        "vision",
        "Anthropic",
        "unlikely-no-matches-xyzabc"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 50,
      "maximum": 500,
      "minimum": 1,
      "description": "Maximum models to return, such as 50.",
      "x-fous-developer": true,
      "examples": [
        4,
        5,
        500
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "sort": "newest",
      "query": "vision",
      "max_results": 4
    },
    {
      "sort": "cheapest",
      "query": "Anthropic",
      "max_results": 5
    },
    {
      "sort": "most_used",
      "max_results": 5
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `models` | array |  | Matching models in the requested order. |
| `models[].provider` | string | `"DeepSeek"` | Model provider. |
| `models[].model_name` | string | `"DeepSeek: DeepSeek V4 Flash Vision Exp"` | Display name of the model. |
| `models[].model_slug` | string | `"deepseek/deepseek-v4-flash-vision-exp"` | OpenRouter model slug. |
| `models[].release_date` | string or null | `"2026-08-21"` | Model listing release date. |
| `models[].model_page_link` | string | `"https://openrouter.ai/models/deepseek/deepseek-v4-flash-vision-exp"` | Page for this model on OpenRouter. |
| `models[].supported_inputs` | array |  | Supported text, image, audio, and file inputs. |
| `models[].context_length_tokens` | integer or null | `1048576` | Maximum context size in tokens, or null if unknown. |
| `models[].input_price_usd_per_million_tokens` | number or null | `0.2156` | Input price in USD for one million tokens, or null if unspecified. |
| `models[].output_price_usd_per_million_tokens` | number or null | `0.6468` | Output price in USD for one million tokens, or null if unspecified. |

**Example input**

```json
{
  "sort": "newest",
  "query": "vision",
  "max_results": 4
}
```

**Example output**

```json
{
  "models": [
    {
      "provider": "DeepSeek",
      "model_name": "DeepSeek: DeepSeek V4 Flash Vision Exp",
      "model_slug": "deepseek/deepseek-v4-flash-vision-exp",
      "release_date": "2026-08-21",
      "model_page_link": "https://openrouter.ai/models/deepseek/deepseek-v4-flash-vision-exp",
      "supported_inputs": [
        "text",
        "image"
      ],
      "context_length_tokens": 1048576,
      "input_price_usd_per_million_tokens": 0.2156,
      "output_price_usd_per_million_tokens": 0.6468
    },
    {
      "provider": "Qwen",
      "model_name": "Qwen: Qwen3.8 27B",
      "model_slug": "qwen/qwen3.8-27b",
      "release_date": "2026-08-14",
      "model_page_link": "https://openrouter.ai/models/qwen/qwen3.8-27b",
      "supported_inputs": [
        "text",
        "image"
      ],
      "context_length_tokens": 1000000,
      "input_price_usd_per_million_tokens": 0.0607,
      "output_price_usd_per_million_tokens": 4.4
    },
    {
      "provider": "Qwen",
      "model_name": "Qwen: Qwen3.8 27B (free)",
      "model_slug": "qwen/qwen3.8-27b:free",
      "release_date": "2026-08-14",
      "model_page_link": "https://openrouter.ai/models/qwen/qwen3.8-27b:free",
      "supported_inputs": [
        "text",
        "image"
      ],
      "context_length_tokens": 262144,
      "input_price_usd_per_million_tokens": 0,
      "output_price_usd_per_million_tokens": 0
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@openrouter",
  "visibility": "public",
  "operation": "get_model",
  "version": 1,
  "input": {
    "model": "Claude Sonnet 4.5"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@openrouter\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_model\",\n  \"version\": 1,\n  \"input\": {\n    \"model\": \"Claude Sonnet 4.5\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@openrouter",
  "visibility": "public",
  "operation": "get_model",
  "version": 1,
  "input": {
    "model": "Claude Sonnet 4.5"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@openrouter","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Compare model input and output prices
- Find models by provider or supported input type
- Review context sizes before selecting a model
- Compare hosting options and reported uptime
- Track model listing release dates

## FAQ

### Is Fous affiliated with OpenRouter?

No. Fous is not affiliated with OpenRouter. This workflow reads the public openrouter.ai website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a OpenRouter account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from openrouter.ai when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### Which models support image input?

Use List models and check the supported inputs for image.

### What does a model cost per million tokens?

Get model returns base input and output prices; List models includes these prices for public models.

### Which providers host a model?

Get model returns hosting options with prices, context windows, and one-day uptime where reported.

## Related

- [Hugging Face API](https://fous.com/workflows/hugging-face.md): Hugging Face returns public model, dataset, and demo search results, model details, or weekly trending models; unpublished information may be missing, and demo availability can change.
- [LMArena API](https://fous.com/workflows/lmarena.md): Human-vote leaderboards for AI models across text, image, video, search, and web development.
- [Polymarket API](https://fous.com/workflows/polymarket.md): Polymarket shows searchable markets with search-time odds and sometimes-unavailable 24-hour volume, ranks open markets by trading, and tracks chances over time, sometimes without recent points.
- [PriceRunner API](https://fous.com/workflows/pricerunner.md): Compare prices for products offered by online shops.
- [Open Library API](https://fous.com/workflows/open-library.md): Open Library returns book search results, catalog details, and author works; availability reflects listed editions, not current loan availability, and catalog details may be missing.
- [Shopify API](https://fous.com/workflows/shopify.md): Shopify provides public products, prices, and availability from Shopify-powered stores, reflecting storefront information that may be restricted by some stores.
- [OpenTable API](https://fous.com/workflows/opentable.md): OpenTable returns bookable tables within two hours or near requested times, plus public restaurant profiles; availability changes, and some profile details may be missing.
- [idealo API](https://fous.com/workflows/idealo.md): Compare online shop offers for products on idealo.
- [All AI workflows](https://fous.com/workflows/category/ai)
