curl -X POST "https://api.lemondata.cc/v1/images/generations" \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "dall-e-3", "prompt": "A white cat sitting on a windowsill watching rain", "size": "1024x1024", "quality": "standard", "n": 1 }'
Sao chép
{ "created": 1706000000, "data": [ { "url": "https://...", "revised_prompt": "A fluffy white cat with bright eyes sitting peacefully on a wooden windowsill, watching raindrops stream down the glass window..." } ]}
Images
Tạo hình ảnh
Tạo hình ảnh từ mô tả văn bản
POST
/
v1
/
images
/
generations
Sao chép
curl -X POST "https://api.lemondata.cc/v1/images/generations" \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "dall-e-3", "prompt": "A white cat sitting on a windowsill watching rain", "size": "1024x1024", "quality": "standard", "n": 1 }'
Sao chép
{ "created": 1706000000, "data": [ { "url": "https://...", "revised_prompt": "A fluffy white cat with bright eyes sitting peacefully on a wooden windowsill, watching raindrops stream down the glass window..." } ]}
Mảng với dữ liệu placeholder. url sẽ trống cho đến khi hoàn thành.
Khi bạn nhận được status: "pending", sử dụng endpoint Lấy trạng thái hình ảnh để polling kết quả.
Sao chép
curl -X POST "https://api.lemondata.cc/v1/images/generations" \ -H "Authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "model": "dall-e-3", "prompt": "A white cat sitting on a windowsill watching rain", "size": "1024x1024", "quality": "standard", "n": 1 }'
Sao chép
{ "created": 1706000000, "data": [ { "url": "https://...", "revised_prompt": "A fluffy white cat with bright eyes sitting peacefully on a wooden windowsill, watching raindrops stream down the glass window..." } ]}