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
POSTretouch-v1Edit an Areaimage1 cr3 cr—16
POSTreimagine_scene-v1Reimagine your Modelimage1 cr3 cr7 cr1
POSTedit_video-v1Edit videovideo3.3 cr/s4.3 cr/s—1
POSTmotion_design-v1Motion Designvideo4 cr4 cr—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
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
POSTsnap_freeze-v1Snap Freezevideo2.2 cr/s4.4 cr/s23 cr/s3
POSTugc_video-v1UGC Videovideo2.2 cr/s4.4 cr/s23 cr/s3
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 Prints & Logosimage1 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 HDvideo4.4 cr/s4.4 cr/s—3
POSTai_stylist-v1AI Stylistimage1 cr3 cr7 cr1
POSToutpaint_new_ratio-v1Expand Imageimage1 cr1 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
POSToutfit_drop-v1Outfit Dropvideo2.2 cr/s4.4 cr/s23 cr/s3
POSTremove_video_background-v1Remove Video Backgroundvideo1.4 cr/s1.4 cr/s—1
POSTreframe_video-v1Reframe Videovideo4.4 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 Videovideo3.3 cr/s4.3 cr/s—1
POSTswap_video_model-v1Swap Model in Videovideo3.3 cr/s4.3 cr/s—2
POSThanger_layering-v1Hanger Switchvideo2.2 cr/s4.4 cr/s23 cr/s5
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.06 cr/1k chars2.12 cr/1k chars2.12 cr/1k chars3
POSTmotion_collection_panorama-v1Collection Panoramavideo1 cr1 cr—6
POSTmotion_split_reel-v1Split Reelvideo1 cr1 cr—4
POSTmotion_style_post-v1Style Postvideo1 cr1 cr—1
POSTmotion_look_film-v1Look Filmvideo1 cr1 cr—4
POSTmotion_colour_drop-v1Colour Dropvideo1 cr1 cr—4
POSTmotion_phone_promo-v1Phone Promovideo1 cr1 cr—4
POSTmotion_cut_montage-v1Cut Montagevideo1 cr1 cr—6
POSTmotion_paper_collage-v1Paper Collagevideo1 cr1 cr—8
POSTmotion_lineup-v1Lineupvideo1 cr1 cr—6
POSTmotion_character_select-v1Character Selectvideo1 cr1 cr—6
POSTmotion_grid_mosaic-v1Grid Mosaicvideo1 cr1 cr—2
POSTmotion_ways_to_wear-v1Ways to Wearvideo1 cr1 cr—6
POSTmotion_detail_study-v1Detail Studyvideo1 cr1 cr—3
POSTmotion_signature_film-v1Signature Filmvideo1 cr1 cr—4
POSTmotion_outfit_picker-v1Outfit Pickervideo1 cr1 cr—4
POSTmotion_beat_cut-v1Beat Cutvideo1 cr1 cr—4
POSTmotion_bold_word-v1Bold Wordvideo1 cr1 cr—4
POSTmotion_mix_match-v1Mix & Matchvideo1 cr1 cr—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/accounts · /v1/publish · /v1/publish/{id}Images & videos as feed posts, stories, carousels, reelslive
TikTok/v1/publish/accounts · /v1/publish · /v1/publish/{id}Videos & photo postslive
X/v1/publish/accounts · /v1/publish · /v1/publish/{id}Images & videos as postslive
Pinterest/v1/publish/accounts · /v1/publish · /v1/publish/{id}Images & videos as pins, onto a boardlive
YouTube/v1/publish/accounts · /v1/publish · /v1/publish/{id}Videos as Shortslive
GET/v1/media · /v1/projects · /v1/elements · /v1/media/upload

Creations catalogue (4)

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, 3D models and soundtracks — URLs, thumbnails, project; filters by project, type, favourites, prompt words, workflow, date; next_before and next_before_id page backlive
ProjectsGET/v1/projectsYour projects — the filter of every listinglive
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
GET/v1/account · /v1/credits · /v1/ledger · /v1/account/invoices · /v1/brand-dna

Account (6)

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

ActionEndpointsReturnsStatus
Read the accountGET/v1/accountUsername, credits, plan, team, brand, Shopify store, Visual styles, projects with their counts, exact library counts, tech packslive
Credit balanceGET/v1/creditsThe balance, one decimallive
Read the ledgerGET/v1/ledger?days=30&lines=60The credit lines of the period, signed, and the usage by team memberlive
InvoicesGET/v1/account/invoices?limit=12Every invoice, plans and credit packs, newest first, with its page and its PDF; next_starting_after pages backlive
Visual styleGET/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 · /v1/techpacks/{id} · /v1/techpacks/{id}/sections · /v1/moodboards

Tech packs (9)

The tech packs and the moodboards: listed, exported as a PDF, and a tech pack whole — pages, sections, data — read and written back, exactly as the account's AI agent does it. 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
List tech packsGET/v1/techpacksThe packs — id, name, project, cover, last updatelive
Tech pack PDFGET/v1/techpacks/{id}/pdfThe pack exported → { url, name }live
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
List moodboardsGET/v1/moodboardsThe boards — id, name, project, cover, last updatelive
Moodboard PDFGET/v1/moodboards/{id}/pdfThe board exported → { url, name }live
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

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"
}

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/mila/messages

Mila - AI Agent (10)

Make Mila work from your own program, exactly as in the app: she uses the studio, the store and the tools for you, with the same permissions and the same credits. Every account has her; keys need the agentsscope. Your message appears in her chat, marked with your key's name, and she answers in the thread.

ActionEndpointsReturnsStatus
Talk to MilaPOST/v1/mila/messages202 and a task id; 409 “working” while she is on a tasklive
Read the threadGET/v1/mila/messages?since=Her messages, with typed results (media, post, shopify_media, techpack, file)live
Her stateGET/v1/milaFree or busy, waiting for your answer, what she may do alonelive
StopPOST/v1/mila/stopStops the running task; what was done stayslive
CalendarGET/v1/mila/schedulesWhat she does later or again: rhythm, next run, last outcomelive
SchedulePOST/v1/mila/schedules{ request, kind: single | recurring, time, date? | every?, day_of_week?, day_of_month?, may_publish? }live
CancelDELETE/v1/mila/schedules/{scheduleId}Takes the line off the calendarlive
FilesGET/v1/files?query=&folder=The account’s Files, as Mila sees themlive
Read a fileGET/v1/files/{id or path}?page=&sheet=&picture=One page of a pdf, docx, xlsx, pptx, text file or picturelive
Describe a filePATCH/v1/files/{id or path}{ description } — the one line the index showslive

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

curl -X POST "https://thenewblack.ai/api/v1/mila/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 Mila 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/mila/messages?since=2026-09-09T15:02:11Z" \
  -H "Authorization: Bearer tnb_live_XXXXXXXXXXXX"

When Mila needs your answer, her message is typed question with the replies she expects (options), and her state reads awaiting: "answer". Your next message is the answer.

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/account/invoicesThe account's invoicesread
GET/v1/brand-dnaThe Visual stylesread
GET/v1/brand-dna/{id}One Visual style 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

Mila

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/milaMila, the account's AI agentagents
GET/v1/mila/messagesRead Mila's threadagents
POST/v1/mila/messagesTalk to Mila· what Mila spends on the task, like the chat.agents
GET/v1/mila/schedulesMila's calendaragents
POST/v1/mila/schedulesPut a request on Mila's calendar· each run spends what the task costs.agents
DELETE/v1/mila/schedules/{scheduleId}Take a request off Mila's calendaragents
POST/v1/mila/stopStop Mila's running taskagents

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.

Serving several stores or clients? On the Enterprise plan, each one can be a workspace of its own — its own API keys, its own creations — on one plan and one balance, with the usage of each workspace in Team › Usage.

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 needs only a free account, no plan: a new account starts with free credits, enough to make its first calls before choosing a plan. 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 style and everything in the Creations catalogue), agents (talk to Mila, her 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.
429statusrequiredrate_limited — the account started its plan's generations for this minute; wait the Retry-After seconds. Nothing was charged.
502statusrequiredgeneration_refused — the job was refused; any debited credit is refunded.

Rate limits

An account starts a set number of generations a minute, through the API, the CLI and the MCP connector together: 30 without a plan or on Starter, 60 on Pro, 120 on Business, 300 on Enterprise. Reading — polling a generation, listing, checking credits — is not counted. Past the limit, POST /v1/generate answers 429 rate_limited with a Retry-After header (seconds to wait), and nothing is charged. Need more for a launch or a store network? Write to us — the limit can be raised for your account.

// 429 Too Many Requests   ·   Retry-After: 12
{ "error": { "code": "rate_limited", "message": "This account starts at most 60 generations a minute on its plan. Try again in 12 s.",
             "retry_after": 12, "limit_per_minute": 60 } }
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). Required where the catalogue says prompt_required: a picture made from words alone, and the text Voice reads.
<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. A place the panel may hide (conditional in the catalogue) is required only while the fields' choice shows it.
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 lists it in tiers: 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 and soundtrack workflows: seconds of output, from the allowed durations.
visual_dnastringoptionalOptional — the id of one of your Visual styles (GET /v1/brand-dna) or a house style; its paragraph closes the prompt. Only on the workflows where the studio shows a Visual style (visual_dna: true in the catalogue); refused elsewhere. How far it reaches is in effects.reach.
soundstringoptionalVideo workflows: "on" (default) keeps the clip's own sound, "off" makes it silent; how far it reaches is in effects.reach.
end_imagestringoptionalVideo workflows that take one (end_image: true): an optional closing frame, one public HTTPS URL.
referencesstring[]optionalWorkflows that take them (references: true): one to three public HTTPS URLs put into the clip — a person, a garment, a place — instead of a start or end frame.
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" \
  --data-binary @- <<'JSON'
{
  "workflow": "product_to_model-v1",
  "product_images": [
    "https://example.com/handbag.jpg"
  ],
  "fields": {
    "gender": "Woman",
    "seg_framing": "full body",
    "seg_scene": "a rooftop terrace at dusk"
  },
  "tier": "standard",
  "ratio": "4:5",
  "webhook_url": "https://example.com/hooks/tnb"
}
JSON
// 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.

Most images are ready in under a minute — a background removal in seconds, a virtual try-on or a product on a model in about half a minute; videos take longer. The result's URL lives 48 hours: copy the file to your own storage. After that the result is deleted and the call answers expired — unless the creation was opened in the app, which keeps it like any other.

// 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.