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.Used for image generation,average runtime 5-10s, project from: https://github.com/Kwai-Kolors/KolorsPrice: 0.05 PTC / call
Request
Header Params
Authorization
string
required
API Key for 302.AI backend
Example:
Bearer {{YOUR_API_KEY}}
Body Params application/json
prompt
string
required
Prompt words support Chinese input
image_size
object
optional
width
integer
required
height
integer
required
num_inference_steps
integer
optional
guidance_scale
integer
optional
negative_prompt
string
optional
Example
{"prompt":"A Chinese couple","negative_prompt":"ugly, deformed, blurry","guidance_scale":5,"image_size":{"width":1024,"height":1024}}
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/kolors' \
--header'Authorization: Bearer sk-jls4AaVBGoe1GwZD64qZA1qyKTN1MPHa4NmvH1cT68z7K1Zz' \
--header'Content-Type: application/json' \
--data-raw'{
"prompt": "A Chinese couple",
"negative_prompt": "ugly, deformed, blurry",
"guidance_scale": 5,
"image_size": {
"width": 1024,
"height": 1024
}
}'