Bria 3.2 Text to Image Serverless API

Bria 3.2 AI transforms natural language into stunning visuals for diverse creative applications — with Base, Fast, and HD modes to match your creative needs.

~21.79s
POST /v2/bria-text-to-image · submit + poll
 1# pip install "segmind>=1.1.0"
 2# export SEGMIND_API_KEY="YOUR_API_KEY"
 3import segmind
 4
 5# Async (v2): submit to the queue and block until COMPLETED.
 6# run() returns the final result dict (600s deadline, 1.0s poll by default).
 7result = segmind.run(
 8    "bria-text-to-image",
 9    prompt="A professional headshot of a CEO",
10    mode="base",
11    aspect_ratio="1:1",
12    seed=654321,
13    negative_prompt="no storms",
14    steps_num=40,
15    text_guidance_scale=7,
16    medium="photography",
17    prompt_enhancement=True,
18    enhance_image=True,
19    prompt_content_moderation=True,
20    content_moderation=False,
21    ip_signal=False,
22)
23print(result["status"])                      # COMPLETED
24print(result.get("output"))                  # model output (e.g. media URL)
25print(result["metrics"]["inference_time"])   # server compute seconds
26
27# --- Or submit + poll manually (track request_id, control the cadence) ---
28from segmind import SegmindClient, InferenceFailed, InferenceTimeout
29
30client = SegmindClient()                      # reads SEGMIND_API_KEY
31payload = {
32    "prompt": "A professional headshot of a CEO",
33    "mode": "base",
34    "aspect_ratio": "1:1",
35    "seed": 654321,
36    "negative_prompt": "no storms",
37    "steps_num": 40,
38    "text_guidance_scale": 7,
39    "medium": "photography",
40    "prompt_enhancement": True,
41    "enhance_image": True,
42    "prompt_content_moderation": True,
43    "content_moderation": False,
44    "ip_signal": False,
45}
46job = client.submit_async("bria-text-to-image", **payload)
47print(job.request_id)                         # available immediately
48try:
49    result = job.wait(timeout=600, interval=1.0)
50except InferenceTimeout as e:
51    print("still running:", e.request_id)
52except InferenceFailed as e:
53    print("failed:", e.detail)

API Endpoint

POSThttps://api.segmind.com/v1/bria-text-to-image

Parameters

promptrequired
string

The prompt you would like to use to generate images. Bria currently supports prompts in English only, excluding special characters.

aspect_ratiooptional
string

Set shape like '16:9' for wide, '1:1' for square formats.

Default: "1:1"
Allowed values :
"1:1""2:3""3:2""3:4""4:3""4:5""5:4""9:16""16:9"
content_moderationoptional
boolean

Moderate images for compliance. 'True' if needed, 'false' otherwise.

Default: false
enhance_imageoptional
boolean

Improve clarity with 'true' for better textures, 'false' for raw visuals.

Default: true
ip_signaloptional
boolean

Alert for IP content with 'true'; 'false' to ignore.

Default: false
mediumoptional
string

Define style; use 'photography' for realism, 'art' for creativity.

Default: "photography"
Allowed values :
"photography""art"
modeoptional
string

Choose output quality with 'base' for normal, 'fast' for speed, 'hd' for high detail.

Default: "base"
Allowed values :
base (3.2)"base"
fast (2.3)"fast"
hd (2.2)"hd"
negative_promptoptional
string

Remove unwanted elements e.g., 'no storms' for calm views.

Default: "no storms"
prompt_content_moderationoptional
boolean

Scan prompts for safety with 'true' on, 'false' off.

Default: true
prompt_enhancementoptional
boolean

Enhance creativity. 'True' for variation, 'false' for consistency.

Default: true
seedoptional
integer

Use specific numbers like '654321' to ensure repeatable results.

Default: 654321Range: 1 - 999999
steps_numoptional
integer

Adjust detail with '50' for intricate detail, '20' for faster processing.

Default: 40Range: 20 - 50
text_guidance_scaleoptional
number

Control prompt adherence with '10' for precise or '1' for flexible outputs.

Default: 7Range: 1 - 10

Response Type

Returns: Text/JSON

Asynchronous requests (v2)

Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.

  1. 1
    POST /v2/bria-text-to-image

    Submitreturns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Polluntil COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Resultfinal response body

Status states

QUEUEDAccepted, waiting for a worker
PROCESSINGRunning on a worker
COMPLETEDDone — result body is ready
FAILEDErrored (incl. content/RAI blocks)
  • A FAILED request is served as HTTP 422 — the body still carries the error detail.
  • An unknown or expired request_id returns HTTP 404.
  • Results are retained for 1 hour, then expire.
  • Content / RAI blocks surface as FAILED, not a separate state.
  • Track completion by polling the status endpoint.

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out