Skip to content
MCPBytes
DocsCreate a pixel sprite

Tool reference · Images

Create a pixel sprite

Generate character sprite sheets, fixed-size frames and four-direction walking previews from a description and optional reference.

MCP tool
create_pixel_sprite
MCP endpoint
/mcp/image
REST
POST /v1/tools/create_pixel_sprite/jobs
Price
From 20 credits

Overview

Each candidate returns a 128 × 128 sprite sheet containing sixteen 32 × 32 cells. Rows contain down, left, right and up walking poses. The fourth cell in each row is an extra still pose. ZIP exports include the individual frames, GIF previews, shared palette, fixed pivots and review metadata.

Input
A description; optional PNG or JPEG reference
Sprite sheet
128 × 128 pixels, arranged in a 4 × 4 grid
Frames
Sixteen fixed 32 × 32 PNG frames
Walking
Down, left, right and up; three generated poses per direction
Export
PNG sheets, JSON metadata and ZIPs with frames and GIF previews

Quickstart

Send the options as JSON. A reference file is optional. The response is the new job; poll it until its status is final, then download the files in result.files.

Start a jobcreate-sprite.sh
curl https://api.mcpbytes.com/v1/tools/create_pixel_sprite/jobs \
  -H "Authorization: Bearer $MCPBYTES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "options": {"description": "A forest ranger with a green hood and a brown satchel", "seed": 42},
    "idempotency_key": "pixel-sprite-example-002"
  }'
Response202 Accepted · trimmed
{
  "tool": "create_pixel_sprite",
  "status": "queued",
  "input_kind": "parameters",
  "result": null
}
Get the resultread-sprite.sh
# JOB_ID is the id from the create response
curl "https://api.mcpbytes.com/v1/jobs/$JOB_ID" \
  -H "Authorization: Bearer $MCPBYTES_API_KEY"
Response200 OK · trimmed
{
  "tool": "create_pixel_sprite",
  "status": "succeeded",
  "result": {
    "variants": 1,
    "qa_status": "needs_review",
    "files": [
      {
        "name": "raw_1.png"
      },
      {
        "name": "sprite_1.png"
      },
      {
        "name": "sprite_1.json"
      },
      {
        "name": "sprite_1.zip"
      },
      {
        "name": "generation.json"
      }
    ]
  }
}

Jobs of this tool take minutes. While one runs, workflow.stage says what is happening and workflow.deadline when it must finish. Cancel it with POST /v1/jobs/{id}/cancel while capabilities.can_cancel is true.

More on statuses, downloads and retention in Jobs & files.

Input

You may omit the file, or add one reference in one of these ways. The formats it accepts are listed in the overview.

Input sources
upload_id
Create an upload URL (POST /v1/uploads, or create_upload over MCP), PUT the file to it, then pass the upload_id. Upload URLs expire after an hour.
job_file
{job_id, name}: an output of one of your own completed jobs that has not expired. It is copied into the new job, with no download in between.
Upload URL
# 1. Create an upload URL (valid for one hour)
curl https://api.mcpbytes.com/v1/uploads \
  -H "Authorization: Bearer $MCPBYTES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filename": "reference.png"}'

# 2. PUT the file to the "url" from the response
curl -X PUT --data-binary @reference.png "$UPLOAD_URL"

# 3. Start the job with the "upload_id"
curl https://api.mcpbytes.com/v1/tools/create_pixel_sprite/jobs \
  -H "Authorization: Bearer $MCPBYTES_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"upload_id\": \"$UPLOAD_ID\",
    \"options\": {
      \"description\": \"A forest ranger with a green hood and a brown satchel\",
      \"seed\": 42,
      \"variants\": 2
    },
    \"idempotency_key\": \"create_pixel_sprite-upload-001\"
  }"
idempotency_key is required. Repeating a request with the same key returns the original job instead of starting and charging a new one; reusing a key for a different request returns 409 idempotency_conflict.

Options

Put options in the options object of the JSON body, or pass them as arguments of the MCP tool. Leave an option out to use its default.

Options
description
text, 1–4000 charactersRequired. Describe one character. Use only reference images you are authorized to use.
variants
1–4Number of alternative candidate sheets from the same request. Default 1. Every candidate has the same resolution and exports; the selected price covers all candidates.
transparent
true · falseAttempt to remove the background. Default true; inspect QA and alpha rather than assuming every render can be masked cleanly.
palette_colors
16 · 32 · 64Shared palette size. Default 32. A supplied palette takes precedence.
palette
2–64 comma-separated #RRGGBB colorsOptional. One palette for the whole character; no spaces between colors.
frame_duration_ms
40–1000, in multiples of 10Duration of each walk-preview frame. Default 120; this changes playback speed, not the number of generated poses.
seed
integer 0–4294967295Optional. A random seed is selected when omitted; individual candidate seeds are recorded.

Outputs

A succeeded job lists its files in result.files, each with a download url.

Output files
raw_N.png
The original 512 × 512 image for candidate N.
sprite_N.png
The 128 × 128 sheet, with a shared palette and attempted transparency when requested.
sprite_N.json
Frame rectangles, pivots, animation sequences, palette and QA checks.
sprite_N.zip
Raw image, sheet, sixteen frame PNGs, four walk GIFs, manifest.json, qa.json and provenance.json.
generation.json
The job's effective public settings and version identifiers.

N runs from 1 to variants. Files are published together after the entire job succeeds; a failed or canceled job exposes no partial candidates. Re-read the job for fresh links before its output retention expires.

Result summary

Next to files, the job's result has a summary you can check without downloading anything:

result
variants
Number of candidate sheets.
qa_status
unreviewed or needs_review; never automatic artistic approval.
notes
Review guidance for the generated character.

Tips

  • Variants control the number of candidate sheets, not their quality or resolution. The two example sheets on the tool page came from one request with variants set to 2. Each candidate includes its own frames, previews and ZIP.
  • Start with one character and a clear description. The tool is designed for small character sheets, not arbitrary scenery, seamless tiles or arbitrary animation actions.
  • A walk preview plays three generated poses as [0, 1, 2, 1]. Faster playback does not generate additional poses.
  • The extra still poses are arms raised, jump left, jump right and lying down. They are not complete jump or death animations.
  • Read sprite_N.json and inspect anatomy, clipping, direction, consistency and transparency. A succeeded job is not artist-approved; qa_status remains unreviewed or needs_review.
  • Review transparency and edge colors before use. Background removal can fail on an unsuitable render; the raw image is always included for comparison.
  • The seed is recorded, but exact reproduction depends on the same tested tool version and runtime. Reusing an idempotency key retrieves the original job instead of generating again.

MCP

Your agent calls create_pixel_sprite. Connect it to https://api.mcpbytes.com/mcp/image for this tool and the rest of its family (Create an image), or to https://api.mcpbytes.com/mcp for every tool.

Claude Code

The first form signs in through the browser when you run /mcp. In .mcp.json (project root), ${MCPBYTES_API_KEY} is read from the environment when Claude Code connects. Claude Code docs

claude mcp add --transport http mcpbytes \
  https://api.mcpbytes.com/mcp/image
Codex (CLI, IDE extension, ChatGPT desktop)

Codex reads the key from the environment variable each time it connects. The same table can go in ~/.codex/config.toml by hand; codex mcp add has no --header flag. Codex docs

codex mcp add mcpbytes --url https://api.mcpbytes.com/mcp/image \
  --bearer-token-env-var MCPBYTES_API_KEY
Cursor

~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project). Remote servers take no "type". Without the header, the client signs you in with GitHub or an email link (OAuth). Cursor docs

~/.cursor/mcp.json
{
  "mcpServers": {
    "mcpbytes": {
      "url": "https://api.mcpbytes.com/mcp/image",
      "headers": {
        "Authorization": "Bearer ${env:MCPBYTES_API_KEY}"
      }
    }
  }
}
11 more clients in the docs →

Arguments

The tool's options are flat arguments. Besides them:

create_pixel_sprite arguments
upload_id
From create_upload, after the agent has PUT the file.
url, filename
A public https URL, and the file name when the URL does not end in the extension.
job_file
{job_id, name}: an owned output of an earlier job.
wait_seconds
0–45, default 0How long the call waits for the result. If the job is still running, the agent calls get_job.
idempotency_key
RequiredReuse it with the same arguments when retrying after a network error.

What the agent sees

MCP tools
create_pixel_sprite
Generate 1–4 character sprite sheets from a description and an optional uploaded reference. Each 128×128 PNG contains sixteen 32×32 cells: three walk poses per direction and four extra still poses. ZIP exports contain fixed-size frames, looping previews, QA and animation metadata. Outputs require visual review; previews reuse three poses, not four distinct frames. No arbitrary actions or eight-direction animation. Follow the asynchronous job with get_job. variants: 1: 20 credits. variants: 2: 40 credits. variants: 3: 60 credits. variants: 4: 80 credits. Requires idempotency_key; retain it when retrying the same request.
create_upload
Returns a one-hour URL to PUT a local file to; then call the tool with the upload_id.
get_job
Status and results of a job; waits up to wait_seconds for it to finish.
cancel_job
Cancel a queued job or a workflow whose can_cancel is true; repeated calls never delete results.
list_jobs
Your most recent jobs, newest first.
read_job_file
Reads a text output (.txt .json .md .csv) of a succeeded job in chunks.

Setup for every client, and how agents upload files and read results: Connect over MCP.

Agent skill

The MCPBytes skill teaches agents this tool, in references/create_pixel_sprite.md. Agents without MCP run it through the REST API with the skill's script, which reads your key from MCPBYTES_API_KEY:

mcpbytes.py
printf '{"description":"A forest ranger with a green hood and a brown satchel","seed":42}' > sprite-options.json
python scripts/mcpbytes.py run create_pixel_sprite \
  --options-json sprite-options.json \
  --idempotency-key pixel-sprite-example-002 --out sprites/

Pricing

From 20 credits. The selected option's price is charged before paid processing starts, and a canceled job is refunded. A variant is one complete candidate sheet. Choose 1, 2, 3 or 4 variants to get that many different takes on the same request. Every candidate has the same 128 × 128 size, sixteen frames and four walking previews; the price increases with the number of candidates. A failed job is refunded.

1 variant
20 credits
2 variants
40 credits
3 variants
60 credits
4 variants
80 credits

One credit balance pays for every tool, and a new account starts with free credits. See Credits & prices or buy credits.

Limits

Limits
Description
Up to 4,000 characters
Candidates
1–4 sheets per request
Reference
PNG or JPEG, up to 20 MB and within your account's upload limit
At a time
1 job
Uploads
Up to 50 MB
Results
24 hours by default

GET /v1/me returns your limits and current usage; Limits & errors explains what happens when one is reached.

Errors

A failed job comes back with error.code, error.message and often error.hint. Codes are stable. Inputs that fail with a validation error will fail again unchanged.

Job errors
invalid_image
The reference could not be decoded within the supported bounds.
invalid_output
Generated output failed file or layout validation. The charge is refunded.
out_of_memory
Generation exceeded available memory. The charge is refunded.
timeout
Generation did not finish by its deadline. The charge is refunded.
unsupported_format
The tool does not take this file type.
insufficient_credits
The job costs more than the balance, which is known once the input has been measured. Nothing was charged.

Requests can also fail before a job starts, with an HTTP status: see HTTP errors.