{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["tabs","tab"]},"type":"markdown"},"seo":{"title":"Rate limits and errors","description":"Generate and edit images and video with Bria's Fibo models through a REST API, Python and TypeScript SDKs, MCP server and agent skills. Licensed training data, controllable output, provenance on every result.","siteUrl":"https://docs.bria.ai","image":"/assets/bria-social-card.5f3c59395e7b5efa776984c64ef9cb0956b1d651f45b7ebf9502122a66054f35.db81178d.png","llmstxt":{"hide":false,"title":"Bria API documentation","description":"Bria's developer platform: controllable, commercially safe visual generative AI (images and video) as a REST API, Python and TypeScript SDKs, MCP server and agent skills.","details":{"path":"_llmstxt-details.md"},"sections":[{"title":"Getting started","description":"First call, authentication, async jobs and webhooks, rate limits, inputs.","includeFiles":["index.md","whats-new/fibo-2.md","getting-started/quickstart.md","getting-started/authentication.md","getting-started/async-requests.md","status.yaml","getting-started/rate-limits-and-errors.md","getting-started/working-with-images.md","getting-started/asset-retention.md"]},{"title":"Integrate","description":"Python SDK, TypeScript SDK, MCP server, agent skills, and machine-readable docs for agents.","includeFiles":["integration-methods/python-sdk.md","integration-methods/typescript-sdk.md","MCP-authentication.md","integration-methods/bria-skill.md","integration-methods/for-ai-agents.md"]},{"title":"Concepts","description":"Platform map, VGL and the Fibo models, safety, best practices.","includeFiles":["products-overview.md","VGL.md","safety.md","best-practices-overview.md","image-generation-best-practices.md","image-editing-best-practices.md","product-shots-best-practices.md"]},{"title":"Image Generation","description":"Generate images from text, reference images or structured (VGL) prompts with Fibo 2.","includeFiles":["image-generation-overview.md","image-generation.yaml"]},{"title":"Image Editing","description":"Instruction-based editing plus specialized endpoints for backgrounds, erasing, fill, expansion, upscaling and style.","includeFiles":["image-editing-overview.md","image-editing.yaml"]},{"title":"Product Shot Editing","description":"Cutouts, packshots, shadows, lifestyle scenes, product integration, holding, virtual try-on, automotive.","includeFiles":["product-shot-overview.md","product-shot-editing.yaml"]},{"title":"Video Editing","description":"Background removal (REST or real-time streaming), erasing, upscaling and masks for video; local video upload.","includeFiles":["video-editing-overview.md","local-video-upload-service.md","streaming-rmbg.md","video-editing.yaml"]},{"title":"Ads","description":"Finished ads as input. Ad Delayer turns one into editable layers (the guide holds the layer document contract); Ad Resize produces it at other sizes with the layout redone.","includeFiles":["ads-overview.md","ads.yaml"]},{"title":"Trust and provenance","description":"Public verification of Bria provenance, and attribution of outputs to licensed training data.","includeFiles":["trust-and-provenance-overview.md","visual-verification-overview.md","visual-verification.yaml","enterprise/attribution.md","bria-attribution-service.yaml"]},{"title":"Self-hosting","description":"Run licensed Bria models on your own GPUs. Buy a per-model license, install with Bria Studio or the Python library, run, and handle license errors.","includeFiles":["self-hosted/quickstart.md","self-hosted/overview.md","self-hosted/best-practices.md","self-hosted/fibo-2.md","self-hosted/rmbg-2.md"]},{"title":"Enterprise","description":"Run Bria in your own cloud or on-premises.","includeFiles":["enterprise/deployment-options.md"]}],"excludeFiles":["_llmstxt-details.md","README.md"]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"rate-limits-and-errors","__idx":0},"children":["Rate limits and errors"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"rate-limits","__idx":1},"children":["Rate limits"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Limits apply per organization and per endpoint, measured in requests per minute."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Plan"},"children":["Plan"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Requests per minute per endpoint"},"children":["Requests per minute per endpoint"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Free"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["10"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Pay-as-you-go"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["60"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Enterprise"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1000, customizable per organization"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Above the limit the API returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["429 Too Many Requests"]},". Status endpoint calls count toward the limit, so poll at a sensible interval or use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/getting-started/async-requests#webhooks"},"children":["webhooks"]},". If you need more throughput, ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://bria.ai/contact-us"},"children":["contact us"]}," about an Enterprise plan."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"handling-429","__idx":2},"children":["Handling 429"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Retry with exponential backoff and jitter, honor ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Retry-After"]}," when present, and cap concurrency on your side so a burst does not turn into a wave of retries."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python SDK","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK retries ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["429"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["502"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["503"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["504"]}," responses to status polling automatically (3 attempts, exponential backoff). ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["submit"]}," are never retried, so a job is never started twice. Tune it per client:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"from bria_client import BriaSyncClient\nfrom httpx_retries import Retry\n\nclient = BriaSyncClient(retry=Retry(total=5, backoff_factor=2))\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Keep your own concurrency bounded, for example with a thread pool of a few workers, so parallel jobs stay under the per-endpoint limit."]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"TypeScript SDK","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK retries ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["429"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["502"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["503"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["504"]}," responses to status polling automatically (3 attempts, exponential backoff, honoring ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Retry-After"]},"). ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["submit"]}," are never retried, so a job is never started twice. Tune the policy per client:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import { BriaClient } from \"@bria-ai/client\";\n\nconst client = new BriaClient({ retry: { total: 5, backoffFactor: 2 } });\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Keep your own concurrency bounded: submit in batches of a few jobs with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise.all"]}," rather than everything at once, so parallel jobs stay under the per-endpoint limit."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"error-contract","__idx":3},"children":["Error contract"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Synchronous errors return a JSON body with an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]}," object and the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["request_id"]}," to quote when contacting support:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"request_id\": \"9d4a1a2f5c7e4b6f8a0c2d3e4f5a6b7c\",\n  \"error\": {\n    \"code\": 422,\n    \"message\": \"Unprocessable Entity\",\n    \"details\": \"Prompt failed content moderation.\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Asynchronous jobs report failures through the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/status"},"children":["status endpoint"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ERROR"]}," and the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]}," object is included."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"HTTP status"},"children":["HTTP status"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"When it happens"},"children":["When it happens"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400 Bad Request"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Malformed JSON, an unknown parameter, an invalid value or an unsupported parameter combination."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401 Unauthorized"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Missing or invalid ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api_token"]},". See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/getting-started/authentication"},"children":["Authentication"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403 Forbidden"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The endpoint or option is not included in your plan."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["404 Not Found"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Unknown route, or an unknown or expired ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["request_id"]}," on the status endpoint."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["406 Not Acceptable"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The input image is over the endpoint's pixel limit, or the requested output resolution is over its maximum."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["413 Payload Too Large"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The image or request exceeds the endpoint's size limit."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["415 Unsupported Media Type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The input file type or color mode is not supported. Use JPEG, PNG or WEBP."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["422 Unprocessable Entity"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The request is well formed but cannot be processed: ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/safety"},"children":["content moderation"]}," failed, no object was detected for a prompt, or an async-only option was combined with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sync: true"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["429 Too Many Requests"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Rate limit exceeded. Back off and retry."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["5xx"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A problem on Bria's side. Retry with backoff; check ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://status.bria.ai"},"children":["status.bria.ai"]}," if it persists."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each endpoint page lists its specific error responses and messages."]}]},"headings":[{"value":"Rate limits and errors","id":"rate-limits-and-errors","depth":1},{"value":"Rate limits","id":"rate-limits","depth":2},{"value":"Handling 429","id":"handling-429","depth":3},{"value":"Error contract","id":"error-contract","depth":2}],"frontmatter":{"title":"Rate limits and errors","description":"Request limits per plan, how to handle 429 responses, and the error contract shared by all v2 endpoints.","seo":{"title":"Rate limits and errors"}},"lastModified":"2026-10-11T20:09:03.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/getting-started/rate-limits-and-errors","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}