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.

GET/api/v1/flows

Base URL: https://api.banatie.app

Query Parameters

Parameter
Type
Description
limitnumberResults per page (default: 20, max: 100)
offsetnumberNumber of results to skip

Example Request

Request
curl "https://api.banatie.app/api/v1/flows?limit=10" \
  -H "X-API-Key: YOUR_API_KEY"

Response

200 OK
{
  "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.

GET/api/v1/flows/:id

Base URL: https://api.banatie.app

Example Request

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.

GET/api/v1/flows/:id/generations

Base URL: https://api.banatie.app

Example Request

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.

GET/api/v1/flows/:id/images

Base URL: https://api.banatie.app

Example Request

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.

PUT/api/v1/flows/:id/aliases

Base URL: https://api.banatie.app

Request Body

Parameter
Type
Description
aliasesobjectKey-value pairs of aliases to add/update

Example Request

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.

DELETE/api/v1/flows/:id/aliases/:alias

Base URL: https://api.banatie.app

Example Request

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.

POST/api/v1/flows/:id/regenerate

Base URL: https://api.banatie.app

Example Request

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.

DELETE/api/v1/flows/:id

Base URL: https://api.banatie.app

Example Request

Request
curl -X DELETE https://api.banatie.app/api/v1/flows/770e8400-e29b-41d4-a716-446655440002 \
  -H "X-API-Key: YOUR_API_KEY"
Deleting a flow removes all generations and images in it. Images with project aliases are preserved (unlinked from the flow).

Next Steps