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

# Gemini 图片(Nano Banana)

> Gemini 图片生成



## OpenAPI

````yaml /api.json post /v1beta/models/{model}:generateContent
openapi: 3.0.1
info:
  title: TKHub API
  description: TKHub 平台 API 接口文档
  version: 1.0.0
servers:
  - url: https://api.tkhub.ai
    description: 生产环境
  - url: https://api-test.tkhub.ai
    description: 测试环境
security:
  - bearerAuth: []
paths:
  /v1beta/models/{model}:generateContent:
    post:
      tags:
        - Gemini格式
      summary: Gemini 图片(Nano Banana)
      description: Gemini 图片生成
      operationId: geminiRelayV1Beta
      parameters:
        - name: model
          in: path
          description: 模型名称
          required: true
          example: gemini-3-pro-image-preview
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                contents:
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                      parts:
                        type: array
                        items:
                          type: object
                          properties:
                            text:
                              type: string
                generationConfig:
                  type: object
                  properties:
                    responseModalities:
                      type: array
                      items:
                        type: string
                    imageConfig:
                      type: object
                      properties:
                        aspectRatio:
                          type: string
                        imageSize:
                          type: string
                  required:
                    - responseModalities
              required:
                - contents
                - generationConfig
            example:
              contents:
                - role: user
                  parts:
                    - text: draw a cat
              generationConfig:
                responseModalities:
                  - TEXT
                  - IMAGE
                imageConfig:
                  aspectRatio: '16:9'
                  imageSize: 4K
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeminiResponse'
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    GeminiResponse:
      type: object
      properties:
        candidates:
          type: array
          items:
            type: object
            properties:
              content:
                type: object
                properties:
                  role:
                    type: string
                  parts:
                    type: array
                    items:
                      type: object
                      properties: {}
              finishReason:
                type: string
              safetyRatings:
                type: array
                items:
                  type: object
                  properties: {}
        usageMetadata:
          type: object
          properties:
            promptTokenCount:
              type: integer
            candidatesTokenCount:
              type: integer
            totalTokenCount:
              type: integer
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        使用 Bearer Token 认证。
        格式: `Authorization: Bearer sk-xxxxxx`

````