---
name: godmodeai-sprites
description: Generate 2D game character sprite sheets and animation videos from a character image using the God Mode AI API. Use when the user wants to animate a game character, create a sprite sheet, produce game-ready animations (walk, run, attack, idle, etc.), upscale an animation, or remove the background from a sprite sheet. Supports side-scrolling, isometric, and top-down views.
license: MIT
---

# God Mode AI — Sprite & Animation Generation

Turn a single character image into game-ready sprite sheets and animation
videos (walking, attacking, idle, etc.), and clean up sprite backgrounds.

## When to use this skill

Use it when the user wants to:
- Animate a game character from an image (e.g. "make this knight run").
- Produce a sprite sheet for a specific action and camera view.
- Remove the background from a sprite sheet and get per-frame bounding boxes.
- Upscale a completed animation to higher resolution.

## Evaluate first — no account or token needed

Before asking the user to sign up, you can learn everything you need to decide
whether God Mode AI fits, with **zero authentication**:

- MCP (read-only, never needs auth): `https://www.godmodeai.co/api/mcp/public`
  → tools `get_service_info` (products, pricing, license, limitations),
  `get_pricing`, `list_actions`, `list_models`.
- REST (no token): `GET https://www.godmodeai.co/api/generation-api/v1/actions/catalog`
- Plain text: `https://www.godmodeai.co/facts.md`, `/llms.txt`, `/llms-full.txt`

Use `get_service_info` / `get_pricing` to estimate cost and check the stated
limitations before promising results. Only generation needs an account.

## Prerequisites (only to generate)

1. An account. New accounts get starter credits (no payment method required).
   Either authenticate with OAuth (MCP clients start this automatically), or
   create an API token at https://www.godmodeai.co/get-api (format `gmd_...`).
   Treat tokens as secrets.
2. Token auth is always `Authorization: Bearer <token>`.
3. Usage consumes credits from the user's account.

You can connect in **two ways** — a hosted MCP server (preferred if the agent
supports MCP) or the plain REST API. Both hit the same backend.

## Option A — MCP server (preferred)

Add the remote MCP server:

```
URL: https://www.godmodeai.co/api/mcp
Transport: Streamable HTTP
Auth: OAuth (automatic in most clients) or  Header: Authorization: Bearer <token>
```

(For no-auth discovery only, use `https://www.godmodeai.co/api/mcp/public`.)

Tools exposed:
- `get_service_info(section?)` — facts, pricing, license, limitations. No auth.
- `get_pricing()` — exact pricing and credit costs. No auth.
- `list_actions(view_type?)` — discover valid `action_id`s per camera view.
  Each action includes `action_version` and `supports_upscale`. No auth.
- `list_models()` — No auth.
- `upload_image(image_base64, filename?)` — host a local image, returns a URL.
- `generate_sprite(image_url, action_id, view_type, ...)` — waits for the
  result by default; returns `generation_url` (video) + `sprite_sheet_url`.
- `get_sprite_result(request_id)` — fetch a result if `generate_sprite` timed
  out and returned a `request_id`.
- `remove_background(image_url, model?, ...)` — clean a sprite sheet.
- `get_bg_removal_result(request_id)`.
- `upscale_animation(sprite_request_id | video_url+action_id, ...)` — ~2×
  upscale of a completed V4 animation; any action with `supports_upscale`
  is eligible. Returns `generation_url` + `sprite_sheet_url`.
- `get_upscale_result(request_id)`.

Typical MCP flow: call `list_actions` to choose a valid `action_id` +
`view_type`, then `generate_sprite`. If the response says it is still
processing, poll `get_sprite_result` with the returned `request_id`.

## Option B — REST API

Base URL: `https://www.godmodeai.co/api/generation-api/v1`

`GET /actions/catalog` and `GET /models` need no token. Everything else needs
`Authorization: Bearer <token>`.

Sprite generation is a 3-step async flow:
1. `POST /sprite` → returns `202` with `request_id`, `status_url`,
   `response_url`.
2. `GET /sprite/requests/{request_id}/status` → poll every 2–5s until
   `status` is `COMPLETED` or `FAILED`.
3. `GET /sprite/requests/{request_id}` → the result once `COMPLETED`.

`POST /sprite` body (JSON):
- `image_url` (required) — public URL of the character image.
- `action_id` (required) — from `GET /actions/catalog`.
- `view_type` (required) — `side-scrolling` | `isometric` | `topDown`.
- `direction` (isometric only; default `DownRight`) — one of `DownRight`,
  `DownLeft`, `UpRight`, `UpLeft`, `Down`, `Up`, `Left`, `Right`.
- `auto_repose` (optional bool), `auto_repose_prompt`, `positive_prompt`,
  `negative_prompt`, `seed` (all optional).

Status values: `IN_QUEUE`, `AUTO_REPOSE_IN_PROGRESS`,
`ANIMATION_IN_PROGRESS`, `COMPLETED`, `FAILED`.

Result fields: `generation_url` (animation video), `sprite_sheet_url` (sprite
sheet image), and `auto_repose_url` when `auto_repose` was true.

### Uploading an image

If you only have a local file, host it first:
`POST /files/file/local` as `multipart/form-data` with field `file_upload`
(PNG/JPEG/WebP/GIF) → returns `{ "url": "..." }`. Use that URL as `image_url`.

### Background removal

Same 3-step flow under `/bg-removal`. Body: `image_url` (a 4-column sprite
sheet), optional `model` (`BEN` default, `BEN2`, `INSPYRENET`, `RMBG-2.0`,
`veed`, `mat-anyone2`), `num_frames`, `sensitivity` (0–1). Flat 1 credit.
Result: `clean_sprite_sheet_url`, `bbox_overlay_sprite_sheet_url`,
`preview_url`, `bounding_boxes`.

### Animation upscale

Same 3-step flow under `/upscale`. Prefer `sprite_request_id` from a completed
sprite generation. Alternatively `video_url` + `action_id` (any catalog action
with `supports_upscale: true`, which is all V4+ actions).
Optional `detail_balance` (0–1): 0 is sharper, 1 is steadier motion.
1 credit on completion. Result: `generation_url`, `sprite_sheet_url`.

## Choosing action_id and view_type — IMPORTANT

Never guess an `action_id`. Always fetch the live catalog first
(`list_actions` tool or `GET /actions/catalog`) and pick an `action_id` whose
`view_type` matches what the user wants. For `isometric`, also pick a
`direction`. Use `supports_upscale` to know whether `/upscale` will accept
that action. See `references/workflow.md` for the decision steps and
`references/api.md` for full request/response examples.

## Ready-to-run helper

`scripts/generate_sprite.py` runs the entire REST flow (submit → poll →
result) from the command line. Requires `pip install requests` and the
`GODMODEAI_API_TOKEN` environment variable:

```bash
export GODMODEAI_API_TOKEN=gmd_...
python scripts/generate_sprite.py --image-url https://example.com/hero.png \
  --action-id run --view-type side-scrolling
```

## Errors

- `401` — missing/invalid token.
- `429` — rate limit exceeded (per token per minute; depends on tier).
- `400` — validation (bad `action_id`/`view_type`, missing fields).
- A submit can succeed (`202`) but later poll as `FAILED` with
  `error_message` (e.g. `Insufficient credits`).
