# Models & Catalog

> OpenGen catalogs 54 exact image, video, and audio model variants across 33 series, 12 serving providers, and 184 regional routes. Every variant retains its exact execution identity without merging derivatives by name. Discover models via compact GET /v1/models summaries, curated collections, or single-call GET /v1/models/{provider}/{model} detail responses.

## Agent Prompt

```text
Discover and inspect exact OpenGen model contracts using https://opengen.dev/docs/models-and-catalog:
1. Search compact model summaries via GET https://opengen.dev/v1/models (filters: q, modality, providerId, region, familyId, operation, inputRole, collection; omit expand=schemas unless bulk schemas are needed) or MCP find_models on https://opengen.dev/mcp/readonly.
2. Inspect one exact variant, its effective generationProfiles (JSON input schema, defaults, bounds), regional routes with privacy disclosures, and published pricing in one call via GET https://opengen.dev/v1/models/{provider}/{model}?operation=<op> (or MCP get_model).
3. Never substitute a derivative or sibling variant by marketing name, and never assume a documented route is live-verified — inspect route.status and call POST https://opengen.dev/v1/pricing/estimate before asking the user to confirm spend and submitting with an Idempotency-Key.
```

## Exact variant identity and catalog structure

OpenGen separates four concepts so execution choices stay explicit and auditable:

- **Exact model variant (`modelId`)**: A fixed `<creator>/<variant>` execution identity (for example `openai/gpt-image-2`, `bytedance/seedance-2.5`, `alibaba/wan-3.0`, or `minimax/h3-max`). OpenGen catalogs **54** exact variants (**7** published with `open-weights`, each retaining its own license). Derivatives and speed tiers (`Fast`, `Flash`, `Lite`, `Mini`, `Turbo`, `Prime`, `Klein`) are never merged by marketing name. Where equivalence is explicitly confirmed — such as `minimax/h3-max` served by MiniMax and fal — legacy aliases (`fal/h3-max`) resolve cleanly without merging distinct derivatives (`fal/h3-max-turbo`, `pika/h3-flex`).
- **Model series**: A public grouping of closely related variants for browsing (33 series across 11 model providers — for example [GPT Image 2](/openai/gpt-image-2), [Seedance 2.5](/bytedance/seedance-2.5), [Wan 3.0](/alibaba/wan-3.0), [Kling 4.0](/kling/kling-4.0), [Nano Banana 2](/google/nano-banana-2), [FLUX 3 Image](/bfl/flux-3-image), [MiniMax H3](/minimax/h3), and [GPT-4o mini TTS](/openai/gpt-4o-mini-tts)).
- **Regional deployment (`deploymentId`)**: A serving provider's specific API endpoint region and scope (20 deployments across 12 serving providers: Alibaba Cloud, Black Forest Labs, BytePlus, fal, Google, Kling AI, MiniMax, OpenAI, Pika, Replicate, Runway, and xAI).
- **Regional route (`routeId`)**: One exact `modelId` served on one `deploymentId` with explicit supported operations, resolutions, durations, single-source pricing, privacy disclosure, and verification status (184 total routes: **19** `live-verified` with scoped `liveVerification` metadata and **165** `documented`).

> [!IMPORTANT]
> A `documented` catalog listing is **not** a claim of live execution availability or live-verified behavior on `https://opengen.dev`. Check `route.status`, `route.liveVerification`, and `POST /v1/pricing/estimate` (`selectedRouteId`, `candidates[].executable`, and `workspaceEligibility`) before submitting.

## Public catalog endpoints (6 routes)

All six endpoints under the `models` OpenAPI tag are unauthenticated, CORS-enabled (`Access-Control-Allow-Origin: *`), and served with `Cache-Control: public, max-age=60, s-maxage=300` (`Vary: Authorization, Cookie`) on unauthenticated `200 OK` responses:

| Endpoint                            | Operation ID       | Purpose & Key Query Parameters                                                                                                                                                                                                                                                      |
| ----------------------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GET /v1/models`                    | `models.list`      | Compact list/search of exact variants (~25 KB default without `generationProfiles`). Filters: `q`, `modality` (`image\|video\|audio`), `familyId`, `providerId`, `region`, `operation`, `inputRole`, `collection`, and optional `expand=schemas` to embed full `generationProfiles` |
| `GET /v1/models/{provider}/{model}` | `models.get`       | **Recommended single-call inspection**: returns `model` (with `generationProfiles`), `series`, `routes` (with `privacyDisclosure`), `pricing`, and `deployments`. Optional `?operation=<op>` narrows schemas, routes, and pricing                                                   |
| `GET /v1/models/schema`             | `models.schema`    | Returns one exact `GenerationProfile` (`?modelId=<id>&operation=<op>`), including `commonArguments`, `modelSpecificArguments`, `defaults`, `capabilities`, `inputSchema`, `sources`, `notices`, and validated `examples`                                                            |
| `GET /v1/collections`               | `collections.list` | Lists all 9 curated factual model collections with slugs, factual selection criteria, modalities, and `modelIds`                                                                                                                                                                    |
| `GET /v1/collections/{slug}`        | `collections.get`  | Returns full collection detail including constituent `models` (with `generationProfiles`), `series`, and privacy-disclosed `routes`                                                                                                                                                 |
| `GET /v1/routes`                    | `routes.list`      | Lists documented and live-verified regional routes with `privacyDisclosure`, `rates`, `publishedPricing`, and `pricingSource`. Filters: `?modelId=` and `?operation=`                                                                                                               |

> [!NOTE]
> Free-text model search uses REST query param `q` on `GET /v1/models` and MCP `find_models` argument `query`; single-model inspection uses `GET /v1/models/{provider}/{model}` on REST and argument `id` on MCP `get_model`.

### Compact search and single-call inspection

```bash tab="cURL"
# Compact filtered search (returns ~25 KB or smaller summaries without JSON Schemas)
curl --fail-with-body \
  "$OPENGEN_API_URL/v1/models?modality=video&operation=image-to-video&inputRole=firstFrame"

# Opt-in bulk schema expansion when needed
curl --fail-with-body \
  "$OPENGEN_API_URL/v1/models?collection=image-utilities&expand=schemas"

# Single-call model inspection (schemas + routes + privacy disclosures + pricing + deployments)
curl --fail-with-body \
  "$OPENGEN_API_URL/v1/models/bytedance/seedance-2.5?operation=image-to-video"

# Exact schema profile only (JSON Schema + defaults + example payload)
curl --fail-with-body \
  "$OPENGEN_API_URL/v1/models/schema?modelId=bytedance%2Fseedance-2.5&operation=image-to-video"

# List regional routes for one model
curl --fail-with-body \
  "$OPENGEN_API_URL/v1/routes?modelId=alibaba%2Fwan-3.0&operation=text-to-video"
```

```ts tab="TypeScript"
const baseUrl = process.env.OPENGEN_API_URL ?? 'https://opengen.dev';

// 1. Search compact models
const list = await fetch(
  `${baseUrl}/v1/models?modality=video&operation=image-to-video&inputRole=firstFrame`,
).then((r) => r.json());

// 2. Single-call inspection of one variant
const detail = await fetch(
  `${baseUrl}/v1/models/bytedance/seedance-2.5?operation=image-to-video`,
).then((r) => r.json());

console.log(list.data.length, detail.model.generationProfiles[0].capabilities);
```

```python tab="Python"
import os
import httpx

base_url = os.environ.get("OPENGEN_API_URL", "https://opengen.dev")

with httpx.Client(base_url=base_url, timeout=30.0) as client:
    models = client.get(
        "/v1/models",
        params={"modality": "video", "operation": "image-to-video", "inputRole": "firstFrame"},
    ).raise_for_status().json()
    detail = client.get(
        "/v1/models/bytedance/seedance-2.5",
        params={"operation": "image-to-video"},
    ).raise_for_status().json()

print(len(models["data"]), detail["routes"][0]["id"])
```

```json tab="MCP"
{
  "tool": "get_model",
  "arguments": {
    "id": "bytedance/seedance-2.5",
    "operation": "image-to-video"
  }
}
```

```bash tab="CLI"
opengen catalog search --modality video --operation image-to-video --input-role firstFrame
opengen catalog get bytedance/seedance-2.5
opengen routes --model alibaba/wan-3.0 --operation text-to-video
opengen collections image-to-video
```

## Supported operations and input roles

Every generation request declares an exact `operation` from the 10 canonical operations in `@media-router/contracts`. Each operation has a dedicated walkthrough guide with live supported-model tables:

| Operation            | Modality | Primary Input Roles                                             | Guide                                                 |
| -------------------- | -------- | --------------------------------------------------------------- | ----------------------------------------------------- |
| `text-to-image`      | Image    | `prompt`                                                        | [Text to Image](/docs/guides/text-to-image)           |
| `image-edit`         | Image    | `prompt`, `references.image`, optional `mask`                   | [Image Edit](/docs/guides/image-edit)                 |
| `image-upscale`      | Image    | `references.image`, `scale`                                     | [Image Upscale](/docs/guides/image-upscale)           |
| `background-remove`  | Image    | `references.image`                                              | [Background Remove](/docs/guides/background-remove)   |
| `text-to-video`      | Video    | `prompt`                                                        | [Text to Video](/docs/guides/text-to-video)           |
| `image-to-video`     | Video    | `firstFrame`, optional `lastFrame`, `keyframes`                 | [Image to Video](/docs/guides/image-to-video)         |
| `reference-to-video` | Video    | `references.image` / `video` / `audio` / `document`, `elements` | [Reference to Video](/docs/guides/reference-to-video) |
| `video-edit`         | Video    | `sourceVideo`, `prompt`, optional `references` / `elements`     | [Video Edit](/docs/guides/video-edit)                 |
| `video-extend`       | Video    | `sourceVideo` or `previousJobId`                                | [Video Extend](/docs/guides/video-extend)             |
| `text-to-speech`     | Audio    | `prompt`, `voice`, `speed`                                      | [Text to Speech](/docs/guides/text-to-speech)         |

Filter `GET /v1/models` or MCP `find_models` by any of the **11** canonical `inputRole` values: `firstFrame`, `lastFrame`, `keyframes`, `sourceVideo`, `references.image`, `references.video`, `references.audio`, `references.document`, `mask`, `elements`, and `targetAudio`.

## Curated factual collections (9 slugs)

Collections are computed deterministically from live catalog metadata via `GET /v1/collections` and `GET /v1/collections/{slug}` (or MCP `find_models({ listCollections: true })` / `find_models({ collection: "<slug>" })`):

- `fast-image` — Image variants explicitly designated Flash, Klein, Lite, Turbo, or Highspeed.
- `image-editing` — Image models supporting `image-edit`.
- `image-utilities` — Specialized `image-upscale` and `background-remove` models.
- `text-to-video` — Video models supporting `text-to-video`.
- `image-to-video` — Video models supporting first-frame, last-frame, or keyframe conditioning.
- `audio-enabled-video` — Video models with documented `switchable` or `always-on` synchronized audio.
- `reference-consistent-video` — Video models supporting `reference-to-video`.
- `text-to-speech` — Audio speech synthesis models supporting `text-to-speech`.
- `open-weights` — Exact catalog variants published with open weights (each with its own license).

## Reading `GenerationProfile` and `examples`

`GET /v1/models/{provider}/{model}` and `GET /v1/models/schema` return `GenerationProfile` objects containing:

- `commonArguments` and `modelSpecificArguments`: exact allowlisted keys for `input`. Unknown or unsupported fields fail fast with `400 invalid_generation` before hitting any provider.
- `capabilities`: exact `resolutions`, `aspectRatios`, `duration` (`minimum`, `maximum`, `integer`, `auto`), `references` (`types`, per-type `maximum`, `totalMaximum`), `frames` (`first`, `last`, `lastOnly`, `keyframesMaximum`, `timed`), `frameReferenceMix`, `audio` (`switchable | always-on | unsupported | unverified`), `quality`, and `countMaximum`.
- `inputSchema`: JSON Schema for the nested `input` object.
- `examples`: ready-to-edit `request`, `generate` envelope, `cli` command, `placeholders` (asset keys to replace after uploading), and `notices`.

## Model-specific connect instructions & `.md` twins

Every model series page (`/[provider]/[series]`, such as `/openai/gpt-image-2` or `/bytedance/seedance-2.5`) pairs an above-the-fold **Pricing at a Glance** summary with a single-source `#connect` section generated from `@media-router/docs` and `@media-router/catalog`:

- An above-the-fold **Pricing at a Glance** prose lead and `Provider | Unit Price | Cost per 1,000 ... | Region` comparison table sourced strictly from `@media-router/catalog` (with a unified `Checked YYYY-MM-DD` catalog/pricing review date, exact same-`modelId` `Lowest` comparisons, `≈` markers for approximate/token-derived rates, `Unknown` / `—` for unpriced or mixed-unit entries, and explicit separation of higher-priced, unpriced, and other-variant regions). Treat starting rates as catalog list rates rather than executable quotes — confirm exact request cost via `POST /v1/pricing/estimate` or MCP `estimate_cost` (see [Pricing & Analytics](/docs/pricing-and-analytics)).
- A copyable **Agent Prompt** box tailored to the selected exact variant and operation (with zero-auth `GET /v1/models/{provider}/{model}` / MCP `get_model`, dry-run `POST /v1/pricing/estimate`, private `/v1/assets` upload when required, and persisted `Idempotency-Key` safety).
- Step-by-step connection checklists and synced 5-tab copy-paste examples (`cURL`, `TypeScript`, `Python`, `MCP`, and `CLI`) backed by live `GenerationProfile` schemas.
- Direct backlinks to the matching `/docs/guides/<operation>` page and core platform docs (`/docs/quickstart`, `/docs/mcp`, `/docs/clients`, `/docs/authentication`, `/docs/generations`, `/docs/regional-routing`, `/docs/pricing-and-analytics`, `/docs/webhooks`, and `/docs/api`).
- A full Markdown twin at `/[provider]/[series].md` (and via `Accept: text/markdown`) including `## Pricing at a Glance`, `## Agent Prompt`, and optional `?variant=<modelId>&operation=<operation>` selection.

> [!TIP]
> Browse the live model directory at [/models](/models), compare providers at [/providers](/providers), or fetch any series page directly as Markdown (for example `https://opengen.dev/openai/gpt-image-2.md` or `https://opengen.dev/openai/gpt-image-2.md?operation=image-edit`).
