API referenceMedia

Find the named parts of a picture

Per named part: a mask PNG (alpha), box [x,y,w,h], polygon, SVG path, centroid and quad.

SPENDS CREDITS (generation type image-segment); dry_run quotes. Waits up to ~50s; a slower call returns 202 with status: "generating" — poll GET /generations/{id}, whose result carries the same output. A failed job refunds its credits.

POST
/media/segment

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/segment" \  -H "Content-Type: application/json" \  -d '{    "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9"  }'
{
  "data": {
    "tool": "segment",
    "dry_run": true,
    "credits": 0,
    "available": 0,
    "generation_id": "a3c889df-e7ae-4ae9-9838-8884129ade5e",
    "credits_used": 0,
    "source_url": "string",
    "status": "completed",
    "error": "string",
    "result": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "data": {
    "tool": "segment",
    "dry_run": true,
    "credits": 0,
    "available": 0,
    "generation_id": "a3c889df-e7ae-4ae9-9838-8884129ade5e",
    "credits_used": 0,
    "source_url": "string",
    "status": "completed",
    "error": "string",
    "result": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "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"
  }
}