Flows API
Manage generation chains and flow-scoped aliases.
Overview
Flows group related generations together. They're created automatically when you chain generations using the same flowId.
Flows also support flow-scoped aliases — named references to images that are unique within a flow but don't conflict with project-level aliases.
List Flows
Retrieve all flows for your project with computed counts.
/api/v1/flowsBase URL: https://api.banatie.app
Query Parameters
Parameter | Type | Description |
|---|---|---|
limit | number | Results per page (default: 20, max: 100) |
offset | number | Number of results to skip |
Example Request
curl "https://api.banatie.app/api/v1/flows?limit=10" \
-H "X-API-Key: YOUR_API_KEY"Response
{
"success": true,
"data": [
{
"id": "770e8400-e29b-41d4-a716-446655440002",
"aliases": {"@hero": "img-uuid-1", "@background": "img-uuid-2"},
"generationCount": 5,
"imageCount": 5,
"createdAt": "2025-01-15T10:00:00Z",
"updatedAt": "2025-01-15T10:30:00Z"
}
],
"pagination": {
"total": 1,
"limit": 10,
"offset": 0,
"hasMore": false
}
}Get Flow
Retrieve a single flow with detailed statistics.
/api/v1/flows/:idBase URL: https://api.banatie.app
Example Request
curl https://api.banatie.app/api/v1/flows/770e8400-e29b-41d4-a716-446655440002 \
-H "X-API-Key: YOUR_API_KEY"List Flow Generations
Retrieve all generations in a specific flow.
/api/v1/flows/:id/generationsBase URL: https://api.banatie.app
Example Request
curl "https://api.banatie.app/api/v1/flows/770e8400-e29b-41d4-a716-446655440002/generations?limit=20" \
-H "X-API-Key: YOUR_API_KEY"List Flow Images
Retrieve all images (generated and uploaded) in a flow.
/api/v1/flows/:id/imagesBase URL: https://api.banatie.app
Example Request
curl "https://api.banatie.app/api/v1/flows/770e8400-e29b-41d4-a716-446655440002/images" \
-H "X-API-Key: YOUR_API_KEY"Update Flow Aliases
Add or update flow-scoped aliases. Aliases are merged with existing ones.
/api/v1/flows/:id/aliasesBase URL: https://api.banatie.app
Request Body
Parameter | Type | Description |
|---|---|---|
aliases | object | Key-value pairs of aliases to add/update |
Example Request
curl -X PUT https://api.banatie.app/api/v1/flows/770e8400-e29b-41d4-a716-446655440002/aliases \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"aliases": {
"@hero": "image-id-123",
"@background": "image-id-456"
}
}'Remove Flow Alias
Remove a specific alias from a flow.
/api/v1/flows/:id/aliases/:aliasBase URL: https://api.banatie.app
Example Request
curl -X DELETE https://api.banatie.app/api/v1/flows/770e8400-e29b-41d4-a716-446655440002/aliases/@hero \
-H "X-API-Key: YOUR_API_KEY"Regenerate Flow
Regenerate the most recent generation in the flow.
/api/v1/flows/:id/regenerateBase URL: https://api.banatie.app
Example Request
curl -X POST https://api.banatie.app/api/v1/flows/770e8400-e29b-41d4-a716-446655440002/regenerate \
-H "X-API-Key: YOUR_API_KEY"Delete Flow
Delete a flow with cascade deletion. Images with project aliases are preserved.
/api/v1/flows/:idBase URL: https://api.banatie.app
Example Request
curl -X DELETE https://api.banatie.app/api/v1/flows/770e8400-e29b-41d4-a716-446655440002 \
-H "X-API-Key: YOUR_API_KEY"