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

# AI GIF Generator

`POST /v1/ai-gif-generator`

## Request

- Base URL: `https://api.magichour.ai`
- URL: `https://api.magichour.ai/v1/ai-gif-generator`
- Auth: HTTP bearer

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
- `500`: Internal Server Error

## Changes

- **2026-09-02** `9aeb9397c62a`: 8 info
  - added the non-success response with the status `500`
  - removed the `Not Found` enum value from the `message` response property for the response status `404`
  - removed the `Unauthorized` enum value from the `message` response property for the response status `401`
  - added the required property `code` to the response with the `400` status
  - …4 more
- **2026-03-06** `1f72d520ddc6`: 1 info
  - added the non-success response with the status `402`
- **2026-01-24** `a342af4ecbcf`: 1 breaking
  - removed the required property `frame_cost` from the response with the `200` status

[Operation history](https://skmtc.dev/magichourhq/apis/magic-hour-api/changes/v1/ai-gif-generator/post.md)

---

[API](https://skmtc.dev/magichourhq/apis/magic-hour-api.md) - [All operations](https://skmtc.dev/magichourhq/apis/magic-hour-api/llms.txt) - [OpenAPI document](https://skmtc.dev/magichourhq/apis/magic-hour-api/revisions/2ee5927306a9?raw)
