Bria Vector Graphics Serverless API

Bria Vision enables high-quality text-to-image and text-to-vector graphic generation for versatile commercial use.

~17.99s
POST /v2/bria-text-to-vector-graphics · 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-vector-graphics",
 9    prompt="A playful cartoon kitten, sitting with a tiny ball of yarn, in a clean, minimalistic vector illustration style, suitable for icons, stickers, and scalable graphics.",
10    mode="base",
11    aspect_ratio="1:1",
12    seed=12345,
13    negative_prompt="dark colors",
14    steps_num=30,
15    medium="art",
16    prompt_enhancement=False,
17    enhance_image=False,
18    prompt_content_moderation=True,
19    content_moderation=False,
20    ip_signal=False,
21)
22print(result["status"])                      # COMPLETED
23print(result.get("output"))                  # model output (e.g. media URL)
24print(result["metrics"]["inference_time"])   # server compute seconds
25
26# --- Or submit + poll manually (track request_id, control the cadence) ---
27from segmind import SegmindClient, InferenceFailed, InferenceTimeout
28
29client = SegmindClient()                      # reads SEGMIND_API_KEY
30payload = {
31    "prompt": "A playful cartoon kitten, sitting with a tiny ball of yarn, in a clean, minimalistic vector illustration style, suitable for icons, stickers, and scalable graphics.",
32    "mode": "base",
33    "aspect_ratio": "1:1",
34    "seed": 12345,
35    "negative_prompt": "dark colors",
36    "steps_num": 30,
37    "medium": "art",
38    "prompt_enhancement": False,
39    "enhance_image": False,
40    "prompt_content_moderation": True,
41    "content_moderation": False,
42    "ip_signal": False,
43}
44job = client.submit_async("bria-text-to-vector-graphics", **payload)
45print(job.request_id)                         # available immediately
46try:
47    result = job.wait(timeout=600, interval=1.0)
48except InferenceTimeout as e:
49    print("still running:", e.request_id)
50except InferenceFailed as e:
51    print("failed:", e.detail)

API Endpoint

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

Parameters

promptrequired
string

Use the prompt to guide image creation. Detailed prompts for complexity; simple prompts for basic illustrations.

Default: "A playful cartoon kitten, sitting with a tiny ball of yarn, in a clean, minimalistic vector illustration style, suitable for icons, stickers, and scalable graphics."
aspect_ratiooptional
string

Determines image shape. Use 1:1 for icons or 16:9 for wide 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

Moderates all inputs/outputs for compliance. Recommended for safe usage.

Default: false
enhance_imageoptional
boolean

Improves texture and clarity. Ideal for high-detail image needs.

Default: false
ip_signaloptional
boolean

Flags prompts likely to have IP concerns, useful for sensitive projects.

Default: false
mediumoptional
string

Selects image type: 'art' for illustrations or 'photography' for realistic looks.

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

Controls output quality: 'hd' for high detail, 'fast' for quicker results.

Default: "base"
negative_promptoptional
string

Exclude specific elements using negative prompts. Helpful for refining and controlling outputs.

Default: "dark colors"
prompt_content_moderationoptional
boolean

Ensures prompt complies with standards. Keep enabled for all standard applications.

Default: true
prompt_enhancementoptional
boolean

Enables more creative versions. Useful for generating diverse options.

Default: false
seedoptional
integer

Use a seed to replicate images. Choose any number between 1-999999.

Default: 12345Range: 1 - 999999
steps_numoptional
integer

Define iteration steps for refinement. More steps offer polished images but are slower.

Default: 30Range: 20 - 50
text_guidance_scaleoptional
float

Adjust how closely the image follows the prompt. Higher numbers mean stricter adherence.

Default: 5Range: 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-vector-graphics

    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