remagicaDocs home
API referenceSprites

Draw an outfit

POST
/sprites/characters/{characterId}/outfits/generate

Needs a key withsprites:write

Draws an outfit as an edit of the character's master: only the clothing and gear prompt names change, and the pose, size and framing stay the master's (the master and the pose guide are its references). Send prompt (and a name) for a new outfit, or outfitId to draw one again. The outfit goes queued, generating, then ready with its master and its fit check (height, baseline, width and position against the master, each within 1 px or a warning), or failed. Holds credits for the worst case and settles at what ran. Follow it with GET /sprites/events (topic outfit), then read GET /sprites/characters/{characterId}/outfits.

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
model?string

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

Length1 <= length <= 200
name?string

A new outfit's name; made from the first words of its prompt when left out.

Length1 <= length <= 120
outfitId?string

Draw this outfit again (not the base outfit or a colour skin). Left out: a new outfit is made.

Length1 <= length <= 128
prompt?string

What the outfit changes: the clothing and gear to draw. Needed for a new outfit; an outfit drawn again keeps its own without it.

Lengthlength <= 4000

Response Body

Accepted: the outfit is held and queued.

application/json
  1. response

An outfit held and started.

credits*integer

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

model*string

The capability model it runs.

outfitId*string

The outfit, queued: the live feed (GET /sprites/events, topic outfit) names it as it's drawn.

Length1 <= length <= 128
priceVersion*integer|null
requestId*string

The request: its credit hold.

Length1 <= length <= 128
Example Request
curl -X POST 'https://api.remagica.com/api/v1/sprites/characters/8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f/outfits/generate' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "credits": 12,  "model": "google/nano-banana-pro",  "outfitId": "f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05",  "priceVersion": 3,  "requestId": "2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05"}