# "/fal-ai/imagen4/preview"

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

> 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:
  /fal-ai/imagen4/preview:
    post:
      summary: /fal-ai/imagen4/preview
      deprecated: false
      description: 'Tài liệu chính thức: https://fal.ai/models/fal-ai/imagen4/preview'
      operationId: post-fal-ai-imagen4-preview
      tags:
        - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Hình ảnh/Fal.ai
        - fal-ai
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - prompt
              properties:
                aspect_ratio:
                  type: string
                  description: 'Tỷ lệ khung hình. Kiểu liệt kê: 1:1, 16:9, 9:16, 3:4, 4:3'
                num_images:
                  type: integer
                  description: 'Số lượng hình ảnh cần tạo. Phạm vi: 1–4'
                prompt:
                  type: string
                  description: Lời nhắc
                resolution:
                  type: string
                  description: 'Độ phân giải. Kiểu liệt kê: "1K", "2K"'
              x-apifox-orders:
                - aspect_ratio
                - num_images
                - prompt
                - resolution
              x-apidog-orders:
                - aspect_ratio
                - num_images
                - prompt
                - resolution
            examples:
              example:
                value:
                  aspect_ratio: '1:1'
                  num_images: 1
                  prompt: >-
                    Ghi lại một cảnh cận cảnh thân mật, ngập trong ánh nắng cuối
                    buổi chiều ấm áp, dịu nhẹ, len vào một căn bếp đậm chất thập
                    niên 1960. Tâm điểm là một gói bột mì đa dụng cổ điển có
                    thiết kế duyên dáng, được đặt đầy mời gọi trên mặt bàn
                    Formica lốm đốm. Bao bì gợi lên cảm giác hoài niệm thuần
                    khiết: có thể làm từ giấy dày, hơi sần, mang tông kem ấm,
                    được trang trí bằng kiểu chữ đơn giản, đậm nét (chữ có chân
                    thân thiện hoặc chữ viết tay) với hai màu đỏ và xanh lam
                    kinh điển, ghi “ALL-PURPOSE FLOUR”, cùng một hình minh họa
                    thú vị như bó lúa mì cách điệu hoặc nhân vật thợ làm bánh
                    vui vẻ. Ở phần cuối bao bì, bằng chữ in đậm nhỏ hơn: “NET WT
                    5 LBS (80 OZ) 2.27kg”. Lấy nét rõ vào các chi tiết của bao
                    bì – các mép hơi mềm của túi giấy, kết cấu của kỹ thuật in
                    cổ điển, dòng chữ "All-Purpose Flour" đầy cuốn hút. Những
                    gợi ý tinh tế về căn bếp thập niên 1960 tạo khung cho cảnh
                    chụp – viền crôm của mặt bàn ánh lên dịu nhẹ, một thoáng mờ
                    của tấm ốp tường bằng gạch men màu vàng nhạt, hoặc góc của
                    một bộ hộp đựng bằng kim loại cổ điển nằm ngay ngoài vùng
                    nét. Độ sâu trường ảnh nông giữ sự chú ý tập trung hoàn toàn
                    vào bao bì được thiết kế đẹp mắt, tạo nên một thẩm mỹ giàu
                    sự ấm áp, chân thực và sức hấp dẫn hoài cổ.
                  resolution: 1K
                summary: example
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                x-apidog-orders: []
              examples:
                example:
                  summary: example
                  value:
                    cancel_url: >-
                      https://queue.fal.run/fal-ai/imagen4/requests/484ccb37-5477-44fe-8e75-6d6f6e9160b3/cancel
                    metrics: {}
                    queue_position: 0
                    request_id: 484ccb37-5477-44fe-8e75-6d6f6e9160b3
                    response_url: >-
                      https://queue.fal.run/fal-ai/imagen4/requests/484ccb37-5477-44fe-8e75-6d6f6e9160b3
                    status: IN_QUEUE
                    status_url: >-
                      https://queue.fal.run/fal-ai/imagen4/requests/484ccb37-5477-44fe-8e75-6d6f6e9160b3/status
          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/Hình ảnh/Fal.ai
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208912-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.openaihub.net
    description: Prod Env
security: []

```
