The New Black AI

AI Fashion Clothing API

Generate AI fashion visuals from your own product with a REST API, or straight from Claude with our MCP. Every workflow of the studio, one endpoint.

GET/v1/workflows

Workflows catalogue (48)

Every studio workflow is callable by its versioned endpoint name. The route returns the live catalogue — named image parameters, fields, variants, formats and prices; the table below is rendered from the same data.

MethodWorkflow keyTitleModeStandardProMax refs
POSTvirtual_try_on-v1Virtual Try-Onimage1 cr3 cr5
POSTproduct_to_model-v1Product to Modelimage1 cr3 cr5
POSTcreate_design-v1Create a Productimage1 cr3 cr3
POSTfreeform_video-v1Create video from text or imagevideo2.2 cr/s4.4 cr/s1
POSTreimagine_scene-v1Reimagine your Modelimage1 cr3 cr1
POSTugc_video-v1UGC Videoplanvideo2.2 cr/s4.4 cr/s3
POSTedit_video-v1Edit videoplanvideo2.8 cr/s3.7 cr/s1
POSTmodel_walk-v1Model Walkplanvideo2.2 cr/s4.4 cr/s1
POSTproduct_360-v1Product 360planvideo2.2 cr/s4.4 cr/s3
POSTmodel_360-v1Model 360planvideo2.2 cr/s4.4 cr/s2
POSTswap_models-v1Swap Modelimage1 cr3 cr1
POSTface_swap-v1Face Swapimage1 cr1 cr2
POSTfabric_to_design-v1Fabric to Imageimage1 cr3 cr1
POSTimage_to_fabric-v1Image to Fabricimage1 cr3 cr1
POSTtext_to_textile-v1Text to Textileimage1 cr3 cr3
POSTimage_to_ghost_mannequin-v1Image to Ghost Mannequinimage1 cr3 cr1
POSTimage_to_flat_lay-v1Image to Flat Layimage1 cr3 cr1
POSTchange_color-v1Change a Colorimage1 cr3 cr1
POSTswap_fabrics-v1Swap Fabricsimage1 cr3 cr2
POSTlogo_placement-v1Add a Logoimage1 cr3 cr2
POSTtext_to_sketch-v1Text to Sketchimage1 cr3 cr3
POSTsketch_to_image-v1Sketch to Imageimage1 cr3 cr1
POSTimage_to_sketch-v1Image to Sketchimage1 cr3 cr1
POSTsketch_to_svg-v1Sketch to SVGimage1 cr1 cr1
POSTvectorize_image-v1Vectorize Imageimage1 cr1 cr1
POSTinsert_fabric_on_sketch-v1Insert Fabric on Sketchimage1 cr3 cr2
POSTcreate_similar_outfits-v1Create Similar Outfitsimage1 cr3 cr1
POSTcreate_design_variations-v1Create Design Variationsimage1 cr3 cr1
POSTchange_background-v1Change Backgroundimage1 cr3 cr2
POSTremove_background-v1Remove Backgroundimage0.5 cr0.5 cr1
POSTad_creative-v1Ad Creativeimage1 cr3 cr1
POSTenhance_photo_to_hd-v1Enhance Photo to HD (2K/4K)planimage1 cr3 cr1
POSTenhance_video_to_hd-v1Enhance Video to HDplanvideo2.3 cr/s2.3 cr/s3
POSTai_stylist-v1AI Stylistimage1 cr3 cr1
POSToutpaint_new_ratio-v1Extend Imageimage1 cr3 cr1
POSTretouch-v1Retouch a Zoneimage1 cr3 cr1
POSTfreeform_image-v1Create or edit imagesimage1 cr3 cr3
POSTcreate_3d_models-v1Image to 3D3d10 cr10 cr1
POSTtryon_video-v1Virtual Try-On Videoplanvideo2.2 cr/s4.4 cr/s2
POSToutfit_transition-v1Outfit Transitionplanvideo2.2 cr/s4.4 cr/s2
POSTfashion_ad-v1Fashion Adplanvideo2.2 cr/s4.4 cr/s3
POSTdetail_closeup-v1Detail Close-upplanvideo2.2 cr/s4.4 cr/s1
POSTeditorial_video-v1Editorial Lookbookplanvideo2.2 cr/s4.4 cr/s1
POSTremove_video_background-v1Remove Video Backgroundplanvideo0.71 cr/s0.71 cr/s1
POSTreframe_video-v1Reframe Videoplanvideo2.2 cr/s4.4 cr/s1
POSTchange_video_background-v1Change Video Backgroundplanvideo2.8 cr/s3.7 cr/s1
POSTchange_video_outfit-v1Edit Outfit in Videoplanvideo2.8 cr/s3.7 cr/s1
POSTswap_video_model-v1Swap Model in Videoplanvideo2.8 cr/s3.7 cr/s2

Publishing catalogue (5)

Send what you create where it sells, by API — keys with the publish scope. One documentation page per platform.

PlatformEndpointsPublishesStatus
Shopify/v1/shopify/products · /v1/shopify/publishImages & videos onto product pageslive
Instagram/v1/publish · /v1/publish/accountsImages & videos as feed posts, stories, carousels, reelslive
TikTok/v1/publish · /v1/publish/accountsVideos & photo postslive
X/v1/publish · /v1/publish/accountsImages & videos as postslive
Pinterest/v1/publish · /v1/publish/accountsImages & videos as pins, onto a boardlive
YouTube/v1/publish · /v1/publish/accountsVideos as Shortslive
GET/v1/media · /v1/projects · /v1/techpacks · /v1/moodboards · /v1/elements

Creations catalogue (8)

Read back what the account has created — keys with the read scope. Every listing accepts ?project=<id> to filter by project. PDF exports return a JSON { url } — public but unguessable, the same regime as every creation URL.

ResourceEndpointsReturnsStatus
MediaGET/v1/mediaYour images & videos — URLs, thumbnails, projectlive
ProjectsGET/v1/projectsYour projects — the filter of every listinglive
Tech packsGET/v1/techpacks · /v1/techpacks/{id}/pdfThe list, and each pack as a PDFlive
MoodboardsGET/v1/moodboards · /v1/moodboards/{id}/pdfThe list, and each board as a PDFlive
ElementsGET/v1/elementsYour starred pot — creations, presets, uploadslive
UploadPOST/v1/media/uploadmultipart `file` (JPG, PNG, WebP, 15 MB) + optional `project` → { media_id, url } — a picture of yours, hosted by us, for any image parameterlive

List, then export — two calls and a downloadable file:

curl "https://thenewblack.ai/api/v1/techpacks" \
  -H "Authorization: Bearer tnb_live_XXXXXXXXXXXX"
{
  "techpacks": [
    {
      "id": "3f1c9a6e-8b21-4f7d-9c1e-2a7b5d4e8f01",
      "name": "Short sleeves",
      "project": "b2cefb2b-3d48-48c1-9f2a-6e1c0d7a9b34",
      "cover": "https://cloud.thenewblack.ai/storage/v1/object/public/media/...",
      "updated_at": "2026-08-21T14:03:22Z"
    }
  ]
}
curl "https://thenewblack.ai/api/v1/techpacks/3f1c9a6e-8b21-4f7d-9c1e-2a7b5d4e8f01/pdf" \
  -H "Authorization: Bearer tnb_live_XXXXXXXXXXXX"
{
  "url": "https://cloud.thenewblack.ai/storage/v1/object/public/media/exports/.../8c4e21d7-....pdf",
  "name": "Short sleeves"
}
GET/v1/account · /v1/ledger · /v1/brand-dna

Account (3)

The account as its AI agent reads it, for your own program: everything in one reading, what it spent and received, and its Visual DNA profiles with the analysis the vision model wrote. read scope; nothing is debited.

ActionEndpointsReturnsStatus
Read the accountGET/v1/accountUsername, credits, team, Visual DNA profiles, projects with their counts, library counts, tech packs, Shopify product countlive
Read the ledgerGET/v1/ledger?days=30&lines=60The credit lines of the period, signed, and the usage by team memberlive
Visual DNAGET/v1/brand-dna · /v1/brand-dna/{id}The profiles; one in full with its references and its analysis textlive
curl "https://thenewblack.ai/api/v1/account" \
  -H "Authorization: Bearer tnb_live_XXXXXXXXXXXX"
{
  "id": "a1e259ae-...", "username": "maison-k", "credits": 206.5,
  "team": { "role": "leader", "members": [{ "id": "3edf...", "username": "lea" }] },
  "brand_dna": [{ "id": "7c1a...", "name": "SS27", "focus": "womenswear", "analysed": true, "references": 12 }],
  "library": { "creations": 1000, "favourites": 3, "archived": 3 },
  "projects": [{ "id": "7763...", "name": "Linen capsule", "creations": 41, "archived": 0, "last_creation": "2026-09-11T16:02:00Z" }],
  "counts": { "shopify_products": 18, "techpacks": 4 },
  "techpacks": [{ "id": "8363...", "name": "Custom Print Crew Neck T-Shirt", "pages": 2, "project": null, "template": false, "origin": "ai", "updated_at": "2026-09-10T09:14:00Z" }]
}
GET/v1/techpacks/{id} · /v1/techpacks/{id}/sections · /v1/techpacks/from-photos

Tech packs (5)

A tech pack whole — pages, sections, data — read and written back, exactly as the account's AI agent does it. The list and the PDF export live in the Creations catalogue above. Reading takes the read scope; writing takes generate, the scope that creates and changes things in the studio. Editing costs nothing; Start with AI costs 1 credit for the reading plus 1 per sketch, like the button.

ActionEndpointsReturnsStatus
Read a tech packGET/v1/techpacks/{id}The pack whole: pages in order, sections with id, kind and data (canvas summarised)live
RenamePATCH/v1/techpacks/{id}{ name }live
Add a sectionPOST/v1/techpacks/{id}/sections{ page_id, kind, at_index? } → the page’s sections after the change, with the new idlive
Write a sectionPUT/v1/techpacks/{id}/sections/{sectionId}{ data } — the whole data of the section in its kind’s shape; the canvas is not writablelive
Start with AIPOST/v1/techpacks/from-photos{ images, back?, description?, product?, size_range?, unit?, sketch?, project_id? } → the new pack’s id, up to three minuteslive

Read a section first, then write back the same keys with your changes — never drop a column or a cell the person made. Shapes by kind: header { cells: [{ key, label, value }] }; descriptions { blocks: [{ key, label, body }] }; size_chart and bom { columns: [{ key, label }], rows: [{ <columnKey>: "text" }], unit?, note? }; end_notes { block: { key, label, body } }.

curl -X PUT "https://thenewblack.ai/api/v1/techpacks/3f1c9a6e-.../sections/9a1d..." \
  -H "Authorization: Bearer tnb_live_XXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{ "data": { "columns": [{ "key": "item", "label": "Item" }, { "key": "supplier", "label": "Supplier" }],
                  "rows": [{ "item": "Linen 180 g", "supplier": "Libeco" }] } }'
{ "ok": true, "section_id": "9a1d...", "kind": "bom" }

Start with AI takes photos hosted by us — URLs from /v1/media or from a generation — front first; the model writes the header, the description and the size chart, and the BOM stays empty (a supplier is not in a photo). With sketch it draws the flat(s) on the canvas.

curl -X POST "https://thenewblack.ai/api/v1/techpacks/from-photos" \
  -H "Authorization: Bearer tnb_live_XXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{ "images": ["https://cloud.thenewblack.ai/.../front.jpg"], "size_range": "XS-XL", "unit": "cm", "sketch": "front" }'
{ "id": "6b3e...", "status": "done", "note": "Created. Read it (GET /v1/techpacks/{id}) to check the values; the BOM is empty by design." }
POST/v1/agents/{id}/messages

AI agents (10)

Talk to the account's AI agents exactly as in the app — keys with the agentsscope, Business plan and above. An agent has one thread: a message sent here appears in its chat, marked with your key's name, and the agent works with the same tools, the same permissions and the same credits as when you write to it yourself. Its permissions are set in the app and only read here. Its calendar — what it does later or again — and the account's Files are read and written through the same door.

ActionEndpointsReturnsStatus
List agentsGET/v1/agentsEach agent: name, role, status, permissions, whether it is busy or waiting for your answerlive
Send a messagePOST/v1/agents/{id}/messages202 and a task id; 409 “working” while the agent is busylive
Read the threadGET/v1/agents/{id}/messages?since=The messages, each of the agent’s with its typed results (media, post, shopify_media, techpack, file)live
StopPOST/v1/agents/{id}/stopStops the running task; what was done stayslive
CalendarGET/v1/agents/{id}/schedulesWhat the agent will do later or again: rhythm, next run, last outcomelive
SchedulePOST/v1/agents/{id}/schedules{ request, kind: single | recurring, time, date? | every?, day_of_week?, day_of_month?, may_publish? } — each run is an ordinary task, in the agent’s zonelive
CancelDELETE/v1/agents/{id}/schedules/{scheduleId}Takes the line off the calendar; nothing already done is undonelive
FilesGET/v1/files?query=&folder=The account’s Files, as the agents see them: paths, descriptions, kindslive
Read a fileGET/v1/files/{id or path}?page=&sheet=&picture=One page of a pdf, docx, xlsx, pptx, text file or picture; pdf and pictures cost a fraction of a creditlive
Describe a filePATCH/v1/files/{id or path}{ description } — the one line the index showslive

Say something, then read the thread until the agent is free. A message can carry pictures from your gallery (media_ids, from /v1/media); an Idempotency-Key header makes a retried request harmless.

curl -X POST "https://thenewblack.ai/api/v1/agents/3f1c9a6e-.../messages" \
  -H "Authorization: Bearer tnb_live_XXXXXXXXXXXX" \
  -H "Idempotency-Key: order-8812" \
  -H "Content-Type: application/json" \
  -d '{ "message": "Make three on-model visuals of this product and publish them to Instagram.", "media_ids": ["6f2a9c1b-..."] }'
{ "status": "accepted", "task_id": "0c4e...", "message_id": "9a1d...", "created_at": "2026-09-09T15:02:11Z" }

// while the agent works, the same call answers:
{ "status": "working", "task_id": "0c4e...", "since": "2026-09-09T15:02:11Z", "on": "Make three on-model visuals..." }
curl "https://thenewblack.ai/api/v1/agents/3f1c9a6e-.../messages?since=2026-09-09T15:02:11Z" \
  -H "Authorization: Bearer tnb_live_XXXXXXXXXXXX"
{
  "agent": { "id": "3f1c9a6e-...", "name": "Mila", "busy": false, "awaiting": null },
  "messages": [
    { "role": "tool", "results": [
        { "kind": "media", "id": "8b2d...", "url": "https://cloud.thenewblack.ai/.../8b2d.webp", "type": "image", "status": "done" },
        { "kind": "post", "id": "p_44...", "platform": "instagram", "status": "to_validate", "at": "2026-09-10T09:00:00Z" }
    ] },
    { "role": "agent", "kind": "answer", "text": "Three visuals are ready; the Instagram post waits in Posts › To validate.", "results": [] }
  ]
}

When the agent needs your answer before going on, its message is typed question and carries the replies it expects (options); the agent's state reads awaiting: "answer". Your next message is the answer. A post or a Shopify visual keeps living after the message — read its current state through /v1/publish/{id} and /v1/shopify/products.

Introduction

The API is asynchronous, like the studio it drives: you submit a generation, credits are debited atomically at submission, and you collect the result by polling — or let us call your webhook when it settles. A generation that fails is refunded automatically.

Base URL   https://thenewblack.ai/api/v1
Format     JSON in, JSON out
Auth       Authorization: Bearer tnb_live_...

The whole API is described in OpenAPI 3.1, publicly and without a key, generated at the instant of the call: GET /api/v1/openapi.json — every route, every workflow as a body schema of /generate, every error code. Point a code generator, an agent or an SDK builder at it. The catalogue alone is at GET /api/v1/catalog (every workflow's contract and prices) and GET /api/v1/catalog/presets (the stock preset shelves). The Claude connector and the CLI build themselves from these.

Authentication

Create up to three keys from your account's API / MCP tab. A key is shown once at creation and stored only as a hash — keep it server-side, never in a browser. Keys belong to the paying account: on a team, they spend the leader's credits.

Each key carries scopes chosen at creation: generate (create with the workflows and edit tech packs — spends credits), read (poll generations, list workflows, check credits, read the account, the ledger, the Visual DNA and everything in the Creations catalogue), agents (talk to the AI agents, their calendar and the Files — spends credits like the chat), publish (post to connected platforms — Shopify and the social platforms).

curl https://thenewblack.ai/api/v1/credits \
  -H "Authorization: Bearer tnb_live_XXXXXXXXXXXX"

Errors

Errors are JSON with a stable code and a human message:

{ "error": { "code": "insufficient_credits", "message": "Not enough credits — this needs 3." } }
ParameterType
401statusrequiredmissing_key · invalid_key — no key, or an unknown/revoked one.
402statusrequiredinsufficient_credits — the account balance cannot cover the generation.
403statusrequiredmissing_scope — the key exists but lacks the scope for this action.
404statusrequiredunknown_workflow · not_found — no such workflow, or no such generation on this account.
502statusrequiredgeneration_refused — the provider refused the job; any debited credit is refunded.
POST/v1/generate

Create a generation

Requires the generate scope. Credits are debited when the request is accepted; if the balance is short nothing starts and nothing is charged. Returns 202 with the generation id.

ParameterType
workflowstringrequiredA versioned endpoint from the catalogue, e.g. create_design-v1. The version is part of the name — earlier versions keep being served under theirs.
promptstringoptionalWhat to create — in English for best results (workflows that take one).
<named images>stringoptionalEach workflow declares its image parameters by name, exactly like its panel — sketch_image, fabric_image, model_image… — listed on its endpoint page and in the catalogue. Positional arrays are not accepted.
fieldsobjectoptionalThe workflow's panel fields by name, options validated — see its endpoint page.
variantstringoptionalWorkflows with tabs: the variant by its visible title.
tierstringoptional"standard" (default) or "pro".
ratiostringoptionalFrom the workflow's offered ratios.
durationstringoptionalVideo workflows: seconds of output, from the allowed durations.
webhook_urlstringoptionalOptional — we POST the outcome here when the generation settles. Without it, poll the URL returned in the response until the status settles.
curl -X POST https://thenewblack.ai/api/v1/generate \
  -H "Authorization: Bearer tnb_live_XXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow": "product_to_model-v1",
    "prompt": "AI model wearing the handbag, studio light",
    "tier": "standard",
    "ratio": "4:5",
    "product_images": ["https://example.com/handbag.jpg"],
    "webhook_url": "https://example.com/hooks/tnb"
  }'
// 202 Accepted
{
  "generation_id": "3f1c9a6e-...",
  "status": "running",
  "poll": "/api/v1/generations/3f1c9a6e-..."
}
GET/v1/generations/{id}

Retrieve a generation

Requires the read scope. Poll every few seconds until status is succeeded or failed. A failed generation is refunded automatically.

// 200 OK
{
  "generation_id": "3f1c9a6e-...",
  "workflow": "product_to_model",
  "status": "succeeded",
  "result": {
    "type": "image",
    "url": "https://.../result.webp",
    "thumbnail": "https://.../thumb.webp"
  }
}

Webhooks

Pass webhook_url when creating a generation and we POST the outcome — success or failure — to your endpoint the moment it settles, instead of being polled. Answer with any 2xx; we try once, with a 5-second timeout, and your poll endpoint always remains the source of truth.

// POST to your webhook_url
{
  "generation_id": "3f1c9a6e-...",
  "status": "succeeded",
  "result": { "type": "image", "url": "https://...", "thumbnail": "https://..." }
}
GET/v1/credits

Credits

The account's live balance. Generation costs are per workflow and tier — see the catalogue; video is billed per second of output. Top up or subscribe on the pricing page.

// 200 OK
{ "credits": 142 }

Claude MCP

The same capabilities inside a conversation: connect The New Black AI to Claude as a Model Context Protocol server and generate from your chat — no code, same keys, same credits. The connector builds its tools from the live catalogue. Setup and details on the MCP page.

Building your integration with Claude Code? Install our skill and Claude knows the whole contract — auth, the async loop, every workflow read live from the catalogue, the CLI — before it writes a line:

npx skills add newblackai/claude-skill --skill thenewblack

Command line

The same API as a program — for an AI coding agent (Claude Code, Codex, Cursor), a script, a cron or a CI job. One command per workflow, generated from the live catalogue, and one per route of this page; local pictures uploaded once, --wait and --out do the plumbing. In a conversation, add the connector; in a project of code, install the CLI. Everything on the CLI page.

npx @thenewblack/cli --help
tnb generate virtual_try_on --product_images dress.jpg --model_image model.jpg --ratio 4:5 --wait --out ./renders/

Migrating from the legacy API

When the platform migration completes, the legacy endpoints are retired and answer with a notice pointing here. Keys are not carried over: create a new key from your API / MCP tab, point your integration at /api/v1, and retire the old key with the old endpoints. The concepts are unchanged — submit, poll or webhook, 48-hour storage — with one endpoint now covering every workflow of the studio.