---
title: "Render one approved GIF template as downloadable GIF bytes"
method: POST
path: "/api/gifs/{slug}/generate"
tags: ["templates", "gifs"]
---

# Render one approved GIF template as downloadable GIF bytes

`POST /api/gifs/{slug}/generate`

Returns image/gif bytes. Request body accepts width, startMs, durationMs, fps, title, tags, and caption objects with x/y/fontSize placement.

## Path parameters

- `slug` string, required

## Request body

- GenerateGifRequest
  - `gifSlug` string — Required for /api/v1/gifs/generate.
  - `widthPx` integer
  - `startMs` integer
  - `durationMs` integer
  - `fps` integer
  - `title` string
  - `tags` string[]
  - `captions` GifCaptionInput[]
    - `id` string
    - `text` string, required
    - `x` number
    - `y` number
    - `fontSize` number
    - `boxWidthPct` number
    - `maxLines` integer
    - `color` string
    - `stroke` string
    - `textAlign` 'left' | 'center' | 'right'
    - `fontFamily` 'impact' | 'arial' | 'poster'
  - `returnBase64` boolean — Only used by /api/v1/gifs/generate.

## Response `200`

Generated GIF bytes

## Other responses

- `400` — Validation error
- `404` — GIF template not found
- `413` — Source or output GIF too large
- `422` — Frame or pixel budget exceeded
- `429` — Rate limit exceeded

---

[API](https://skmtc.net/memesio/apis/memesio-api-contracts.md) · [All operations](https://skmtc.net/memesio/apis/memesio-api-contracts/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/memesio/memesio-api-contracts/revisions/826e6edbf294/schema)
