API referenceMedia

Generate or edit a picture

Make ONE standalone image — text-to-image, or an edit of the given reference image(s) — into the project media library.

SPENDS CREDITS (generation type image-chat). Not a scene element: use the returned url as a scene background, as a reference_image_url, or as the input of another edit. Waits up to ~50s by default; a slower image returns 202 with status: "generating" — poll GET /generations/{id}. A failed job refunds its credits.

POST
/media/generate

Authorization

bearerAuth
AuthorizationBearer <token>

Typecut API key. Generate one in app.typecut.ai → Settings → API keys. Send as Authorization: Bearer tc_live_….

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/media/generate" \  -H "Content-Type: application/json" \  -d '{    "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9"  }'
{
  "data": {
    "generation_id": "a3c889df-e7ae-4ae9-9838-8884129ade5e",
    "count": 0,
    "credits_used": 0,
    "width": 0,
    "height": 0,
    "status": "completed",
    "error": "string",
    "image": {
      "asset_id": "b4695157-0d1d-4da0-8f9e-5c53149389e4",
      "url": "string",
      "width": 0,
      "height": 0,
      "description": "string"
    },
    "images": [
      {
        "index": 0,
        "prompt": "string",
        "asset_id": "string",
        "url": "string",
        "width": 0,
        "height": 0,
        "seed": 0
      }
    ],
    "failed": [
      {
        "index": 0,
        "prompt": "string",
        "error": "string"
      }
    ]
  }
}
{
  "data": {
    "generation_id": "a3c889df-e7ae-4ae9-9838-8884129ade5e",
    "count": 0,
    "credits_used": 0,
    "width": 0,
    "height": 0,
    "status": "completed",
    "error": "string",
    "image": {
      "asset_id": "b4695157-0d1d-4da0-8f9e-5c53149389e4",
      "url": "string",
      "width": 0,
      "height": 0,
      "description": "string"
    },
    "images": [
      {
        "index": 0,
        "prompt": "string",
        "asset_id": "string",
        "url": "string",
        "width": 0,
        "height": 0,
        "seed": 0
      }
    ],
    "failed": [
      {
        "index": 0,
        "prompt": "string",
        "error": "string"
      }
    ]
  }
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string"
  }
}