REST API v1 · MCP

Neuro en su código

Todo lo que hace el panel: subir una foto, presupuestar, iniciar una tarea, obtener los archivos. Los créditos se cobran solo por formatos aceptados por el control de IA, del saldo del espacio de trabajo.

# 1. Foto
curl https://api.neurobanner.com/v1/assets -H "Authorization: Bearer $NB_KEY" -F file=@mug.jpg

# 2. Presupuesto
curl https://api.neurobanner.com/v1/estimate -H "Authorization: Bearer $NB_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode":"pack","packs":["direct","vk"],"asset_ids":["<asset id>"]}'

# 3. Tarea
curl https://api.neurobanner.com/v1/jobs -H "Authorization: Bearer $NB_KEY" \
  -H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" \
  -d '{"mode":"pack","packs":["direct","vk"],"asset_ids":["<asset id>"],"webhook_url":"https://you.app/hooks/nb"}'

# 4. Estado y archivos
curl https://api.neurobanner.com/v1/jobs/<job id> -H "Authorization: Bearer $NB_KEY"
curl -o result.zip https://api.neurobanner.com/v1/jobs/<job id>/zip -H "Authorization: Bearer $NB_KEY"

Claves

Encabezado Authorization: Bearer nb_live_…. Las claves se crean en la página «API y MCP» y se muestran una vez. Una clave de prueba nb_test_… no crea ni cobra nada: responde con el presupuesto en el mismo formato que una clave de producción.

Límites: 120 solicitudes por minuto por clave, 300 por espacio de trabajo, 30 tareas nuevas por minuto.

Obtener una clave

Endpoints

URL base: https://api.neurobanner.com/v1

POST/assetsUpload a photo or bannermultipart `file`, or JSON `{ url }`, or JSON `{ name, mime, bytes }` to get a signed upload URL. JPG, PNG, WEBP up to 20 MB, at least 200 px on the short side.
POST/assets/{id}/completeFinish a signed upload
POST/estimateEstimate the cost before starting
POST/jobsStart a jobAnswers 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).
GET/jobs/{id}Job status and results
POST/jobs/{id}/answerAnswer Neuro's question
POST/jobs/{id}/feedbackRate a resultA 1–5 score for the job, or `output_id` with 1 / -1 for one file. Reasons: text, product, style, composition, rules, quality (and slow, price, ready, saved_time for the job). Voting again replaces the earlier vote. Neuro uses the scores to choose models.
POST/jobs/{id}/cancelCancel a job and refund
GET/jobs/{id}/zipZIP of accepted formats
GET/formatsFormat catalog
GET/outputsResult files
GET/brand-kitsBrand kits of the workspace
GET/webhooksWorkspace webhooks
POST/webhooksAdd a workspace webhookEvery job of the workspace sends its events here. The `secret` is returned once: verify `NB-Signature` with it.
DELETE/webhooks/{id}Remove a workspace webhook
GET/balanceCredit balance

Campos de la tarea

{
  "mode": {
    "type": "string",
    "enum": [
      "create",
      "adapt",
      "pack",
      "enhance",
      "ctr",
      "unify",
      "card",
      "video",
      "html5",
      "edit",
      "reframe",
      "background",
      "scene",
      "translate",
      "tryon",
      "model",
      "markup"
    ]
  },
  "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
  },
  "art_notes": {
    "type": "string",
    "maxLength": 400
  },
  "lang": {
    "type": "string",
    "enum": [
      "ru",
      "en",
      "es",
      "pt",
      "de",
      "fr"
    ]
  },
  "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
        },
        "format_keys": {
          "maxItems": 20,
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 64
          }
        }
      },
      "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",
    "pattern": "^\\d{1,2}:\\d{1,2}$"
  },
  "seconds": {
    "type": "integer",
    "minimum": 2,
    "maximum": 30
  },
  "seconds_auto": {
    "type": "boolean"
  },
  "concept": {
    "type": "object",
    "properties": {
      "title": {
        "type": "string",
        "maxLength": 120
      },
      "idea": {
        "type": "string",
        "maxLength": 600
      },
      "seconds": {
        "type": "integer",
        "minimum": 2,
        "maximum": 30
      },
      "timing": {
        "maxItems": 8,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "time": {
              "type": "string",
              "maxLength": 40
            },
            "what": {
              "type": "string",
              "maxLength": 300
            }
          },
          "required": [
            "time",
            "what"
          ]
        }
      },
      "prompt": {
        "type": "string",
        "maxLength": 2000
      },
      "frozen": {
        "maxItems": 12,
        "type": "array",
        "items": {
          "type": "string",
          "maxLength": 200
        }
      }
    },
    "required": [
      "title",
      "idea",
      "seconds",
      "timing",
      "prompt",
      "frozen"
    ]
  },
  "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)$"
  },
  "reference_asset_ids": {
    "maxItems": 5,
    "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)$"
    }
  },
  "target": {
    "type": "string",
    "enum": [
      "tiktok",
      "reels",
      "shorts",
      "vk_clips",
      "youtube",
      "feed"
    ]
  },
  "source_video": {
    "type": "object",
    "properties": {
      "seconds": {
        "type": "number",
        "minimum": 0.5,
        "maximum": 600
      },
      "width": {
        "type": "integer",
        "minimum": 16,
        "maximum": 8192
      },
      "height": {
        "type": "integer",
        "minimum": 16,
        "maximum": 8192
      },
      "name": {
        "type": "string",
        "maxLength": 200
      }
    },
    "required": [
      "seconds",
      "width",
      "height"
    ]
  },
  "webhook_url": {
    "type": "string",
    "format": "uri"
  },
  "autostart": {
    "type": "boolean"
  },
  "thread_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)$"
  },
  "auto_pick": {
    "type": "boolean"
  },
  "shots": {
    "type": "integer",
    "minimum": 1,
    "maximum": 8
  },
  "scene_aspect": {
    "type": "string",
    "enum": [
      "3:4",
      "1:1",
      "4:5",
      "9:16",
      "16:9"
    ]
  },
  "scenes": {
    "maxItems": 8,
    "type": "array",
    "items": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "prompt": {
          "type": "string",
          "minLength": 3,
          "maxLength": 600
        }
      },
      "required": [
        "title",
        "prompt"
      ]
    }
  },
  "wishes": {
    "type": "string",
    "maxLength": 1000
  },
  "tryon": {
    "type": "object",
    "properties": {
      "model": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "kit"
              },
              "model_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64
              }
            },
            "required": [
              "kind",
              "model_id"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "auto"
              },
              "look": {
                "type": "string",
                "maxLength": 300
              }
            },
            "required": [
              "kind",
              "look"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "ghost"
              }
            },
            "required": [
              "kind"
            ]
          }
        ]
      },
      "poses": {
        "minItems": 1,
        "maxItems": 6,
        "type": "array",
        "items": {
          "type": "string",
          "enum": [
            "front",
            "three_quarter",
            "back",
            "walk",
            "detail",
            "seated"
          ]
        }
      },
      "setting": {
        "default": "studio",
        "type": "string",
        "enum": [
          "studio",
          "white",
          "street",
          "interior"
        ]
      },
      "styling": {
        "type": "string",
        "maxLength": 300
      },
      "aspect": {
        "default": "3:4",
        "type": "string",
        "enum": [
          "3:4",
          "1:1",
          "4:5",
          "9:16"
        ]
      }
    },
    "required": [
      "model",
      "poses"
    ]
  },
  "model_look": {
    "type": "string",
    "maxLength": 300
  },
  "translate": {
    "type": "object",
    "properties": {
      "langs": {
        "minItems": 1,
        "maxItems": 10,
        "type": "array",
        "items": {
          "type": "string",
          "enum": [
            "ru",
            "en",
            "kk",
            "uz",
            "ky",
            "tg",
            "az",
            "hy",
            "ka",
            "be",
            "uk",
            "tr",
            "de",
            "fr",
            "es",
            "it",
            "pl",
            "zh",
            "ar"
          ]
        }
      },
      "texts": {
        "maxItems": 60,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "minLength": 1,
              "maxLength": 400
            },
            "images": {
              "minItems": 1,
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "integer",
                "minimum": 0,
                "maximum": 19
              }
            },
            "keep": {
              "type": "boolean"
            },
            "to": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "string",
                "maxLength": 400
              }
            }
          },
          "required": [
            "source",
            "images",
            "to"
          ]
        }
      }
    },
    "required": [
      "langs"
    ]
  },
  "markup": {
    "type": "object",
    "properties": {
      "pages": {
        "maxItems": 30,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "lines": {
              "maxItems": 600,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 400
                  },
                  "y": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  }
                },
                "required": [
                  "text",
                  "y"
                ]
              }
            }
          }
        }
      }
    },
    "required": [
      "pages"
    ]
  },
  "background": {
    "type": "object",
    "properties": {
      "kind": {
        "type": "string",
        "enum": [
          "transparent",
          "white",
          "color",
          "scene"
        ]
      },
      "color": {
        "type": "string",
        "pattern": "^#[0-9a-fA-F]{6}$"
      },
      "scene": {
        "type": "string",
        "maxLength": 300
      }
    },
    "required": [
      "kind"
    ]
  }
}

Modos: create, pack, adapt, html5, video, reframe, ctr, enhance, card, background, scene, tryon, model, unify, translate, markup, edit. En create con auto_pick: true, Neuro elige el boceto; si no, la tarea espera una respuesta en question: responda con /jobs/{id}/answer. En markup, envíe las páginas del PDF como imágenes, en orden.

Webhooks

Eventos job.step, job.completed, job.failed. Firma en el encabezado NB-Signature: t=…,v1=… — HMAC-SHA256 de `${t}.${body}` con el secreto del endpoint. Reintentos: 1, 5, 30 minutos, 2 y 12 horas.

De dónde sale el secreto: una dirección para todas las tareas — POST /v1/webhooks o la página de desarrolladores; el secreto llega una sola vez en la respuesta. Una dirección para una sola tarea — webhook_url en POST /v1/jobs, el secreto está en el campo webhook_secret de la respuesta. Lista y eliminación: GET /v1/webhooks, DELETE /v1/webhooks/{id}.

import { createHmac, timingSafeEqual } from 'node:crypto';

export function verify(secret, rawBody, header) {
  const { t, v1 } = Object.fromEntries(header.split(',').map((p) => p.split('=')));
  if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const mac = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
  return timingSafeEqual(Buffer.from(mac), Buffer.from(v1));
}

Errores

La respuesta { "error": { "code", "message" } } — message va con la voz de Neuro, en el idioma de Accept-Language.

401 invalid_api_keyNo reconozco la clave de API.
402 insufficient_creditsNo hay créditos suficientes; missing indica cuántos.
422 invalid_requestLa solicitud tiene errores; details enumera los campos.
429 rate_limitedDemasiadas solicitudes; vea Retry-After.
503 not_configuredEl servicio aún se está configurando.

MCP

Streamable HTTP: https://mcp.neurobanner.com/mcp. La autenticación es la misma clave de API en el encabezado Authorization. Las tareas largas devuelven un job_id de inmediato.

list_formatsFormat catalog with tamaños, weight limits, rules and popular sizes.
estimate_costEstimates a task in credits before it starts.
create_bannerBanner from a product photo: 3 sketches, a 2K final.
adapt_bannerAn existing banner into any tamaños.
make_format_packPlatform tamaño packs; shared sizes are made and charged once.
enhance_bannerSharpness, light and a clean background.
replace_backgroundQuitar or replace the background: transparent PNG, marketplace white, a color or a scene.
product_in_sceneLifestyle gallery shots de the product.
translate_creativeLocalize a creative into 1–10 languages, same layout.
dress_on_modelYour garment on a model.
create_modelA new model by description.
improve_ctrCTR review and 3 variants.
unify_style2–100 images in one style.
make_marketplace_cardMain image and 5 slides by marketplace rules.
animate_to_videoAnimated video from a banner.
make_html5Animated HTML5 banner.
make_html_layoutAn image layout or PDF pages (as images, in order) into responsive HTML: live text, cut-out photos, a ZIP with index.html, fragment.html and images.
get_jobJob status, question and result links.
answer_questionAnswers the job question.
list_outputsAccepted files with 1-hour links.
rate_result-1 для одного файла. Причины: text, product, style, composition, rules, quality (для задачи ещё slow, price, ready, saved_time). По оценкам Нейро выбирает модели.
get_balanceCredit balance and plan.
list_brand_kitsBrand kits de the workspace.