remagicaDocs home
API referenceSprites

Draw master candidates

POST
/sprites/characters/{characterId}/masters

Needs a key withsprites:write

Draws candidates (four by default) of a character's master: full body, a neutral ready pose, on a clean ground, fitted to its size class with its feet on the baseline and validated (one that fails is drawn again, up to twice). Holds credits for the worst case and settles at what ran. Follow it with GET /sprites/events (sprites.watch), then read the rows. Pick one with POST /sprites/characters/{characterId}/masters/pick.

Requires scope sprites:write.

Authorization

apiKey
headerx-api-key<token>

An API key of your workspace (rmg_…), created in the web app. It acts for that workspace, not for a person, and keeps working when its creator leaves.

Path Parameters

characterId*string
Length1 <= length <= 128

Header Parameters

Idempotency-Key?string

Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is 409 CONFLICT. A request that fails frees its key.

Length1 <= length <= 255

Request Body

application/json
  1. body
aspectRatio?string

The shape it's drawn at, 1:1 by default. The figure is then fitted to the game's square canvas, so this only changes how the model frames it.

Value in"1:1""3:4""4:3""9:16""16:9"
greenScreen?boolean

true: drawn on a flat key colour (magenta, or green for a pink or purple character) and keyed out for free. false: drawn with the model's own transparent background where it has one; a model without one stays on the key colour. Left out: what the model does best.

quality?string

Rendering quality, for a model whose qualities list it (GPT Image); left out: its defaultQuality. Ignored by a model with none.

Value in"auto""low""medium""high""xhigh""max"
resolution?string

1K by default, or the model's lowest when it has no 1K.

Value in"1K""2K""4K"
seed?integer

A fixed seed, for a model with seed (Nano Banana): the first candidate draws with it, each next one with one more, so the same prompt and seed draw the same images again. Left out: a random one. Ignored by a model that takes none.

Range0 <= value <= 2147483647
count?integer

Candidates to draw, 1 to 4; four by default.

Range1 <= value <= 4
description*string

What the character is, in your words.

Length1 <= length <= 4000
keyColour?string

The flat colour it's drawn on to be keyed out, when it's drawn on one. Left out: magenta, or green for a pink or purple character.

Value in"magenta""green"
model?string

A base image model (google/nano-banana-pro, google/nano-banana-2.1, bytedance/seedream-5-lite, openai/gpt-image-2, openai/gpt-image-2.5-sunburst, openai/gpt-image-2.5-flare) or its capability model id. Left out: the game's.

Length1 <= length <= 200
referenceKeys?array<>

Your own references, by storage key, in order.

Itemsitems <= 8
sourceImageKey?string

The image the character is made from (From an image).

Length1 <= length <= 1024

Response Body

Accepted: the request is held and started.

application/json
  1. response

A master or views request, held and started.

credits*integer

What the request sets aside, in credits: its worst case.

model*string

The capability model it runs.

priceVersion*|

The price revision it's priced at.

requestId*string

The request: the live feed (GET /sprites/events, topic master) names it and each of its candidates (<requestId>-<n>).

Length1 <= length <= 128
Example Request
curl -X POST 'https://api.remagica.com/api/v1/sprites/characters/8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f/masters' \  -H 'Content-Type: application/json' \  -d '{  "description": "A stalwart knight in steel plate with a crimson plume"}'
Example Response
{  "credits": 12,  "model": "google/nano-banana-pro",  "priceVersion": 3,  "requestId": "2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05"}