快速入门
Nano Banana Pro API 快速入门指南
1. 获取您的 API 密钥
登录您的账户,前往API密钥页面创建新的API密钥。
2. 查看账户余额
curl https://gateway.nanobananapro.site/api/v1/account/balances \
-H "Authorization: Bearer sk-your-api-key"3. 生成你的第一张图像
curl -X POST https://gateway.nanobananapro.site/api/v1/images/generate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-pro",
"prompt": "A beautiful sunset over mountains",
"aspect_ratio": "16:9"
}'回复:
{
"success": true,
"data": {
"task_id": "task_abc123",
"credits_used": 6,
"remaining_credits": 494
}
}4. 检查任务状态
curl https://gateway.nanobananapro.site/api/v1/images/task_abc123 \
-H "Authorization: Bearer sk-your-api-key"回复:
{
"success": true,
"data": {
"task_id": "task_abc123",
"status": "completed",
"image_url": "https://cdn.example.com/image.png"
}
}完整代码示例
不同编程语言的完整可运行代码示例