{"openapi":"3.1.0","info":{"title":"NeuroBanner API","version":"1.0.0","description":"Нейро собирает баннеры, карточки, видео и HTML5 из одного фото. Ключ `nb_live_…` списывает кредиты только за принятые форматы; `nb_test_…` — заглушка без генерации и списания.\n\nNeuro builds banners, cards, video and HTML5 from one photo. A `nb_live_…` key charges only for accepted formats; `nb_test_…` is a stub that generates and charges nothing."},"servers":[{"url":"https://api.neurobanner.com/v1"}],"security":[{"bearer":[]}],"paths":{"/assets":{"post":{"summary":"Upload a photo or banner","description":"multipart `file`, or JSON `{ url }`, or JSON `{ name, mime, bytes }` to get a signed upload URL. JPG, PNG, WEBP up to 20 MB, at least 600 px on the short side.","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]}},"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]},{"type":"object","properties":{"name":{"type":"string"},"mime":{"type":"string"},"bytes":{"type":"integer"}},"required":["name","mime","bytes"]}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"4XX":{"$ref":"#/components/responses/Error"}}}},"/assets/{id}/complete":{"post":{"summary":"Finish a signed upload","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"4XX":{"$ref":"#/components/responses/Error"}}}},"/estimate":{"post":{"summary":"Estimate the cost before starting","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Estimate"}}}},"4XX":{"$ref":"#/components/responses/Error"}}}},"/jobs":{"post":{"summary":"Start a job","description":"Answers at once with the job id. Credits are reserved now and charged only for accepted formats. With too few credits and `autostart: true` the job is saved as a draft (202).","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobInput"}}}},"responses":{"201":{"description":"Started","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"202":{"description":"Draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"402":{"$ref":"#/components/responses/Error"},"4XX":{"$ref":"#/components/responses/Error"}}}},"/jobs/{id}":{"get":{"summary":"Job status and results","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"404":{"$ref":"#/components/responses/Error"}}}},"/jobs/{id}/answer":{"post":{"summary":"Answer Neuro's question","parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"choice":{"type":"string"},"text":{"type":"string"}},"required":["token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"4XX":{"$ref":"#/components/responses/Error"}}}},"/jobs/{id}/cancel":{"post":{"summary":"Cancel a job and refund","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"4XX":{"$ref":"#/components/responses/Error"}}}},"/jobs/{id}/zip":{"get":{"summary":"ZIP of accepted formats","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"ZIP","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"404":{"$ref":"#/components/responses/Error"}}}},"/formats":{"get":{"summary":"Format catalog","parameters":[{"name":"pack","in":"query","description":"Platform id: rsya, vk, google, direct, meta, tiktok, telegram, pinterest, avito, wb, ozon, ym, kaspi. The full list is in the response without this filter.","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/outputs":{"get":{"summary":"Result files","parameters":[{"name":"job_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","schema":{"type":"string","default":"accepted"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Output"}}}}}}}}}},"/brand-kits":{"get":{"summary":"Brand kits of the workspace","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/balance":{"get":{"summary":"Credit balance","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer"},"reserved":{"type":"integer"},"plan":{"type":"string"},"message":{"type":"string"}}}}}}}}}},"webhooks":{"job.step":{"post":{"summary":"Neuro made a step","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx"}}}},"job.completed":{"post":{"summary":"Job finished (done or partial)","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx"}}}},"job.failed":{"post":{"summary":"Job failed, credits refunded","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Any 2xx"}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"`nb_live_…` or `nb_test_…`"}},"parameters":{"id":{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}},"responses":{"Error":{"description":"Error in Neuro’s voice","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"missing":{"type":"integer"},"details":{"type":"array"}},"required":["code","message"]}}}}}}},"schemas":{"JobInput":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","enum":["create","adapt","pack","enhance","ctr","unify","card","video","html5","edit"]},"tier":{"default":"standard","type":"string","enum":["standard","pro"]},"title":{"type":"string","maxLength":120},"asset_ids":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"brand_kit_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"brief":{"type":"string","maxLength":2000},"lang":{"type":"string","enum":["ru","en"]},"packs":{"maxItems":30,"type":"array","items":{"type":"string","pattern":"^[a-z0-9_]{2,32}$"}},"format_keys":{"maxItems":200,"type":"array","items":{"type":"string","maxLength":64}},"from_photo":{"type":"boolean"},"sizes":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"width":{"type":"integer","minimum":16,"maximum":4096},"height":{"type":"integer","minimum":16,"maximum":4096},"max_kb":{"type":"integer","minimum":10,"maximum":30000}},"required":["width","height"]}},"goal":{"type":"string","maxLength":200},"marketplace":{"type":"string","enum":["wb","ozon","ym","kaspi"]},"characteristics":{"type":"string","maxLength":3000},"output_ids":{"maxItems":30,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"instruction":{"type":"string","minLength":2,"maxLength":1000},"network":{"type":"string","enum":["rsya","google"]},"click_url":{"type":"string","format":"uri"},"video_aspect":{"type":"string","enum":["9:16","1:1","16:9"]},"motion":{"type":"string","maxLength":300},"reference_asset_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"webhook_url":{"type":"string","format":"uri"},"autostart":{"type":"boolean"},"auto_pick":{"type":"boolean"}},"required":["mode"]},"Asset":{"type":"object","properties":{"id":{"type":"string"},"status":{"enum":["pending","ready","rejected"]},"width":{"type":["integer","null"]},"height":{"type":["integer","null"]},"bytes":{"type":["integer","null"]},"upload_url":{"type":"string"}}},"Estimate":{"type":"object","properties":{"total":{"type":"integer"},"units":{"type":"integer"},"lines":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"credits":{"type":"integer"}}}},"message":{"type":"string"}}},"Output":{"type":"object","properties":{"id":{"type":"string"},"job_id":{"type":"string"},"format":{"type":"string"},"label":{"type":"string"},"pack":{"type":["string","null"]},"width":{"type":"integer"},"height":{"type":"integer"},"status":{"type":"string"},"version":{"type":"integer"},"bytes":{"type":["integer","null"]},"url":{"type":["string","null"],"description":"Signed, 1 hour"}}},"Job":{"type":"object","properties":{"id":{"type":"string"},"mode":{"type":"string"},"status":{"enum":["draft","queued","running","waiting_input","done","partial","failed","canceled"]},"test":{"type":"boolean"},"progress":{"type":"object","properties":{"done":{"type":"integer"},"total":{"type":"integer"},"failed":{"type":"integer"}}},"credits":{"type":"object","properties":{"estimated":{"type":"integer"},"reserved":{"type":"integer"},"charged":{"type":"integer"},"refunded":{"type":"integer"}}},"question":{"type":["object","null"]},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/Output"}},"zip_url":{"type":["string","null"]},"web_url":{"type":"string"},"message":{"type":"string"}}},"WebhookEvent":{"type":"object","description":"Header `NB-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the endpoint secret>`. Retries: 1, 5, 30 min, 2 h, 12 h.","properties":{"id":{"type":"string"},"type":{"enum":["job.step","job.completed","job.failed"]},"created":{"type":"string"},"data":{"type":"object"}}}}}}