OpenRouter API guide

openrouter.ai

Use OpenRouter to shortlist models by capability and price, review usage costs, and estimate and generate images with a chosen model.

Included services OpenRouter Images

Actions and inputs

models query

Filter the synced model catalog by capabilities, price, and context length.

Inputs capability, price, and context query

usage cost-by

Break down recorded usage costs by job or agent tag.

Inputs lookback window

cost-estimate

Estimate the cost of an image request before generation.

Inputs model, quality, resolution, image count

generate

Generate an image with a specified model and save it to a file.

Inputs model, prompt, output path

Model presets

Create

Save a reusable model configuration as a preset in your account.

Inputs Preset name, model choices, optional system prompt and sampling settings

Read

Inspect a saved preset's model choices and request defaults.

Inputs Preset name or slug

Update

Change the models, system prompt, or sampling defaults in a preset you own.

Inputs Preset slug, revised fields

Delete

Delete a preset you own so it can no longer be selected or referenced by its slug; past requests are unaffected.

Inputs Preset slug, confirmation