curl --request POST \
--url https://api.evolink.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gemini-nano-banana-2.1",
"prompt": "A cat playing on the grass",
"size": "16:9",
"quality": "2K"
}
'{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "gemini-nano-banana-2.1",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "image",
"usage": {
"billing_rule": "per_image",
"credits_reserved": 3.0845,
"user_group": "default"
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota"
}
}{
"error": {
"code": "model_access_denied",
"message": "Token does not have access to model: gemini-nano-banana-2.1",
"type": "invalid_request_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"type": "api_error"
}
}Nanobanana 2.1
Nanobanana 2.1 画像生成
- Nano Banana 2.1 (gemini-nano-banana-2.1) は、テキストからの画像生成、画像からの画像生成、画像編集、複数画像の合成に対応し、
1K、2K、4Kの解像度で出力できます - 非同期処理:返されたタスクIDを使用してタスクを確認してください
- 生成画像のリンクは24時間有効です。画像は早めに保存してください
- 課金:出力画像は解像度別、入力画像は画像単位、ウェブ検索と画像検索は実際の検索回数に基づいて課金されます。プロンプトのテキスト、テキスト出力、思考はトークン単位で課金されます。実際の料金はタスク照会で返される
usageに基づきます
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://api.evolink.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gemini-nano-banana-2.1",
"prompt": "A cat playing on the grass",
"size": "16:9",
"quality": "2K"
}
'{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "gemini-nano-banana-2.1",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "image",
"usage": {
"billing_rule": "per_image",
"credits_reserved": 3.0845,
"user_group": "default"
}
}{
"error": {
"code": "invalid_request",
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota"
}
}{
"error": {
"code": "model_access_denied",
"message": "Token does not have access to model: gemini-nano-banana-2.1",
"type": "invalid_request_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"type": "api_error"
}
}承認
##すべてのAPIにBearer Token認証が必要です##
APIキーの取得:
APIキー管理ページにアクセスしてAPIキーを取得してください
リクエストヘッダーに追加:
Authorization: Bearer YOUR_API_KEY
ボディ
application/json
画像生成モデル名、公式チャネル、より優れた安定性と制御性、商用シナリオに適しています
利用可能なオプション:
gemini-nano-banana-2.1 例:
"gemini-nano-banana-2.1"
生成したい画像、または入力画像の編集方法を記述するプロンプト。最大 4000 トークン
例:
"A cat playing in the grass"
生成画像のアスペクト比、デフォルトはauto
利用可能なオプション:
auto, 1:1, 1:4, 4:1, 1:8, 8:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 生成画像の解像度。デフォルトは 2K
注意:
- 解像度によって料金が異なります。出力画像は選択した解像度に基づいて課金されるため、このパラメータを明示的に指定することを推奨します
利用可能なオプション:
1K, 2K, 4K 画像からの画像生成、画像編集、複数画像の合成に使用する参照画像URLの一覧
注意:
- 1回のリクエストで最大
14枚の入力画像に対応 - 画像サイズ:
20MB以下 - 対応ファイル形式:
.jpeg、.jpg、.png、.webp - 画像URLはサーバーから直接アクセスできるか、アクセス時に画像を直接ダウンロードできる必要があります(通常、このようなURLは
.pngや.jpgなどの画像拡張子で終わります) - 入力画像は画像単位で課金されます
Maximum array length:
14例:
[
"https://example.com/image1.png",
"https://example.com/image2.png"
]
モデル拡張パラメータ
Show child attributes
Show child attributes
タスク完了後の HTTPS コールバックアドレス
コールバックタイミング:
- タスクが完了、失敗、またはキャンセルされた時にトリガーされます
- 課金確認完了後に送信されます
セキュリティ制限:
- HTTPS プロトコルのみサポート
- 内部 IP アドレスへのコールバックは禁止(127.0.0.1、10.x.x.x、172.16-31.x.x、192.168.x.x など)
- URL の長さは
2048文字以内
コールバックメカニズム:
- タイムアウト:
10秒 - 失敗時最大
3回リトライ(1秒/2秒/4秒後にリトライ) - コールバックレスポンスボディの形式はタスククエリ API のレスポンス形式と一致
- コールバックアドレスが 2xx ステータスコードを返した場合は成功とみなされ、その他のステータスコードはリトライをトリガーします
例:
"https://your-domain.com/webhooks/image-task-completed"
レスポンス
画像生成タスクが正常に作成されました
タスク作成タイムスタンプ
例:
1757165031
タスク ID
例:
"task-unified-1757165031-uyujaw3d"
使用された実際のモデル名
例:
"gemini-nano-banana-2.1"
具体的なタスクタイプ
利用可能なオプション:
image.generation.task タスク進捗率(0-100)
必須範囲:
0 <= x <= 100例:
0
タスクステータス
利用可能なオプション:
pending, processing, completed, failed 例:
"pending"
非同期タスク情報
Show child attributes
Show child attributes
タスク出力タイプ
利用可能なオプション:
text, image, audio, video 例:
"image"
使用量と課金情報
Show child attributes
Show child attributes