remagicaDocs home
API referenceSprites

Bring an edit back to Sprites

POST
/sprites/characters/{characterId}/masters/returns

Needs a key withsprites:write

Brings an edit of one of a character's images back to Sprites: once the edit's generation ends, its image is cut out as a master is (keyed for free, or through background removal, which the request holds credits for and settles at what ran) and kept as a new candidate of the character. Asking again for the same edit is the same request. Follow it with GET /sprites/events (sprites.watch), then read the rows.

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

Request Body

application/json
  1. body
generationId*string

The generation that edited one of the character's images (in the Image tool, or POST /generations/...). It can still be running.

Length1 <= length <= 128

Response Body

Accepted: the edit comes back when it ends.

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/returns' \  -H 'Content-Type: application/json' \  -d '{  "generationId": "241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05"}'
Example Response
{  "credits": 12,  "model": "google/nano-banana-pro",  "priceVersion": 3,  "requestId": "2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05"}