GameTorch exposes a RESTful interface so you can programmatically create and manage animations. You will first need an API key โ sign in to GameTorch, visit /account and click "Create New API Key". Send the key on each request using either the Authorization: Bearer <API_KEY>
header or X-Api-Key: <API_KEY>
.
Prefer using the official GameTorch CLI (under construction) for simpler scripting and downloads: https://github.com/gametorch/gametorch.
POST /api/animation
โ start a new animation job.{
"animation_id": 123
}
POST /api/animation/regenerate/<animation_id>
โ regenerate an animation with the same parameters as an existing one.{
"animation_id": 456
}
GET /api/animations
โ list your animations.[\n {\n \"id\": 1,\n \"status\": 1\n }\n]
(array)GET /api/animation_results/<animation_id>
โ list results for a single animation.[\n {\n \"id\": 456,\n \"fps\": 12,\n \"status\": 1\n }\n]
(array)POST /api/animation_result
โ request rendering (slow/fast) of a result.{
"animation_result_id": 789,
"duration_seconds": 5
}
GET /api/queue_position/<animation_result_id>
โ check processing queue position.{
"processing": false,
"position": 4
}
or {
"processing": true
}
GET /api/animation_result_zip/<animation_result_id>
โ download frames as a .zip file.DELETE /api/animation_result/<animation_result_id>
โ delete a result.{ "status": "ok" }
DELETE /api/animation/<animation_id>
โ delete the entire animation (fails if results exist).{ "status": "ok" }
or {
"status": "error",
"has_results": true
}
POST /api/animation_result_crop
โ create a cropped clip from a result.{ "animation_result_crop_id": 123 }
GET /api/animation_result_crops/<animation_result_id>
โ list crops of a result.[
{
"id": 1,
"start_frame": 1,
"end_frame": 24,
"fps": 12,
"crop_x": 0,
"crop_y": 0,
"crop_width": 512,
"crop_height": 512,
"label": "Hero"
}
]
(array)GET /api/animation_result_crop/<crop_id>
โ download a crop as a .zip.DELETE /api/animation_result_crop/<crop_id>
โ delete a crop.{ "status": "ok" }
curl -X POST https://gametorch.app/api/animation \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"animation_model_id": 1,
"prompt": "walking to the right",
"duration_seconds": 5,
"input_image_base64": ""
}'
curl -X POST https://gametorch.app/api/animation/regenerate/123 \
-H "Authorization: Bearer $API_KEY"
curl -H "Authorization: Bearer $API_KEY" \
"https://gametorch.app/api/animations?offset=0&limit=50"
curl -H "Authorization: Bearer $API_KEY" \
https://gametorch.app/api/animation_results/123
curl -X POST https://gametorch.app/api/animation_result \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"animation_id": 123,
"fps": 12,
"go_fast": true
}'
curl -H "Authorization: Bearer $API_KEY" \
https://gametorch.app/api/queue_position/456
curl -H "Authorization: Bearer $API_KEY" -o anim.zip \
https://gametorch.app/api/animation_result_zip/456
curl -X POST https://gametorch.app/api/animation_result_crop \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"animation_result_id": 456,
"start_frame": 1,
"end_frame": 24,
"fps": 12,
"crop_x": 0,
"crop_y": 0,
"crop_width": 512,
"crop_height": 512,
"label": "Hero entrance"
}'
curl -H "Authorization: Bearer $API_KEY" -o crop.zip \
https://gametorch.app/api/animation_result_crop/789