remagicaDocs home
API referenceSprites

Add in-betweens

POST
/sprites/frames/tween

Needs a key withsprites:write

Draws 1 to 3 in-betweens between the frames at afterIndex and afterIndex + 1, from both frames and the master. They're inserted after the first (flagged isTween), and the later frames, the action's frame count, loop points, storyboard keys, cancel window and beats move along. Holds credits for every frame at its worst and settles at what ran; an approved take goes back to review. Follow it on the live feed (GET /sprites/events, topic take, by take id), then read the take.

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.

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
afterIndex*integer

The frame they go after (0-based); they lead to the frame after it.

Range0 <= value
count*integer

In-betweens to draw, 1 to 3.

Range1 <= value <= 3
model?string

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

Length1 <= length <= 200
takeId*string
Length1 <= length <= 128

Response Body

Accepted: the in-betweens are held and started.

application/json
  1. response

A frame edit, held and started.

credits*integer

What the request sets aside: every frame at its worst.

model*string

The capability model it runs.

priceVersion*integer|null
requestId*string

The request: its credit hold's subject.

Length1 <= length <= 128
takeId*string

The take it changes: follow it on the live feed (GET /sprites/events, topic take).

Length1 <= length <= 128
Example Request
curl -X POST 'https://api.remagica.com/api/v1/sprites/frames/tween' \  -H 'Content-Type: application/json' \  -d '{  "afterIndex": 1,  "count": 1,  "takeId": "6b7c8d9e-0f1a-4b2c-9d3e-4f5a6b7c8d9e"}'
Example Response
{  "credits": 12,  "model": "google/nano-banana-pro",  "priceVersion": 3,  "requestId": "2163759e-5b3d-4f60-8e2a-1d9c6b4f7e05",  "takeId": "2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05"}