Skip to main content

Generations API

Endpoints for creating, retrieving, and managing AI-generated designs.

Overview

Generations are the core output of the Studio—each represents an AI-created design that can be saved, shared, or sent to production.

Endpoints

List Generations

GET
/api/generations
Retrieve all generations for the current user.
Query Parameters
ParamTypeDescription
project_iduuidFilter by project
thread_iduuidFilter by chat thread
limitnumberMax results (default: 50)
offsetnumberPagination offset
Response
{
  "generations": [
    {
      "id": "uuid",
      "prompt": "vintage surf shop logo",
      "image_url": "https://...",
      "provider": "fal",
      "model": "nano-banana-pro",
      "status": "completed",
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "total": 42
}

Get Generation

GET
/api/generations/[id]
Retrieve a single generation by ID.
Response
{
  "id": "uuid",
  "user_id": "uuid",
  "project_id": "uuid",
  "thread_id": "uuid",
  "prompt": "vintage surf shop logo with palm trees",
  "image_url": "https://cdn.garmint.app/...",
  "provider": "fal",
  "model": "nano-banana-pro",
  "status": "completed",
  "metadata": {
    "garment_id": "...",
    "placement": "center-chest",
    "size": "medium"
  },
  "created_at": "2024-01-15T10:30:00Z"
}

Delete Generation

DELETE
/api/generations/[id]
Delete a generation and its associated assets.
Response
{
  "success": true,
  "deleted_at": "2024-01-15T12:00:00Z"
}

Generation Status

StatusDescription
pendingGeneration queued, awaiting AI processing
processingAI is actively generating
completedSuccessfully generated
failedGeneration failed (check error)

Token Cost

Each generation consumes tokens based on the model used:
ModelCost
nano-banana1 token
nano-banana-pro2 tokens
Token balance is checked before generation and debited on completion.