Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
创建并轮询第一个 APIPod 图片任务。
创建 API Key
设置本地环境变量
export APIPOD_API_KEY="your-api-key" export APIPOD_IDEMPOTENCY_KEY="image-$(date +%s)"
创建图片任务
curl https://api.apipod.ai/v1/images/generations \ -H "Authorization: Bearer $APIPOD_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $APIPOD_IDEMPOTENCY_KEY" \ -d '{ "model": "gpt-image-2", "prompt": "A clean product photograph of a translucent glass speaker, soft studio lighting", "aspect_ratio": "1:1", "resolution": "1K" }'
{ "code": 200, "message": "success", "data": { "task_id": "img_example_task_id" } }
轮询任务
export APIPOD_TASK_ID="img_example_task_id" curl "https://api.apipod.ai/v1/images/status/$APIPOD_TASK_ID" \ -H "Authorization: Bearer $APIPOD_API_KEY"
pending
processing
completed
failed
cancelled
{ "code": 200, "message": "success", "data": { "task_id": "img_example_task_id", "status": "completed", "result": [ "https://example.com/generated-image.png" ], "completed_at": 1786358400 } }
200
此页面对您有帮助吗?