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 rapid image generation,average runtime 1-3s, project from: https://huggingface.co/ByteDance/SDXL-LightningPrice: 0.005 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
image_size
object
required
width
integer
required
height
integer
required
embeddings
array[string]
required
format
string
required
Example
{"prompt":"photo of a girl smiling during a sunset, with lightnings in the background","image_size":{"width":1024,"height":1024},"embeddings":[],"format":"jpeg"}
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/sdxl-lightning-v2' \
--header'Authorization: Bearer sk-jls4AaVBGoe1GwZD64qZA1qyKTN1MPHa4NmvH1cT68z7K1Zz' \
--header'Content-Type: application/json' \
--data-raw'{
"prompt": "photo of a girl smiling during a sunset, with lightnings in the background",
"image_size": {
"width": 1024,
"height": 1024
},
"embeddings": [],
"format": "jpeg"
}'