Skip to content
MCPBytes
DocsCreate an image

Tool reference · Images

Create an image

One request returns a finished PNG, with a real transparent background when you ask for it.

MCP tool
create_image
MCP endpoint
/mcp/image
REST
POST /v1/tools/create_image/jobs
Price
20 credits per job

Overview

Send a prompt and get back a PNG plus a small provenance file that records exactly how it was made. Ask for transparency and the alpha channel is generated with the image, not cut out afterwards.

Input
A prompt of up to 4,000 characters; no file
Outputs
image.png and generation.json
Sizes
1:1 1024 × 1024 · 4:3 1152 × 864 · 3:4 864 × 1152
Transparency
Optional RGBA output generated with alpha, not segmented afterwards
Duration
Asynchronous; one-hour deadline including queueing and execution

Quickstart

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

Start a jobgenerate.sh
# idempotency_key is required: repeating the same request returns the same job
curl https://api.mcpbytes.com/v1/tools/create_image/jobs \
  -H "Authorization: Bearer $MCPBYTES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "options": {
      "prompt": "a ceramic teapot with a blue glaze",
      "transparent_background": true,
      "seed": 42
    },
    "idempotency_key": "image-example-001"
  }'
Response202 Accepted · trimmed
{
  "tool": "create_image",
  "status": "queued",
  "input_kind": "parameters",
  "options": {
    "prompt": "a ceramic teapot with a blue glaze",
    "preset": "standard",
    "aspect_ratio": "1:1",
    "transparent_background": true,
    "seed": 42
  },
  "workflow": {
    "stage": "Generating visuals",
    "deadline": "2026-09-22T04:54:31.021Z",
    "cancel_pending": false,
    "refund_pending": false
  },
  "capabilities": {
    "can_cancel": true
  },
  "result": null
}
Get the resultread.sh
# JOB_ID is the id from the create response; poll until status is final
curl "https://api.mcpbytes.com/v1/jobs/$JOB_ID" \
  -H "Authorization: Bearer $MCPBYTES_API_KEY"

# Once status is succeeded, download the image from result.files[].url
curl -fsSLo image.png "$IMAGE_URL"
Response200 OK · trimmed
{
  "tool": "create_image",
  "status": "succeeded",
  "credits_charged": 20,
  "compute_ms": 40083,
  "result": {
    "files": [
      {
        "name": "image.png",
        "bytes": 1110043,
        "content_type": "image/png",
        "url": "https://api.mcpbytes.com/blob/dl/…"
      },
      {
        "name": "generation.json",
        "bytes": 1329,
        "content_type": "application/json",
        "url": "https://api.mcpbytes.com/blob/dl/…"
      }
    ]
  }
}

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

No file. Send the options in a JSON body, {"options": {…}}, or as arguments of the MCP tool. Keep private text such as prompts out of URLs.

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
prompt
text, up to 4000 charactersWhat to draw. Required.
preset
standard · reference_3dreference_3d frames one isolated object from a three-quarter view with neutral lighting, for reconstruction. Default standard.
aspect_ratio
1:1 · 4:3 · 3:4The output size: 1024 × 1024, 1152 × 864 or 864 × 1152. Default 1:1.
transparent_background
true · falsetrue keeps the alpha channel and asks the model for a transparent background. Default false.
seed
integer 0 – 4294967295Reproducible sampling seed within the same profile version. Random when omitted.

Outputs

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

Output files
image.png
The image: RGBA when transparent_background is true, otherwise opaque RGB, at the size of the chosen aspect ratio.
generation.json
Provenance: your options, the image digest and model revision, the prompt template applied, seed, size, steps and timings.

Download links last up to 24 hours, capped by output retention; read the job again for fresh links. Text and fine detail in generated images are best-effort; transparent output relies on the model's own alpha channel, so a busy prompt can leave background elements attached to the object.

Tips

  • Send the prompt in the JSON body or as MCP arguments, never in a URL.
  • preset reference_3d frames one isolated object from a three-quarter view with neutral lighting. Pass its image.png to create_3d_model_from_image as job_file.
  • With transparent_background, the alpha channel is part of the generated image, so a busy prompt can leave background elements attached to the object.
  • Text and fine detail in generated images are best-effort.
  • The same seed reproduces an image within the same profile version; generation.json records the seed and settings.

MCP

Your agent calls create_image. Connect it to https://api.mcpbytes.com/mcp/image for this tool, 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_image arguments
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_image
Generate one image from a prompt and approved preset. Returns image.png and generation.json. This is an asynchronous job; use get_job to follow progress. Costs 20 credits per job. Requires idempotency_key; retain it when retrying the same request.
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_image.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 '{"prompt": "a ceramic teapot with a blue glaze",
  "transparent_background": true}' > options.json
python scripts/mcpbytes.py run create_image \
  --options-json options.json --out image/
python scripts/mcpbytes.py job j_...

Pricing

20 credits per job. The price is charged before paid processing starts, and a canceled job is refunded. A job that fails costs nothing: its charge is refunded.

Per job
20 credits

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

Limits

Limits
Jobs
20 per rolling 24 hours; 3 until your first credit purchase
Prompt
Up to 4,000 characters
At a time
1 job
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_output
The generated image failed output validation. The charge is refunded.
invalid_alpha
Transparency was requested but the generated image has no transparent alpha.
out_of_memory
The generation needed more memory than the profile allows.
timeout
The generation did not finish within its deadline. Any charge is refunded.
capacity_exhausted
Budget exhausted: HTTP 503 at creation, or a failed job if the budget ran out before charging. Try again later.
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.