The New Black AI

AI Fashion Clothing API

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

GET/v1/workflows

Workflows catalogue (77)

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 keyTitleModeStandardProUltraMax refs
POSTfreeform_image-v1Free Prompt Imageimage1 cr3 cr7 cr3
POSTfreeform_video-v1Free Prompt Videovideo2.2 cr/s4.4 cr/s23 cr/s1
POSTvirtual_try_on-v1Virtual Try-Onimage1 cr3 cr7 cr5
POSTproduct_to_model-v1Product to Modelimage1 cr3 cr7 cr5
POSTimage_to_ghost_mannequin-v1Image to Ghost Mannequinimage1 cr3 cr7 cr1
POSTchange_color-v1Change a Colorimage1 cr3 cr7 cr1
POSTcreate_design-v1Create a Productimage1 cr3 cr7 cr3
POSTenhance_photo_to_hd-v1Enhance Photo to HD (2K/4K)image1 cr3 cr—3
POSTsnap_freeze-v1Snap Freezevideo2.2 cr/s4.4 cr/s23 cr/s3
POSTreimagine_scene-v1Reimagine your Modelimage1 cr3 cr7 cr1
POSTedit_video-v1Edit videovideo2.8 cr/s3.7 cr/s—1
POSTmotion_design-v1Motion Designvideo4 cr/s4 cr/s—4
POSTmodel_walk-v1Model Walkvideo2.2 cr/s4.4 cr/s23 cr/s1
POSTproduct_360-v1Product 360video2.2 cr/s4.4 cr/s23 cr/s3
POSTmodel_360-v1Model 360video2.2 cr/s4.4 cr/s23 cr/s2
POSTugc_video-v1UGC Videovideo2.2 cr/s4.4 cr/s23 cr/s3
POSTswap_models-v1Swap Modelimage1 cr3 cr7 cr1
POSTface_swap-v1Face Swapimage1 cr1 cr—2
POSTfabric_to_design-v1Fabric to Imageimage1 cr3 cr7 cr1
POSTimage_to_fabric-v1Image to Fabricimage1 cr3 cr7 cr1
POSTtext_to_textile-v1Text to Textileimage1 cr3 cr7 cr3
POSTimage_to_flat_lay-v1Image to Flat Layimage1 cr3 cr7 cr1
POSTswap_fabrics-v1Swap Fabricsimage1 cr3 cr7 cr2
POSTlogo_placement-v1Add a Logoimage1 cr3 cr—3
POSTtext_to_sketch-v1Text to Sketchimage1 cr3 cr7 cr3
POSTsketch_to_image-v1Sketch to Imageimage1 cr3 cr—1
POSTimage_to_sketch-v1Image to Sketchimage1 cr3 cr7 cr2
POSTsketch_to_svg-v1Sketch to SVGimage1 cr1 cr—1
POSTvectorize_image-v1Vectorize Imageimage1 cr1 cr—1
POSTinsert_fabric_on_sketch-v1Insert Fabric on Sketchimage1 cr3 cr7 cr2
POSTcreate_similar_outfits-v1Create Similar Outfitsimage1 cr3 cr7 cr1
POSTcreate_design_variations-v1Create Design Variationsimage1 cr3 cr7 cr1
POSTchange_background-v1Change Backgroundimage1 cr3 cr—2
POSTremove_background-v1Remove Backgroundimage0.5 cr0.5 cr—1
POSTad_creative-v1Ad Creativeimage1 cr3 cr7 cr2
POSTenhance_video_to_hd-v1Enhance Video to HDvideo2.3 cr/s2.3 cr/s—3
POSTai_stylist-v1AI Stylistimage1 cr3 cr7 cr1
POSToutpaint_new_ratio-v1Expand Imageimage1 cr1 cr—1
POSTretouch-v1Retouch a Zoneimage1 cr3 cr—1
POSTcreate_3d_models-v1Image to 3D3d10 cr10 cr—1
POSTtryon_video-v1Virtual Try-On Videovideo2.2 cr/s4.4 cr/s23 cr/s2
POSToutfit_transition-v1Outfit Transitionvideo2.2 cr/s4.4 cr/s23 cr/s2
POSTfashion_ad-v1Fashion Advideo2.2 cr/s4.4 cr/s23 cr/s3
POSTdetail_closeup-v1Detail Close-upvideo2.2 cr/s4.4 cr/s23 cr/s1
POSTeditorial_video-v1Editorial Lookbookvideo2.2 cr/s4.4 cr/s23 cr/s1
POSTremove_video_background-v1Remove Video Backgroundvideo0.71 cr/s0.71 cr/s—1
POSToutfit_drop-v1Outfit Dropvideo2.2 cr/s4.4 cr/s23 cr/s3
POSTreframe_video-v1Reframe Videovideo2.2 cr/s4.4 cr/s—1
POSTpasserby_transition-v1Passer-By Transitionvideo2.2 cr/s4.4 cr/s23 cr/s3
POSTcrosswalk_look_switch-v1Look Switch Walkvideo2.2 cr/s4.4 cr/s23 cr/s3
POSTchange_video_background-v1Change Video Backgroundvideo4.4 cr/s8.8 cr/s—1
POSTchange_video_outfit-v1Edit Outfit in Videovideo2.8 cr/s3.7 cr/s—1
POSThanger_layering-v1Hanger Switchvideo2.2 cr/s4.4 cr/s23 cr/s5
POSTswap_video_model-v1Swap Model in Videovideo2.8 cr/s3.7 cr/s—2
POSTwindow_walkby-v1Window Walk-Byvideo2.2 cr/s4.4 cr/s23 cr/s3
POSTdetail_zoom_rush-v1Detail Zoom Rushvideo2.2 cr/s4.4 cr/s23 cr/s1
POSToutfit_morph-v1Outfit Morphvideo2.2 cr/s4.4 cr/s23 cr/s4
POSTfreeform_audio-v1Create a Soundtrackaudio2 cr2 cr—1
POSTvoice_over-v1Create a Voice-overaudio1.1 cr2.1 cr2.1 cr3
POSTmotion_collection_panorama-v1Collection Panoramavideo1 cr/s1 cr/s—6
POSTmotion_split_reel-v1Split Reelvideo1 cr/s1 cr/s—4
POSTmotion_style_post-v1Style Postvideo1 cr/s1 cr/s—1
POSTmotion_look_film-v1Look Filmvideo1 cr/s1 cr/s—4
POSTmotion_colour_drop-v1Colour Dropvideo1 cr/s1 cr/s—4
POSTmotion_phone_promo-v1Phone Promovideo1 cr/s1 cr/s—4
POSTmotion_cut_montage-v1Cut Montagevideo1 cr/s1 cr/s—6
POSTmotion_paper_collage-v1Paper Collagevideo1 cr/s1 cr/s—8
POSTmotion_lineup-v1Lineupvideo1 cr/s1 cr/s—6
POSTmotion_character_select-v1Character Selectvideo1 cr/s1 cr/s—6
POSTmotion_grid_mosaic-v1Grid Mosaicvideo1 cr/s1 cr/s—2
POSTmotion_ways_to_wear-v1Ways to Wearvideo1 cr/s1 cr/s—6
POSTmotion_detail_study-v1Detail Studyvideo1 cr/s1 cr/s—3
POSTmotion_signature_film-v1Signature Filmvideo1 cr/s1 cr/s—4
POSTmotion_outfit_picker-v1Outfit Pickervideo1 cr/s1 cr/s—4
POSTmotion_beat_cut-v1Beat Cutvideo1 cr/s1 cr/s—4
POSTmotion_bold_word-v1Bold Wordvideo1 cr/s1 cr/s—4
POSTmotion_mix_match-v1Mix & Matchvideo1 cr/s1 cr/s—6

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.

Fixed routes

Every route of /v1 besides the workflows — the 77 workflows above are not routes but the bodies one route accepts, POST /v1/generate. Drawn from the same descriptions the OpenAPI document, the CLI and the Claude MCP connector are built from: complete by construction, never typed here.

Catalog

GET/v1/catalogEvery workflow, publicpublic
GET/v1/catalog/presetsThe stock template library, publicpublic
GET/v1/openapi.jsonThis document, publicpublic
GET/v1/workflowsThe live catalogue, keyedread

Generate

GET/v1/generations/{id}A generation's status and resultread

Publish

POST/v1/publishPost a creation to a connected social accountpublish
GET/v1/publish/{id}A post's statepublish
GET/v1/publish/accountsThe connected social accountspublish
GET/v1/shopify/productsThe connected store's productsread
POST/v1/shopify/publishPut a creation on a product pagepublish

Creations

GET/v1/elementsThe account's starred potread
GET/v1/mediaThe account's recent creationsread
POST/v1/media/uploadUpload a picturegenerate
GET/v1/projectsThe account's projectsread

Account

GET/v1/accountThe account in one readingread
GET/v1/brand-dnaThe Visual DNA profilesread
GET/v1/brand-dna/{id}One Visual DNA profile in fullread
GET/v1/creditsThe account's credit balanceread
GET/v1/ledgerWhat the account spent and receivedread

Tech packs

GET/v1/moodboardsThe account's moodboardsread
GET/v1/moodboards/{id}/pdfThe moodboard as a PDFread
GET/v1/techpacksThe account's tech packsread
GET/v1/techpacks/{id}One tech pack wholeread
PATCH/v1/techpacks/{id}Rename a tech packgenerate
GET/v1/techpacks/{id}/pdfThe tech pack as a PDFread
POST/v1/techpacks/{id}/sectionsAdd a section to a pagegenerate
PUT/v1/techpacks/{id}/sections/{sectionId}Replace a section's datagenerate
POST/v1/techpacks/from-photosStart a tech pack with AI, from photos· 1 for the reading, plus 1 per sketch.generate

Agents

GET/v1/agentsThe account's AI agentsagents
GET/v1/agents/{id}/messagesRead an agent's threadagents
POST/v1/agents/{id}/messagesSay something to an agent· what the agent spends on the task, like the chat.agents
GET/v1/agents/{id}/schedulesThe agent's calendaragents
POST/v1/agents/{id}/schedulesPut a request on the agent's calendar· each run spends what the task costs.agents
DELETE/v1/agents/{id}/schedules/{scheduleId}Take a request off the agent's calendaragents
POST/v1/agents/{id}/stopStop the agent's running taskagents
GET/v1/filesThe account's Filesagents
GET/v1/files/{id}One page of a file· a fraction of a credit for pdf and pictures (a model reads them), nothing for the rest.agents
PATCH/v1/files/{id}Write a file's one-line descriptionagents

GET /v1/openapi.json carries this whole table with every parameter and answer, and each workflow as a body of POST /v1/generate.

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), "pro", or "ultra" where the catalogue prices one (credits.ultra): our best model at its largest output — a picture in 4K (from the Pro plan), a video in 1080p on our top video model. For a picture: standard — 1K resolution image + fast generation; pro — 2K resolution image + thinking process before generating; ultra — 4K resolution image + deep thinking process before generating. For a video: standard — 720p resolution video + fast generation; pro — 1080p resolution video + thinking process before generating; ultra — 1080p resolution video + deep thinking process before generating.
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 }

MCP

The same capabilities inside a conversation: connect The New Black AI to Claude or ChatGPT 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.