---
title: "AI GIF Generator"
method: POST
path: "/v1/ai-gif-generator"
tags: ["Image Projects"]
---

# AI GIF Generator

`POST /v1/ai-gif-generator`

Create an AI GIF. Each GIF costs 50 credits.

## Request body

- object
  - `name` string — Give your gif a custom name for easy identification.
  - `style` object, required
    - `prompt` string, required — The prompt used for the GIF.
  - `output_format` 'gif' | 'mp4' | 'webm' — The output file format for the generated animation.

## Response `200`

Success

- object — Success
  - `id` string, required — Unique ID of the image. Use it with the [Get image Project API](https://docs.magichour.ai/api-reference/image-projects/get-image-details) to fetch status and downloads.
  - `credits_charged` integer, required — The amount of credits deducted from your account to generate the image. We charge credits right when the request is made. If an error occurred while generating the image(s), credits will be refunded and this field will be updated to include the refund.

## Other responses

- `400` — Invalid Request
- `401` — Unauthorized
- `402` — Payment Required
- `404` — Not Found
- `422` — Unprocessable Entity

---

[API](https://skmtc.net/magichourhq/apis/magic-hour-api.md) · [All operations](https://skmtc.net/magichourhq/apis/magic-hour-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/magichourhq/magic-hour-api/revisions/d03d90b0b8e0/schema)
