> ## Documentation Index
> Fetch the complete documentation index at: https://evolink.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Nanobanana 2.1 画像生成

> - Nano Banana 2.1 (gemini-nano-banana-2.1) は、テキストからの画像生成、画像からの画像生成、画像編集、複数画像の合成に対応し、`1K`、`2K`、`4K` の解像度で出力できます
- 非同期処理：返されたタスクIDを使用して[タスクを確認](/ja/api-manual/task-management/get-task-detail)してください
- 生成画像のリンクは24時間有効です。画像は早めに保存してください
- 課金：出力画像は解像度別、入力画像は画像単位、ウェブ検索と画像検索は実際の検索回数に基づいて課金されます。プロンプトのテキスト、テキスト出力、思考はトークン単位で課金されます。実際の料金はタスク照会で返される `usage` に基づきます



## OpenAPI

````yaml ja/api-manual/image-series/nanobanana/nanobanana-2.1/nanobanana-2.1-image-generate.json POST /v1/images/generations
openapi: 3.1.0
info:
  title: Nano Banana 2.1 API
  description: AIモデルを使用して画像生成タスクを作成、様々なモデルとパラメータ設定に対応
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.evolink.ai
    description: 本番環境
security:
  - bearerAuth: []
tags:
  - name: 画像生成
    description: AI画像生成関連API
paths:
  /v1/images/generations:
    post:
      tags:
        - 画像生成
      summary: Nano Banana 2.1 API
      description: >-
        - Nano Banana 2.1 (gemini-nano-banana-2.1)
        は、テキストからの画像生成、画像からの画像生成、画像編集、複数画像の合成に対応し、`1K`、`2K`、`4K` の解像度で出力できます

        -
        非同期処理：返されたタスクIDを使用して[タスクを確認](/ja/api-manual/task-management/get-task-detail)してください

        - 生成画像のリンクは24時間有効です。画像は早めに保存してください

        -
        課金：出力画像は解像度別、入力画像は画像単位、ウェブ検索と画像検索は実際の検索回数に基づいて課金されます。プロンプトのテキスト、テキスト出力、思考はトークン単位で課金されます。実際の料金はタスク照会で返される
        `usage` に基づきます
      operationId: createImageGenerationNanoBanana21
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
            examples:
              text_to_image:
                summary: テキストから画像
                value:
                  model: gemini-nano-banana-2.1
                  prompt: A cat playing on the grass
                  size: '16:9'
                  quality: 2K
              image_edit:
                summary: 画像から画像生成 / 画像編集
                value:
                  model: gemini-nano-banana-2.1
                  prompt: 画像内の猫を柴犬に置き換え、背景と照明はそのままにしてください
                  quality: 2K
                  image_urls:
                    - https://example.com/image1.png
              web_search:
                summary: ウェブ検索を使用した生成
                value:
                  model: gemini-nano-banana-2.1
                  prompt: 今週末の東京の天気を示すインフォグラフィック。フラットなデザインで、文字は鮮明で読みやすくしてください
                  size: '16:9'
                  quality: 2K
                  model_params:
                    web_search: true
      responses:
        '200':
          description: 画像生成タスクが正常に作成されました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
        '400':
          description: リクエストパラメータが不正です
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_request
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 未認証、トークンが無効または期限切れです
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: クォータ不足のため、チャージが必要です
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: insufficient_quota
                  message: Insufficient quota. Please top up your account.
                  type: insufficient_quota
        '403':
          description: アクセスが拒否されました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: model_access_denied
                  message: 'Token does not have access to model: gemini-nano-banana-2.1'
                  type: invalid_request_error
        '429':
          description: レート制限を超えました
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: rate_limit_exceeded
                  message: Too many requests, please try again later
                  type: rate_limit_error
        '500':
          description: サーバー内部エラー
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: internal_error
                  message: Internal server error
                  type: api_error
components:
  schemas:
    ImageGenerationRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: 画像生成モデル名、公式チャネル、より優れた安定性と制御性、商用シナリオに適しています
          example: gemini-nano-banana-2.1
          enum:
            - gemini-nano-banana-2.1
          default: gemini-nano-banana-2.1
        prompt:
          type: string
          description: 生成したい画像、または入力画像の編集方法を記述するプロンプト。最大 `4000` トークン
          example: A cat playing in the grass
        size:
          type: string
          description: 生成画像のアスペクト比、デフォルトは`auto`
          enum:
            - 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'
          default: auto
        quality:
          type: string
          description: |-
            生成画像の解像度。デフォルトは `2K`

            **注意：**
            - 解像度によって料金が異なります。出力画像は選択した解像度に基づいて課金されるため、このパラメータを明示的に指定することを推奨します
          enum:
            - 1K
            - 2K
            - 4K
          default: 2K
        image_urls:
          type: array
          description: >-
            画像からの画像生成、画像編集、複数画像の合成に使用する参照画像URLの一覧


            **注意：**

            - 1回のリクエストで最大 `14` 枚の入力画像に対応

            - 画像サイズ：`20MB` 以下

            - 対応ファイル形式：`.jpeg`、`.jpg`、`.png`、`.webp`

            - 画像URLはサーバーから直接アクセスできるか、アクセス時に画像を直接ダウンロードできる必要があります（通常、このようなURLは
            `.png` や `.jpg` などの画像拡張子で終わります）

            - 入力画像は画像単位で課金されます
          items:
            type: string
            format: uri
          maxItems: 14
          example:
            - https://example.com/image1.png
            - https://example.com/image2.png
        model_params:
          type: object
          description: モデル拡張パラメータ
          properties:
            web_search:
              type: boolean
              description: |-
                ウェブ検索を有効にするかどうか。デフォルトは `false`。有効にすると、画像生成前にモデルがウェブ上の最新情報を検索します

                **注意：**
                - モデルが実際に実行した検索回数に基づいて課金されます。1回のリクエストで複数回の検索が行われる場合があります
              default: false
              example: true
            image_search:
              type: boolean
              description: >-
                画像検索を有効にするかどうか。デフォルトは
                `false`。有効にすると、画像生成前にモデルが視覚的な参照としてウェブ上の画像を検索します


                **注意：**

                - モデルが実際に実行した検索回数に基づいて課金されます。1回のリクエストで複数回の検索が行われる場合があります
              default: false
              example: true
            thinking_level:
              type: string
              description: |-
                画像生成前のモデルの思考の深さを制御する思考レベル。デフォルトは `auto`

                - `auto`：指定せず、モデルが自動的に決定
                - `min`：最小限の思考、生成速度が最速
                - `medium`：バランスの取れた思考
                - `high`：深い思考

                **注意：**
                - 思考によって生成されたトークンはテキスト出力として課金されます
              enum:
                - auto
                - min
                - medium
                - high
              default: auto
              example: medium
        callback_url:
          type: string
          description: >-
            タスク完了後の 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 ステータスコードを返した場合は成功とみなされ、その他のステータスコードはリトライをトリガーします
          format: uri
          example: https://your-domain.com/webhooks/image-task-completed
    ImageGenerationResponse:
      type: object
      properties:
        created:
          type: integer
          description: タスク作成タイムスタンプ
          example: 1757165031
        id:
          type: string
          description: タスク ID
          example: task-unified-1757165031-uyujaw3d
        model:
          type: string
          description: 使用された実際のモデル名
          example: gemini-nano-banana-2.1
        object:
          type: string
          enum:
            - image.generation.task
          description: 具体的なタスクタイプ
        progress:
          type: integer
          description: タスク進捗率（0-100）
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: タスクステータス
          enum:
            - pending
            - processing
            - completed
            - failed
          example: pending
        task_info:
          $ref: '#/components/schemas/TaskInfo'
          description: 非同期タスク情報
        type:
          type: string
          enum:
            - text
            - image
            - audio
            - video
          description: タスク出力タイプ
          example: image
        usage:
          $ref: '#/components/schemas/Usage'
          description: 使用量と課金情報
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: エラーコード識別子
            message:
              type: string
              description: エラーの説明
            type:
              type: string
              description: エラータイプ
    TaskInfo:
      type: object
      properties:
        can_cancel:
          type: boolean
          description: タスクをキャンセルできるかどうか
          example: true
        estimated_time:
          type: integer
          description: 推定完了時間（秒）
          minimum: 0
          example: 45
    Usage:
      type: object
      description: 使用量と課金情報
      properties:
        billing_rule:
          type: string
          description: 課金ルール
          enum:
            - per_call
            - per_image
            - per_token
            - per_second
          example: per_image
        credits_reserved:
          type: number
          description: 推定消費クレジット
          minimum: 0
          example: 3.0845
        user_group:
          type: string
          description: ユーザーが所属する課金グループ
          example: default
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##すべてのAPIにBearer Token認証が必要です##

        **APIキーの取得：**

        [APIキー管理ページ](https://evolink.ai/dashboard/keys)にアクセスしてAPIキーを取得してください

        **リクエストヘッダーに追加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.