# Models and variants

The catalog is an endpoint. Read it to learn every model's id, prices and input fields.

`GET /v1/models` lists every model that can run right now with its variants and prices. `GET /v1/models/{id}` adds the allowed quantity and every input field the model accepts. Neither needs a key. The same catalog is on the [Models](https://opengrid.one/models) page.

GET /v1/models/nano-banana-pro:

```json
{
  "id": "nano-banana-pro",
  "name": "Nano Banana Pro",
  "maker": "Google",
  "category": "image",
  "unit": "per_image",
  "variants": [
    { "id": "1k", "label": "1K", "price_usd": 0.141225, "providers": 2 },
    { "id": "2k", "label": "2K", "price_usd": 0.141225, "providers": 2 },
    { "id": "4k", "label": "4K", "price_usd": 0.252105, "providers": 2 }
  ],
  "quantity": { "min": 1, "max": 4 },
  "inputs": {
    "prompt": { "type": "text", "required": true, "max": 20000 },
    "aspect_ratio": { "type": "enum", "required": false, "values": ["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"] },
    "images": { "type": "url_list", "required": false, "max": 14 }
  }
}
```

## How to read a model

- A **variant** is a priced setting such as `720p` or `1080p+audio`. Its `price_usd` is per unit. `providers` is how many providers can run it.
- The **unit** is what `quantity` counts: `per_second` (seconds of video), `per_image`, `per_run` (always 1) or `per_1k_chars`.
- For `per_1k_chars` models, leave `quantity` out. It is worked out from the text: one unit per 1,000 characters, rounded up.
- `inputs` is the complete list of fields the model takes in `input`. A field the model does not list is refused with a 400, never passed through.

## Input types

| Type | What to send |
|---|---|
| `text` | A string, up to `max` characters. |
| `enum` | One of `values`. |
| `int` | A whole number between `min` and `max`. |
| `bool` | `true` or `false`. |
| `url` | A public `https` URL to a file. |
| `url_list` | A list of public `https` URLs, up to `max`. |

Files (`images`, `end_image`, `audio`, `video`) are always public `https` URLs. OpenGrid does not accept uploads or base64 data.

Source: https://opengrid.one/docs/models
