remagicaDocs home
API referenceSprites

Draw a take

POST
/sprites/characters/{characterId}/takes

Needs a key withsprites:write

Makes one take of an action in a direction: a short video clip that starts on the master, with every frame kept, cut out and fitted to the master's height and baseline, and its best loop (or the whole clip, for a one-shot) selected as the take's frames (takes.clipInspector shows them all). With source: sheet or an image model, one sheet of its frames instead. It's queued, then generating, then a draft with its frames (or failed, refunded). The character needs a master. 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

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

An image model for sheet takes (google/nano-banana-pro, openai/gpt-image-2, google/nano-banana-2.1) or a video model for clip takes (kling/v4, bytedance/seedance-2.5, xai/grok-imagine-video-1.5), or its capability model id (sprite_take/…, sprite_clip_take/…). Takes of the other kind, and all when left out, use the game's (else Nano Banana Pro and the plan's video model).

Length1 <= length <= 200
actionId*string
Length1 <= length <= 128
change?string

What to change from the action's words, for this take only (a regeneration's "slower swing, arms wider"). The action keeps its own words.

Lengthlength <= 500
direction*string

A direction the game's camera draws. Left-facing ones (W, NW, SW) are mirrored at export, never drawn.

Value in"E""W""N""S""NE""NW""SE""SW"
outfitId?|

Left out or null: the base outfit.

seconds?integer

A clip's length, within the model's durations. Left out: the action's, its preset's, or the model's default.

Range1 <= value <= 30
source?string

clip: the master animated as a short video, every frame kept. sheet: every frame drawn in one image. Left out: a clip, unless model is an image model.

Value in"sheet""clip"

Response Body

Accepted: the take is held and queued.

application/json
  1. response

Takes 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*|

The request's hold; null when there was nothing to draw.

takes*array<>
Example Request
curl -X POST 'https://api.remagica.com/api/v1/sprites/characters/8a1d5e3f-2b4c-4d6e-9f07-1a2b3c4d5e6f/takes' \  -H 'Content-Type: application/json' \  -d '{  "actionId": "c4f7ff02-5b3d-4f60-8e2a-1d9c6b4f7e05",  "direction": "E"}'
Example Response
{  "credits": 12,  "model": "google/nano-banana-pro",  "priceVersion": 3,  "requestId": "2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05",  "takes": [    {      "actionId": "c4f7ff02-5b3d-4f60-8e2a-1d9c6b4f7e05",      "direction": "E",      "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",      "model": "google/nano-banana-pro",      "outfitId": "f54469b9-5b3d-4f60-8e2a-1d9c6b4f7e05",      "source": "sheet"    }  ]}