Bria Vector Graphics Serverless API
Bria Vision enables high-quality text-to-image and text-to-vector graphic generation for versatile commercial use.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/bria-text-to-vector-graphics"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "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.",
12 "mode": "base",
13 "aspect_ratio": "1:1",
14 "seed": 12345,
15 "negative_prompt": "dark colors",
16 "steps_num": 30,
17 "medium": "art",
18 "prompt_enhancement": false,
19 "enhance_image": false,
20 "prompt_content_moderation": true,
21 "content_moderation": false,
22 "ip_signal": false
23}
24
25response = requests.post(url, headers=headers, json=data)
26
27if response.status_code == 200:
28 result = response.json()
29 print(json.dumps(result, indent=2))
30else:
31 print(f"Error: {response.status_code}")
32 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/bria-text-to-vector-graphics"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "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.",
12 "mode": "base",
13 "aspect_ratio": "1:1",
14 "seed": 12345,
15 "negative_prompt": "dark colors",
16 "steps_num": 30,
17 "medium": "art",
18 "prompt_enhancement": false,
19 "enhance_image": false,
20 "prompt_content_moderation": true,
21 "content_moderation": false,
22 "ip_signal": false
23}
24
25response = requests.post(url, headers=headers, json=data)
26
27if response.status_code == 200:
28 result = response.json()
29 print(json.dumps(result, indent=2))
30else:
31 print(f"Error: {response.status_code}")
32 print(response.text)API Endpoint
https://api.segmind.com/v1/bria-text-to-vector-graphicsParameters
promptrequiredstringUse the prompt to guide image creation. Detailed prompts for complexity; simple prompts for basic illustrations.
"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_ratiooptionalstringDetermines image shape. Use 1:1 for icons or 16:9 for wide formats.
"1:1""1:1""2:3""3:2""3:4""4:3""4:5""5:4""9:16""16:9"content_moderationoptionalbooleanModerates all inputs/outputs for compliance. Recommended for safe usage.
falseenhance_imageoptionalbooleanImproves texture and clarity. Ideal for high-detail image needs.
falseip_signaloptionalbooleanFlags prompts likely to have IP concerns, useful for sensitive projects.
falsemediumoptionalstringSelects image type: 'art' for illustrations or 'photography' for realistic looks.
"art""photography""art"modeoptionalstringControls output quality: 'hd' for high detail, 'fast' for quicker results.
"base"negative_promptoptionalstringExclude specific elements using negative prompts. Helpful for refining and controlling outputs.
"dark colors"prompt_content_moderationoptionalbooleanEnsures prompt complies with standards. Keep enabled for all standard applications.
trueprompt_enhancementoptionalbooleanEnables more creative versions. Useful for generating diverse options.
falseseedoptionalintegerUse a seed to replicate images. Choose any number between 1-999999.
12345Range: 1 - 999999steps_numoptionalintegerDefine iteration steps for refinement. More steps offer polished images but are slower.
30Range: 20 - 50text_guidance_scaleoptionalfloatAdjust how closely the image follows the prompt. Higher numbers mean stricter adherence.
5Range: 1 - 10Response Type
Returns: Text/JSON
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out