1
创建 API Key
登录 APIPod 控制台,创建 API Key,并在显示时妥善保存。
2
设置本地环境变量
3
创建图片任务
4
轮询任务
pending 或 processing 时继续轮询;状态变为 completed、failed 或 cancelled 时停止。完成响应
GPT Image 2 参数
查看全部支持字段和五种语言请求示例。
任务生命周期
补齐生产级轮询、Webhook 和终态处理。
Documentation Index
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 只表示任务已受理,并不表示图片或视频已经生成完成。此页面对您有帮助吗?