{"id":"d5575a21-63ca-4114-8536-61946668a39d","entityType":"agent","slug":"clawhub-galbria-bria-ai","name":"Bria Ai","canonicalUrl":"https://www.xpersona.co/agent/clawhub-galbria-bria-ai","canonicalPath":"/agent/clawhub-galbria-bria-ai","generatedAt":"2026-10-09T19:02:25.927Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T09:49:28.684Z","emptyReason":null},"description":"Bria.ai image API — generate from text prompts, edit with natural language, remove backgrounds for transparent PNGs, and create product lifestyle shots. Auth...","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 3.1K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s176yy33gynx3j8dr2cp0nabad83gvey:bria-ai","sourceUrl":"https://clawhub.ai/galbria/bria-ai","homepage":"https://clawhub.ai/galbria/skills/bria-ai","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/galbria/bria-ai","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/galbria/skills/bria-ai","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":64,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Bria Ai technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T09:49:28.684Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T09:49:28.684Z","emptyReason":null},"stars":null,"forks":null,"downloads":3091,"packageName":null,"latestVersion":"1.3.1","tractionLabel":"3.1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T09:49:28.684Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T09:49:28.684Z","lastCrawledAt":"2026-10-09T09:49:28.684Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T09:49:28.684Z","lastVerifiedAt":null,"highlights":[{"version":"1.3.1","createdAt":"2026-06-24T10:06:48.977Z","changelog":"Update bria-ai (OpenClaw device-flow auth); add video-remove-background and bundle skills","fileCount":8,"zipByteSize":15181},{"version":"1.3.0","createdAt":"2026-03-29T11:50:25.970Z","changelog":"**Bria AI Skill v1.3.0 – Major authentication system update** - Upgraded authentication to use OAuth device flow with credential caching in `~/.bria/credentials` (no longer manual API key setup). - Sign-in flow is guided via a single authorization link, improving clarity and usability. - Billing status and API key resolution is now automatic via token introspection. - All code samples and references to manual API key checks have been removed and replaced with the new OAuth flow. - Removed legacy code samples and reference documentation files. This version streamlines setup, enhances security, and simplifies user onboarding.","fileCount":5,"zipByteSize":13258},{"version":"1.2.7","createdAt":"2026-03-14T10:56:22.975Z","changelog":"**Bria AI Skill v0.0.29 Changelog** - Improved API key onboarding: now guides users to acquire and permanently save their API key, including shell and Windows support. - Enhanced setup instructions with cross-platform guidance and auto-detection for environment persistence. - Broadened and clarified the feature descriptions for easier discovery of all capabilities. - Documentation updated to latest API version and usage best practices. - Minor wording changes for clarity, consistency, and user experience.","fileCount":8,"zipByteSize":30029},{"version":"0.0.27","createdAt":"2026-03-14T10:41:14.597Z","changelog":"- Added an MIT license file. - Improved API key setup instructions: now checks if BRIA_API_KEY is set without printing its value.","fileCount":8,"zipByteSize":29946},{"version":"0.2.6","createdAt":"2026-03-11T11:09:29.853Z","changelog":"Bria AI skill v0.2.6 - Expanded and clarified documentation on all features and API endpoints in a new, detailed `SKILL.md`. - Added clear setup instructions and strong API key validation process before usage. - Unified and standardized cURL request examples for all core operations (generate, edit, background removal, upscaling, compositing, product scene creation, etc.). - Provided a comprehensive quick reference for all core use cases and structured JSON requests. - Included advanced response handling guidance (sync/async, polling). - Enhanced descriptions for all capabilities, especially controllable, fine-grained editing operations.","fileCount":7,"zipByteSize":29008},{"version":"1.0.2","createdAt":"2026-03-11T08:50:02.531Z","changelog":"- No user-visible changes; documentation formatting and metadata clean-up. - No changes to functionality, API references, or version identifiers.","fileCount":8,"zipByteSize":29854},{"version":"1.0.1","createdAt":"2026-03-11T08:29:10.388Z","changelog":"- Simplified the API key setup instructions: removed export command and persistence instructions to streamline onboarding. - Clarified that no image operations should proceed until the API key is confirmed set. - Removed guidance about setting environment variables from the instructions. - No changes to the functionality or API reference.","fileCount":8,"zipByteSize":29897},{"version":"1.0.0","createdAt":"2026-03-11T08:21:34.157Z","changelog":"- Improved API key setup instructions: users are now guided to manually visit the Bria API key page instead of relying on auto-opening the browser. - Clarified messaging: instructions for obtaining and setting the API key are simpler and more direct. - Removed platform-specific shell commands for opening URLs; replaced with a universal approach. - No changes to features, endpoints, or core functionality.","fileCount":8,"zipByteSize":30157}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s176yy33gynx3j8dr2cp0nabad83gvey:bria-ai","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s176yy33gynx3j8dr2cp0nabad83gvey:bria-ai` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/galbria/bria-ai before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-09T19:02:25.924Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-galbria-bria-ai/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T09:49:28.684Z","emptyReason":null},"readme":"Skill: Bria Ai\n\nOwner: galbria\n\nSummary: Bria.ai image API — generate from text prompts, edit with natural language, remove backgrounds for transparent PNGs, and create product lifestyle shots. Auth...\n\nTags: latest:1.3.1\n\nVersion history:\n\nv1.3.1 | 2026-06-24T10:06:48.977Z | user\n\nUpdate bria-ai (OpenClaw device-flow auth); add video-remove-background and bundle skills\n\nv1.3.0 | 2026-03-29T11:50:25.970Z | user\n\n**Bria AI Skill v1.3.0 – Major authentication system update**\n\n- Upgraded authentication to use OAuth device flow with credential caching in `~/.bria/credentials` (no longer manual API key setup).\n- Sign-in flow is guided via a single authorization link, improving clarity and usability.\n- Billing status and API key resolution is now automatic via token introspection.\n- All code samples and references to manual API key checks have been removed and replaced with the new OAuth flow.\n- Removed legacy code samples and reference documentation files. \n\nThis version streamlines setup, enhances security, and simplifies user onboarding.\n\nv1.2.7 | 2026-03-14T10:56:22.975Z | user\n\n**Bria AI Skill v0.0.29 Changelog**\n\n- Improved API key onboarding: now guides users to acquire and permanently save their API key, including shell and Windows support.\n- Enhanced setup instructions with cross-platform guidance and auto-detection for environment persistence.\n- Broadened and clarified the feature descriptions for easier discovery of all capabilities.\n- Documentation updated to latest API version and usage best practices.\n- Minor wording changes for clarity, consistency, and user experience.\n\nv0.0.27 | 2026-03-14T10:41:14.597Z | user\n\n- Added an MIT license file.\n- Improved API key setup instructions: now checks if BRIA_API_KEY is set without printing its value.\n\nv0.2.6 | 2026-03-11T11:09:29.853Z | auto\n\nBria AI skill v0.2.6\n\n- Expanded and clarified documentation on all features and API endpoints in a new, detailed `SKILL.md`.\n- Added clear setup instructions and strong API key validation process before usage.\n- Unified and standardized cURL request examples for all core operations (generate, edit, background removal, upscaling, compositing, product scene creation, etc.).\n- Provided a comprehensive quick reference for all core use cases and structured JSON requests.\n- Included advanced response handling guidance (sync/async, polling).\n- Enhanced descriptions for all capabilities, especially controllable, fine-grained editing operations.\n\nv1.0.2 | 2026-03-11T08:50:02.531Z | user\n\n- No user-visible changes; documentation formatting and metadata clean-up.\n- No changes to functionality, API references, or version identifiers.\n\nv1.0.1 | 2026-03-11T08:29:10.388Z | auto\n\n- Simplified the API key setup instructions: removed export command and persistence instructions to streamline onboarding.\n- Clarified that no image operations should proceed until the API key is confirmed set.\n- Removed guidance about setting environment variables from the instructions.\n- No changes to the functionality or API reference.\n\nv1.0.0 | 2026-03-11T08:21:34.157Z | user\n\n- Improved API key setup instructions: users are now guided to manually visit the Bria API key page instead of relying on auto-opening the browser.\n- Clarified messaging: instructions for obtaining and setting the API key are simpler and more direct.\n- Removed platform-specific shell commands for opening URLs; replaced with a universal approach.\n- No changes to features, endpoints, or core functionality.\n\nv1.2.6 | 2026-03-10T21:04:35.317Z | user\n\n- No changes detected in this release; version and documentation remain the same.\n- All API usage instructions, setup steps, and capabilities unchanged.\n- No new features, bug fixes, or enhancements added.\n\nv1.2.5 | 2026-03-10T20:55:21.240Z | user\n\n- Bumped version to 1.2.5.\n- Updated all example curl commands to use User-Agent: BriaSkills/1.2.5.\n- No other changes to core functionality or documentation.\n\nv1.2.4 | 2026-03-10T20:41:35.598Z | user\n\nBria AI Skill 1.2.4\n\n- Streamlined API key setup: requires users to manually set environment variable for persistence—no more direct profile file edits.\n- Modernized description, homepage, and metadata for improved clarity and discoverability.\n- Updated all example API requests to include the BriaSkills/1.2.4 User-Agent header.\n- Expanded and clarified usage tables and quick reference for all core image generation and editing features.\n- Improved guidance and documentation for sync/async image generation and pipeline scenarios.\n\nv1.2.3 | 2026-03-08T14:03:40.366Z | auto\n\n- Updated and expanded the skill description to clarify supported image generation, editing, enhancement, transformation, and e-commerce use cases.\n- Added more trigger phrases related to image editing, batch generation, pipeline workflows, style transfer, photo restoration, colorization, and product integration.\n- No changes to APIs, capabilities, or technical setup steps; documentation improvements only.\n- This update increases discoverability and makes usage scenarios clearer for a broader audience.\n\nv1.2.2 | 2026-03-05T08:23:38.503Z | user\n\nNo file changes detected; documentation and usage details improved.\n\n- Added new core capability: Product Integrate for embedding products into scenes at specific coordinates.\n- Clarified quick reference commands, including new fields for image resolution and product integration workflow.\n- Updated Product Lifestyle Shot endpoint path for accuracy.\n- Documented available image resolutions and their effects.\n- Expanded capability descriptions for clearer use case guidance.\n\nv1.2.1 | 2026-02-23T12:46:16.546Z | user\n\nVersion 1.2.1\n\n- Added step-by-step API key setup and verification instructions for users (including platform-specific commands for macOS, Linux, and Windows).\n- Improved and reorganized documentation for clearer usage guidance and core capability explanations.\n- Enhanced skill description for easier discovery and understanding of controllable image generation and editing use cases.\n- Added references/workflows.md for workflow guidance; removed outdated guide.md file.\n- Updated metadata (author, version, license) for consistency and clarity.\n\nv0.0.2 | 2026-02-08T12:14:00.474Z | user\n\nVersion 0.0.2\n\nv0.0.1 | 2026-02-08T08:58:49.593Z | auto\n\nInitial release of bria-ai: Generate and edit production-ready visual assets with Bria.ai’s commercially-safe models.\n\n- Supports batch image generation and parallel API workflows.\n- Offers chained pipeline capabilities: generate → edit → remove background, and more.\n- Core functions include image creation, editing (text/mask), background removal, outpainting, upscaling, and style/quality transformations.\n- Ready-to-use examples and prompts for websites, presentations, e-commerce, and marketing assets.\n- Includes prompt engineering and workflow tips for best results in production use.\n\nArchive index:\n\nArchive v1.3.1: 8 files, 15181 bytes\n\nFiles: LICENSE.txt (1335b), references/api-endpoints.md (13032b), references/capabilities.md (4105b), references/code-examples/bria_auth.sh (3498b), references/code-examples/bria_client.sh (4244b), skill-card.md (2574b), SKILL.md (7294b), _meta.json (126b)\n\nFile v1.3.1:SKILL.md\n\n---\nname: bria-ai\ndescription: >\n  Bria.ai image API — generate from text prompts, edit with natural language,\n  remove backgrounds for transparent PNGs, and create product lifestyle shots.\n  Authenticates via OAuth device flow, caches credentials in ~/.bria/credentials,\n  calls 20+ endpoints. Commercially safe, royalty-free.\n  Triggers on: remove background, transparent PNG, cutout, generate image, create banner,\n  edit photo, product photography, upscale, restyle, inpainting, outpainting,\n  lifestyle shot, background replacement, object removal, photo restoration.\nlicense: MIT\nhomepage: https://bria.ai\nmetadata:\n  author: Bria AI\n  version: \"1.3.0\"\n  openclaw:\n    requires:\n      env:\n        - BRIA_API_KEY\n      anyBins:\n        - curl\n      config:\n        - ~/.bria/credentials\n    primaryEnv: BRIA_API_KEY\n    homepage: https://bria.ai\n    emoji: \"\\U0001F5BC\"\n\n---\n\n# Bria — AI Image Generation, Editing & Background Removal\n\nCommercially safe, royalty-free image generation and editing through 20+ API endpoints.\n\nFor additional endpoint details, see the [Bria API reference for agents](https://docs.bria.ai/llms.txt).\n\n## When to Use This Skill\n\n- **Generate images** — \"create an image of...\", \"make me a banner\", \"generate a hero image\", \"I need a product photo\"\n- **Edit images** — \"change the background\", \"make it look like winter\", \"add a vase to the table\", \"remove the person\"\n- **Remove/replace backgrounds** — \"make the background transparent\", \"cut out the product\", \"replace with a studio background\"\n- **Product photography** — \"create a lifestyle shot\", \"place this product in a kitchen scene\", \"e-commerce packshot\"\n- **Enhance/transform** — \"upscale this image\", \"make it higher resolution\", \"restyle as oil painting\", \"change the lighting\"\n\n---\n\n## Setup — Authentication\n\n### Step 1: Check for existing credentials\n\n```bash\nif [ -f ~/.bria/credentials ]; then\n  BRIA_ACCESS_TOKEN=$(grep '^access_token=' \"$HOME/.bria/credentials\" | cut -d= -f2-)\n  BRIA_API_KEY=$(grep '^api_token=' \"$HOME/.bria/credentials\" | cut -d= -f2-)\nfi\nif [ -z \"$BRIA_ACCESS_TOKEN\" ]; then\n  echo \"NO_CREDENTIALS\"\nelif [ -n \"$BRIA_API_KEY\" ]; then\n  echo \"READY\"\nelse\n  echo \"CREDENTIALS_FOUND\"\nfi\n```\n\n- `READY` → skip to making API calls\n- `CREDENTIALS_FOUND` → skip to Step 3\n- `NO_CREDENTIALS` → proceed to Step 2\n\n### Step 2: Authenticate via device flow\n\nSource the auth helper and run `bria_auth`:\n\n```bash\nsource ~/.agents/skills/bria-ai/references/code-examples/bria_auth.sh\nbria_auth\n```\n\n`bria_auth` will print `SIGN_IN_URL=...` and `USER_CODE=...`. Show the user exactly this — nothing more:\n\n> **Connect your Bria account:** [Click here to sign in]({SIGN_IN_URL})\n> Your code is **{USER_CODE}** — it's already filled in.\n\nThen wait; `bria_auth` polls automatically and prints `AUTHENTICATED` when done.\n\nIf it prints an error, the code expired — run `bria_auth` again.\n\n**Do not proceed with any API call until authentication is confirmed.**\n\n### Step 3: Verify billing status and resolve API key\n\n```bash\nsource ~/.agents/skills/bria-ai/references/code-examples/bria_auth.sh\nbria_introspect\n```\n\nInterpret output:\n- `BILLING_ERROR: ...` — relay the message to the user verbatim and **stop**. Do not make any API calls.\n- `TOKEN_EXPIRED` — tell the user their session expired and restart from Step 2.\n- `READY` — `BRIA_API_KEY` is now cached in `~/.bria/credentials`. Proceed.\n\n---\n\n## Decision Tree — Which Endpoint to Use\n\n```\nTransparent PNG / cutout / remove background?\n  → /v2/image/edit/remove_background\n\nGenerate image from scratch (text → image)?\n  → /v2/image/generate\n\nEdit existing image with text instruction?\n  → /v2/image/edit  (use --key images)\n\nChange / replace / blur background?\n  → /v2/image/edit/replace_background  (prompt: \"blur\" or describe new bg)\n\nPlace product in a lifestyle scene?\n  → /v1/product/lifestyle_shot_by_text\n\nUpscale / increase resolution?\n  → /v2/image/edit/increase_resolution  (scale: 2 or 4)\n\nAnything else (restyle, relight, reseason, restore, colorize, sketch, blend, outpaint)?\n  → See references/capabilities.md for the full endpoint list\n```\n\n---\n\n## How to Call Any Endpoint\n\n```bash\nsource ~/.agents/skills/bria-ai/references/code-examples/bria_client.sh\n\n# Generate (no image input)\nRESULT=$(bria_call /v2/image/generate \"\" '\"prompt\": \"your description\", \"aspect_ratio\": \"16:9\", \"sync\": true')\n\n# Remove background\nRESULT=$(bria_call /v2/image/edit/remove_background \"/path/to/local/image.png\")\n\n# Replace background\nRESULT=$(bria_call /v2/image/edit/replace_background \"https://example.com/img.jpg\" '\"prompt\": \"sunset beach\"')\n\n# Edit image (uses images array — pass --key images)\nRESULT=$(bria_call /v2/image/edit \"/path/to/image.png\" --key images '\"instruction\": \"make it look warmer\"')\n\n# Upscale\nRESULT=$(bria_call /v2/image/edit/increase_resolution \"https://example.com/img.jpg\" '\"scale\": 4')\n\n# Lifestyle shot\nRESULT=$(bria_call /v1/product/lifestyle_shot_by_text \"/path/to/product.png\" '\"scene_description\": \"modern kitchen countertop\"')\n\necho \"$RESULT\"\n```\n\n**Calling convention:** `bria_call <endpoint> <image_or_empty> [--key <json_key>] [extra JSON fields...]`\n- Pass a URL, local file path, or `\"\"` for endpoints without image input\n- Use `--key images` when the endpoint expects an `images` array instead of `image`\n- Returns the result image URL on success, or prints an error to stderr\n\n**Generation options:** Aspect ratios `1:1`, `16:9`, `4:3`, `9:16`, `3:4`. Resolution `1MP` (default) or `4MP` (more detail, +30s). Pass `\"sync\": true` for single images.\n\n> **Advanced**: For precise control over generation, use the **vgl** skill for structured VGL JSON prompts.\n\n---\n\n## Common Failures\n\n- **`bria_call` returns empty / no URL** → `BRIA_API_KEY` was not set. Run Step 3 (`bria_introspect`) to cache it.\n- **Async job times out** → Some endpoints take 60–90s. If `bria_call` reports a timeout, retry once; the job may have been queued.\n- **ERROR 401** → API key is stale. Delete `~/.bria/credentials` and re-authenticate from Step 2.\n- **`BILLING_ERROR`** → Relay message to user verbatim, do not retry API calls.\n- **Local file not found** → Pass the absolute path; `bria_client.sh` handles base64 encoding automatically.\n- **`/v2/image/edit` returns wrong result** → Confirm `--key images` flag is present; this endpoint requires the images array format.\n\n---\n\n## Resources\n\n- **[Capabilities & Prompt Recipes](references/capabilities.md)** — Full endpoint table, use-case recipes, and prompt engineering tips\n- **[API Endpoints Reference](references/api-endpoints.md)** — Complete parameter documentation for all 20+ endpoints\n- **[Shell Client (bria_client.sh)](references/code-examples/bria_client.sh)** — `bria_call` helper: auth, base64, JSON, polling\n- **[Auth Helper (bria_auth.sh)](references/code-examples/bria_auth.sh)** — `bria_auth` and `bria_introspect` functions\n- **[Full API docs for agents (llms.txt)](https://docs.bria.ai/llms.txt)** — Agent-ready Bria API reference\n\n## Related Skills\n\n- **vgl** — Structured VGL JSON prompts for precise, deterministic control over FIBO image generation\n- **image-utils** — Classic image manipulation (resize, crop, composite, watermarks) for post-processing\n\nFile v1.3.1:_meta.json\n\n{\n  \"ownerId\": \"kn7artjmk0ncb5fmp9x21x4tss80jshr\",\n  \"slug\": \"bria-ai\",\n  \"version\": \"1.3.1\",\n  \"publishedAt\": 1782295608977\n}\n\nFile v1.3.1:references/api-endpoints.md\n\n# Bria.ai API Reference\n\n## Base URL & Authentication\n\n**Base URL:** `https://engine.prod.bria-api.com`\n\n**Authentication:** Include these headers in all requests:\n```\napi_token: YOUR_BRIA_API_KEY\nContent-Type: application/json\nUser-Agent: BriaSkills/<version>\n```\n\n> **Required:** Always include the `User-Agent: BriaSkills/<version>` header (where `<version>` is the current skill version from `package.json`, e.g. `BriaSkills/1.3.0`) in every API call, including status polling requests.\n\n---\n\n## FIBO - Image Generation\n\n### POST /v2/image/generate\n\nGenerate images from text prompts using FIBO's structured prompt system.\n\n**Request:**\n```json\n{\n  \"prompt\": \"string (required)\",\n  \"aspect_ratio\": \"1:1\",\n  \"resolution\": \"1MP\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1,\n  \"seed\": null\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `prompt` | string | required* | Image description (* or use `structured_prompt`) |\n| `aspect_ratio` | string | \"1:1\" | \"1:1\", \"4:3\", \"16:9\", \"3:4\", \"9:16\" |\n| `resolution` | string | \"1MP\" | Output image resolution. \"1MP\" or \"4MP\". \"4MP\" improves image details, especially for photorealism, but increases latency by ~30 seconds. |\n| `negative_prompt` | string | - | What to exclude |\n| `num_results` | int | 1 | Number of images (1-4) |\n| `seed` | int | random | For reproducibility |\n| `structured_prompt` | string | - | JSON from previous generation (for refinement). Use with `prompt` to refine, or alone with `seed` to recreate. |\n| `image_url` | string | - | Reference image (for inspire mode) |\n\n**Input Combination Rules** (mutually exclusive):\n- `prompt` — Generate from text\n- `image_url` — Generate inspired by a reference image\n- `image_url` + `prompt` — Generate inspired by image, guided by text\n- `structured_prompt` + `seed` — Recreate a previous image exactly\n- `structured_prompt` + `prompt` + `seed` — Refine a previous image with new instructions\n\nAll combinations support `aspect_ratio`, `negative_prompt`, `num_results`, and `seed`.\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://engine.prod.bria-api.com/v2/status/uuid\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...\",\n    \"structured_prompt\": \"{...}\",\n    \"seed\": 12345\n  }\n}\n```\n\n---\n\n## RMBG-2.0 - Background Removal\n\n### POST /v2/image/edit/remove_background\n\nRemove background from image. Returns PNG with transparency.\n\n**Request:**\n```json\n{\n  \"image\": \"https://publicly-accessible-image-url\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `image` | string | Source image URL (JPEG, PNG, WEBP) |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://...\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...png\"\n  }\n}\n```\n\n---\n\n## FIBO-Edit - Image Editing\n\n### POST /v2/image/edit\n\nEdit an image using natural language instructions. No mask required.\n\n**Request:**\n```json\n{\n  \"images\": [\"https://source-image-url\"],\n  \"instruction\": \"change the mug color to red\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `images` | array | required | Array of image URLs or base64 data URLs |\n| `instruction` | string | required | Edit instruction in natural language |\n\n### POST /v2/image/edit/gen_fill\n\nGenerate content in a masked region (inpainting).\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"mask\": \"https://mask-image-url\",\n  \"prompt\": \"what to generate\",\n  \"mask_type\": \"manual\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL |\n| `mask` | string | required | Mask URL (white=edit, black=keep) |\n| `prompt` | string | required | What to generate in masked area |\n| `mask_type` | string | \"manual\" | \"manual\" or \"automatic\" |\n| `negative_prompt` | string | - | What to avoid |\n| `num_results` | int | 1 | Number of variations |\n\n**Mask Requirements:**\n- White pixels (255) = area to edit\n- Black pixels (0) = area to preserve\n- Same aspect ratio as source image\n\n### POST /v2/image/edit/erase\n\nRemove objects defined by mask.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"mask\": \"https://mask-image-url\"\n}\n```\n\n### POST /v2/image/edit/erase_foreground\n\nRemove primary subject and fill with background.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/replace_background\n\nReplace background with AI-generated content.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"prompt\": \"new background description\"\n}\n```\n\n### POST /v2/image/edit/blur_background\n\nApply blur effect to image background.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/expand\n\nExpand/outpaint an image to extend its boundaries.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-string-or-url\",\n  \"aspect_ratio\": \"16:9\",\n  \"prompt\": \"optional description for new content\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL or base64 string |\n| `aspect_ratio` | string | required | Target ratio: \"1:1\", \"4:3\", \"16:9\", \"3:4\", \"9:16\" |\n| `prompt` | string | - | Optional - describe content to generate |\n\n### POST /v2/image/edit/enhance\n\nEnhance image quality (lighting, colors, details).\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/increase_resolution\n\nUpscale image resolution.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"scale\": 2\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL |\n| `scale` | int | 2 | Upscale factor (2 or 4) |\n\n### POST /v1/product/lifestyle_shot_by_text\n\nPlace a product in a lifestyle scene using text description.\n\n**Request:**\n```json\n{\n  \"file\": \"BASE64_ENCODED_IMAGE\",\n  \"prompt\": \"modern kitchen countertop, natural lighting\",\n  \"placement_type\": \"automatic\"\n}\n```\n\n### POST /image/edit/product/integrate\n\nIntegrate and embed one or more products into a predefined scene at precise user-defined coordinates. The product is automatically matched to the scene's lighting, perspective, and aesthetics. Products are automatically cut out from their background as part of the pipeline.\n\n**Request:**\n```json\n{\n  \"scene\": \"https://scene-image-url\",\n  \"products\": [\n    {\n      \"image\": \"https://product-image-url\",\n      \"coordinates\": {\n        \"x\": 100,\n        \"y\": 200,\n        \"width\": 300,\n        \"height\": 400\n      }\n    }\n  ],\n  \"seed\": 42\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `scene` | string | required | Scene image URL or base64. Accepted formats: jpeg, jpg, png, webp |\n| `products` | array | required | Array of product objects (1 to N products) |\n| `products[].image` | string | required | Product image URL or base64. If it has an alpha channel, no cutout is applied; otherwise automatic cutout is applied |\n| `products[].coordinates` | object | required | Placement and scaling of the product within the scene |\n| `products[].coordinates.x` | int | required | X-coordinate of the product's top-left corner (pixels) |\n| `products[].coordinates.y` | int | required | Y-coordinate of the product's top-left corner (pixels) |\n| `products[].coordinates.width` | int | required | Desired product width in pixels (must not exceed scene dimensions) |\n| `products[].coordinates.height` | int | required | Desired product height in pixels (must not exceed scene dimensions) |\n| `seed` | int | random | Seed for deterministic generation |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"result\": {\n    \"image_url\": \"https://...\"\n  }\n}\n```\n\n**Async Response (202):**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://...\"\n}\n```\n\n---\n\n## Text-Based Object Editing\n\n### POST /v2/image/edit/add_object_by_text\n\nAdd a new object to an image using natural language.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"instruction\": \"Place a red vase with flowers on the table\"\n}\n```\n\n### POST /v2/image/edit/replace_object_by_text\n\nReplace an existing object with a new one.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"instruction\": \"Replace the red apple with a green pear\"\n}\n```\n\n### POST /v2/image/edit/erase_by_text\n\nRemove a specific object by name.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"object_name\": \"table\"\n}\n```\n\n---\n\n## Image Transformation\n\n### POST /v2/image/edit/blend\n\nBlend/merge images or apply textures.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"overlay\": \"texture-or-art-url\",\n  \"instruction\": \"Place the art on the shirt, keep the art exactly the same\"\n}\n```\n\n### POST /v2/image/edit/reseason\n\nChange the season or weather of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"season\": \"winter\"\n}\n```\n\n**Seasons:** `spring`, `summer`, `autumn`, `winter`\n\n### POST /v2/image/edit/restyle\n\nTransform the artistic style of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"style\": \"oil_painting\"\n}\n```\n\n**Style IDs:** `render_3d`, `cubism`, `oil_painting`, `anime`, `cartoon`, `coloring_book`, `retro_ad`, `pop_art_halftone`, `vector_art`, `story_board`, `art_nouveau`, `cross_etching`, `wood_cut`\n\n### POST /v2/image/edit/relight\n\nModify the lighting setup of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"light_type\": \"sunrise light\",\n  \"light_direction\": \"front\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL or base64 |\n| `light_type` | string | required | Lighting preset (see values below) |\n| `light_direction` | string | required | `front`, `side`, `bottom`, `top-down` |\n\n**Light Types:** `midday`, `blue hour light`, `low-angle sunlight`, `sunrise light`, `spotlight on subject`, `overcast light`, `soft overcast daylight lighting`, `cloud-filtered lighting`, `fog-diffused lighting`, `side lighting`, `moonlight lighting`, `starlight nighttime`, `soft bokeh lighting`, `harsh studio lighting`\n\n---\n\n## Image Restoration & Conversion\n\n### POST /v2/image/edit/sketch_to_colored_image\n\nConvert a sketch or line drawing to a photorealistic image.\n\n**Request:**\n```json\n{\n  \"image\": \"sketch-base64-or-url\",\n  \"prompt\": \"optional description\"\n}\n```\n\n### POST /v2/image/edit/restore\n\nRestore old/damaged photos by removing noise, scratches, and blur.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\"\n}\n```\n\n### POST /v2/image/edit/colorize\n\nAdd color to B&W photos or convert to B&W.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"color\": \"contemporary color\"\n}\n```\n\n**Colors:** `contemporary color`, `vivid color`, `black and white colors`, `sepia vintage`\n\n### POST /v2/image/edit/crop_foreground\n\nRemove background and crop tightly around the foreground.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\"\n}\n```\n\n---\n\n## Structured Instructions\n\n### POST /v2/structured_instruction/generate\n\nGenerate a structured JSON instruction from natural language (no image generated).\n\n**Request:**\n```json\n{\n  \"images\": [\"base64-or-url\"],\n  \"instruction\": \"change to golden hour lighting\",\n  \"mask\": \"optional-mask-url\"\n}\n```\n\n**Returns:** `structured_instruction` JSON that can be passed to `/v2/image/edit`\n\n---\n\n## Status Polling\n\n### GET /v2/status/{request_id}\n\nCheck async request status.\n\n**Response:**\n```json\n{\n  \"status\": \"IN_PROGRESS | COMPLETED | FAILED\",\n  \"result\": {\n    \"image_url\": \"https://...\"\n  },\n  \"request_id\": \"uuid\"\n}\n```\n\n**Status Values:**\n- `IN_PROGRESS` - Still processing\n- `COMPLETED` - Success, result available\n- `FAILED` - Error occurred\n\n**Polling Pattern:**\n```python\nimport requests, time\n\ndef poll(status_url, api_key, timeout=120):\n    headers = {\"api_token\": api_key, \"User-Agent\": \"BriaSkills/1.3.0\"}\n    for _ in range(timeout // 2):\n        r = requests.get(status_url, headers=headers)\n        data = r.json()\n        if data[\"status\"] == \"COMPLETED\":\n            return data[\"result\"][\"image_url\"]\n        if data[\"status\"] == \"FAILED\":\n            raise Exception(data.get(\"error\"))\n        time.sleep(2)\n    raise TimeoutError()\n```\n\n---\n\n## Error Handling\n\n### HTTP Status Codes\n\n| Code | Description |\n|------|-------------|\n| 200 | Success |\n| 400 | Bad request |\n| 401 | Unauthorized - invalid API key |\n| 415 | Unsupported media type |\n| 422 | Validation failed / Content moderation blocked |\n| 429 | Rate limited |\n| 500 | Server error |\n\n### Supported Image Formats\n\n- **Input:** JPEG, JPG, PNG, WEBP (RGB, RGBA, CMYK)\n- **Output:** PNG (with transparency where applicable)\n\nFile v1.3.1:references/capabilities.md\n\n# Bria Capabilities Reference\n\n## What You Can Build\n\n- **E-commerce product catalog** — Generate product photos, remove backgrounds for transparent PNGs, place products in lifestyle scenes (kitchen, office, outdoor), create packshots with consistent style\n- **Landing page visuals** — Generate hero images, abstract tech backgrounds, team photos, and section illustrations — all matching your brand aesthetic\n- **Social media content** — Instagram posts (1:1), Stories/Reels (9:16), LinkedIn banners (16:9), ad creatives — batch-generate variants for A/B testing\n- **Marketing campaign assets** — Seasonal transformations (summer→winter), restyle product shots for different markets, create localized visuals at scale\n- **Photo restoration pipeline** — Restore old damaged photos, colorize black & white images, upscale low-res photos to 4x, enhance quality automatically\n- **Brand asset toolkit** — Remove backgrounds from logos, blend artwork onto products (t-shirts, mugs), create consistent product photography across your entire catalog\n- **AI-powered design workflows** — Chain operations: generate→edit→remove background→place in scene→upscale — all automated through API pipelines\n\n---\n\n## Full Capabilities Table\n\n| Need | Capability | Endpoint |\n|------|------------|----------|\n| Generate images from text | FIBO Generate | `/v2/image/generate` |\n| Edit images by text instruction | FIBO-Edit | `/v2/image/edit` |\n| Edit image region with mask | GenFill/Erase | `/v2/image/edit/genfill` |\n| Add/Replace/Remove objects | Text-based editing | `/v2/image/edit` |\n| Remove background (transparent PNG) | RMBG-2.0 | `/v2/image/edit/remove_background` |\n| Replace/blur/erase background | Background ops | `/v2/image/edit/replace_background` |\n| Expand/outpaint images | Outpainting | `/v2/image/edit/increase_outpaint` |\n| Upscale image resolution | Super Resolution | `/v2/image/edit/increase_resolution` |\n| Enhance image quality | Enhancement | `/v2/image/edit/enhance` |\n| Restyle images | Restyle | `/v2/image/edit/restyle` |\n| Change lighting | Relight | `/v2/image/edit/relight` |\n| Change season | Reseason | `/v2/image/edit/reseason` |\n| Composite/blend images | Image Blending | `/v2/image/edit/blend` |\n| Restore old photos | Restoration | `/v2/image/edit/restore` |\n| Colorize images | Colorization | `/v2/image/edit/colorize` |\n| Sketch to photo | Sketch2Image | `/v2/image/edit/sketch2image` |\n| Create product lifestyle shots | Lifestyle Shot | `/v1/product/lifestyle_shot_by_text` |\n| Integrate products into scenes | Product Integrate | `/v1/product/product_integrate` |\n\n---\n\n## Prompt Engineering Tips\n\n- **Style**: \"professional product photography\" vs \"casual snapshot\", \"flat design illustration\" vs \"3D rendered\"\n- **Lighting**: \"soft natural light\", \"studio lighting\", \"dramatic shadows\"\n- **Background**: \"white studio\", \"gradient\", \"blurred office\", \"transparent\"\n- **Composition**: \"centered\", \"rule of thirds\", \"negative space on left for text\"\n- **Quality keywords**: \"high quality\", \"professional\", \"commercial grade\", \"4K\", \"sharp focus\"\n- **Negative prompts**: \"blurry, low quality, pixelated\", \"text, watermark, logo\"\n\n### Recipes by Use Case\n\n**Hero banner (16:9):** `\"Modern tech startup workspace with developers collaborating, bright natural lighting, clean minimal aesthetic\"` — include \"clean background\" or \"minimal\" for text overlay space\n\n**Product photo (1:1):** `\"Professional product photo of [item] on white studio background, soft shadows, commercial photography lighting\"` — then remove background for transparent PNG\n\n**Presentation visual (16:9):** `\"Abstract visualization of data analytics, blue and purple gradient, modern corporate style, clean composition with space for text\"` — common themes: \"abstract technology\", \"business collaboration\", \"minimalist geometric patterns\"\n\n**Instagram post (1:1):** `\"Lifestyle photo of coffee and laptop on wooden desk, morning light, cozy atmosphere\"`\n\n**Story/Reel (9:16):** `\"Vertical product showcase of smartphone, floating in gradient background, tech aesthetic\"`\n\nFile v1.3.1:skill-card.md\n\n## Description:\n\nBria.ai image API skill that guides agents to authenticate, generate images from prompts, edit images with natural language, remove backgrounds, and create product lifestyle shots through Bria endpoints.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[galbria](https://clawhub.ai/user/galbria)\n\n### License/Terms of Use:\n\nMIT\n\n## Use Case:\n\nDevelopers, creators, and marketing teams use this skill through an agent to generate, edit, upscale, restore, and remove backgrounds from images with Bria.ai for product, campaign, and design workflows.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Credentials are cached in ~/.bria/credentials and may be exposed on shared or sensitive machines.\n\nMitigation: Use the skill on user-controlled machines, lock down ~/.bria and ~/.bria/credentials to the current user, and rotate Bria credentials if they may have been stored with permissive permissions.\n\nRisk: Local or remote images can be sent to Bria API endpoints during generation and editing workflows.\n\nMitigation: Use only non-confidential images unless the user's Bria terms and data-handling requirements permit uploading that content.\n\nRisk: Environment overrides such as BRIA_AUTH_BASE or BRIA_API_BASE can redirect authentication or API calls unexpectedly.\n\nMitigation: Verify endpoint-related environment variables before use and avoid running the skill in untrusted shell environments.\n\n## Reference(s):\n\n- [Bria.ai Homepage](https://bria.ai)\n- [Full API docs for agents](https://docs.bria.ai/llms.txt)\n- [ClawHub Skill Page](https://clawhub.ai/galbria/skills/bria-ai)\n- [Capabilities & Prompt Recipes](references/capabilities.md)\n- [API Endpoints Reference](references/api-endpoints.md)\n- [Shell Client](references/code-examples/bria_client.sh)\n- [Auth Helper](references/code-examples/bria_auth.sh)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Shell commands, API calls, Configuration]\n\n**Output Format:** [Markdown with inline bash code blocks and API result URLs]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Requires Bria authentication and may cache credentials in ~/.bria/credentials.]\n\n## Skill Version(s):\n\n1.3.1 (source: server release metadata; artifact frontmatter reports 1.3.0)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.3.1:LICENSE.txt\n\nMIT License\n\nCopyright (c) 2025\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n---\n\nNote: This skill integrates with Bria.ai's API. Usage of the Bria.ai API is\nsubject to Bria.ai's Terms of Service and API usage policies. The Bria.ai\nAPI and associated models are commercial products - please refer to\nhttps://bria.ai for licensing and pricing information.\n\nArchive v1.3.0: 5 files, 13258 bytes\n\nFiles: references/api-endpoints.md (13032b), references/code-examples/bria_client.sh (4244b), skill-card.md (2086b), SKILL.md (14006b), _meta.json (126b)\n\nFile v1.3.0:SKILL.md\n\n---\nname: bria-ai\ndescription: AI image generation, editing, and background removal API via Bria.ai — authenticates via OAuth device flow and caches credentials in ~/.bria/credentials, then calls 20+ endpoints to remove backgrounds for transparent PNGs and cutouts, generate images from text prompts, and edit photos with natural language instructions. Also create product photography and lifestyle shots, replace or blur backgrounds, upscale resolution, restyle, and batch-generate visual assets. Use this skill whenever the user wants to remove a background, create transparent PNGs, generate, edit, modify, or transform any image — including hero images, banners, social media visuals, product photos, illustrations, icons, thumbnails, ad creatives, or marketing materials. Also triggers on cutout, inpainting, outpainting, object removal or addition, photo restoration, style transfer, image enhancement, relight, reseason, sketch-to-photo, or any visual content creation. Commercially safe, royalty-free.\nlicense: MIT\nhomepage: https://bria.ai\nmetadata:\n  author: Bria AI\n  version: \"1.3.0\"\n  openclaw:\n    requires:\n      env:\n        - BRIA_API_KEY\n      anyBins:\n        - curl\n      config:\n        - ~/.bria/credentials\n    primaryEnv: BRIA_API_KEY\n    homepage: https://bria.ai\n    emoji: \"\\U0001F5BC\"\n\n---\n\n# Bria — AI Image Generation, Editing & Background Removal\n\nCommercially safe, royalty-free image generation and editing through 20+ API endpoints. Generate from text, edit with natural language, remove backgrounds, create product shots, and build automated image pipelines.\n\nFor additional endpoint details beyond what is documented here, see the [Bria API reference for agents](https://docs.bria.ai/llms.txt).\n\n## When to Use This Skill\n\nUse this skill when the user wants to:\n- **Generate images** — \"create an image of...\", \"make me a banner\", \"generate a hero image\", \"I need a product photo\"\n- **Edit images** — \"change the background\", \"make it look like winter\", \"add a vase to the table\", \"remove the person\"\n- **Remove/replace backgrounds** — \"make the background transparent\", \"cut out the product\", \"replace with a studio background\"\n- **Product photography** — \"create a lifestyle shot\", \"place this product in a kitchen scene\", \"e-commerce packshot\"\n- **Enhance/transform** — \"upscale this image\", \"make it higher resolution\", \"restyle as oil painting\", \"change the lighting\"\n- **Batch/pipeline** — \"generate 10 product images\", \"process all these images\", \"remove backgrounds in bulk\"\n\nThis skill handles the full spectrum of AI image operations. If the user mentions images, photos, visuals, or any visual content creation — use this skill.\n\n---\n\n## What You Can Build\n\n- **E-commerce product catalog** — Generate product photos, remove backgrounds for transparent PNGs, place products in lifestyle scenes (kitchen, office, outdoor), create packshots with consistent style\n- **Landing page visuals** — Generate hero images, abstract tech backgrounds, team photos, and section illustrations — all matching your brand aesthetic\n- **Social media content** — Instagram posts (1:1), Stories/Reels (9:16), LinkedIn banners (16:9), ad creatives — batch-generate variants for A/B testing\n- **Marketing campaign assets** — Seasonal transformations (summer→winter), restyle product shots for different markets, create localized visuals at scale\n- **Photo restoration pipeline** — Restore old damaged photos, colorize black & white images, upscale low-res photos to 4x, enhance quality automatically\n- **Brand asset toolkit** — Remove backgrounds from logos, blend artwork onto products (t-shirts, mugs), create consistent product photography across your entire catalog\n- **AI-powered design workflows** — Chain operations: generate→edit→remove background→place in scene→upscale — all automated through API pipelines\n\n---\n\n## Setup — Authentication\n\nBefore making any API call, you need a valid Bria access token.\n\n### Step 1: Check for existing credentials\n\n```bash\nif [ -f ~/.bria/credentials ]; then\n  BRIA_ACCESS_TOKEN=$(grep '^access_token=' \"$HOME/.bria/credentials\" | cut -d= -f2-)\n  BRIA_API_KEY=$(grep '^api_token=' \"$HOME/.bria/credentials\" | cut -d= -f2-)\nfi\nif [ -z \"$BRIA_ACCESS_TOKEN\" ]; then\n  echo \"NO_CREDENTIALS\"\nelif [ -n \"$BRIA_API_KEY\" ]; then\n  echo \"READY\"\nelse\n  echo \"CREDENTIALS_FOUND\"\nfi\n```\n\nIf the output is `READY`, skip straight to making API calls — no introspection needed.\nIf the output is `CREDENTIALS_FOUND`, skip to Step 3.\nIf the output is `NO_CREDENTIALS`, proceed to Step 2.\n\n### Step 2: Authenticate via device authorization\n\nStart the device authorization flow:\n\n**2a. Request a device code:**\n\n```bash\nDEVICE_RESPONSE=$(curl -s -X POST \"https://engine.prod.bria-api.com/v2/auth/device/authorize\" \\\n  -H \"Content-Type: application/json\")\necho \"$DEVICE_RESPONSE\"\n```\n\nParse the response fields:\n- `device_code` — used to poll for the token (keep this, don't show to user)\n- `user_code` — the code the user must enter (e.g. `BRIA-XXXX`)\n- `interval` — seconds between poll attempts\n\n**2b. Show the user a single sign-in link.** Tell them exactly this — nothing more:\n\n> **Connect your Bria account:** [Click here to sign in](https://platform.bria.ai/device/verify?user_code={user_code})\n> Your code is **{user_code}** — it's already filled in.\n\nDo NOT show two links. Do NOT show the raw URL separately. Do NOT use `verification_uri` from the API response. Keep it to one clickable link.\n\n**2c. Poll for the token.** After showing the user the code, immediately start polling. Try up to 60 times with the given interval (default 5 seconds):\n\n```bash\nfor i in $(seq 1 60); do\n  TOKEN_RESPONSE=$(curl -s -X POST \"https://engine.prod.bria-api.com/v2/auth/token\" \\\n    -d \"grant_type=urn:ietf:params:oauth:grant-type:device_code\" \\\n    -d \"device_code=$DEVICE_CODE\")\n  ACCESS_TOKEN=$(printf '%s' \"$TOKEN_RESPONSE\" | sed -n 's/.*\"access_token\" *: *\"\\([^\"]*\\)\".*/\\1/p')\n  if [ -n \"$ACCESS_TOKEN\" ]; then\n    BRIA_ACCESS_TOKEN=\"$ACCESS_TOKEN\"\n    REFRESH_TOKEN=$(printf '%s' \"$TOKEN_RESPONSE\" | sed -n 's/.*\"refresh_token\" *: *\"\\([^\"]*\\)\".*/\\1/p')\n    mkdir -p ~/.bria\n    printf 'access_token=%s\\nrefresh_token=%s\\n' \"$BRIA_ACCESS_TOKEN\" \"$REFRESH_TOKEN\" > \"$HOME/.bria/credentials\"\n    echo \"AUTHENTICATED\"\n    break\n  fi\n  sleep 5\ndone\n```\n\nIf the output contains `AUTHENTICATED`, proceed to Step 3. Otherwise the code expired — start over from Step 2a.\n\n**Do not proceed with any API call until authentication is confirmed.**\n\n### Step 3: Verify billing status and resolve API key\n\nIntrospect the bearer token to check billing status and obtain the real API key for Bria API calls:\n\n```bash\nINTROSPECT=$(curl -s -X POST \"https://engine.prod.bria-api.com/v2/auth/token/introspect\" \\\n  -d \"token=$BRIA_ACCESS_TOKEN\")\nBILLING_STATUS=$(printf '%s' \"$INTROSPECT\" | sed -n 's/.*\"billing_status\" *: *\"\\([^\"]*\\)\".*/\\1/p')\nif [ \"$BILLING_STATUS\" = \"blocked\" ]; then\n  BILLING_MSG=$(printf '%s' \"$INTROSPECT\" | sed -n 's/.*\"billing_message\" *: *\"\\([^\"]*\\)\".*/\\1/p')\n  echo \"BILLING_ERROR: $BILLING_MSG\"\nfi\nACTIVE=$(printf '%s' \"$INTROSPECT\" | sed -n 's/.*\"active\" *: *\\([^,}]*\\).*/\\1/p' | tr -d ' ')\nif [ \"$ACTIVE\" = \"false\" ]; then\n  # Clear stale tokens so re-auth starts fresh (credentials file is re-created in Step 2c)\n  printf '' > \"$HOME/.bria/credentials\"\n  echo \"TOKEN_EXPIRED\"\nfi\nBRIA_API_KEY=$(printf '%s' \"$INTROSPECT\" | sed -n 's/.*\"api_token\" *: *\"\\([^\"]*\\)\".*/\\1/p')\nif [ -n \"$BRIA_API_KEY\" ]; then\n  grep -v '^api_token=' \"$HOME/.bria/credentials\" > \"$HOME/.bria/credentials.tmp\" 2>/dev/null || true\n  printf 'api_token=%s\\n' \"$BRIA_API_KEY\" >> \"$HOME/.bria/credentials.tmp\"\n  mv \"$HOME/.bria/credentials.tmp\" \"$HOME/.bria/credentials\"\nfi\n```\n\nInterpret the output:\n- If it prints `BILLING_ERROR: ...` — relay the message to the user exactly as shown and **stop**. Do not make any API calls.\n- If it prints `TOKEN_EXPIRED` — the session is no longer valid. Tell the user their session expired and restart from Step 2.\n- Otherwise, `BRIA_API_KEY` now contains the real API key and is cached for future calls. Proceed to the next section.\n\n---\n\n## Core Capabilities\n\n| Need | Capability | Use Case |\n|------|------------|----------|\n| Generate images from text | FIBO Generate | Hero images, product shots, illustrations, social media images, banners |\n| Edit images by text instruction | FIBO-Edit | Change colors, modify objects, transform scenes |\n| Edit image region with mask | GenFill/Erase | Precise inpainting, add/replace specific regions |\n| Add/Replace/Remove objects | Text-based editing | Add vase, replace apple with pear, remove table |\n| Remove background (transparent PNG) | RMBG-2.0 | Extract subjects for overlays, logos, cutouts |\n| Replace/blur/erase background | Background ops | Change, blur, or remove backgrounds |\n| Expand/outpaint images | Outpainting | Extend boundaries, change aspect ratios |\n| Upscale image resolution | Super Resolution | Increase resolution 2x or 4x |\n| Enhance image quality | Enhancement | Improve lighting, colors, details |\n| Restyle images | Restyle | Oil painting, anime, cartoon, 3D render |\n| Change lighting | Relight | Golden hour, spotlight, dramatic lighting |\n| Change season | Reseason | Spring, summer, autumn, winter |\n| Composite/blend images | Image Blending | Apply textures, logos, merge images |\n| Restore old photos | Restoration | Fix old/damaged photos |\n| Colorize images | Colorization | Add color to B&W, or convert to B&W |\n| Sketch to photo | Sketch2Image | Convert drawings to realistic photos |\n| Create product lifestyle shots | Lifestyle Shot | Place products in scenes for e-commerce |\n| Integrate products into scenes | Product Integrate | Embed products at exact coordinates |\n\n## How to Call Any Endpoint\n\nUse `bria_call` for all API calls. It handles URL passthrough, local file base64 encoding, JSON construction, API call, and async polling in a single function call. The API key is auto-loaded from `~/.bria/credentials`.\n\n```bash\nsource ~/.agents/skills/bria-ai/references/code-examples/bria_client.sh\n\n# Generate (no image input — pass empty string)\nRESULT=$(bria_call /v2/image/generate \"\" '\"prompt\": \"your description\", \"aspect_ratio\": \"16:9\", \"sync\": true')\n\n# Remove background\nRESULT=$(bria_call /v2/image/edit/remove_background \"/path/to/local/image.png\")\n\n# Replace background\nRESULT=$(bria_call /v2/image/edit/replace_background \"https://example.com/img.jpg\" '\"prompt\": \"sunset beach\"')\n\n# Edit image (uses images array — pass --key images)\nRESULT=$(bria_call /v2/image/edit \"/path/to/image.png\" --key images '\"instruction\": \"make it look warmer\"')\n\n# Upscale\nRESULT=$(bria_call /v2/image/edit/increase_resolution \"https://example.com/img.jpg\" '\"scale\": 4')\n\n# Lifestyle shot\nRESULT=$(bria_call /v1/product/lifestyle_shot_by_text \"/path/to/product.png\" '\"prompt\": \"modern kitchen countertop\"')\n\necho \"$RESULT\"\n```\n\n**Calling convention:** `bria_call <endpoint> <image_or_empty> [--key <json_key>] [extra JSON fields...]`\n- Pass a URL, local file path, or `\"\"` (empty) for endpoints without image input\n- Use `--key images` when the endpoint expects an `images` array instead of `image`\n- Extra JSON fields are appended as key-value pairs: `'\"key\": \"value\"'`\n- Returns the result image URL on success, or prints an error to stderr\n\n**Generation options:** Aspect ratios `1:1`, `16:9`, `4:3`, `9:16`, `3:4`. Resolution `1MP` (default) or `4MP` (more detail, +30s). Pass `\"sync\": true` for single images.\n\n> **Advanced**: For precise control over generation, use the **vgl** skill for structured VGL JSON prompts instead of natural language.\n\nSee **[API Endpoints Reference](references/api-endpoints.md)** for full parameter documentation on all 20+ endpoints.\n\n---\n\n## Prompt Engineering Tips\n\n- **Style**: \"professional product photography\" vs \"casual snapshot\", \"flat design illustration\" vs \"3D rendered\"\n- **Lighting**: \"soft natural light\", \"studio lighting\", \"dramatic shadows\"\n- **Background**: \"white studio\", \"gradient\", \"blurred office\", \"transparent\"\n- **Composition**: \"centered\", \"rule of thirds\", \"negative space on left for text\"\n- **Quality keywords**: \"high quality\", \"professional\", \"commercial grade\", \"4K\", \"sharp focus\"\n- **Negative prompts**: \"blurry, low quality, pixelated\", \"text, watermark, logo\"\n\n### Recipes by Use Case\n\n**Hero banner (16:9):** `\"Modern tech startup workspace with developers collaborating, bright natural lighting, clean minimal aesthetic\"` — include \"clean background\" or \"minimal\" for text overlay space\n\n**Product photo (1:1):** `\"Professional product photo of [item] on white studio background, soft shadows, commercial photography lighting\"` — then remove background for transparent PNG\n\n**Presentation visual (16:9):** `\"Abstract visualization of data analytics, blue and purple gradient, modern corporate style, clean composition with space for text\"` — common themes: \"abstract technology\", \"business collaboration\", \"minimalist geometric patterns\"\n\n**Instagram post (1:1):** `\"Lifestyle photo of coffee and laptop on wooden desk, morning light, cozy atmosphere\"`\n\n**Story/Reel (9:16):** `\"Vertical product showcase of smartphone, floating in gradient background, tech aesthetic\"`\n\n---\n\n## Additional Resources\n\n- **[API Endpoints Reference](references/api-endpoints.md)** — Complete endpoint documentation with request/response formats for all 20+ endpoints\n- **[Shell Client (bria_client.sh)](references/code-examples/bria_client.sh)** — Single-function helper: `bria_call` handles auth, base64, JSON, polling\n- **[Full API docs for agents (llms.txt)](https://docs.bria.ai/llms.txt)** — Agent-ready Bria API reference; use when this skill's summary is not enough\n\n## Related Skills\n\n- **vgl** — Write structured VGL JSON prompts for precise, deterministic control over FIBO image generation\n- **image-utils** — Classic image manipulation (resize, crop, composite, watermarks) for post-processing\n\nFile v1.3.0:_meta.json\n\n{\n  \"ownerId\": \"kn7artjmk0ncb5fmp9x21x4tss80jshr\",\n  \"slug\": \"bria-ai\",\n  \"version\": \"1.3.0\",\n  \"publishedAt\": 1774785025970\n}\n\nFile v1.3.0:references/api-endpoints.md\n\n# Bria.ai API Reference\n\n## Base URL & Authentication\n\n**Base URL:** `https://engine.prod.bria-api.com`\n\n**Authentication:** Include these headers in all requests:\n```\napi_token: YOUR_BRIA_API_KEY\nContent-Type: application/json\nUser-Agent: BriaSkills/<version>\n```\n\n> **Required:** Always include the `User-Agent: BriaSkills/<version>` header (where `<version>` is the current skill version from `package.json`, e.g. `BriaSkills/1.3.0`) in every API call, including status polling requests.\n\n---\n\n## FIBO - Image Generation\n\n### POST /v2/image/generate\n\nGenerate images from text prompts using FIBO's structured prompt system.\n\n**Request:**\n```json\n{\n  \"prompt\": \"string (required)\",\n  \"aspect_ratio\": \"1:1\",\n  \"resolution\": \"1MP\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1,\n  \"seed\": null\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `prompt` | string | required* | Image description (* or use `structured_prompt`) |\n| `aspect_ratio` | string | \"1:1\" | \"1:1\", \"4:3\", \"16:9\", \"3:4\", \"9:16\" |\n| `resolution` | string | \"1MP\" | Output image resolution. \"1MP\" or \"4MP\". \"4MP\" improves image details, especially for photorealism, but increases latency by ~30 seconds. |\n| `negative_prompt` | string | - | What to exclude |\n| `num_results` | int | 1 | Number of images (1-4) |\n| `seed` | int | random | For reproducibility |\n| `structured_prompt` | string | - | JSON from previous generation (for refinement). Use with `prompt` to refine, or alone with `seed` to recreate. |\n| `image_url` | string | - | Reference image (for inspire mode) |\n\n**Input Combination Rules** (mutually exclusive):\n- `prompt` — Generate from text\n- `image_url` — Generate inspired by a reference image\n- `image_url` + `prompt` — Generate inspired by image, guided by text\n- `structured_prompt` + `seed` — Recreate a previous image exactly\n- `structured_prompt` + `prompt` + `seed` — Refine a previous image with new instructions\n\nAll combinations support `aspect_ratio`, `negative_prompt`, `num_results`, and `seed`.\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://engine.prod.bria-api.com/v2/status/uuid\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...\",\n    \"structured_prompt\": \"{...}\",\n    \"seed\": 12345\n  }\n}\n```\n\n---\n\n## RMBG-2.0 - Background Removal\n\n### POST /v2/image/edit/remove_background\n\nRemove background from image. Returns PNG with transparency.\n\n**Request:**\n```json\n{\n  \"image\": \"https://publicly-accessible-image-url\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `image` | string | Source image URL (JPEG, PNG, WEBP) |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://...\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...png\"\n  }\n}\n```\n\n---\n\n## FIBO-Edit - Image Editing\n\n### POST /v2/image/edit\n\nEdit an image using natural language instructions. No mask required.\n\n**Request:**\n```json\n{\n  \"images\": [\"https://source-image-url\"],\n  \"instruction\": \"change the mug color to red\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `images` | array | required | Array of image URLs or base64 data URLs |\n| `instruction` | string | required | Edit instruction in natural language |\n\n### POST /v2/image/edit/gen_fill\n\nGenerate content in a masked region (inpainting).\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"mask\": \"https://mask-image-url\",\n  \"prompt\": \"what to generate\",\n  \"mask_type\": \"manual\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL |\n| `mask` | string | required | Mask URL (white=edit, black=keep) |\n| `prompt` | string | required | What to generate in masked area |\n| `mask_type` | string | \"manual\" | \"manual\" or \"automatic\" |\n| `negative_prompt` | string | - | What to avoid |\n| `num_results` | int | 1 | Number of variations |\n\n**Mask Requirements:**\n- White pixels (255) = area to edit\n- Black pixels (0) = area to preserve\n- Same aspect ratio as source image\n\n### POST /v2/image/edit/erase\n\nRemove objects defined by mask.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"mask\": \"https://mask-image-url\"\n}\n```\n\n### POST /v2/image/edit/erase_foreground\n\nRemove primary subject and fill with background.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/replace_background\n\nReplace background with AI-generated content.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"prompt\": \"new background description\"\n}\n```\n\n### POST /v2/image/edit/blur_background\n\nApply blur effect to image background.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/expand\n\nExpand/outpaint an image to extend its boundaries.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-string-or-url\",\n  \"aspect_ratio\": \"16:9\",\n  \"prompt\": \"optional description for new content\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL or base64 string |\n| `aspect_ratio` | string | required | Target ratio: \"1:1\", \"4:3\", \"16:9\", \"3:4\", \"9:16\" |\n| `prompt` | string | - | Optional - describe content to generate |\n\n### POST /v2/image/edit/enhance\n\nEnhance image quality (lighting, colors, details).\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/increase_resolution\n\nUpscale image resolution.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"scale\": 2\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL |\n| `scale` | int | 2 | Upscale factor (2 or 4) |\n\n### POST /v1/product/lifestyle_shot_by_text\n\nPlace a product in a lifestyle scene using text description.\n\n**Request:**\n```json\n{\n  \"file\": \"BASE64_ENCODED_IMAGE\",\n  \"prompt\": \"modern kitchen countertop, natural lighting\",\n  \"placement_type\": \"automatic\"\n}\n```\n\n### POST /image/edit/product/integrate\n\nIntegrate and embed one or more products into a predefined scene at precise user-defined coordinates. The product is automatically matched to the scene's lighting, perspective, and aesthetics. Products are automatically cut out from their background as part of the pipeline.\n\n**Request:**\n```json\n{\n  \"scene\": \"https://scene-image-url\",\n  \"products\": [\n    {\n      \"image\": \"https://product-image-url\",\n      \"coordinates\": {\n        \"x\": 100,\n        \"y\": 200,\n        \"width\": 300,\n        \"height\": 400\n      }\n    }\n  ],\n  \"seed\": 42\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `scene` | string | required | Scene image URL or base64. Accepted formats: jpeg, jpg, png, webp |\n| `products` | array | required | Array of product objects (1 to N products) |\n| `products[].image` | string | required | Product image URL or base64. If it has an alpha channel, no cutout is applied; otherwise automatic cutout is applied |\n| `products[].coordinates` | object | required | Placement and scaling of the product within the scene |\n| `products[].coordinates.x` | int | required | X-coordinate of the product's top-left corner (pixels) |\n| `products[].coordinates.y` | int | required | Y-coordinate of the product's top-left corner (pixels) |\n| `products[].coordinates.width` | int | required | Desired product width in pixels (must not exceed scene dimensions) |\n| `products[].coordinates.height` | int | required | Desired product height in pixels (must not exceed scene dimensions) |\n| `seed` | int | random | Seed for deterministic generation |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"result\": {\n    \"image_url\": \"https://...\"\n  }\n}\n```\n\n**Async Response (202):**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://...\"\n}\n```\n\n---\n\n## Text-Based Object Editing\n\n### POST /v2/image/edit/add_object_by_text\n\nAdd a new object to an image using natural language.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"instruction\": \"Place a red vase with flowers on the table\"\n}\n```\n\n### POST /v2/image/edit/replace_object_by_text\n\nReplace an existing object with a new one.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"instruction\": \"Replace the red apple with a green pear\"\n}\n```\n\n### POST /v2/image/edit/erase_by_text\n\nRemove a specific object by name.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"object_name\": \"table\"\n}\n```\n\n---\n\n## Image Transformation\n\n### POST /v2/image/edit/blend\n\nBlend/merge images or apply textures.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"overlay\": \"texture-or-art-url\",\n  \"instruction\": \"Place the art on the shirt, keep the art exactly the same\"\n}\n```\n\n### POST /v2/image/edit/reseason\n\nChange the season or weather of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"season\": \"winter\"\n}\n```\n\n**Seasons:** `spring`, `summer`, `autumn`, `winter`\n\n### POST /v2/image/edit/restyle\n\nTransform the artistic style of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"style\": \"oil_painting\"\n}\n```\n\n**Style IDs:** `render_3d`, `cubism`, `oil_painting`, `anime`, `cartoon`, `coloring_book`, `retro_ad`, `pop_art_halftone`, `vector_art`, `story_board`, `art_nouveau`, `cross_etching`, `wood_cut`\n\n### POST /v2/image/edit/relight\n\nModify the lighting setup of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"light_type\": \"sunrise light\",\n  \"light_direction\": \"front\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL or base64 |\n| `light_type` | string | required | Lighting preset (see values below) |\n| `light_direction` | string | required | `front`, `side`, `bottom`, `top-down` |\n\n**Light Types:** `midday`, `blue hour light`, `low-angle sunlight`, `sunrise light`, `spotlight on subject`, `overcast light`, `soft overcast daylight lighting`, `cloud-filtered lighting`, `fog-diffused lighting`, `side lighting`, `moonlight lighting`, `starlight nighttime`, `soft bokeh lighting`, `harsh studio lighting`\n\n---\n\n## Image Restoration & Conversion\n\n### POST /v2/image/edit/sketch_to_colored_image\n\nConvert a sketch or line drawing to a photorealistic image.\n\n**Request:**\n```json\n{\n  \"image\": \"sketch-base64-or-url\",\n  \"prompt\": \"optional description\"\n}\n```\n\n### POST /v2/image/edit/restore\n\nRestore old/damaged photos by removing noise, scratches, and blur.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\"\n}\n```\n\n### POST /v2/image/edit/colorize\n\nAdd color to B&W photos or convert to B&W.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"color\": \"contemporary color\"\n}\n```\n\n**Colors:** `contemporary color`, `vivid color`, `black and white colors`, `sepia vintage`\n\n### POST /v2/image/edit/crop_foreground\n\nRemove background and crop tightly around the foreground.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\"\n}\n```\n\n---\n\n## Structured Instructions\n\n### POST /v2/structured_instruction/generate\n\nGenerate a structured JSON instruction from natural language (no image generated).\n\n**Request:**\n```json\n{\n  \"images\": [\"base64-or-url\"],\n  \"instruction\": \"change to golden hour lighting\",\n  \"mask\": \"optional-mask-url\"\n}\n```\n\n**Returns:** `structured_instruction` JSON that can be passed to `/v2/image/edit`\n\n---\n\n## Status Polling\n\n### GET /v2/status/{request_id}\n\nCheck async request status.\n\n**Response:**\n```json\n{\n  \"status\": \"IN_PROGRESS | COMPLETED | FAILED\",\n  \"result\": {\n    \"image_url\": \"https://...\"\n  },\n  \"request_id\": \"uuid\"\n}\n```\n\n**Status Values:**\n- `IN_PROGRESS` - Still processing\n- `COMPLETED` - Success, result available\n- `FAILED` - Error occurred\n\n**Polling Pattern:**\n```python\nimport requests, time\n\ndef poll(status_url, api_key, timeout=120):\n    headers = {\"api_token\": api_key, \"User-Agent\": \"BriaSkills/1.3.0\"}\n    for _ in range(timeout // 2):\n        r = requests.get(status_url, headers=headers)\n        data = r.json()\n        if data[\"status\"] == \"COMPLETED\":\n            return data[\"result\"][\"image_url\"]\n        if data[\"status\"] == \"FAILED\":\n            raise Exception(data.get(\"error\"))\n        time.sleep(2)\n    raise TimeoutError()\n```\n\n---\n\n## Error Handling\n\n### HTTP Status Codes\n\n| Code | Description |\n|------|-------------|\n| 200 | Success |\n| 400 | Bad request |\n| 401 | Unauthorized - invalid API key |\n| 415 | Unsupported media type |\n| 422 | Validation failed / Content moderation blocked |\n| 429 | Rate limited |\n| 500 | Server error |\n\n### Supported Image Formats\n\n- **Input:** JPEG, JPG, PNG, WEBP (RGB, RGBA, CMYK)\n- **Output:** PNG (with transparency where applicable)\n\nFile v1.3.0:skill-card.md\n\n## Description: <br>\nGenerates, edits, removes backgrounds, and enhances images through Bria.ai API workflows, including OAuth device authentication and reusable local credentials. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[galbria](https://clawhub.ai/user/galbria) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, designers, and marketing teams use this skill to generate visual assets, edit photos, remove backgrounds, and automate product or campaign image workflows through Bria.ai. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Prompts and selected images are uploaded to Bria for generation or editing. <br>\nMitigation: Avoid sensitive, regulated, or confidential images unless Bria's terms and retention practices fit the intended use. <br>\nRisk: Reusable Bria credentials are stored locally in ~/.bria/credentials. <br>\nMitigation: Protect the credentials file, limit local access, and delete it when the integration is no longer needed. <br>\n\n\n## Reference(s): <br>\n- [Bria.ai homepage](https://bria.ai) <br>\n- [Bria API reference for agents](https://docs.bria.ai/llms.txt) <br>\n- [API Endpoints Reference](references/api-endpoints.md) <br>\n- [Shell Client](references/code-examples/bria_client.sh) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Guidance, Shell commands, Configuration, API calls] <br>\n**Output Format:** [Markdown with inline bash code blocks and API result URLs] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May create local credential state at ~/.bria/credentials and return Bria-hosted image URLs or error messages.] <br>\n\n## Skill Version(s): <br>\n1.3.0 (source: server release metadata and skill metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.2.7: 8 files, 30029 bytes\n\nFiles: LICENSE.txt (1335b), references/api-endpoints.md (13032b), references/code-examples/bria_client.py (26746b), references/code-examples/bria_client.sh (25018b), references/code-examples/bria_client.ts (23863b), references/workflows.md (11024b), SKILL.md (12910b), _meta.json (126b)\n\nFile v1.2.7:SKILL.md\n\n---\nname: bria-ai\ndescription: Generate, edit, and transform images with commercially-safe AI models. Create images from text, edit by natural language instruction, remove backgrounds (transparent PNG), replace backgrounds, add/replace/remove objects, inpaint, outpaint, upscale (2x/4x), enhance quality, restyle (oil painting, anime, 3D), relight, reseason, restore old photos, colorize, sketch to photo, and product lifestyle shots. Use for websites, apps, presentations needing hero images, banners, product photos, product placement in scenes, icons, illustrations, or backgrounds. Also for e-commerce photography, batch generation, and pipelines. Triggers are image generation, generate/create image, edit photo, remove background, transparent PNG, replace background, product shot, lifestyle scenes, upscale, style transfer, photo restoration, colorize, sketch to image, outpaint, inpaint, cut out subject, integrate products into scene.\nlicense: MIT\nmetadata:\n  author: Bria AI\n  version: \"1.2.6\"\n  openclaw:\n    requires:\n      env:\n        - BRIA_API_KEY\n      bins:\n        - curl\n    primaryEnv: BRIA_API_KEY\n---\n\n# Bria — Generate, Edit & Remove Background from Images with AI\n\nGenerate, edit, and create visual assets using Bria's commercially-safe AI models (Fibo, Fibo-Edit,  RMBG-2.0, GenFill, and more). Remove or replace backgrounds, create product lifestyle shots, generate transparent PNGs, batch generate images, and build pipeline workflows. Unlike black-box generators, Bria gives you fine-grained control: edit by text instruction, mask specific regions, add/replace/remove individual objects, change lighting or season independently.\n\n## Setup — API Key Check\n\nBefore making any Bria API call, check for the API key and help the user set it up if missing:\n\n### Step 1: Check if the key exists (without printing the key)\n\n```bash\nif [ -z \"$BRIA_API_KEY\" ]; then\n  echo \"BRIA_API_KEY is not set\"\nelse\n  echo \"BRIA_API_KEY is set\"\nfi\n```\n\nIf the output is **not empty**, skip to the next section.\n\n### Step 2: If the key is missing, guide the user\n\nTell the user exactly this:\n> To use image generation, you need a free Bria API key.\n>\n> 1. Go to https://platform.bria.ai/console/account/api-keys\n> 2. Sign up or log in\n> 3. Click **Create API Key**\n\nWait for the user to provide their API key. Do not proceed until they give you the key.\n\n**Do not proceed with any image generation or editing until the API key is confirmed set.**\n\n---\n\n## Core Capabilities\n\n| Need | Capability | Use Case |\n|------|------------|----------|\n| Generate images from text | FIBO Generate | Hero images, product shots, illustrations, social media images, banners |\n| Edit images by text instruction | FIBO-Edit | Change colors, modify objects, transform scenes |\n| Edit image region with mask | GenFill/Erase | Precise inpainting, add/replace specific regions |\n| Add/Replace/Remove objects | Text-based editing | Add vase, replace apple with pear, remove table |\n| Remove background (transparent PNG) | RMBG-2.0 | Extract subjects for overlays, logos, cutouts |\n| Replace/blur/erase background | Background ops | Change, blur, or remove backgrounds |\n| Expand/outpaint images | Outpainting | Extend boundaries, change aspect ratios |\n| Upscale image resolution | Super Resolution | Increase resolution 2x or 4x |\n| Enhance image quality | Enhancement | Improve lighting, colors, details |\n| Restyle images | Restyle | Oil painting, anime, cartoon, 3D render |\n| Change lighting | Relight | Golden hour, spotlight, dramatic lighting |\n| Change season | Reseason | Spring, summer, autumn, winter |\n| Composite/blend images | Image Blending | Apply textures, logos, merge images |\n| Restore old photos | Restoration | Fix old/damaged photos |\n| Colorize images | Colorization | Add color to B&W, or convert to B&W |\n| Sketch to photo | Sketch2Image | Convert drawings to realistic photos |\n| Create product lifestyle shots | Lifestyle Shot | Place products in scenes for e-commerce |\n| Integrate products into scenes | Product Integrate | Embed products at exact coordinates |\n\n## Quick Reference\n\n### Generate an Image (FIBO)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/generate\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"prompt\": \"your description\",\n    \"aspect_ratio\": \"16:9\",\n    \"resolution\": \"1MP\",\n    \"sync\": true\n  }'\n```\n\n**Aspect ratios**: `1:1` (square), `16:9` (hero/banner), `4:3` (presentation), `9:16` (mobile/story), `3:4` (portrait)\n\n**Resolution**: `1MP` (default) or `4MP` (improved details for photorealism, adds ~30s latency)\n\n**Sync mode**: Pass `\"sync\": true` in the request body for single image generation to get the result directly in the response. For batch/multiple image generation, omit `sync` (or set `false`) and use polling instead.\n\n> **Advanced**: For precise, deterministic control over generation, use **[VGL structured prompts](../vgl/SKILL.md)** instead of natural language. VGL defines every visual attribute (objects, lighting, composition) as explicit JSON.\n\n### Remove Background (RMBG-2.0)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/remove_background\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\"image\": \"https://...\"}'\n```\n\nReturns PNG with transparency.\n\n### Edit Image (FIBO-Edit) - No Mask Required\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"images\": [\"https://...\"],\n    \"instruction\": \"change the mug to red\"\n  }'\n```\n\n### Edit Image Region with Mask (GenFill)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/gen_fill\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"image\": \"https://...\",\n    \"mask\": \"https://...\",\n    \"prompt\": \"what to generate in masked area\"\n  }'\n```\n\n### Expand Image (Outpainting)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/expand\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"image\": \"base64-or-url\",\n    \"aspect_ratio\": \"16:9\",\n    \"prompt\": \"coffee shop background, wooden table\"\n  }'\n```\n\n### Upscale Image\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/increase_resolution\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\"image\": \"https://...\", \"scale\": 2}'\n```\n\n### Create Product Lifestyle Shot\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v1/product/lifestyle_shot_by_text\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"image\": \"https://product-with-transparent-bg.png\",\n    \"prompt\": \"modern kitchen countertop, natural morning light\"\n  }'\n```\n\n### Integrate Products into Scene\n\nPlace one or more products at exact coordinates in a scene. Products are automatically cut out and matched to the scene's lighting and perspective.\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/image/edit/product/integrate\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"scene\": \"https://scene-image-url\",\n    \"products\": [\n      {\n        \"image\": \"https://product-image-url\",\n        \"coordinates\": {\"x\": 100, \"y\": 200, \"width\": 300, \"height\": 400}\n      }\n    ]\n  }'\n```\n\n---\n\n## Response Handling\n\n### Sync (single image generation)\n\nFor single image requests, pass `\"sync\": true` in the request body. The response returns the result directly — no polling needed.\n\n### Async with polling (batch generation)\n\nFor batch or multiple image generation, omit `sync` (or set `\"sync\": false`). The response returns a status URL to poll:\n\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://engine.prod.bria-api.com/v2/status/uuid\"\n}\n```\n\nPoll the status_url until `status: \"COMPLETED\"`, then get `result.image_url`.\n\n```python\nimport requests, time\n\ndef get_result(status_url, api_key):\n    while True:\n        r = requests.get(status_url, headers={\"api_token\": api_key, \"User-Agent\": \"BriaSkills/1.2.6\"})\n        data = r.json()\n        if data[\"status\"] == \"COMPLETED\":\n            return data[\"result\"][\"image_url\"]\n        if data[\"status\"] == \"FAILED\":\n            raise Exception(data.get(\"error\"))\n        time.sleep(2)\n```\n\n---\n\n## Prompt Engineering Tips\n\n- **Style**: \"professional product photography\" vs \"casual snapshot\", \"flat design illustration\" vs \"3D rendered\"\n- **Lighting**: \"soft natural light\", \"studio lighting\", \"dramatic shadows\"\n- **Background**: \"white studio\", \"gradient\", \"blurred office\", \"transparent\"\n- **Composition**: \"centered\", \"rule of thirds\", \"negative space on left for text\"\n- **Quality keywords**: \"high quality\", \"professional\", \"commercial grade\", \"4K\", \"sharp focus\"\n- **Negative prompts**: \"blurry, low quality, pixelated\", \"text, watermark, logo\"\n\n---\n\n## API Reference\n\nSee `references/api-endpoints.md` for complete endpoint documentation.\n\n### Key Endpoints\n\n**Image Generation**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/generate` | Generate images from text (FIBO) |\n\n**Edit by Text (No Mask)**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit` | Edit image with natural language instruction |\n| `POST /v2/image/edit/add_object_by_text` | Add objects to image |\n| `POST /v2/image/edit/replace_object_by_text` | Replace objects in image |\n| `POST /v2/image/edit/erase_by_text` | Remove objects by name |\n\n**Edit with Mask**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/gen_fill` | Inpaint/generate in masked region |\n| `POST /v2/image/edit/erase` | Erase masked region |\n\n**Background Operations**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/remove_background` | Remove background (RMBG-2.0) |\n| `POST /v2/image/edit/replace_background` | Replace with AI-generated background |\n| `POST /v2/image/edit/blur_background` | Apply blur to background |\n| `POST /v2/image/edit/erase_foreground` | Remove foreground, fill background |\n| `POST /v2/image/edit/crop_foreground` | Crop tightly around subject |\n\n**Image Transformation**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/expand` | Outpaint to new aspect ratio |\n| `POST /v2/image/edit/enhance` | Enhance quality and details |\n| `POST /v2/image/edit/increase_resolution` | Upscale 2x or 4x |\n| `POST /v2/image/edit/blend` | Blend/merge images or textures |\n| `POST /v2/image/edit/reseason` | Change season/weather |\n| `POST /v2/image/edit/restyle` | Transform artistic style |\n| `POST /v2/image/edit/relight` | Modify lighting |\n\n**Restoration**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/sketch_to_colored_image` | Convert sketch to photo |\n| `POST /v2/image/edit/restore` | Restore old/damaged photos |\n| `POST /v2/image/edit/colorize` | Colorize B&W or convert to B&W |\n\n**Product Photography**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v1/product/lifestyle_shot_by_text` | Create product lifestyle shots by text |\n| `POST /image/edit/product/integrate` | Integrate products into scene at exact coordinates |\n\n**Utilities**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/structured_instruction/generate` | Generate JSON instruction (no image) |\n| `GET /v2/status/{id}` | Check async request status |\n\n### Authentication\n\nAll requests need `api_token` header:\n```\napi_token: YOUR_BRIA_API_KEY\nUser-Agent: BriaSkills/<version>\n```\n> **Required:** Always include the `User-Agent: BriaSkills/<version>` header (where `<version>` is the current skill version from `package.json`, e.g. `BriaSkills/1.2.6`) in every API call, including status polling requests.\n\n---\n\n## Additional Resources\n\n- **[API Endpoints Reference](references/api-endpoints.md)** — Complete endpoint documentation with request/response formats\n- **[Workflows & Pipelines](references/workflows.md)** — Batch generation, parallel pipelines, integration examples\n- **[Python Client](references/code-examples/bria_client.py)** — Full-featured async Python client\n- **[TypeScript Client](references/code-examples/bria_client.ts)** — Typed Node.js client\n- **[Bash/curl Reference](references/code-examples/bria_client.sh)** — Shell functions for all endpoints\n\n## Related Skills\n\n- **[vgl](../vgl/SKILL.md)** — Write structured VGL JSON prompts for precise, deterministic control over FIBO image generation\n- **[image-utils](../image-utils/SKILL.md)** — Classic image manipulation (resize, crop, composite, watermarks) for post-processing\n\nFile v1.2.7:_meta.json\n\n{\n  \"ownerId\": \"kn7artjmk0ncb5fmp9x21x4tss80jshr\",\n  \"slug\": \"bria-ai\",\n  \"version\": \"1.2.7\",\n  \"publishedAt\": 1773485782975\n}\n\nFile v1.2.7:references/api-endpoints.md\n\n# Bria.ai API Reference\n\n## Base URL & Authentication\n\n**Base URL:** `https://engine.prod.bria-api.com`\n\n**Authentication:** Include these headers in all requests:\n```\napi_token: YOUR_BRIA_API_KEY\nContent-Type: application/json\nUser-Agent: BriaSkills/<version>\n```\n\n> **Required:** Always include the `User-Agent: BriaSkills/<version>` header (where `<version>` is the current skill version from `package.json`, e.g. `BriaSkills/1.2.6`) in every API call, including status polling requests.\n\n---\n\n## FIBO - Image Generation\n\n### POST /v2/image/generate\n\nGenerate images from text prompts using FIBO's structured prompt system.\n\n**Request:**\n```json\n{\n  \"prompt\": \"string (required)\",\n  \"aspect_ratio\": \"1:1\",\n  \"resolution\": \"1MP\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1,\n  \"seed\": null\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `prompt` | string | required* | Image description (* or use `structured_prompt`) |\n| `aspect_ratio` | string | \"1:1\" | \"1:1\", \"4:3\", \"16:9\", \"3:4\", \"9:16\" |\n| `resolution` | string | \"1MP\" | Output image resolution. \"1MP\" or \"4MP\". \"4MP\" improves image details, especially for photorealism, but increases latency by ~30 seconds. |\n| `negative_prompt` | string | - | What to exclude |\n| `num_results` | int | 1 | Number of images (1-4) |\n| `seed` | int | random | For reproducibility |\n| `structured_prompt` | string | - | JSON from previous generation (for refinement). Use with `prompt` to refine, or alone with `seed` to recreate. |\n| `image_url` | string | - | Reference image (for inspire mode) |\n\n**Input Combination Rules** (mutually exclusive):\n- `prompt` — Generate from text\n- `image_url` — Generate inspired by a reference image\n- `image_url` + `prompt` — Generate inspired by image, guided by text\n- `structured_prompt` + `seed` — Recreate a previous image exactly\n- `structured_prompt` + `prompt` + `seed` — Refine a previous image with new instructions\n\nAll combinations support `aspect_ratio`, `negative_prompt`, `num_results`, and `seed`.\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://engine.prod.bria-api.com/v2/status/uuid\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...\",\n    \"structured_prompt\": \"{...}\",\n    \"seed\": 12345\n  }\n}\n```\n\n---\n\n## RMBG-2.0 - Background Removal\n\n### POST /v2/image/edit/remove_background\n\nRemove background from image. Returns PNG with transparency.\n\n**Request:**\n```json\n{\n  \"image\": \"https://publicly-accessible-image-url\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `image` | string | Source image URL (JPEG, PNG, WEBP) |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://...\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...png\"\n  }\n}\n```\n\n---\n\n## FIBO-Edit - Image Editing\n\n### POST /v2/image/edit\n\nEdit an image using natural language instructions. No mask required.\n\n**Request:**\n```json\n{\n  \"images\": [\"https://source-image-url\"],\n  \"instruction\": \"change the mug color to red\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `images` | array | required | Array of image URLs or base64 data URLs |\n| `instruction` | string | required | Edit instruction in natural language |\n\n### POST /v2/image/edit/gen_fill\n\nGenerate content in a masked region (inpainting).\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"mask\": \"https://mask-image-url\",\n  \"prompt\": \"what to generate\",\n  \"mask_type\": \"manual\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL |\n| `mask` | string | required | Mask URL (white=edit, black=keep) |\n| `prompt` | string | required | What to generate in masked area |\n| `mask_type` | string | \"manual\" | \"manual\" or \"automatic\" |\n| `negative_prompt` | string | - | What to avoid |\n| `num_results` | int | 1 | Number of variations |\n\n**Mask Requirements:**\n- White pixels (255) = area to edit\n- Black pixels (0) = area to preserve\n- Same aspect ratio as source image\n\n### POST /v2/image/edit/erase\n\nRemove objects defined by mask.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"mask\": \"https://mask-image-url\"\n}\n```\n\n### POST /v2/image/edit/erase_foreground\n\nRemove primary subject and fill with background.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/replace_background\n\nReplace background with AI-generated content.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"prompt\": \"new background description\"\n}\n```\n\n### POST /v2/image/edit/blur_background\n\nApply blur effect to image background.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/expand\n\nExpand/outpaint an image to extend its boundaries.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-string-or-url\",\n  \"aspect_ratio\": \"16:9\",\n  \"prompt\": \"optional description for new content\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL or base64 string |\n| `aspect_ratio` | string | required | Target ratio: \"1:1\", \"4:3\", \"16:9\", \"3:4\", \"9:16\" |\n| `prompt` | string | - | Optional - describe content to generate |\n\n### POST /v2/image/edit/enhance\n\nEnhance image quality (lighting, colors, details).\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/increase_resolution\n\nUpscale image resolution.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"scale\": 2\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL |\n| `scale` | int | 2 | Upscale factor (2 or 4) |\n\n### POST /v1/product/lifestyle_shot_by_text\n\nPlace a product in a lifestyle scene using text description.\n\n**Request:**\n```json\n{\n  \"file\": \"BASE64_ENCODED_IMAGE\",\n  \"prompt\": \"modern kitchen countertop, natural lighting\",\n  \"placement_type\": \"automatic\"\n}\n```\n\n### POST /image/edit/product/integrate\n\nIntegrate and embed one or more products into a predefined scene at precise user-defined coordinates. The product is automatically matched to the scene's lighting, perspective, and aesthetics. Products are automatically cut out from their background as part of the pipeline.\n\n**Request:**\n```json\n{\n  \"scene\": \"https://scene-image-url\",\n  \"products\": [\n    {\n      \"image\": \"https://product-image-url\",\n      \"coordinates\": {\n        \"x\": 100,\n        \"y\": 200,\n        \"width\": 300,\n        \"height\": 400\n      }\n    }\n  ],\n  \"seed\": 42\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `scene` | string | required | Scene image URL or base64. Accepted formats: jpeg, jpg, png, webp |\n| `products` | array | required | Array of product objects (1 to N products) |\n| `products[].image` | string | required | Product image URL or base64. If it has an alpha channel, no cutout is applied; otherwise automatic cutout is applied |\n| `products[].coordinates` | object | required | Placement and scaling of the product within the scene |\n| `products[].coordinates.x` | int | required | X-coordinate of the product's top-left corner (pixels) |\n| `products[].coordinates.y` | int | required | Y-coordinate of the product's top-left corner (pixels) |\n| `products[].coordinates.width` | int | required | Desired product width in pixels (must not exceed scene dimensions) |\n| `products[].coordinates.height` | int | required | Desired product height in pixels (must not exceed scene dimensions) |\n| `seed` | int | random | Seed for deterministic generation |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"result\": {\n    \"image_url\": \"https://...\"\n  }\n}\n```\n\n**Async Response (202):**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://...\"\n}\n```\n\n---\n\n## Text-Based Object Editing\n\n### POST /v2/image/edit/add_object_by_text\n\nAdd a new object to an image using natural language.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"instruction\": \"Place a red vase with flowers on the table\"\n}\n```\n\n### POST /v2/image/edit/replace_object_by_text\n\nReplace an existing object with a new one.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"instruction\": \"Replace the red apple with a green pear\"\n}\n```\n\n### POST /v2/image/edit/erase_by_text\n\nRemove a specific object by name.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"object_name\": \"table\"\n}\n```\n\n---\n\n## Image Transformation\n\n### POST /v2/image/edit/blend\n\nBlend/merge images or apply textures.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"overlay\": \"texture-or-art-url\",\n  \"instruction\": \"Place the art on the shirt, keep the art exactly the same\"\n}\n```\n\n### POST /v2/image/edit/reseason\n\nChange the season or weather of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"season\": \"winter\"\n}\n```\n\n**Seasons:** `spring`, `summer`, `autumn`, `winter`\n\n### POST /v2/image/edit/restyle\n\nTransform the artistic style of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"style\": \"oil_painting\"\n}\n```\n\n**Style IDs:** `render_3d`, `cubism`, `oil_painting`, `anime`, `cartoon`, `coloring_book`, `retro_ad`, `pop_art_halftone`, `vector_art`, `story_board`, `art_nouveau`, `cross_etching`, `wood_cut`\n\n### POST /v2/image/edit/relight\n\nModify the lighting setup of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"light_type\": \"sunrise light\",\n  \"light_direction\": \"front\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL or base64 |\n| `light_type` | string | required | Lighting preset (see values below) |\n| `light_direction` | string | required | `front`, `side`, `bottom`, `top-down` |\n\n**Light Types:** `midday`, `blue hour light`, `low-angle sunlight`, `sunrise light`, `spotlight on subject`, `overcast light`, `soft overcast daylight lighting`, `cloud-filtered lighting`, `fog-diffused lighting`, `side lighting`, `moonlight lighting`, `starlight nighttime`, `soft bokeh lighting`, `harsh studio lighting`\n\n---\n\n## Image Restoration & Conversion\n\n### POST /v2/image/edit/sketch_to_colored_image\n\nConvert a sketch or line drawing to a photorealistic image.\n\n**Request:**\n```json\n{\n  \"image\": \"sketch-base64-or-url\",\n  \"prompt\": \"optional description\"\n}\n```\n\n### POST /v2/image/edit/restore\n\nRestore old/damaged photos by removing noise, scratches, and blur.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\"\n}\n```\n\n### POST /v2/image/edit/colorize\n\nAdd color to B&W photos or convert to B&W.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"color\": \"contemporary color\"\n}\n```\n\n**Colors:** `contemporary color`, `vivid color`, `black and white colors`, `sepia vintage`\n\n### POST /v2/image/edit/crop_foreground\n\nRemove background and crop tightly around the foreground.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\"\n}\n```\n\n---\n\n## Structured Instructions\n\n### POST /v2/structured_instruction/generate\n\nGenerate a structured JSON instruction from natural language (no image generated).\n\n**Request:**\n```json\n{\n  \"images\": [\"base64-or-url\"],\n  \"instruction\": \"change to golden hour lighting\",\n  \"mask\": \"optional-mask-url\"\n}\n```\n\n**Returns:** `structured_instruction` JSON that can be passed to `/v2/image/edit`\n\n---\n\n## Status Polling\n\n### GET /v2/status/{request_id}\n\nCheck async request status.\n\n**Response:**\n```json\n{\n  \"status\": \"IN_PROGRESS | COMPLETED | FAILED\",\n  \"result\": {\n    \"image_url\": \"https://...\"\n  },\n  \"request_id\": \"uuid\"\n}\n```\n\n**Status Values:**\n- `IN_PROGRESS` - Still processing\n- `COMPLETED` - Success, result available\n- `FAILED` - Error occurred\n\n**Polling Pattern:**\n```python\nimport requests, time\n\ndef poll(status_url, api_key, timeout=120):\n    headers = {\"api_token\": api_key, \"User-Agent\": \"BriaSkills/1.2.6\"}\n    for _ in range(timeout // 2):\n        r = requests.get(status_url, headers=headers)\n        data = r.json()\n        if data[\"status\"] == \"COMPLETED\":\n            return data[\"result\"][\"image_url\"]\n        if data[\"status\"] == \"FAILED\":\n            raise Exception(data.get(\"error\"))\n        time.sleep(2)\n    raise TimeoutError()\n```\n\n---\n\n## Error Handling\n\n### HTTP Status Codes\n\n| Code | Description |\n|------|-------------|\n| 200 | Success |\n| 400 | Bad request |\n| 401 | Unauthorized - invalid API key |\n| 415 | Unsupported media type |\n| 422 | Validation failed / Content moderation blocked |\n| 429 | Rate limited |\n| 500 | Server error |\n\n### Supported Image Formats\n\n- **Input:** JPEG, JPG, PNG, WEBP (RGB, RGBA, CMYK)\n- **Output:** PNG (with transparency where applicable)\n\nFile v1.2.7:references/workflows.md\n\n# Bria AI Workflows & Advanced Patterns\n\n## Batch & Parallel Image Generation\n\n### Python Async Batch Generation\n\nFor generating many images efficiently, launch requests in parallel and poll concurrently:\n\n```python\nimport asyncio\nimport aiohttp\n\nasync def generate_image(session, api_key, prompt, aspect_ratio=\"1:1\"):\n    \"\"\"Launch a single generation request.\"\"\"\n    async with session.post(\n        \"https://engine.prod.bria-api.com/v2/image/generate\",\n        headers={\"api_token\": api_key, \"Content-Type\": \"application/json\", \"User-Agent\": \"BriaSkills/1.2.6\"},\n        json={\"prompt\": prompt, \"aspect_ratio\": aspect_ratio}\n    ) as resp:\n        return await resp.json()\n\nasync def poll_status(session, api_key, status_url, timeout=120):\n    \"\"\"Poll until complete or failed.\"\"\"\n    for _ in range(timeout // 2):\n        async with session.get(status_url, headers={\"api_token\": api_key, \"User-Agent\": \"BriaSkills/1.2.6\"}) as resp:\n            data = await resp.json()\n            if data[\"status\"] == \"COMPLETED\":\n                return data[\"result\"][\"image_url\"]\n            if data[\"status\"] == \"FAILED\":\n                raise Exception(data.get(\"error\", \"Generation failed\"))\n        await asyncio.sleep(2)\n    raise TimeoutError(f\"Timeout polling {status_url}\")\n\nasync def generate_batch(api_key, prompts, aspect_ratio=\"1:1\", max_concurrent=5):\n    \"\"\"Generate multiple images with different prompts concurrently.\"\"\"\n    semaphore = asyncio.Semaphore(max_concurrent)  # Rate limiting\n\n    async def generate_one(prompt):\n        async with semaphore:\n            async with aiohttp.ClientSession() as session:\n                # Launch request\n                result = await generate_image(session, api_key, prompt, aspect_ratio)\n                # Poll for completion\n                return await poll_status(session, api_key, result[\"status_url\"])\n\n    # Run all concurrently\n    results = await asyncio.gather(*[generate_one(p) for p in prompts], return_exceptions=True)\n    return results\n\n# Usage\nprompts = [\n    \"Professional photo of running shoes on white background\",\n    \"Professional photo of leather handbag on white background\",\n    \"Professional photo of smartwatch on white background\",\n    \"Professional photo of sunglasses on white background\",\n]\nimage_urls = asyncio.run(generate_batch(\"YOUR_API_KEY\", prompts, max_concurrent=3))\n```\n\n**Key points:**\n- Use `asyncio.Semaphore` to limit concurrent requests (recommended: 3-5)\n- `return_exceptions=True` prevents one failure from canceling all requests\n- Each result is either a URL string or an Exception object\n\n### TypeScript/Node.js Parallel Generation\n\n```typescript\ntype AspectRatio = \"1:1\" | \"4:3\" | \"16:9\" | \"3:4\" | \"9:16\";\n\ninterface BriaResponse {\n  request_id: string;\n  status_url: string;\n}\n\ninterface BriaStatusResponse {\n  status: \"IN_PROGRESS\" | \"COMPLETED\" | \"FAILED\";\n  result?: { image_url: string };\n  error?: string;\n}\n\ninterface GenerateBatchResult {\n  prompt: string;\n  imageUrl: string | null;\n  error: string | null;\n}\n\nasync function generateBatch(\n  apiKey: string,\n  prompts: string[],\n  aspectRatio: AspectRatio = \"1:1\",\n  maxConcurrent = 5\n): Promise<GenerateBatchResult[]> {\n  const semaphore = { count: 0, max: maxConcurrent };\n\n  async function withLimit<T>(fn: () => Promise<T>): Promise<T> {\n    while (semaphore.count >= semaphore.max) {\n      await new Promise(r => setTimeout(r, 100));\n    }\n    semaphore.count++;\n    try {\n      return await fn();\n    } finally {\n      semaphore.count--;\n    }\n  }\n\n  async function generateOne(prompt: string): Promise<string> {\n    return withLimit(async () => {\n      // Launch request\n      const res = await fetch(\"https://engine.prod.bria-api.com/v2/image/generate\", {\n        method: \"POST\",\n        headers: { \"api_token\": apiKey, \"Content-Type\": \"application/json\", \"User-Agent\": \"BriaSkills/1.2.6\" },\n        body: JSON.stringify({ prompt, aspect_ratio: aspectRatio })\n      });\n      const { status_url } = (await res.json()) as BriaResponse;\n\n      // Poll for result\n      for (let i = 0; i < 60; i++) {\n        const statusRes = await fetch(status_url, { headers: { \"api_token\": apiKey, \"User-Agent\": \"BriaSkills/1.2.6\" } });\n        const data = (await statusRes.json()) as BriaStatusResponse;\n        if (data.status === \"COMPLETED\") return data.result!.image_url;\n        if (data.status === \"FAILED\") throw new Error(data.error || \"Generation failed\");\n        await new Promise(r => setTimeout(r, 2000));\n      }\n      throw new Error(\"Timeout waiting for generation\");\n    });\n  }\n\n  const results = await Promise.allSettled(prompts.map(generateOne));\n\n  return results.map((result, i) => ({\n    prompt: prompts[i],\n    imageUrl: result.status === \"fulfilled\" ? result.value : null,\n    error: result.status === \"rejected\" ? result.reason.message : null\n  }));\n}\n\n// Usage\nconst results = await generateBatch(process.env.BRIA_API_KEY!, [\n  \"Modern office workspace with natural lighting\",\n  \"Abstract tech background with blue gradient\",\n  \"Professional headshot studio setup\"\n], \"16:9\", 3);\n\nresults.forEach(r => {\n  if (r.imageUrl) console.log(`Done ${r.prompt}: ${r.imageUrl}`);\n  else console.log(`Failed ${r.prompt}: ${r.error}`);\n});\n```\n\n---\n\n## Pipeline Workflows\n\nChain multiple operations on images (generate -> edit -> remove background).\n\n### Complete Pipeline Example\n\n```python\nasync def product_pipeline(api_key, product_descriptions, scene_prompt):\n    \"\"\"\n    Pipeline: Generate product -> Remove background -> Place in lifestyle scene\n    \"\"\"\n    async with aiohttp.ClientSession() as session:\n        results = []\n\n        for desc in product_descriptions:\n            # Step 1: Generate product image\n            gen_result = await generate_image(session, api_key,\n                f\"Professional product photo of {desc} on white background, studio lighting\",\n                aspect_ratio=\"1:1\")\n            product_url = await poll_status(session, api_key, gen_result[\"status_url\"])\n\n            # Step 2: Remove background\n            async with session.post(\n                \"https://engine.prod.bria-api.com/v2/image/edit/remove_background\",\n                headers={\"api_token\": api_key, \"Content-Type\": \"application/json\", \"User-Agent\": \"BriaSkills/1.2.6\"},\n                json={\"image\": product_url}\n            ) as resp:\n                rmbg_result = await resp.json()\n            transparent_url = await poll_status(session, api_key, rmbg_result[\"status_url\"])\n\n            # Step 3: Place in lifestyle scene\n            async with session.post(\n                \"https://engine.prod.bria-api.com/v2/image/edit/lifestyle_shot_by_text\",\n                headers={\"api_token\": api_key, \"Content-Type\": \"application/json\", \"User-Agent\": \"BriaSkills/1.2.6\"},\n                json={\"image\": transparent_url, \"prompt\": scene_prompt}\n            ) as resp:\n                lifestyle_result = await resp.json()\n            final_url = await poll_status(session, api_key, lifestyle_result[\"status_url\"])\n\n            results.append({\n                \"product\": desc,\n                \"original\": product_url,\n                \"transparent\": transparent_url,\n                \"lifestyle\": final_url\n            })\n\n        return results\n\n# Usage\nproducts = [\"coffee mug\", \"water bottle\", \"notebook\"]\nscene = \"modern minimalist desk, natural morning light, plants in background\"\nresults = asyncio.run(product_pipeline(\"YOUR_API_KEY\", products, scene))\n```\n\n### Parallel Pipeline (Advanced)\n\nProcess multiple products through the pipeline concurrently:\n\n```python\nasync def parallel_pipeline(api_key, products, scene_prompt, max_concurrent=3):\n    \"\"\"Run full pipeline for multiple products in parallel.\"\"\"\n    semaphore = asyncio.Semaphore(max_concurrent)\n\n    async def process_one(product):\n        async with semaphore:\n            return await single_product_pipeline(api_key, product, scene_prompt)\n\n    return await asyncio.gather(*[process_one(p) for p in products], return_exceptions=True)\n```\n\n### Common Pipeline Patterns\n\n| Pipeline | Steps | Use Case |\n|----------|-------|----------|\n| Product -> Transparent | generate -> remove_background | E-commerce cutouts |\n| Product -> Lifestyle | generate -> remove_background -> lifestyle_shot | Marketing photos |\n| Edit -> Upscale | edit -> increase_resolution | High-res edited images |\n| Generate -> Restyle | generate -> restyle | Artistic variations |\n| Generate -> Variations | generate (num_results=4) | A/B testing options |\n\n---\n\n## Integration Examples\n\n### React/Next.js Component\n\n```jsx\n// Generate and display a hero image\nconst [imageUrl, setImageUrl] = useState(null);\n\nasync function generateHero(prompt) {\n  const res = await fetch('/api/bria/generate', {\n    method: 'POST',\n    body: JSON.stringify({ prompt, aspect_ratio: '16:9' })\n  });\n  const { image_url } = await res.json();\n  setImageUrl(image_url);\n}\n```\n\n### Python Script for Batch Generation\n\n```python\nimport asyncio\n\n# See \"Batch & Parallel Image Generation\" section for generate_batch function\n\nasync def main():\n    api_key = \"YOUR_API_KEY\"\n    products = [\"running shoes\", \"leather bag\", \"smart watch\"]\n    prompts = [f\"Professional product photo of {p} on white background\" for p in products]\n\n    results = await generate_batch(api_key, prompts, aspect_ratio=\"1:1\", max_concurrent=3)\n\n    for product, result in zip(products, results):\n        if isinstance(result, Exception):\n            print(f\"{product}: FAILED - {result}\")\n        else:\n            print(f\"{product}: {result}\")\n\nasyncio.run(main())\n```\n\n---\n\n## Asset Generation Recipes\n\n### Website Hero Images\n\n```json\n{\n  \"prompt\": \"Modern tech startup workspace with developers collaborating, bright natural lighting, clean minimal aesthetic\",\n  \"aspect_ratio\": \"16:9\",\n  \"negative_prompt\": \"cluttered, dark, low quality\"\n}\n```\n\n**Tips:**\n- Use `16:9` for full-width banners\n- Describe lighting and mood explicitly\n- Include \"professional\", \"high quality\", \"commercial\" for polished results\n- Specify \"clean background\" or \"minimal\" for text overlay space\n\n### Product Photography\n\n```json\n{\n  \"prompt\": \"Professional product photo of [item] on white studio background, soft shadows, commercial photography lighting\",\n  \"aspect_ratio\": \"1:1\"\n}\n```\n\nThen remove background for transparent PNG to composite anywhere.\n\n### Presentation Visuals\n\n```json\n{\n  \"prompt\": \"Abstract visualization of data analytics, blue and purple gradient, modern corporate style, clean composition with space for text\",\n  \"aspect_ratio\": \"16:9\"\n}\n```\n\n**Common themes:** \"Abstract technology background\", \"Business team collaboration\", \"Growth chart visualization\", \"Minimalist geometric patterns\"\n\n### Social Media Assets\n\n**Instagram post (1:1):**\n```json\n{\n  \"prompt\": \"Lifestyle photo of coffee and laptop on wooden desk, morning light, cozy atmosphere\",\n  \"aspect_ratio\": \"1:1\"\n}\n```\n\n**Story/Reel (9:16):**\n```json\n{\n  \"prompt\": \"Vertical product showcase of smartphone, floating in gradient background, tech aesthetic\",\n  \"aspect_ratio\": \"9:16\"\n}\n```\n\nFile v1.2.7:LICENSE.txt\n\nMIT License\n\nCopyright (c) 2025\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n---\n\nNote: This skill integrates with Bria.ai's API. Usage of the Bria.ai API is\nsubject to Bria.ai's Terms of Service and API usage policies. The Bria.ai\nAPI and associated models are commercial products - please refer to\nhttps://bria.ai for licensing and pricing information.\n\nArchive v0.0.27: 8 files, 29946 bytes\n\nFiles: LICENSE.txt (1335b), references/api-endpoints.md (13032b), references/code-examples/bria_client.py (26746b), references/code-examples/bria_client.sh (25018b), references/code-examples/bria_client.ts (23863b), references/workflows.md (11024b), SKILL.md (12707b), _meta.json (127b)\n\nFile v0.0.27:SKILL.md\n\n---\nname: bria-ai\ndescription: Generate, edit, create product images with AI. Remove or replace backgrounds, lifestyle shots, transparent PNGs, visual assets, batch generation, illustrations. Controllable image editing with Bria.ai commercially-safe models — fine-grained control over what gets generated, edited, or removed. Edit by text instruction, mask specific regions, add/replace/remove individual objects, control lighting, season, and style. Use for e-commerce product photography, background removal, image upscaling, style transfer, hero images, icons, banners, and pipeline workflows. Triggers on AI image generation, controllable editing, background removal, or visual asset creation.\nlicense: MIT\nmetadata:\n  author: Bria AI\n  version: \"1.2.6\"\n  dependencies:\n    - type: env\n      name: BRIA_API_KEY\n      description: \"Bria AI API key (get one at https://platform.bria.ai/console/account/api-keys)\"\n---\n\n# Bria — Generate, Edit & Remove Background from Images with AI\n\nGenerate, edit, and create visual assets using Bria's commercially-safe AI models (Fibo, Fibo-Edit,  RMBG-2.0, GenFill, and more). Remove or replace backgrounds, create product lifestyle shots, generate transparent PNGs, batch generate images, and build pipeline workflows. Unlike black-box generators, Bria gives you fine-grained control: edit by text instruction, mask specific regions, add/replace/remove individual objects, change lighting or season independently.\n\n## Setup — API Key Check\n\nBefore making any Bria API call, check for the API key and help the user set it up if missing:\n\n### Step 1: Check if the key exists (without printing the key)\n\n```bash\nif [ -z \"$BRIA_API_KEY\" ]; then\n  echo \"BRIA_API_KEY is not set\"\nelse\n  echo \"BRIA_API_KEY is set\"\nfi\n```\n\nIf the output is **not empty**, skip to the next section.\n\n### Step 2: If the key is missing, guide the user\n\nTell the user exactly this:\n> To use image generation, you need a free Bria API key.\n>\n> 1. Go to https://platform.bria.ai/console/account/api-keys\n> 2. Sign up or log in\n> 3. Click **Create API Key**\n\nWait for the user to provide their API key. Do not proceed until they give you the key.\n\n**Do not proceed with any image generation or editing until the API key is confirmed set.**\n\n---\n\n## Core Capabilities\n\n| Need | Capability | Use Case |\n|------|------------|----------|\n| Generate images from text | FIBO Generate | Hero images, product shots, illustrations, social media images, banners |\n| Edit images by text instruction | FIBO-Edit | Change colors, modify objects, transform scenes |\n| Edit image region with mask | GenFill/Erase | Precise inpainting, add/replace specific regions |\n| Add/Replace/Remove objects | Text-based editing | Add vase, replace apple with pear, remove table |\n| Remove background (transparent PNG) | RMBG-2.0 | Extract subjects for overlays, logos, cutouts |\n| Replace/blur/erase background | Background ops | Change, blur, or remove backgrounds |\n| Expand/outpaint images | Outpainting | Extend boundaries, change aspect ratios |\n| Upscale image resolution | Super Resolution | Increase resolution 2x or 4x |\n| Enhance image quality | Enhancement | Improve lighting, colors, details |\n| Restyle images | Restyle | Oil painting, anime, cartoon, 3D render |\n| Change lighting | Relight | Golden hour, spotlight, dramatic lighting |\n| Change season | Reseason | Spring, summer, autumn, winter |\n| Composite/blend images | Image Blending | Apply textures, logos, merge images |\n| Restore old photos | Restoration | Fix old/damaged photos |\n| Colorize images | Colorization | Add color to B&W, or convert to B&W |\n| Sketch to photo | Sketch2Image | Convert drawings to realistic photos |\n| Create product lifestyle shots | Lifestyle Shot | Place products in scenes for e-commerce |\n| Integrate products into scenes | Product Integrate | Embed products at exact coordinates |\n\n## Quick Reference\n\n### Generate an Image (FIBO)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/generate\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"prompt\": \"your description\",\n    \"aspect_ratio\": \"16:9\",\n    \"resolution\": \"1MP\",\n    \"sync\": true\n  }'\n```\n\n**Aspect ratios**: `1:1` (square), `16:9` (hero/banner), `4:3` (presentation), `9:16` (mobile/story), `3:4` (portrait)\n\n**Resolution**: `1MP` (default) or `4MP` (improved details for photorealism, adds ~30s latency)\n\n**Sync mode**: Pass `\"sync\": true` in the request body for single image generation to get the result directly in the response. For batch/multiple image generation, omit `sync` (or set `false`) and use polling instead.\n\n> **Advanced**: For precise, deterministic control over generation, use **[VGL structured prompts](../vgl/SKILL.md)** instead of natural language. VGL defines every visual attribute (objects, lighting, composition) as explicit JSON.\n\n### Remove Background (RMBG-2.0)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/remove_background\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\"image\": \"https://...\"}'\n```\n\nReturns PNG with transparency.\n\n### Edit Image (FIBO-Edit) - No Mask Required\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"images\": [\"https://...\"],\n    \"instruction\": \"change the mug to red\"\n  }'\n```\n\n### Edit Image Region with Mask (GenFill)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/gen_fill\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"image\": \"https://...\",\n    \"mask\": \"https://...\",\n    \"prompt\": \"what to generate in masked area\"\n  }'\n```\n\n### Expand Image (Outpainting)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/expand\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"image\": \"base64-or-url\",\n    \"aspect_ratio\": \"16:9\",\n    \"prompt\": \"coffee shop background, wooden table\"\n  }'\n```\n\n### Upscale Image\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/increase_resolution\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\"image\": \"https://...\", \"scale\": 2}'\n```\n\n### Create Product Lifestyle Shot\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v1/product/lifestyle_shot_by_text\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"image\": \"https://product-with-transparent-bg.png\",\n    \"prompt\": \"modern kitchen countertop, natural morning light\"\n  }'\n```\n\n### Integrate Products into Scene\n\nPlace one or more products at exact coordinates in a scene. Products are automatically cut out and matched to the scene's lighting and perspective.\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/image/edit/product/integrate\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"scene\": \"https://scene-image-url\",\n    \"products\": [\n      {\n        \"image\": \"https://product-image-url\",\n        \"coordinates\": {\"x\": 100, \"y\": 200, \"width\": 300, \"height\": 400}\n      }\n    ]\n  }'\n```\n\n---\n\n## Response Handling\n\n### Sync (single image generation)\n\nFor single image requests, pass `\"sync\": true` in the request body. The response returns the result directly — no polling needed.\n\n### Async with polling (batch generation)\n\nFor batch or multiple image generation, omit `sync` (or set `\"sync\": false`). The response returns a status URL to poll:\n\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://engine.prod.bria-api.com/v2/status/uuid\"\n}\n```\n\nPoll the status_url until `status: \"COMPLETED\"`, then get `result.image_url`.\n\n```python\nimport requests, time\n\ndef get_result(status_url, api_key):\n    while True:\n        r = requests.get(status_url, headers={\"api_token\": api_key, \"User-Agent\": \"BriaSkills/1.2.6\"})\n        data = r.json()\n        if data[\"status\"] == \"COMPLETED\":\n            return data[\"result\"][\"image_url\"]\n        if data[\"status\"] == \"FAILED\":\n            raise Exception(data.get(\"error\"))\n        time.sleep(2)\n```\n\n---\n\n## Prompt Engineering Tips\n\n- **Style**: \"professional product photography\" vs \"casual snapshot\", \"flat design illustration\" vs \"3D rendered\"\n- **Lighting**: \"soft natural light\", \"studio lighting\", \"dramatic shadows\"\n- **Background**: \"white studio\", \"gradient\", \"blurred office\", \"transparent\"\n- **Composition**: \"centered\", \"rule of thirds\", \"negative space on left for text\"\n- **Quality keywords**: \"high quality\", \"professional\", \"commercial grade\", \"4K\", \"sharp focus\"\n- **Negative prompts**: \"blurry, low quality, pixelated\", \"text, watermark, logo\"\n\n---\n\n## API Reference\n\nSee `references/api-endpoints.md` for complete endpoint documentation.\n\n### Key Endpoints\n\n**Image Generation**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/generate` | Generate images from text (FIBO) |\n\n**Edit by Text (No Mask)**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit` | Edit image with natural language instruction |\n| `POST /v2/image/edit/add_object_by_text` | Add objects to image |\n| `POST /v2/image/edit/replace_object_by_text` | Replace objects in image |\n| `POST /v2/image/edit/erase_by_text` | Remove objects by name |\n\n**Edit with Mask**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/gen_fill` | Inpaint/generate in masked region |\n| `POST /v2/image/edit/erase` | Erase masked region |\n\n**Background Operations**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/remove_background` | Remove background (RMBG-2.0) |\n| `POST /v2/image/edit/replace_background` | Replace with AI-generated background |\n| `POST /v2/image/edit/blur_background` | Apply blur to background |\n| `POST /v2/image/edit/erase_foreground` | Remove foreground, fill background |\n| `POST /v2/image/edit/crop_foreground` | Crop tightly around subject |\n\n**Image Transformation**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/expand` | Outpaint to new aspect ratio |\n| `POST /v2/image/edit/enhance` | Enhance quality and details |\n| `POST /v2/image/edit/increase_resolution` | Upscale 2x or 4x |\n| `POST /v2/image/edit/blend` | Blend/merge images or textures |\n| `POST /v2/image/edit/reseason` | Change season/weather |\n| `POST /v2/image/edit/restyle` | Transform artistic style |\n| `POST /v2/image/edit/relight` | Modify lighting |\n\n**Restoration**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/image/edit/sketch_to_colored_image` | Convert sketch to photo |\n| `POST /v2/image/edit/restore` | Restore old/damaged photos |\n| `POST /v2/image/edit/colorize` | Colorize B&W or convert to B&W |\n\n**Product Photography**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v1/product/lifestyle_shot_by_text` | Create product lifestyle shots by text |\n| `POST /image/edit/product/integrate` | Integrate products into scene at exact coordinates |\n\n**Utilities**\n| Endpoint | Purpose |\n|----------|---------|\n| `POST /v2/structured_instruction/generate` | Generate JSON instruction (no image) |\n| `GET /v2/status/{id}` | Check async request status |\n\n### Authentication\n\nAll requests need `api_token` header:\n```\napi_token: YOUR_BRIA_API_KEY\nUser-Agent: BriaSkills/<version>\n```\n> **Required:** Always include the `User-Agent: BriaSkills/<version>` header (where `<version>` is the current skill version from `package.json`, e.g. `BriaSkills/1.2.6`) in every API call, including status polling requests.\n\n---\n\n## Additional Resources\n\n- **[API Endpoints Reference](references/api-endpoints.md)** — Complete endpoint documentation with request/response formats\n- **[Workflows & Pipelines](references/workflows.md)** — Batch generation, parallel pipelines, integration examples\n- **[Python Client](references/code-examples/bria_client.py)** — Full-featured async Python client\n- **[TypeScript Client](references/code-examples/bria_client.ts)** — Typed Node.js client\n- **[Bash/curl Reference](references/code-examples/bria_client.sh)** — Shell functions for all endpoints\n\n## Related Skills\n\n- **[vgl](../vgl/SKILL.md)** — Write structured VGL JSON prompts for precise, deterministic control over FIBO image generation\n- **[image-utils](../image-utils/SKILL.md)** — Classic image manipulation (resize, crop, composite, watermarks) for post-processing\n\nFile v0.0.27:_meta.json\n\n{\n  \"ownerId\": \"kn7artjmk0ncb5fmp9x21x4tss80jshr\",\n  \"slug\": \"bria-ai\",\n  \"version\": \"0.0.27\",\n  \"publishedAt\": 1773484874597\n}\n\nFile v0.0.27:references/api-endpoints.md\n\n# Bria.ai API Reference\n\n## Base URL & Authentication\n\n**Base URL:** `https://engine.prod.bria-api.com`\n\n**Authentication:** Include these headers in all requests:\n```\napi_token: YOUR_BRIA_API_KEY\nContent-Type: application/json\nUser-Agent: BriaSkills/<version>\n```\n\n> **Required:** Always include the `User-Agent: BriaSkills/<version>` header (where `<version>` is the current skill version from `package.json`, e.g. `BriaSkills/1.2.6`) in every API call, including status polling requests.\n\n---\n\n## FIBO - Image Generation\n\n### POST /v2/image/generate\n\nGenerate images from text prompts using FIBO's structured prompt system.\n\n**Request:**\n```json\n{\n  \"prompt\": \"string (required)\",\n  \"aspect_ratio\": \"1:1\",\n  \"resolution\": \"1MP\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1,\n  \"seed\": null\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `prompt` | string | required* | Image description (* or use `structured_prompt`) |\n| `aspect_ratio` | string | \"1:1\" | \"1:1\", \"4:3\", \"16:9\", \"3:4\", \"9:16\" |\n| `resolution` | string | \"1MP\" | Output image resolution. \"1MP\" or \"4MP\". \"4MP\" improves image details, especially for photorealism, but increases latency by ~30 seconds. |\n| `negative_prompt` | string | - | What to exclude |\n| `num_results` | int | 1 | Number of images (1-4) |\n| `seed` | int | random | For reproducibility |\n| `structured_prompt` | string | - | JSON from previous generation (for refinement). Use with `prompt` to refine, or alone with `seed` to recreate. |\n| `image_url` | string | - | Reference image (for inspire mode) |\n\n**Input Combination Rules** (mutually exclusive):\n- `prompt` — Generate from text\n- `image_url` — Generate inspired by a reference image\n- `image_url` + `prompt` — Generate inspired by image, guided by text\n- `structured_prompt` + `seed` — Recreate a previous image exactly\n- `structured_prompt` + `prompt` + `seed` — Refine a previous image with new instructions\n\nAll combinations support `aspect_ratio`, `negative_prompt`, `num_results`, and `seed`.\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://engine.prod.bria-api.com/v2/status/uuid\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...\",\n    \"structured_prompt\": \"{...}\",\n    \"seed\": 12345\n  }\n}\n```\n\n---\n\n## RMBG-2.0 - Background Removal\n\n### POST /v2/image/edit/remove_background\n\nRemove background from image. Returns PNG with transparency.\n\n**Request:**\n```json\n{\n  \"image\": \"https://publicly-accessible-image-url\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `image` | string | Source image URL (JPEG, PNG, WEBP) |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://...\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...png\"\n  }\n}\n```\n\n---\n\n## FIBO-Edit - Image Editing\n\n### POST /v2/image/edit\n\nEdit an image using natural language instructions. No mask required.\n\n**Request:**\n```json\n{\n  \"images\": [\"https://source-image-url\"],\n  \"instruction\": \"change the mug color to red\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `images` | array | required | Array of image URLs or base64 data URLs |\n| `instruction` | string | required | Edit instruction in natural language |\n\n### POST /v2/image/edit/gen_fill\n\nGenerate content in a masked region (inpainting).\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"mask\": \"https://mask-image-url\",\n  \"prompt\": \"what to generate\",\n  \"mask_type\": \"manual\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL |\n| `mask` | string | required | Mask URL (white=edit, black=keep) |\n| `prompt` | string | required | What to generate in masked area |\n| `mask_type` | string | \"manual\" | \"manual\" or \"automatic\" |\n| `negative_prompt` | string | - | What to avoid |\n| `num_results` | int | 1 | Number of variations |\n\n**Mask Requirements:**\n- White pixels (255) = area to edit\n- Black pixels (0) = area to preserve\n- Same aspect ratio as source image\n\n### POST /v2/image/edit/erase\n\nRemove objects defined by mask.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"mask\": \"https://mask-image-url\"\n}\n```\n\n### POST /v2/image/edit/erase_foreground\n\nRemove primary subject and fill with background.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/replace_background\n\nReplace background with AI-generated content.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"prompt\": \"new background description\"\n}\n```\n\n### POST /v2/image/edit/blur_background\n\nApply blur effect to image background.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/expand\n\nExpand/outpaint an image to extend its boundaries.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-string-or-url\",\n  \"aspect_ratio\": \"16:9\",\n  \"prompt\": \"optional description for new content\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL or base64 string |\n| `aspect_ratio` | string | required | Target ratio: \"1:1\", \"4:3\", \"16:9\", \"3:4\", \"9:16\" |\n| `prompt` | string | - | Optional - describe content to generate |\n\n### POST /v2/image/edit/enhance\n\nEnhance image quality (lighting, colors, details).\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\"\n}\n```\n\n### POST /v2/image/edit/increase_resolution\n\nUpscale image resolution.\n\n**Request:**\n```json\n{\n  \"image\": \"https://source-image-url\",\n  \"scale\": 2\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL |\n| `scale` | int | 2 | Upscale factor (2 or 4) |\n\n### POST /v1/product/lifestyle_shot_by_text\n\nPlace a product in a lifestyle scene using text description.\n\n**Request:**\n```json\n{\n  \"file\": \"BASE64_ENCODED_IMAGE\",\n  \"prompt\": \"modern kitchen countertop, natural lighting\",\n  \"placement_type\": \"automatic\"\n}\n```\n\n### POST /image/edit/product/integrate\n\nIntegrate and embed one or more products into a predefined scene at precise user-defined coordinates. The product is automatically matched to the scene's lighting, perspective, and aesthetics. Products are automatically cut out from their background as part of the pipeline.\n\n**Request:**\n```json\n{\n  \"scene\": \"https://scene-image-url\",\n  \"products\": [\n    {\n      \"image\": \"https://product-image-url\",\n      \"coordinates\": {\n        \"x\": 100,\n        \"y\": 200,\n        \"width\": 300,\n        \"height\": 400\n      }\n    }\n  ],\n  \"seed\": 42\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `scene` | string | required | Scene image URL or base64. Accepted formats: jpeg, jpg, png, webp |\n| `products` | array | required | Array of product objects (1 to N products) |\n| `products[].image` | string | required | Product image URL or base64. If it has an alpha channel, no cutout is applied; otherwise automatic cutout is applied |\n| `products[].coordinates` | object | required | Placement and scaling of the product within the scene |\n| `products[].coordinates.x` | int | required | X-coordinate of the product's top-left corner (pixels) |\n| `products[].coordinates.y` | int | required | Y-coordinate of the product's top-left corner (pixels) |\n| `products[].coordinates.width` | int | required | Desired product width in pixels (must not exceed scene dimensions) |\n| `products[].coordinates.height` | int | required | Desired product height in pixels (must not exceed scene dimensions) |\n| `seed` | int | random | Seed for deterministic generation |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"result\": {\n    \"image_url\": \"https://...\"\n  }\n}\n```\n\n**Async Response (202):**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://...\"\n}\n```\n\n---\n\n## Text-Based Object Editing\n\n### POST /v2/image/edit/add_object_by_text\n\nAdd a new object to an image using natural language.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"instruction\": \"Place a red vase with flowers on the table\"\n}\n```\n\n### POST /v2/image/edit/replace_object_by_text\n\nReplace an existing object with a new one.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"instruction\": \"Replace the red apple with a green pear\"\n}\n```\n\n### POST /v2/image/edit/erase_by_text\n\nRemove a specific object by name.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"object_name\": \"table\"\n}\n```\n\n---\n\n## Image Transformation\n\n### POST /v2/image/edit/blend\n\nBlend/merge images or apply textures.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"overlay\": \"texture-or-art-url\",\n  \"instruction\": \"Place the art on the shirt, keep the art exactly the same\"\n}\n```\n\n### POST /v2/image/edit/reseason\n\nChange the season or weather of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"season\": \"winter\"\n}\n```\n\n**Seasons:** `spring`, `summer`, `autumn`, `winter`\n\n### POST /v2/image/edit/restyle\n\nTransform the artistic style of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"style\": \"oil_painting\"\n}\n```\n\n**Style IDs:** `render_3d`, `cubism`, `oil_painting`, `anime`, `cartoon`, `coloring_book`, `retro_ad`, `pop_art_halftone`, `vector_art`, `story_board`, `art_nouveau`, `cross_etching`, `wood_cut`\n\n### POST /v2/image/edit/relight\n\nModify the lighting setup of an image.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"light_type\": \"sunrise light\",\n  \"light_direction\": \"front\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `image` | string | required | Source image URL or base64 |\n| `light_type` | string | required | Lighting preset (see values below) |\n| `light_direction` | string | required | `front`, `side`, `bottom`, `top-down` |\n\n**Light Types:** `midday`, `blue hour light`, `low-angle sunlight`, `sunrise light`, `spotlight on subject`, `overcast light`, `soft overcast daylight lighting`, `cloud-filtered lighting`, `fog-diffused lighting`, `side lighting`, `moonlight lighting`, `starlight nighttime`, `soft bokeh lighting`, `harsh studio lighting`\n\n---\n\n## Image Restoration & Conversion\n\n### POST /v2/image/edit/sketch_to_colored_image\n\nConvert a sketch or line drawing to a photorealistic image.\n\n**Request:**\n```json\n{\n  \"image\": \"sketch-base64-or-url\",\n  \"prompt\": \"optional description\"\n}\n```\n\n### POST /v2/image/edit/restore\n\nRestore old/damaged photos by removing noise, scratches, and blur.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\"\n}\n```\n\n### POST /v2/image/edit/colorize\n\nAdd color to B&W photos or convert to B&W.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\",\n  \"color\": \"contemporary color\"\n}\n```\n\n**Colors:** `contemporary color`, `vivid color`, `black and white colors`, `sepia vintage`\n\n### POST /v2/image/edit/crop_foreground\n\nRemove background and crop tightly around the foreground.\n\n**Request:**\n```json\n{\n  \"image\": \"base64-or-url\"\n}\n```\n\n---\n\n## Structured Instructions\n\n### POST /v2/structured_instruction/generate\n\nGenerate a structured JSON instruction from natural language (no image generated).\n\n**Request:**\n```json\n{\n  \"images\": [\"base64-or-url\"],\n  \"instruction\": \"change to golden hour lighting\",\n  \"mask\": \"optional-mask-url\"\n}\n```\n\n**Returns:** `structured_instruction` JSON that can be passed to `/v2/image/edit`\n\n---\n\n## Status Polling\n\n### GET /v2/status/{request_id}\n\nCheck async request status.\n\n**Response:**\n```json\n{\n  \"status\": \"IN_PROGRESS | COMPLETED | FAILED\",\n  \"result\": {\n    \"image_url\": \"https://...\"\n  },\n  \"request_id\": \"uuid\"\n}\n```\n\n**Status Values:**\n- `IN_PROGRESS` - Still processing\n- `COMPLETED` - Success, result available\n- `FAILED` - Error occurred\n\n**Polling Pattern:**\n```python\nimport requests, time\n\ndef poll(status_url, api_key, timeout=120):\n    headers = {\"api_token\": api_key, \"User-Agent\": \"BriaSkills/1.2.6\"}\n    for _ in range(timeout // 2):\n        r = requests.get(status_url, headers=headers)\n        data = r.json()\n        if data[\"status\"] == \"COMPLETED\":\n            return data[\"result\"][\"image_url\"]\n        if data[\"status\"] == \"FAILED\":\n            raise Exception(data.get(\"error\"))\n        time.sleep(2)\n    raise TimeoutError()\n```\n\n---\n\n## Error Handling\n\n### HTTP Status Codes\n\n| Code | Description |\n|------|-------------|\n| 200 | Success |\n| 400 | Bad request |\n| 401 | Unauthorized - invalid API key |\n| 415 | Unsupported media type |\n| 422 | Validation failed / Content moderation blocked |\n| 429 | Rate limited |\n| 500 | Server error |\n\n### Supported Image Formats\n\n- **Input:** JPEG, JPG, PNG, WEBP (RGB, RGBA, CMYK)\n- **Output:** PNG (with transparency where applicable)\n\nFile v0.0.27:references/workflows.md\n\n# Bria AI Workflows & Advanced Patterns\n\n## Batch & Parallel Image Generation\n\n### Python Async Batch Generation\n\nFor generating many images efficiently, launch requests in parallel and poll concurrently:\n\n```python\nimport asyncio\nimport aiohttp\n\nasync def generate_image(session, api_key, prompt, aspect_ratio=\"1:1\"):\n    \"\"\"Launch a single generation request.\"\"\"\n    async with session.post(\n        \"https://engine.prod.bria-api.com/v2/image/generate\",\n        headers={\"api_token\": api_key, \"Content-Type\": \"application/json\", \"User-Agent\": \"BriaSkills/1.2.6\"},\n        json={\"prompt\": prompt, \"aspect_ratio\": aspect_ratio}\n    ) as resp:\n        return await resp.json()\n\nasync def poll_status(session, api_key, status_url, timeout=120):\n    \"\"\"Poll until complete or failed.\"\"\"\n    for _ in range(timeout // 2):\n        async with session.get(status_url, headers={\"api_token\": api_key, \"User-Agent\": \"BriaSkills/1.2.6\"}) as resp:\n            data = await resp.json()\n            if data[\"status\"] == \"COMPLETED\":\n                return data[\"result\"][\"image_url\"]\n            if data[\"status\"] == \"FAILED\":\n                raise Exception(data.get(\"error\", \"Generation failed\"))\n        await asyncio.sleep(2)\n    raise TimeoutError(f\"Timeout polling {status_url}\")\n\nasync def generate_batch(api_key, prompts, aspect_ratio=\"1:1\", max_concurrent=5):\n    \"\"\"Generate multiple images with different prompts concurrently.\"\"\"\n    semaphore = asyncio.Semaphore(max_concurrent)  # Rate limiting\n\n    async def generate_one(prompt):\n        async with semaphore:\n            async with aiohttp.ClientSession() as session:\n                # Launch request\n                result = await generate_image(session, api_key, prompt, aspect_ratio)\n                # Poll for completion\n                return await poll_status(session, api_key, result[\"status_url\"])\n\n    # Run all concurrently\n    results = await asyncio.gather(*[generate_one(p) for p in prompts], return_exceptions=True)\n    return results\n\n# Usage\nprompts = [\n    \"Professional photo of running shoes on white background\",\n    \"Professional photo of leather handbag on white background\",\n    \"Professional photo of smartwatch on white background\",\n    \"Professional photo of sunglasses on white background\",\n]\nimage_urls = asyncio.run(generate_batch(\"YOUR_API_KEY\", prompts, max_concurrent=3))\n```\n\n**Key points:**\n- Use `asyncio.Semaphore` to limit concurrent requests (recommended: 3-5)\n- `return_exceptions=True` prevents one failure from canceling all requests\n- Each result is either a URL string or an Exception object\n\n### TypeScript/Node.js Parallel Generation\n\n```typescript\ntype AspectRatio = \"1:1\" | \"4:3\" | \"16:9\" | \"3:4\" | \"9:16\";\n\ninterface BriaResponse {\n  request_id: string;\n  status_url: string;\n}\n\ninterface BriaStatusResponse {\n  status: \"IN_PROGRESS\" | \"COMPLETED\" | \"FAILED\";\n  result?: { image_url: string };\n  error?: string;\n}\n\ninterface GenerateBatchResult {\n  prompt: string;\n  imageUrl: string | null;\n  error: string | null;\n}\n\nasync function generateBatch(\n  apiKey: string,\n  prompts: string[],\n  aspectRatio: AspectRatio = \"1:1\",\n  maxConcurrent = 5\n): Promise<GenerateBatchResult[]> {\n  const semaphore = { count: 0, max: maxConcurrent };\n\n  async function withLimit<T>(fn: () => Promise<T>): Promise<T> {\n    while (semaphore.count >= semaphore.max) {\n      await new Promise(r => setTimeout(r, 100));\n    }\n    semaphore.count++;\n    try {\n      return await fn();\n    } finally {\n      semaphore.count--;\n    }\n  }\n\n  async function generateOne(prompt: string): Promise<string> {\n    return withLimit(async () => {\n      // Launch request\n      const res = await fetch(\"https://engine.prod.bria-api.com/v2/image/generate\", {\n        method: \"POST\",\n        headers: { \"api_token\": apiKey, \"Content-Type\": \"application/json\", \"User-Agent\": \"BriaSkills/1.2.6\" },\n        body: JSON.stringify({ prompt, aspect_ratio: aspectRatio })\n      });\n      const { status_url } = (await res.json()) as BriaResponse;\n\n      // Poll for result\n      for (let i = 0; i < 60; i++) {\n        const statusRes = await fetch(status_url, { headers: { \"api_token\": apiKey, \"User-Agent\": \"BriaSkills/1.2.6\" } });\n        const data = (await statusRes.json()) as BriaStatusResponse;\n        if (data.status === \"COMPLETED\") return data.result!.image_url;\n        if (data.status === \"FAILED\") throw new Error(data.error || \"Generation failed\");\n        await new Promise(r => setTimeout(r, 2000));\n      }\n      throw new Error(\"Timeout waiting for generation\");\n    });\n  }\n\n  const results = await Promise.allSettled(prompts.map(generateOne));\n\n  return results.map((result, i) => ({\n    prompt: prompts[i],\n    imageUrl: result.status === \"fulfilled\" ? result.value : null,\n    error: result.status === \"rejected\" ? result.reason.message : null\n  }));\n}\n\n// Usage\nconst results = await generateBatch(process.env.BRIA_API_KEY!, [\n  \"Modern office workspace with natural lighting\",\n  \"Abstract tech background with blue gradient\",\n  \"Professional headshot studio setup\"\n], \"16:9\", 3);\n\nresults.forEach(r => {\n  if (r.imageUrl) console.log(`Done ${r.prompt}: ${r.imageUrl}`);\n  else console.log(`Failed ${r.prompt}: ${r.error}`);\n});\n```\n\n---\n\n## Pipeline Workflows\n\nChain multiple operations on images (generate -> edit -> remove background).\n\n### Complete Pipeline Example\n\n```python\nasync def product_pipeline(api_key, product_descriptions, scene_prompt):\n    \"\"\"\n    Pipeline: Generate product -> Remove background -> Place in lifestyle scene\n    \"\"\"\n    async with aiohttp.ClientSession() as session:\n        results = []\n\n        for desc in product_descriptions:\n            # Step 1: Generate product image\n            gen_result = await generate_image(session, api_key,\n                f\"Professional product photo of {desc} on white background, studio lighting\",\n                aspect_ratio=\"1:1\")\n            product_url = await poll_status(session, api_key, gen_result[\"status_url\"])\n\n            # Step 2: Remove background\n            async with session.post(\n                \"https://engine.prod.bria-api.com/v2/image/edit/remove_background\",\n                headers={\"api_token\": api_key, \"Content-Type\": \"application/json\", \"User-Agent\": \"BriaSkills/1.2.6\"},\n                json={\"image\": product_url}\n            ) as resp:\n                rmbg_result = await resp.json()\n            transparent_url = await poll_status(session, api_key, rmbg_result[\"status_url\"])\n\n            # Step 3: Place in lifestyle scene\n            async with session.post(\n                \"https://engine.prod.bria-api.com/v2/image/edit/lifestyle_shot_by_text\",\n                headers={\"api_token\": api_key, \"Content-Type\": \"application/json\", \"User-Agent\": \"BriaSkills/1.2.6\"},\n                json={\"image\": transparent_url, \"prompt\": scene_prompt}\n            ) as resp:\n                lifestyle_result = await resp.json()\n            final_url = await poll_status(session, api_key, lifestyle_result[\"status_url\"])\n\n            results.append({\n                \"product\": desc,\n                \"original\": product_url,\n                \"transparent\": transparent_url,\n                \"lifestyle\": final_url\n            })\n\n        return results\n\n# Usage\nproducts = [\"coffee mug\", \"water bottle\", \"notebook\"]\nscene = \"modern minimalist desk, natural morning light, plants in background\"\nresults = asyncio.run(product_pipeline(\"YOUR_API_KEY\", products, scene))\n```\n\n### Parallel Pipeline (Advanced)\n\nProcess multiple products through the pipeline concurrently:\n\n```python\nasync def parallel_pipeline(api_key, products, scene_prompt, max_concurrent=3):\n    \"\"\"Run full pipeline for multiple products in parallel.\"\"\"\n    semaphore = asyncio.Semaphore(max_concurrent)\n\n    async def process_one(product):\n        async with semaphore:\n            return await single_product_pipeline(api_key, product, scene_prompt)\n\n    return await asyncio.gather(*[process_one(p) for p in products], return_exceptions=True)\n```\n\n### Common Pipeline Patterns\n\n| Pipeline | Steps | Use Case |\n|----------|-------|----------|\n| Product -> Transparent | generate -> remove_background | E-commerce cutouts |\n| Product -> Lifestyle | generate -> remove_background -> lifestyle_shot | Marketing photos |\n| Edit -> Upscale | edit -> increase_resolution | High-res edited images |\n| Generate -> Restyle | generate -> restyle | Artistic variations |\n| Generate -> Variations | generate (num_results=4) | A/B testing options |\n\n---\n\n## Integration Examples\n\n### React/Next.js Component\n\n```jsx\n// Generate and display a hero image\nconst [imageUrl, setImageUrl] = useState(null);\n\nasync function generateHero(prompt) {\n  const res = await fetch('/api/bria/generate', {\n    method: 'POST',\n    body: JSON.stringify({ prompt, aspect_ratio: '16:9' })\n  });\n  const { image_url } = await res.json();\n  setImageUrl(image_url);\n}\n```\n\n### Python Script for Batch Generation\n\n```python\nimport asyncio\n\n# See \"Batch & Parallel Image Generation\" section for generate_batch function\n\nasync def main():\n    api_key = \"YOUR_API_KEY\"\n    products = [\"running shoes\", \"leather bag\", \"smart watch\"]\n    prompts = [f\"Professional product photo of {p} on white background\" for p in products]\n\n    results = await generate_batch(api_key, prompts, aspect_ratio=\"1:1\", max_concurrent=3)\n\n    for product, result in zip(products, results):\n        if isinstance(result, Exception):\n            print(f\"{product}: FAILED - {result}\")\n        else:\n            print(f\"{product}: {result}\")\n\nasyncio.run(main())\n```\n\n---\n\n## Asset Generation Recipes\n\n### Website Hero Images\n\n```json\n{\n  \"prompt\": \"Modern tech startup workspace with developers collaborating, bright natural lighting, clean minimal aesthetic\",\n  \"aspect_ratio\": \"16:9\",\n  \"negative_prompt\": \"cluttered, dark, low quality\"\n}\n```\n\n**Tips:**\n- Use `16:9` for full-width banners\n- Describe lighting and mood explicitly\n- Include \"professional\", \"high quality\", \"commercial\" for polished results\n- Specify \"clean background\" or \"minimal\" for text overlay space\n\n### Product Photography\n\n```json\n{\n  \"prompt\": \"Professional product photo of [item] on white studio background, soft shadows, commercial photography lighting\",\n  \"aspect_ratio\": \"1:1\"\n}\n```\n\nThen remove background for transparent PNG to composite anywhere.\n\n### Presentation Visuals\n\n```json\n{\n  \"prompt\": \"Abstract visualization of data analytics, blue and purple gradient, modern corporate style, clean composition with space for text\",\n  \"aspect_ratio\": \"16:9\"\n}\n```\n\n**Common themes:** \"Abstract technology background\", \"Business team collaboration\", \"Growth chart visualization\", \"Minimalist geometric patterns\"\n\n### Social Media Assets\n\n**Instagram post (1:1):**\n```json\n{\n  \"prompt\": \"Lifestyle photo of coffee and laptop on wooden desk, morning light, cozy atmosphere\",\n  \"aspect_ratio\": \"1:1\"\n}\n```\n\n**Story/Reel (9:16):**\n```json\n{\n  \"prompt\": \"Vertical product showcase of smartphone, floating in gradient background, tech aesthetic\",\n  \"aspect_ratio\": \"9:16\"\n}\n```\n\nFile v0.0.27:LICENSE.txt\n\nMIT License\n\nCopyright (c) 2025\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n---\n\nNote: This skill integrates with Bria.ai's API. Usage of the Bria.ai API is\nsubject to Bria.ai's Terms of Service and API usage policies. The Bria.ai\nAPI and associated models are commercial products - please refer to\nhttps://bria.ai for licensing and pricing information.\n\nArchive v0.2.6: 7 files, 29008 bytes\n\nFiles: references/api-endpoints.md (13032b), references/code-examples/bria_client.py (26746b), references/code-examples/bria_client.sh (25018b), references/code-examples/bria_client.ts (23863b), references/workflows.md (11024b), SKILL.md (12623b), _meta.json (126b)\n\nFile v0.2.6:SKILL.md\n\n---\nname: bria-ai\ndescription: Generate, edit, create product images with AI. Remove or replace backgrounds, lifestyle shots, transparent PNGs, visual assets, batch generation, illustrations. Controllable image editing with Bria.ai commercially-safe models — fine-grained control over what gets generated, edited, or removed. Edit by text instruction, mask specific regions, add/replace/remove individual objects, control lighting, season, and style. Use for e-commerce product photography, background removal, image upscaling, style transfer, hero images, icons, banners, and pipeline workflows. Triggers on AI image generation, controllable editing, background removal, or visual asset creation.\nhomepage: https://bria.ai\nlicense: MIT\nmetadata:\n  author: Bria AI\n  version: \"1.2.6\"\n  dependencies:\n    - type: env\n      name: BRIA_API_KEY\n      description: \"Bria AI API key (get one at https://platform.bria.ai/console/account/api-keys)\"\n---\n\n# Bria — Generate, Edit & Remove Background from Images with AI\n\nGenerate, edit, and create visual assets using Bria's commercially-safe AI models (Fibo, Fibo-Edit,  RMBG-2.0, GenFill, and more). Remove or replace backgrounds, create product lifestyle shots, generate transparent PNGs, batch generate images, and build pipeline workflows. Unlike black-box generators, Bria gives you fine-grained control: edit by text instruction, mask specific regions, add/replace/remove individual objects, change lighting or season independently.\n\n## Setup — API Key Check\n\nBefore making any Bria API call, check for the API key and help the user set it up if missing:\n\n### Step 1: Check if the key exists\n\n```bash\necho $BRIA_API_KEY\n```\n\nIf the output is **not empty**, skip to the next section.\n\n### Step 2: If the key is missing, guide the user\n\nTell the user exactly this:\n> To use image generation, you need a free Bria API key.\n>\n> 1. Go to https://platform.bria.ai/console/account/api-keys\n> 2. Sign up or log in\n> 3. Click **Create API Key**\n\nWait for the user to provide their API key. Do not proceed until they give you the key.\n\n**Do not proceed with any image generation or editing until the API key is confirmed set.**\n\n---\n\n## Core Capabilities\n\n| Need | Capability | Use Case |\n|------|------------|----------|\n| Generate images from text | FIBO Generate | Hero images, product shots, illustrations, social media images, banners |\n| Edit images by text instruction | FIBO-Edit | Change colors, modify objects, transform scenes |\n| Edit image region with mask | GenFill/Erase | Precise inpainting, add/replace specific regions |\n| Add/Replace/Remove objects | Text-based editing | Add vase, replace apple with pear, remove table |\n| Remove background (transparent PNG) | RMBG-2.0 | Extract subjects for overlays, logos, cutouts |\n| Replace/blur/erase background | Background ops | Change, blur, or remove backgrounds |\n| Expand/outpaint images | Outpainting | Extend boundaries, change aspect ratios |\n| Upscale image resolution | Super Resolution | Increase resolution 2x or 4x |\n| Enhance image quality | Enhancement | Improve lighting, colors, details |\n| Restyle images | Restyle | Oil painting, anime, cartoon, 3D render |\n| Change lighting | Relight | Golden hour, spotlight, dramatic lighting |\n| Change season | Reseason | Spring, summer, autumn, winter |\n| Composite/blend images | Image Blending | Apply textures, logos, merge images |\n| Restore old photos | Restoration | Fix old/damaged photos |\n| Colorize images | Colorization | Add color to B&W, or convert to B&W |\n| Sketch to photo | Sketch2Image | Convert drawings to realistic photos |\n| Create product lifestyle shots | Lifestyle Shot | Place products in scenes for e-commerce |\n| Integrate products into scenes | Product Integrate | Embed products at exact coordinates |\n\n## Quick Reference\n\n### Generate an Image (FIBO)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/generate\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"prompt\": \"your description\",\n    \"aspect_ratio\": \"16:9\",\n    \"resolution\": \"1MP\",\n    \"sync\": true\n  }'\n```\n\n**Aspect ratios**: `1:1` (square), `16:9` (hero/banner), `4:3` (presentation), `9:16` (mobile/story), `3:4` (portrait)\n\n**Resolution**: `1MP` (default) or `4MP` (improved details for photorealism, adds ~30s latency)\n\n**Sync mode**: Pass `\"sync\": true` in the request body for single image generation to get the result directly in the response. For batch/multiple image generation, omit `sync` (or set `false`) and use polling instead.\n\n> **Advanced**: For precise, deterministic control over generation, use **[VGL structured prompts](../vgl/SKILL.md)** instead of natural language. VGL defines every visual attribute (objects, lighting, composition) as explicit JSON.\n\n### Remove Background (RMBG-2.0)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/remove_background\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\"image\": \"https://...\"}'\n```\n\nReturns PNG with transparency.\n\n### Edit Image (FIBO-Edit) - No Mask Required\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"images\": [\"https://...\"],\n    \"instruction\": \"change the mug to red\"\n  }'\n```\n\n### Edit Image Region with Mask (GenFill)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/gen_fill\" \\\n  -H \"api_token: $BRIA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"User-Agent: BriaSkills/1.2.6\" \\\n  -d '{\n    \"image\": \"https://...\",\n    \"mask\": \"https://...\",\n    \"prompt\": \"what to generate in masked area\"\n  }'\n```\n\n### Expand Image (Outpainting)\n\n```bash\ncurl -X POST \"https://engine.prod.bria-api.com/v2/image/edit/expand\" \\\n  -H \"api_token: $BRIA\n\nArchive v1.0.2: 8 files, 29854 bytes\n\nFiles: LICENSE.txt (1335b), references/api-endpoints.md (13032b), references/code-examples/bria_client.py (26746b), references/code-examples/bria_client.sh (25018b), references/code-examples/bria_client.ts (23863b), references/workflows.md (11024b), SKILL.md (12457b), _meta.json (126b)\n\nArchive v1.0.1: 8 files, 29897 bytes\n\nFiles: LICENSE.txt (1335b), references/api-endpoints.md (13032b), references/code-examples/bria_client.py (26746b), references/code-examples/bria_client.sh (25018b), references/code-examples/bria_client.ts (23863b), references/workflows.md (11024b), SKILL.md (12612b), _meta.json (126b)\n\nArchive v1.0.0: 8 files, 30157 bytes\n\nFiles: LICENSE.txt (1335b), references/api-endpoints.md (13032b), references/code-examples/bria_client.py (26746b), references/code-examples/bria_client.sh (25018b), references/code-examples/bria_client.ts (23863b), references/workflows.md (11024b), SKILL.md (13228b), _meta.json (126b)\n\nArchive v1.2.6: 8 files, 30281 bytes\n\nFiles: LICENSE.txt (1335b), references/api-endpoints.md (13032b), references/code-examples/bria_client.py (26746b), references/code-examples/bria_client.sh (25018b), references/code-examples/bria_client.ts (23863b), references/workflows.md (11024b), SKILL.md (13595b), _meta.json (126b)\n\nArchive v1.2.5: 8 files, 30282 bytes\n\nFiles: LICENSE.txt (1335b), references/api-endpoints.md (13032b), references/code-examples/bria_client.py (26746b), references/code-examples/bria_client.sh (25018b), references/code-examples/bria_client.ts (23863b), references/workflows.md (11024b), SKILL.md (13595b), _meta.json (126b)","readmeExcerpt":"Skill: Bria Ai Owner: galbria Summary: Bria.ai image API — generate from text prompts, edit with natural language, remove backgrounds for transparent PNGs, and create product lifestyle shots. Auth... Tags: latest:1.3.1 Version history: v1.3.1 | 2026-06-24T10:06:48.977Z | user Update bria-ai (OpenClaw device-flow auth); add video-remove-background and bundle skills v1.3.0 | 2026-03-29T11:50:25.970Z | user **Bria AI Sk","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"if [ -f ~/.bria/credentials ]; then\n  BRIA_ACCESS_TOKEN=$(grep '^access_token=' \"$HOME/.bria/credentials\" | cut -d= -f2-)\n  BRIA_API_KEY=$(grep '^api_token=' \"$HOME/.bria/credentials\" | cut -d= -f2-)\nfi\nif [ -z \"$BRIA_ACCESS_TOKEN\" ]; then\n  echo \"NO_CREDENTIALS\"\nelif [ -n \"$BRIA_API_KEY\" ]; then\n  echo \"READY\"\nelse\n  echo \"CREDENTIALS_FOUND\"\nfi"},{"language":"bash","snippet":"source ~/.agents/skills/bria-ai/references/code-examples/bria_auth.sh\nbria_auth"},{"language":"bash","snippet":"source ~/.agents/skills/bria-ai/references/code-examples/bria_auth.sh\nbria_introspect"},{"language":"text","snippet":"Transparent PNG / cutout / remove background?\n  → /v2/image/edit/remove_background\n\nGenerate image from scratch (text → image)?\n  → /v2/image/generate\n\nEdit existing image with text instruction?\n  → /v2/image/edit  (use --key images)\n\nChange / replace / blur background?\n  → /v2/image/edit/replace_background  (prompt: \"blur\" or describe new bg)\n\nPlace product in a lifestyle scene?\n  → /v1/product/lifestyle_shot_by_text\n\nUpscale / increase resolution?\n  → /v2/image/edit/increase_resolution  (scale: 2 or 4)\n\nAnything else (restyle, relight, reseason, restore, colorize, sketch, blend, outpaint)?\n  → See references/capabilities.md for the full endpoint list"},{"language":"bash","snippet":"source ~/.agents/skills/bria-ai/references/code-examples/bria_client.sh\n\n# Generate (no image input)\nRESULT=$(bria_call /v2/image/generate \"\" '\"prompt\": \"your description\", \"aspect_ratio\": \"16:9\", \"sync\": true')\n\n# Remove background\nRESULT=$(bria_call /v2/image/edit/remove_background \"/path/to/local/image.png\")\n\n# Replace background\nRESULT=$(bria_call /v2/image/edit/replace_background \"https://example.com/img.jpg\" '\"prompt\": \"sunset beach\"')\n\n# Edit image (uses images array — pass --key images)\nRESULT=$(bria_call /v2/image/edit \"/path/to/image.png\" --key images '\"instruction\": \"make it look warmer\"')\n\n# Upscale\nRESULT=$(bria_call /v2/image/edit/increase_resolution \"https://example.com/img.jpg\" '\"scale\": 4')\n\n# Lifestyle shot\nRESULT=$(bria_call /v1/product/lifestyle_shot_by_text \"/path/to/product.png\" '\"scene_description\": \"modern kitchen countertop\"')\n\necho \"$RESULT\""},{"language":"text","snippet":"api_token: YOUR_BRIA_API_KEY\nContent-Type: application/json\nUser-Agent: BriaSkills/<version>"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: bria-ai\ndescription: >\n  Bria.ai image API — generate from text prompts, edit with natural language,\n  remove backgrounds for transparent PNGs, and create product lifestyle shots.\n  Authenticates via OAuth device flow, caches credentials in ~/.bria/credentials,\n  calls 20+ endpoints. Commercially safe, royalty-free.\n  Triggers on: remove background, transparent PNG, cutout, generate image, create banner,\n  edit photo, product photography, upscale, restyle, inpainting, outpainting,\n  lifestyle shot, background replacement, object removal, photo restoration.\nlicense: MIT\nhomepage: https://bria.ai\nmetadata:\n  author: Bria AI\n  version: \"1.3.0\"\n  openclaw:\n    requires:\n      env:\n        - BRIA_API_KEY\n      anyBins:\n        - curl\n      config:\n        - ~/.bria/credentials\n    primaryEnv: BRIA_API_KEY\n    homepage: https://bria.ai\n    emoji: \"\\U0001F5BC\"\n\n---\n\n# Bria — AI Image Generation, Editing & Background Removal\n\nCommercially safe, royalty-free image generation and editing through 20+ API endpoints.\n\nFor additional endpoint details, see the [Bria API reference for agents](https://docs.bria.ai/llms.txt).\n\n## When to Use This Skill\n\n- **Generate images** — \"create an image of...\", \"make me a banner\", \"generate a hero image\", \"I need a product photo\"\n- **Edit images** — \"change the background\", \"make it look like winter\", \"add a vase to the table\", \"remove the person\"\n- **Remove/replace backgrounds** — \"make the background transparent\", \"cut out the product\", \"replace with a studio background\"\n- **Product photography** — \"create a lifestyle shot\", \"place this product in a kitchen scene\", \"e-commerce packshot\"\n- **Enhance/transform** — \"upscale this image\", \"make it higher resolution\", \"restyle as oil painting\", \"change the lighting\"\n\n---\n\n## Setup — Authentication\n\n### Step 1: Check for existing credentials\n\n```bash\nif [ -f ~/.bria/credentials ]; then\n  BRIA_ACCESS_TOKEN=$(grep '^access_token=' \"$HOME/.bria/credentials\" | cut -d= -f2-)\n  BRIA_API_KEY=$(grep '^api_token=' \"$HOME/.bria/credentials\" | cut -d= -f2-)\nfi\nif [ -z \"$BRIA_ACCESS_TOKEN\" ]; then\n  echo \"NO_CREDENTIALS\"\nelif [ -n \"$BRIA_API_KEY\" ]; then\n  echo \"READY\"\nelse\n  echo \"CREDENTIALS_FOUND\"\nfi\n```\n\n- `READY` → skip to making API calls\n- `CREDENTIALS_FOUND` → skip to Step 3\n- `NO_CREDENTIALS` → proceed to Step 2\n\n### Step 2: Authenticate via device flow\n\nSource the auth helper and run `bria_auth`:\n\n```bash\nsource ~/.agents/skills/bria-ai/references/code-examples/bria_auth.sh\nbria_auth\n```\n\n`bria_auth` will print `SIGN_IN_URL=...` and `USER_CODE=...`. Show the user exactly this — nothing more:\n\n> **Connect your Bria account:** [Click here to sign in]({SIGN_IN_URL})\n> Your code is **{USER_CODE}** — it's already filled in.\n\nThen wait; `bria_auth` polls automatically and prints `AUTHENTICATED` when done.\n\nIf it prints an error, the code expired — run `bria_auth` again.\n\n**Do not proceed with any API call until authentication is confirmed.**\n\n### Step 3: Verify billing status "},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7artjmk0ncb5fmp9x21x4tss80jshr\",\n  \"slug\": \"bria-ai\",\n  \"version\": \"1.3.1\",\n  \"publishedAt\": 1782295608977\n}"},{"path":"references/api-endpoints.md","content":"# Bria.ai API Reference\n\n## Base URL & Authentication\n\n**Base URL:** `https://engine.prod.bria-api.com`\n\n**Authentication:** Include these headers in all requests:\n```\napi_token: YOUR_BRIA_API_KEY\nContent-Type: application/json\nUser-Agent: BriaSkills/<version>\n```\n\n> **Required:** Always include the `User-Agent: BriaSkills/<version>` header (where `<version>` is the current skill version from `package.json`, e.g. `BriaSkills/1.3.0`) in every API call, including status polling requests.\n\n---\n\n## FIBO - Image Generation\n\n### POST /v2/image/generate\n\nGenerate images from text prompts using FIBO's structured prompt system.\n\n**Request:**\n```json\n{\n  \"prompt\": \"string (required)\",\n  \"aspect_ratio\": \"1:1\",\n  \"resolution\": \"1MP\",\n  \"negative_prompt\": \"string\",\n  \"num_results\": 1,\n  \"seed\": null\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| `prompt` | string | required* | Image description (* or use `structured_prompt`) |\n| `aspect_ratio` | string | \"1:1\" | \"1:1\", \"4:3\", \"16:9\", \"3:4\", \"9:16\" |\n| `resolution` | string | \"1MP\" | Output image resolution. \"1MP\" or \"4MP\". \"4MP\" improves image details, especially for photorealism, but increases latency by ~30 seconds. |\n| `negative_prompt` | string | - | What to exclude |\n| `num_results` | int | 1 | Number of images (1-4) |\n| `seed` | int | random | For reproducibility |\n| `structured_prompt` | string | - | JSON from previous generation (for refinement). Use with `prompt` to refine, or alone with `seed` to recreate. |\n| `image_url` | string | - | Reference image (for inspire mode) |\n\n**Input Combination Rules** (mutually exclusive):\n- `prompt` — Generate from text\n- `image_url` — Generate inspired by a reference image\n- `image_url` + `prompt` — Generate inspired by image, guided by text\n- `structured_prompt` + `seed` — Recreate a previous image exactly\n- `structured_prompt` + `prompt` + `seed` — Refine a previous image with new instructions\n\nAll combinations support `aspect_ratio`, `negative_prompt`, `num_results`, and `seed`.\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://engine.prod.bria-api.com/v2/status/uuid\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...\",\n    \"structured_prompt\": \"{...}\",\n    \"seed\": 12345\n  }\n}\n```\n\n---\n\n## RMBG-2.0 - Background Removal\n\n### POST /v2/image/edit/remove_background\n\nRemove background from image. Returns PNG with transparency.\n\n**Request:**\n```json\n{\n  \"image\": \"https://publicly-accessible-image-url\"\n}\n```\n\n**Parameters:**\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `image` | string | Source image URL (JPEG, PNG, WEBP) |\n\n**Response:**\n```json\n{\n  \"request_id\": \"uuid\",\n  \"status_url\": \"https://...\"\n}\n```\n\n**Completed Result:**\n```json\n{\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"image_url\": \"https://...png\"\n  }\n}\n```\n\n---\n\n## FIBO-Edit - Image Editing\n\n### POST /v2/image/edit\n\nEdit an imag"},{"path":"references/capabilities.md","content":"# Bria Capabilities Reference\n\n## What You Can Build\n\n- **E-commerce product catalog** — Generate product photos, remove backgrounds for transparent PNGs, place products in lifestyle scenes (kitchen, office, outdoor), create packshots with consistent style\n- **Landing page visuals** — Generate hero images, abstract tech backgrounds, team photos, and section illustrations — all matching your brand aesthetic\n- **Social media content** — Instagram posts (1:1), Stories/Reels (9:16), LinkedIn banners (16:9), ad creatives — batch-generate variants for A/B testing\n- **Marketing campaign assets** — Seasonal transformations (summer→winter), restyle product shots for different markets, create localized visuals at scale\n- **Photo restoration pipeline** — Restore old damaged photos, colorize black & white images, upscale low-res photos to 4x, enhance quality automatically\n- **Brand asset toolkit** — Remove backgrounds from logos, blend artwork onto products (t-shirts, mugs), create consistent product photography across your entire catalog\n- **AI-powered design workflows** — Chain operations: generate→edit→remove background→place in scene→upscale — all automated through API pipelines\n\n---\n\n## Full Capabilities Table\n\n| Need | Capability | Endpoint |\n|------|------------|----------|\n| Generate images from text | FIBO Generate | `/v2/image/generate` |\n| Edit images by text instruction | FIBO-Edit | `/v2/image/edit` |\n| Edit image region with mask | GenFill/Erase | `/v2/image/edit/genfill` |\n| Add/Replace/Remove objects | Text-based editing | `/v2/image/edit` |\n| Remove background (transparent PNG) | RMBG-2.0 | `/v2/image/edit/remove_background` |\n| Replace/blur/erase background | Background ops | `/v2/image/edit/replace_background` |\n| Expand/outpaint images | Outpainting | `/v2/image/edit/increase_outpaint` |\n| Upscale image resolution | Super Resolution | `/v2/image/edit/increase_resolution` |\n| Enhance image quality | Enhancement | `/v2/image/edit/enhance` |\n| Restyle images | Restyle | `/v2/image/edit/restyle` |\n| Change lighting | Relight | `/v2/image/edit/relight` |\n| Change season | Reseason | `/v2/image/edit/reseason` |\n| Composite/blend images | Image Blending | `/v2/image/edit/blend` |\n| Restore old photos | Restoration | `/v2/image/edit/restore` |\n| Colorize images | Colorization | `/v2/image/edit/colorize` |\n| Sketch to photo | Sketch2Image | `/v2/image/edit/sketch2image` |\n| Create product lifestyle shots | Lifestyle Shot | `/v1/product/lifestyle_shot_by_text` |\n| Integrate products into scenes | Product Integrate | `/v1/product/product_integrate` |\n\n---\n\n## Prompt Engineering Tips\n\n- **Style**: \"professional product photography\" vs \"casual snapshot\", \"flat design illustration\" vs \"3D rendered\"\n- **Lighting**: \"soft natural light\", \"studio lighting\", \"dramatic shadows\"\n- **Background**: \"white studio\", \"gradient\", \"blurred office\", \"transparent\"\n- **Composition**: \"centered\", \"rule of thirds\", \"negative space on left for text\"\n- **Quality keywords*"},{"path":"skill-card.md","content":"## Description:\n\nBria.ai image API skill that guides agents to authenticate, generate images from prompts, edit images with natural language, remove backgrounds, and create product lifestyle shots through Bria endpoints.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[galbria](https://clawhub.ai/user/galbria)\n\n### License/Terms of Use:\n\nMIT\n\n## Use Case:\n\nDevelopers, creators, and marketing teams use this skill through an agent to generate, edit, upscale, restore, and remove backgrounds from images with Bria.ai for product, campaign, and design workflows.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Credentials are cached in ~/.bria/credentials and may be exposed on shared or sensitive machines.\n\nMitigation: Use the skill on user-controlled machines, lock down ~/.bria and ~/.bria/credentials to the current user, and rotate Bria credentials if they may have been stored with permissive permissions.\n\nRisk: Local or remote images can be sent to Bria API endpoints during generation and editing workflows.\n\nMitigation: Use only non-confidential images unless the user's Bria terms and data-handling requirements permit uploading that content.\n\nRisk: Environment overrides such as BRIA_AUTH_BASE or BRIA_API_BASE can redirect authentication or API calls unexpectedly.\n\nMitigation: Verify endpoint-related environment variables before use and avoid running the skill in untrusted shell environments.\n\n## Reference(s):\n\n- [Bria.ai Homepage](https://bria.ai)\n- [Full API docs for agents](https://docs.bria.ai/llms.txt)\n- [ClawHub Skill Page](https://clawhub.ai/galbria/skills/bria-ai)\n- [Capabilities & Prompt Recipes](references/capabilities.md)\n- [API Endpoints Reference](references/api-endpoints.md)\n- [Shell Client](references/code-examples/bria_client.sh)\n- [Auth Helper](references/code-examples/bria_auth.sh)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Shell commands, API calls, Configuration]\n\n**Output Format:** [Markdown with inline bash code blocks and API result URLs]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Requires Bria authentication and may cache credentials in ~/.bria/credentials.]\n\n## Skill Version(s):\n\n1.3.1 (source: server release metadata; artifact frontmatter reports 1.3.0)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":2062,"uniquenessScore":43,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T09:49:28.684Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-09T09:49:28.684Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-09T19:02:25.927Z","emptyReason":null},"items":[{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-10T18:48:31.762Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}