{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["tabs","tab"]},"type":"markdown"},"seo":{"title":"Authentication","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":"authentication","__idx":0},"children":["Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Bria authenticates every API request with an organization-level API token."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-a-token","__idx":1},"children":["Create a token"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Sign in to the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://platform.bria.ai/organization-management/api-keys"},"children":["Bria Console"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Organization management → API keys"]}," and create a key. Give it a name that identifies the application that will use it."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Copy the value once and store it in a secret manager or an environment variable. You can create several keys per organization and revoke any of them at any time."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you are signed in to the Console, your organization's active token appears here, and the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Try it"]}," panel on every endpoint page sends it automatically."]},{"$$mdtype":"Tag","name":"div","attributes":{"class":"bria-token","data-bria-token":"true"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://platform.bria.ai/organization-management/api-keys"},"children":["Get your API token"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"send-the-token","__idx":2},"children":["Send the token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Pass the token in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api_token"]}," request header:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Python SDK","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"from bria_client import BriaSyncClient\n\nclient = BriaSyncClient()                         # reads BRIA_API_TOKEN\nclient = BriaSyncClient(api_token=\"<token>\")      # or pass it explicitly\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"TypeScript SDK","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import { BriaClient } from \"@bria-ai/client\";\n\nconst client = new BriaClient(); // reads BRIA_API_TOKEN\nconst explicit = new BriaClient({ apiToken: \"<token>\" }); // or pass it explicitly\n","lang":"typescript"},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"cURL","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl https://engine.prod.bria-api.com/v2/status/<request_id> -H \"api_token: $BRIA_API_TOKEN\"\n","lang":"bash"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Bria's integrations read the token from the environment:"]},{"$$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":"Integration"},"children":["Integration"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Where the token goes"},"children":["Where the token goes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/integration-methods/python-sdk"},"children":["Python SDK"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BRIA_API_TOKEN"]}," environment variable, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BriaSyncClient(api_token=...)"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/integration-methods/typescript-sdk"},"children":["TypeScript SDK"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BRIA_API_TOKEN"]}," environment variable, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["new BriaClient({ apiToken })"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["REST API (cURL, any language)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api_token"]}," header"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/mcp-authentication"},"children":["MCP server (hosted)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api_token"]}," header, or an OAuth 2.1 bearer token"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/mcp-authentication"},"children":["MCP server (local)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BRIA_API_TOKEN"]}," environment variable"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/integration-methods/bria-skill"},"children":["Agent skills"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BRIA_API_KEY"]}," environment variable"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/streaming-rmbg"},"children":["Streaming Background Removal"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api_token"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["oauth"]}," query parameter on the WebSocket URL"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"endpoints-that-need-no-token","__idx":3},"children":["Endpoints that need no token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/visual-verification-overview"},"children":["Visual Verification"]}," endpoints (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v2/image/verify"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v2/video/verify"]},") are public so that anyone, including an end user's browser, can verify Bria provenance."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"keep-tokens-secret","__idx":4},"children":["Keep tokens secret"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Never embed a token in client-side code, mobile apps or public repositories. Call Bria from your backend, or use the hosted MCP server's OAuth flow when end users need to act with their own Bria accounts."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Rotate keys from the console if one leaks; existing jobs are not affected."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Webhook deliveries are signed with a key derived from your API token, so a leaked token would also let someone forge webhook payloads. Rotate it if in doubt. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/getting-started/async-requests#verify-the-signature"},"children":["Webhooks"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"errors","__idx":5},"children":["Errors"]},{"$$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":"Meaning"},"children":["Meaning"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$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":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api_token"]}," header is missing or the token is invalid or revoked."]}]},{"$$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 token is valid but the plan does not include the endpoint or feature (for example an Enterprise-only option)."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/getting-started/rate-limits-and-errors"},"children":["Rate limits and errors"]}," for the full error contract."]}]},"headings":[{"value":"Authentication","id":"authentication","depth":1},{"value":"Create a token","id":"create-a-token","depth":2},{"value":"Send the token","id":"send-the-token","depth":2},{"value":"Endpoints that need no token","id":"endpoints-that-need-no-token","depth":2},{"value":"Keep tokens secret","id":"keep-tokens-secret","depth":2},{"value":"Errors","id":"errors","depth":2}],"frontmatter":{"title":"Authentication","description":"How to create Bria API tokens, send them, keep them safe, and which endpoints need no token.","seo":{"title":"Authentication"}},"lastModified":"2026-09-29T14:36:47.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/getting-started/authentication","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}