Bỏ qua để đến nội dung

Tạo ảnh bằng gemini-3-pro-image-preview, kiểm soát tỷ lệ khung hình + độ rõ nét

Xem Markdownllms.txt

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: 3.0.1
info:
title: ''
description: ''
version: 1.0.0
paths:
/v1beta/models/gemini-3-pro-image-preview:generateContent:
post:
summary: >-
Tạo ảnh bằng gemini-3-pro-image-preview, kiểm soát tỷ lệ khung hình + độ
rõ nét
deprecated: false
description: >-
Tài liệu chính thức:
https://ai.google.dev/gemini-api/docs/image-generation?hl=zh-cn#gemini-image-editing
operationId: gemini_v1beta_3_pro_image_preview_generate_content
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:
- contents
- generationConfig
properties:
contents:
type: array
items:
type: object
properties:
parts:
type: array
items:
type: object
properties:
inline_data:
type: object
required:
- mime_type
- data
properties:
data:
type: string
description: >-
Dữ liệu phương tiện được mã hóa Base64
(không có tiền tố URI data:)
mime_type:
type: string
description: >-
Loại MIME của phương tiện, ví dụ: image/png,
image/jpeg, audio/wav
description: >-
Dữ liệu phương tiện nội tuyến (hình ảnh/âm
thanh/v.v.)
x-apifox-orders:
- data
- mime_type
x-apidog-orders:
- data
- mime_type
text:
type: string
description: Vui lòng cung cấp nội dung văn bản cần dịch.
x-apifox-orders:
- inline_data
- text
x-apidog-orders:
- inline_data
- text
description: >-
Danh sách các phần nội dung; có thể bao gồm văn bản,
inline_data / inlineData, v.v.
x-apifox-orders:
- parts
x-apidog-orders:
- parts
description: >-
Danh sách nội dung cuộc hội thoại; mỗi mục gồm các phần (văn
bản/hình ảnh/v.v.)
generationConfig:
type: object
required:
- responseModalities
properties:
responseModalities:
type: array
items:
type: string
description: >-
Phương thức phản hồi, ví dụ: ["TEXT"], ["IMAGE"],
["AUDIO"]
description: >-
Cấu hình tạo sinh (phương thức, kích thước hình ảnh, giọng
nói, v.v.)
x-apifox-orders:
- responseModalities
x-apidog-orders:
- responseModalities
response_format:
type: string
description: >-
Điền vào url và trả về url; nếu không, hãy điền base64 mặc
định.
refName: PostV1betaModelsGemini3ProImagePreviewGenerateContentRequest
x-apifox-orders:
- contents
- generationConfig
- response_format
x-apidog-orders:
- contents
- generationConfig
- response_format
examples:
example_single:
value:
contents:
- parts:
- text: >-
'Chào, đây là ảnh của tôi. Bạn có thể thêm một con
lạc đà không bướu bên cạnh tôi không
- inline_data:
data: iVBORw0KGgoAAAANSUhEUgAABAAAAAKoCAIA...
mime_type: image/jpeg
role: user
generationConfig:
responseModalities:
- Vui lòng cung cấp nội dung tài liệu cần dịch.
- HÌNH ẢNH
response_format: url
summary: example_single
description: Chỉnh sửa ảnh
gemini_3_pro_image_preview_single:
value:
contents:
- parts:
- text: >-
'Chào, đây là ảnh của tôi. Bạn có thể thêm một con
lạc đà không bướu bên cạnh tôi không
- inline_data:
data: iVBORw0KGgoAAAANSUhEUgAABAAAAAKoCAIA...
mime_type: image/jpeg
role: user
generationConfig:
imageConfig:
aspectRatio: '9:16'
imageSize: 1K
responseModalities:
- Vui lòng cung cấp nội dung tài liệu cần dịch.
- HÌNH ẢNH
summary: gemini_3_pro_image_preview_single
description: >-
Tạo ảnh bằng gemini-3-pro-image-preview, kiểm soát tỷ lệ khung
hình + độ rõ nét
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-45208840-run
components:
schemas: {}
securitySchemes: {}
servers:
- url: https://api.openaihub.net
description: Prod Env
security: []