cURL
curl --request POST \ --url https://llm.ai-nebula.com/nebula/v4/api/text2imageSubmit \ --header 'Authorization: <authorization>' \ --header 'Content-Type: application/json' \ --data ' { "volcEngineReqDTO.req.prompt": "<string>", "volcEngineReqDTO.req.size": "<string>" } '
{ "code": 200, "msg": "操作成功", "data": { "images": [{ "url": "https://example.com/image.jpg" }] } }
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...
https://docs.openai-nebula.com/cn/nebula-lab-v4/endpoint/get-token
curl -X POST "https://llm.ai-nebula.com/nebula/v4/api/text2imageSubmit" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer sk-xxxxxxxxxx" \ -d '{ "req": { "prompt": "一只可爱的小猫在草地上玩耍", "size": "1024x1024" } }'
import requests import json url = "https://llm.ai-nebula.com/nebula/v4/api/text2imageSubmit" headers = { "Content-Type": "application/json", "Authorization": "Bearer sk-xxxxxxxxxx" } data = { "req": { "prompt": "一只可爱的小猫在草地上玩耍", "size": "1024x1024" } } response = requests.post(url, headers=headers, data=json.dumps(data)) print(response.json())