> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autoadify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Images and videos

> Generate AI images and videos into your media library, then attach them to posts.

Generated files land in your [media library](https://docs.autoadify.com/guides/media.md) like anything you upload, and show up in AI Studio's history in the app. Attach them to a post with their media id.

Generation needs the `generate` permission and spends your Autoadify credits, at the same prices as in the app.

## Models

[List AI models](https://docs.autoadify.com/api-reference/generation/list-ai-models.md) (`list_ai_models` on MCP) returns the current models, their cost, which ones your plan includes, and your credit balance. At the moment:

| Model | Type | Cost | Good for |
| - | - | - | - |
| `nano-banana-2` (default) | Image | 5 credits | All-round product and lifestyle shots |
| `gpt-image-2` | Image | 4 credits | Following detailed prompts, text in the image |
| `qwen-image-3` | Image | 4 credits | Sharp, legible text: posters, quotes, callouts |
| `krea-2-medium` | Image | 4 credits | Consistent photographic and illustrated images |
| `krea-2-medium-turbo` | Image | 2 credits | Quick drafts and iterations |
| `recraft-v4.1-flash` | Image | 1 credit | Graphic and flat styles |
| `minimax-h3` (default) | Video, from text | 9 credits / second | 2K clips with strong text and brand rendering; 5–10 min |
| `runway-gen-4.5` | Video, from an image | 9 credits / second | Animating a product photo; 2–4 min |
| `heygen-video-1` | Video, from text | 2 credits / second | Cheap 480p b-roll with its own sound; 1–3 min |

Image aspect ratios: `1:1`, `4:5`, `9:16`, `16:9`. Video: `16:9`, `9:16`, `1:1` (Runway has no `1:1`), 5, 10 or 15 seconds (Runway 5 or 10).

## Generate an image

```bash theme={null}
curl https://api.autoadify.com/v1/generations/image \
  -H "Authorization: Bearer aak_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "A ceramic mug on a sunlit kitchen counter, soft morning light", "model": "nano-banana-2", "aspectRatio": "4:5" }'
```

Images usually finish within the request:

```json theme={null}
{
  "generation": {
    "id": "gen_123",
    "status": "completed",
    "capability": "image",
    "model": "nano-banana-2",
    "creditsCharged": 5,
    "media": { "id": "med_456", "url": "https://...", "type": "IMAGE" },
    "error": null
  }
}
```

If `status` is still `pending`, poll [Get generation](https://docs.autoadify.com/api-reference/generation/get-generation.md) until it's `completed` or `failed`.

## Generate a video

```bash theme={null}
curl https://api.autoadify.com/v1/generations/video \
  -H "Authorization: Bearer aak_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "Slow push-in on a ceramic mug, steam rising", "model": "minimax-h3", "aspectRatio": "9:16", "durationSeconds": 5 }'
```

Videos return straight away with `status: "pending"`. Poll [Get generation](https://docs.autoadify.com/api-reference/generation/get-generation.md) every 30–60 seconds. To animate a photo, use `runway-gen-4.5` and pass `imageMediaId` with a library image.

Cost is per second: a 10-second `minimax-h3` clip is 90 credits. A duration a model doesn't offer is rounded down to the nearest one it does.

## Attach it to a post

```json theme={null}
{ "content": "Morning ritual ☕", "channelIds": ["ch_instagram"], "mediaIds": ["med_456"] }
```

## Refusals and refunds

* **Content policy.** Prompts are checked against Autoadify's content policy before anything is generated. A refusal returns `422` with the code `content_policy` and the reason, and costs nothing.
* **Not enough credits.** Returns `402` with `insufficient_credits`. Top up or upgrade in the app.
* **Failures.** If a model fails, the generation ends `failed` with the error, and the credits are refunded automatically.

With an AI assistant, just ask: *"Make a 4:5 image of our mug on a kitchen counter and schedule it to Instagram tomorrow at 9."* It checks the cost with `list_ai_models`, generates, and attaches the result.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.