# "Imagen tạo ra hình ảnh"

Nguồn: https://docs.openaihub.net/api-45208848/

> API origin: `https://api.openaihub.net`. Chọn đúng nhóm API và model. Thông số dưới đây là bản tham chiếu kỹ thuật; chưa phải kết quả kiểm thử từng endpoint bằng tài khoản của bạn.


## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1beta/models/imagen-4.0-ultra-generate-001:predict:
    post:
      summary: Imagen tạo ra hình ảnh
      deprecated: false
      description: >-
        Vui lòng dán nội dung tài liệu cần dịch vào đây. Tôi không thể dịch toàn
        bộ nội dung chỉ từ liên kết, nhưng có thể dịch phần văn bản bạn cung cấp
        sang tiếng Việt và giữ nguyên Markdown, mã nguồn, định danh, URL, đường
        dẫn, chỗ giữ chỗ, cấu trúc JSON cùng định dạng.
      operationId: gemini_v1beta_imagen_4_0_ultra_predict
      tags:
        - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/Gemini/Định dạng gốc
        - Gemini v1beta
      parameters:
        - name: key
          in: query
          description: 'Khóa API (cũng hỗ trợ Authorization: Bearer)'
          required: true
          example: '{{YOUR_API_KEY}}'
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Loại nội dung của phần thân yêu cầu, thường là application/json
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - instances
                - parameters
              properties:
                instances:
                  type: array
                  items:
                    type: object
                    properties:
                      prompt:
                        type: string
                        description: Lời nhắc văn bản
                    x-apifox-orders:
                      - prompt
                    x-apidog-orders:
                      - prompt
                  description: Cac doi tuong du doan cua Imagen
                parameters:
                  type: object
                  required:
                    - sampleCount
                  properties:
                    sampleCount:
                      type: integer
                      description: Số lượng hình ảnh cần tạo
                  description: Các tham số tạo ảnh của Imagen
                  x-apifox-orders:
                    - sampleCount
                  x-apidog-orders:
                    - sampleCount
              refName: PostV1betaModelsImagen40UltraGenerate001PredictRequest
              x-apifox-orders:
                - instances
                - parameters
              x-apidog-orders:
                - instances
                - parameters
            examples:
              imagen_single:
                value:
                  instances:
                    - prompt: Robot cầm một chiếc ván trượt màu đỏ
                  parameters:
                    sampleCount: 4
                summary: imagen_single
                description: Imagen tạo ra hình ảnh
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                x-apidog-orders: []
              examples:
                example:
                  summary: example
                  value:
                    id: resp_example
                    object: phản hồi
                    status: completed
          headers: {}
          x-apidog-name: ''
        '400':
          description: Yêu cầu không hợp lệ hoặc xác thực thất bại
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - message
                      - type
                    properties:
                      message:
                        type: string
                        description: Thông báo lỗi (thường kết thúc bằng mã yêu cầu)
                      type:
                        type: string
                        description: Loại lỗi; các lỗi cổng cục bộ thường là new_api_error
                        examples:
                          - new_api_error
                    x-apifox-orders:
                      - message
                      - type
                    x-apidog-orders:
                      - message
                      - type
                refName: NewApiError
                x-apifox-orders:
                  - error
                x-apidog-orders:
                  - error
              examples:
                example:
                  summary: example
                  value:
                    error:
                      message: >-
                        Yêu cầu không hợp lệ (mã yêu cầu:
                        20260805120000123456789AbCdEfGh)
                      type: new_api_error
          headers: {}
          x-apidog-name: Yêu cầu không hợp lệ hoặc xác thực thất bại
        '401':
          description: Khóa API bị thiếu hoặc không hợp lệ
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - message
                      - type
                    properties:
                      message:
                        type: string
                        description: Thông báo lỗi (thường kết thúc bằng mã yêu cầu)
                      type:
                        type: string
                        description: Loại lỗi; các lỗi cổng cục bộ thường là new_api_error
                        examples:
                          - new_api_error
                    x-apifox-orders:
                      - message
                      - type
                    x-apidog-orders:
                      - message
                      - type
                refName: NewApiError
                x-apifox-orders:
                  - error
                x-apidog-orders:
                  - error
              examples:
                example:
                  summary: example
                  value:
                    error:
                      message: >-
                        Mã thông báo không hợp lệ (request id:
                        20260805120000123456789AbCdEfGh)
                      type: new_api_error
          headers: {}
          x-apidog-name: Khóa API bị thiếu hoặc không hợp lệ
      security: []
      x-apidog-folder: OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/Gemini/Định dạng gốc
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208848-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.openaihub.net
    description: Prod Env
security: []

```
