Image Generation (302 Format)
Run in Apifox
Supports parameter passing in both application/json and multipart/form-data formats Pricing: Charged according to the corresponding image model Request Body Params application/json
{
"prompt" : "sky city" ,
"model" : "baidu-irag-t2i"
}
Request Code Samples
curl --location --request POST 'https://api.302.ai/302/image/generate' \
--header 'Authorization: Bearer sk-jls4AaVBGoe1GwZD64qZA1qyKTN1MPHa4NmvH1cT68z7K1Zz' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "sky city",
"model": "baidu-irag-t2i"
}'
Responses application/json Generate Code
{ "image_url" : "https://file.302.ai/gpt/imgs/4dce725a4b1aa5e6b7f4711dae61199f.png" , "data" : { "completed_at" : "2025-04-18T10:29:16.80035912Z" , "created_at" : "2025-04-18T10:29:10.071Z" , "error" : "" , "id" : "17449721508952" , "model" : "sdxl" , "output" : "[\"https://file.302.ai/gpt/imgs/4dce725a4b1aa5e6b7f4711dae61199f.png\"]" , "started_at" : "2025-04-18T10:29:10.079674739Z" , "status" : "succeeded" } }
Modified at 2025-09-01 06:58:24