# list_models

> List models and their prices

`GET /api/v2/models`

Public: works without a key. With a key it counts toward your price-check limit.

- Auth: Optional. Works without a key; a key counts toward your price-check limit.
- Raw spec: https://app.diffusr.ai/api/v2/openapi.json

## Query

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `kind` | "video" \| "image" | no |  |

## Example

**cURL**

```bash
curl "https://app.diffusr.ai/api/v2/models?kind=video" \
  -H "Authorization: Bearer $DIFFUSR_KEY"
```

**TypeScript**

```ts
import { Diffusr } from "diffusr";

const d = new Diffusr(); // reads DIFFUSR_KEY
const { models } = await d.listModels({ kind: "video" });
console.log(models.map((m) => m.id));
```

**Python**

```python
from diffusr import Diffusr

d = Diffusr()  # reads DIFFUSR_KEY
data = d.list_models(kind="video")
print([m["id"] for m in data["models"]])
```

## Response

### 200 ApiModelList

The models you can pass as `model`, with prices.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `models` | object[] | yes |  |
| `models[].id` | string | yes | Pass this as `model`. |
| `models[].name` | string | yes |  |
| `models[].kind` | "video" \| "image" | yes |  |
| `models[].aspect_ratios` | string[] | yes |  |
| `models[].resolutions` | string[] | no |  |
| `models[].duration_sec` | object | no |  |
| `models[].duration_sec.min` | number | yes |  |
| `models[].duration_sec.max` | number | yes |  |
| `models[].duration_sec.default` | number | yes |  |
| `models[].max_reference_images` | number | yes |  |
| `models[].takes_video` | boolean | yes |  |
| `models[].takes_audio` | boolean | yes | Takes voice or sound clips in audio_urls. |
| `models[].reference_labels` | object | no |  |
| `models[].reference_labels.image` | string | no |  |
| `models[].reference_labels.video` | string | no |  |
| `models[].reference_labels.audio` | string | no |  |
| `models[].cost` | object \| object \| object \| object | yes | The price as a simple number, at the API direct tariff. |
| `models[].price` | object | yes |  |
| `models[].price.unit` | "second" \| "image" | yes |  |
| `models[].price.credits` | number | yes | Credits per second of video, or per image, at the settings in `at`. |
| `models[].price.at` | object | yes |  |
| `models[].price.by_resolution` | map of number | no | The same price at each resolution, when the model has several. |
| `models[].price.tariff` | "direct" | yes |  |
| `models[].price.tariff_version` | string | yes |  |
| `models[].about` | string | no |  |
| `models[].caveat` | string | no |  |

## Errors

Every error body is `{ error, code, request_id, ... }`. See https://diffusr.ai/docs/errors.

- 422: The request is not valid (VALIDATION_FAILED, INVALID_JSON, PREFLIGHT_FAILED, CALLBACK_URL_INVALID, REFERENCE_*). `issues` lists each problem. Nothing was charged.
- 429: Too many requests or jobs (RATE_LIMITED, CONCURRENCY_LIMIT, UPLOAD_QUOTA, …). Wait Retry-After seconds, then retry.
- 500: Our fault (INTERNAL_ERROR). Quote request_id to support.
- 503: Paused or busy (API_PAUSED, MODEL_PAUSED, PROVIDER_PAUSED, PROVIDER_BUSY, UNAVAILABLE). Wait Retry-After seconds, then retry.

## Charges

Free. No credits are spent.
