302.AI's API comes from models we deployed on cloud GPUs. Some models are open-source, while others are fine-tuned or developed by 302.AI. For image generation with customizable Lora and Controlnets Average runtime 10sPrice:0.01 PTC/call
Request
Header Params
Authorization
string
required
Example:
Bearer {{YOUR_API_KEY}}
Body Params application/json
prompt
string
required
negative_prompt
string
required
num_inference_steps
integer
required
guidance_scale
number
required
image_size
object
required
width
integer
required
height
integer
required
loras
array [object {3}]
required
path
string
optional
scale
integer
optional
force
boolean
optional
controlnets
array [object {3}]
required
control_image_url
string
optional
path
string
optional
conditioning_scale
integer
optional
Example
{"prompt":"Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture.","image_size":{"width":768,"height":1024},"num_inference_steps":28,"controlnets":[{"control_image_url":"https://xxxx","path":"https://xxxx","conditioning_scale":1}],"guidance_scale":3.5,"loras":[{"path":"https://xxxx","scale":1}]}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl--location--request POST 'https://api.302.ai/302/submit/flux-general' \
--header'Authorization: Bearer sk-jls4AaVBGoe1GwZD64qZA1qyKTN1MPHa4NmvH1cT68z7K1Zz' \
--header'Content-Type: application/json' \
--data-raw'{
"prompt": "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"FLUX\" is painted over it in big, white brush strokes with visible texture.",
"image_size": {
"width": 768,
"height": 1024
},
"num_inference_steps": 28,
"controlnets": [
{
"control_image_url": "https://xxxx",
"path": "https://xxxx",
"conditioning_scale": 1
}
],
"guidance_scale": 3.5,
"loras": [
{
"path": "https://xxxx",
"scale": 1
}
]
}'