# "Tạo cuộc trò chuyện" Nguồn: https://docs.openaihub.net/api-45208823/ > 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: /v1/chat/completions: post: summary: Tạo cuộc trò chuyện deprecated: false description: >- Cổng tương thích OpenAI hợp nhất. Chọn nguồn thượng nguồn thông qua `model`, ví dụ: - `gpt-4o` / `gpt-4o-audio-preview` → OpenAI - `gemini-2.5-flash-all` → Google Gemini (định dạng tương thích) - Với các mô hình khác, xem `GET /v1/models` Tài liệu chính thức của OpenAI: https://platform.openai.com/docs/api-reference/chat/create Định dạng tên mô hình là: gpt-4-gizmo-*, và hệ thống sẽ tự động nhận dạng. Ví dụ, GPTs này: https://chatgpt.com/g/g-B3hgivKK9-write-for-me Khi đó, tên mô hình của nó phải được điền là: gpt-4-gizmo-g-B3hgivKK9 Danh sách GPTs: https://chatgpt.com/gpts operationId: v1_chat_completions tags: - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/ChatGpt/Trò chuyện ChatGPT - Trò chuyện parameters: [] requestBody: content: application/json: schema: type: object required: - model - messages properties: enable_thinking: type: boolean description: >- Có bật chế độ suy luận hay không (phần mở rộng của kho này). Chỉ giá trị Boolean `true` mới có hiệu lực; hãy chọn một trong các giá trị của `extra_body.enable_thinking`. extra_body: type: object properties: enable_thinking: type: boolean description: >- Bật chế độ suy luận trong `extra_body`; chỉ chấp nhận giá trị `true`. google: type: object description: >- Các phần mở rộng hộp thoại Gemini như thinking_config, response_modalities. x-apidog-orders: [] description: >- Các tham số mở rộng cho hội thoại. Thường dùng: enable_thinking; một số mô hình Gemini có thể dùng google.thinking_config, vân vân. Việc tham số có hiệu lực hay không phụ thuộc vào kênh và mô hình. x-apifox-orders: - enable_thinking - google x-apidog-orders: - enable_thinking - google frequency_penalty: type: number description: >- Hệ số phạt tần suất, khoảng -2~2. Giá trị dương làm giảm xác suất lặp lại cùng một từ. logit_bias: type: object description: >- Điều chỉnh xác suất xuất hiện theo ID token, và giá trị là một đối tượng ánh xạ với các giá trị nằm trong khoảng từ -100 đến 100. x-apidog-orders: [] max_completion_tokens: type: integer description: >- Giới hạn token tối đa cho phần hoàn thành (thường được dùng hơn trong các mô hình suy luận như dòng o và GPT-5). `max_tokens` có thể được kế thừa khi không được thiết lập. max_tokens: type: integer description: >- Số lượng token tối đa được tạo trong phản hồi này (các trường dùng chung). messages: type: array items: type: object required: - role - content properties: content: oneOf: - type: string - type: array items: type: object required: - type properties: image_url: type: object required: - url properties: detail: type: string enum: - auto - low - high description: >- Độ chính xác khi hiểu hình ảnh: tự động/thấp/cao. url: type: string description: >- URL hình ảnh hoặc data:image/...;base64,... . description: >- Hình ảnh khi type=image_url. Nếu cổng kết nối bật proxy hình ảnh, url có thể bị thay thế. x-apifox-orders: - detail - url x-apidog-orders: - detail - url text: type: string description: Nội dung văn bản khi type=text. type: type: string enum: - text - image_url description: >- Loại khối nội dung: `text` là văn bản, `image_url` là hình ảnh. refName: Phần nội dung x-apifox-orders: - image_url - text - type x-apidog-orders: - image_url - text - type description: >- Nội dung tin nhắn: văn bản thuần túy hoặc mảng kết hợp hình ảnh và văn bản (xem ContentPart). name: type: string description: >- Tùy chọn. Phân biệt tên người nói trong các tình huống có nhiều người dùng. reasoning_content: type: string description: >- Văn bản về quá trình suy luận/tư duy (được dùng khi suy luận về các mô hình và tiếp nối ngữ cảnh). role: type: string enum: - system - user - assistant - tool - developer description: >- Vai trò của thông điệp. system: cài đặt hệ thống; user: người dùng; assistant: mô hình; tool: kết quả trả về của công cụ. tool_call_id: type: string description: >- Bắt buộc khi role là tool, tương ứng với tool_calls[].id của nội dung được trả về tại một thời điểm nhất định. tool_calls: type: array items: type: object properties: function: type: object properties: arguments: type: string description: Các tham số dưới dạng chuỗi JSON. name: type: string description: Tên description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - arguments - name x-apidog-orders: - arguments - name id: type: string description: >- Mã định danh lời gọi, thông điệp của công cụ cần tương ứng với tool_call_id. type: type: string enum: - function description: Kiểu x-apifox-orders: - function - id - type x-apidog-orders: - function - id - type description: >- Một danh sách các yêu cầu gọi công cụ (do mô hình khởi tạo) trong thông điệp của trợ lý. refName: Thông điệp x-apifox-orders: - content - name - reasoning_content - role - tool_call_id - tool_calls x-apidog-orders: - content - name - reasoning_content - role - tool_call_id - tool_calls description: >- Danh sách các tin nhắn trong cuộc hội thoại, ít nhất một tin nhắn. Hỗ trợ nhiều lượt: system/user/assistant/tool. model: type: string description: >- ID mô hình cần sử dụng. Cổng sẽ chọn các kênh bằng cách nhóm mã thông báo và có thể thực hiện ánh xạ tên mô hình hoặc phân giải hậu tố (chẳng hạn như -thinking, -search). 'n': type: integer description: >- Dịch tài liệu kỹ thuật này sang tiếng Việt. Giữ nguyên Markdown, mã nguồn, định danh, URL, đường dẫn, phần giữ chỗ, cấu trúc JSON và định dạng. Chỉ trả về văn bản đã dịch và không để lại ký tự Hán nào. Tạo một số phương án trả lời của trợ lý cho cùng một lượt đầu vào. parallel_tool_calls: type: boolean description: >- Có cho phép thực hiện nhiều lệnh gọi công cụ song song trong một phản hồi hay không (khi hệ thống đầu nguồn hỗ trợ). presence_penalty: type: number description: >- Có một hệ số phạt, khoảng -2~2. Giá trị dương làm giảm sự lặp lại của các biểu thức chủ đề đã xuất hiện. reasoning_effort: type: string description: >- Mức độ mạnh của mô hình suy luận (chẳng hạn như thấp / trung bình / cao). Giá trị này cũng có thể được cổng kết nối tự động chèn thông qua hậu tố của tên mô hình. response_format: type: object properties: json_schema: type: object description: Định nghĩa cấu trúc đầu ra khi type=json_schema. x-apidog-orders: [] type: type: string enum: - text - json_object - json_schema description: >- text: văn bản thông thường; json_object: đối tượng JSON; json_schema: đầu ra có cấu trúc theo schema. refName: ResponseFormat x-apifox-orders: - json_schema - type x-apidog-orders: - json_schema - type seed: type: number description: >- Hạt giống ngẫu nhiên, dùng để cố gắng thu được kết quả có thể tái tạo với cùng các tham số (không đảm bảo tính nhất quán hoàn toàn). Lưu ý rằng trường này có tên là seed. stop: oneOf: - type: string - type: array items: type: string description: >- Dừng việc tạo nội dung khi gặp các chuỗi này. Có thể là một chuỗi đơn hoặc một mảng chuỗi (tối đa 4 chuỗi). stream: type: boolean description: >- Có truyền phát đầu ra hay không. false: Trả về toàn bộ JSON trong một lần; true: Đẩy tăng dần qua SSE, kết thúc bằng data: [DONE]. stream_options: type: object properties: include_usage: type: boolean description: >- Liệu mức sử dụng (token prompt/completion) có được bao gồm ở cuối luồng hay không. refName: StreamOptions x-apifox-orders: - include_usage x-apidog-orders: - include_usage temperature: type: number description: >- Nhiệt độ lấy mẫu, thường nằm trong khoảng 0~2. Giá trị càng cao, phản hồi càng ngẫu nhiên; giá trị càng thấp, phản hồi càng ổn định. Thông thường, chỉ điều chỉnh một trong hai tham số này cùng với top_p. tool_choice: oneOf: - type: string enum: - none - auto - required - type: object properties: function: type: object required: - name properties: name: type: string description: Tên hàm bắt buộc phải được gọi. description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - name x-apidog-orders: - name type: type: string x-apifox-orders: - function - type x-apidog-orders: - function - type description: >- Dịch tài liệu kỹ thuật này sang tiếng Việt. Giữ nguyên Markdown, mã, định danh, URL, đường dẫn, phần giữ chỗ, cấu trúc JSON và định dạng. Chỉ trả về văn bản đã dịch và không để lại ký tự Hán nào. Kiểm soát việc có gọi công cụ hay không: none (không gọi), auto (tự động), required (bắt buộc phải gọi), hoặc chỉ định một hàm. tools: type: array items: type: object required: - type - function properties: function: type: object required: - name properties: description: type: string description: >- Phần mô tả chức năng giúp mô hình quyết định thời điểm gọi chức năng đó. name: type: string description: Tên hàm mà mô hình dùng để khởi tạo lệnh gọi. parameters: type: object description: Lược đồ JSON của các tham số hàm. x-apidog-orders: [] description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - description - name - parameters x-apidog-orders: - description - name - parameters type: type: string enum: - function description: Đã sửa thành hàm. refName: Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. x-apifox-orders: - function - type x-apidog-orders: - function - type description: >- Danh sách các công cụ (hàm) mà mô hình có thể gọi, được dùng để gọi hàm trong các cuộc hội thoại. top_p: type: number description: >- Lấy mẫu hạt nhân, 0~1. Chỉ lấy mẫu các token có xác suất tích lũy đạt đến top_p. user: type: string description: >- Mã định danh duy nhất của người dùng cuối giúp phát hiện hành vi lạm dụng và thống kê ở phía nền tảng. web_search_options: type: object properties: search_context_size: type: string enum: - high - medium - low description: >- Kích thước ngữ cảnh tìm kiếm trên Internet; nếu không được truyền, cổng mặc định sử dụng mức trung bình. user_location: type: object description: >- Vị trí địa lý của người dùng, v.v., được sử dụng cho kết quả tìm kiếm đã bản địa hóa (cấu trúc phụ thuộc vào nguồn cung cấp phía trên). x-apidog-orders: [] refName: WebSearchOptions x-apifox-orders: - search_context_size - user_location x-apidog-orders: - search_context_size - user_location refName: V1ChatCompletionsRequest description: >- Chỉ áp dụng cho các tình huống hội thoại nhiều lượt, tương ứng với các trường liên quan đến hội thoại của dto.GeneralOpenAIRequest. Bắt buộc: model, messages (không được để trống). Xác thực: Authorization: Bearer {API Key}. x-apifox-orders: - enable_thinking - extra_body - frequency_penalty - logit_bias - max_completion_tokens - max_tokens - messages - model - 'n' - parallel_tool_calls - presence_penalty - reasoning_effort - response_format - seed - stop - stream - stream_options - temperature - tool_choice - tools - top_p - user - web_search_options x-apidog-orders: - enable_thinking - extra_body - frequency_penalty - logit_bias - max_completion_tokens - max_tokens - messages - model - 'n' - parallel_tool_calls - presence_penalty - reasoning_effort - response_format - seed - stop - stream - stream_options - temperature - tool_choice - tools - top_p - user - web_search_options examples: deepseek_chat: value: extra_body: enable_thinking: true messages: - content: >- Có ba chiếc hộp, chỉ một hộp có phần thưởng. Bạn chọn hộp số 2, người dẫn chương trình mở hộp số 3 (trống), rồi hỏi bạn có muốn đổi sang hộp số 1 không? Hãy phân tích và đưa ra lời khuyên. role: user model: deepseek-chat stream: true stream_options: include_usage: true summary: deepseek_chat description: >- Khuyến nghị nâng cao: Hội thoại suy luận DeepSeek (truyền phát) · stream + extra_body.enable_thinking deepseek_ocr: value: messages: - content: - text: >- Hãy nhận dạng toàn bộ văn bản trong hình ảnh và xuất theo đúng thứ tự của bản gốc, không giải thích. type: text - image_url: detail: cao url: https://example.com/document-scan.png type: image_url role: user model: deepseek-ocr stream: false summary: deepseek_ocr description: >- Khuyến nghị nâng cao: DeepSeek-OCR để nhận dạng văn bản · image_url + từ khóa nhắc nhận dạng hình ảnh gemini_multimodal: value: messages: - content: - text: Trong bức ảnh này có gì? Vui lòng mô tả chi tiết. type: text - image_url: url: >- https://lsky.zhongzhuan.chat/i/2024/10/17/6711068a14527.png type: image_url role: user model: gemini-2.5-flash-all stream: true temperature: 0.5 top_p: 1 summary: gemini_multimodal description: Gemini đa phương thức (khả năng hiểu hình ảnh) gpt4o_audio: value: audio: format: wav voice: hợp kim messages: - content: >- Chó golden retriever có phải là giống chó phù hợp với gia đình không? role: user modalities: - văn bản - âm thanh model: gpt-4o-audio-preview summary: gpt4o_audio description: Đầu ra âm thanh của GPT-4o gpt_4_gizmo_g_2fkfe8rbu: value: messages: - content: Bạn là ai? role: user model: gpt-4-gizmo-g-2fkFE8rbu stream: false summary: gpt_4_gizmo_g_2fkfe8rbu description: Đối thoại GPTs gpt_4o: value: messages: - content: Bạn là một cô gái mèo luôn sẵn lòng giúp đỡ mọi người. role: Vui lòng cung cấp tài liệu kỹ thuật cần dịch. - content: Hãy giúp tôi tóm tắt HTTP là gì. role: user model: gpt-4o summary: gpt_4o description: >- Khuyến nghị cho người mới bắt đầu: hội thoại cơ bản (không truyền phát) gpt_4o_10: value: messages: - content: - text: Tóm tắt nội dung hình ảnh và trả lời theo từng ý. type: text - image_url: detail: cao url: https://example.com/demo.jpg type: image_url role: user model: gpt-4o stream: false summary: gpt_4o_10 description: >- Đề xuất nâng cao: Hình ảnh hội thoại (không truyền phát) · extra_body.google.response_modalities + image_config gpt_4o_11: value: max_tokens: 256 messages: - content: Giới thiệu API gateway là gì trong một câu. role: user model: gpt-4o 'n': 2 temperature: 0.8 summary: gpt_4o_11 description: 'Khuyến nghị nâng cao: nhiều phản hồi ứng viên · n' gpt_4o_12: value: functions: - description: Tra cứu thời tiết thành phố name: get_weather parameters: properties: city: description: Tên thành phố type: string x-i18n: en-US: description: tên thành phố required: - city type: object x-i18n: en-US: description: Kiểm tra thời tiết thành phố messages: - content: Thời tiết ở Bắc Kinh hiện giờ thế nào? role: user model: gpt-4o tool_choice: tự động summary: gpt_4o_12 description: >- Khuyến nghị nâng cao: Gọi hàm (phiên bản cũ) · functions + tool_choice gpt_4o_2: value: messages: - content: >- Hãy dùng 3 câu để giải thích token là gì và đưa ra một ví dụ. role: user model: gpt-4o stream: true stream_options: include_usage: true summary: gpt_4o_2 description: >- Khuyến nghị cho người mới: Hội thoại truyền phát · stream + stream_options.include_usage gpt_4o_3: value: messages: - content: >- Viết một đoạn nội dung quảng bá sản phẩm không quá 200 chữ; khi gặp STOP thì dừng lại. role: user model: gpt-4o stop: - Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. - DỪNG LẠI temperature: 0.4 top_p: 0.9 summary: gpt_4o_3 description: >- Khuyến nghị nâng cao: Kiểm soát lấy mẫu: temperature + top_p + stop gpt_4o_4: value: messages: - content: Thời tiết ở Bắc Kinh hôm nay thế nào? role: user model: gpt-4o tool_choice: tự động tools: - function: description: Lấy thông tin thời tiết của thành phố được chỉ định name: get_weather parameters: properties: city: description: Tên thành phố type: string x-i18n: en-US: description: tên thành phố required: - city type: object x-i18n: en-US: description: >- Lấy thông tin thời tiết cho một thành phố được chỉ định type: function summary: gpt_4o_4 description: 'Khuyến nghị nâng cao: gọi công cụ (tools + tool_choice)' gpt_4o_5: value: messages: - content: >- {"title":"Cách viết tài liệu API","bullets":["Mô tả mục đích, phạm vi và đối tượng sử dụng của API.","Liệt kê URL, phương thức HTTP, tiêu đề yêu cầu và cơ chế xác thực.","Giải thích rõ tham số đường dẫn, tham số truy vấn và nội dung yêu cầu, bao gồm kiểu dữ liệu, điều kiện bắt buộc và giá trị mẫu.","Cung cấp ví dụ yêu cầu và phản hồi, đồng thời giữ nguyên định dạng JSON.","Ghi rõ mã trạng thái HTTP, mã lỗi, thông báo lỗi và cách xử lý.","Nêu quy tắc phân trang, giới hạn tần suất, phiên bản API và lịch sử thay đổi."]} role: user model: gpt-4o response_format: type: json_object summary: gpt_4o_5 description: >- Khuyến nghị nâng cao: Bắt buộc đầu ra có cấu trúc (response_format) gpt_4o_6: value: messages: - content: - text: >- Trong bức ảnh này có gì? Vui lòng mô tả bằng tiếng Trung và đưa ra những bối cảnh có thể xảy ra. type: text - image_url: detail: cao url: https://example.com/image.jpg type: image_url role: user model: gpt-4o summary: gpt_4o_6 description: >- Khuyến nghị nâng cao: Ví dụ đa phương thức: messages.content với hình ảnh (image_url gpt_4o_7: value: messages: - content: >- Gần đây có những bài viết chất lượng cao nào về tác nhân AI? Hãy cung cấp cho tôi 3 bài và mô tả ngắn gọn. role: user model: gpt-4o web_search_options: search_context_size: trung bình summary: gpt_4o_7 description: >- Khuyến nghị nâng cao: Các tùy chọn mạng/tìm kiếm (web_search_options) gpt_4o_8: value: messages: - content: - text: Hãy mô tả bức ảnh này bằng tiếng Trung. type: text - image_url: detail: cao url: https://example.com/demo.jpg type: image_url role: user model: gpt-4o stream: true summary: gpt_4o_8 description: >- Đề xuất nâng cao: Hội thoại bằng hình ảnh và văn bản (truyền liên tục) · stream + image_url.url gpt_4o_9: value: messages: - content: - text: Chữ trong hình là gì? type: text - image_url: detail: tự động url: >- data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg== type: image_url role: user model: gpt-4o stream: true summary: gpt_4o_9 description: >- Khuyến nghị nâng cao: Đối thoại bằng hình ảnh và văn bản (truyền phát) · stream + image_url (base64) o3_mini: value: max_completion_tokens: 2000 messages: - content: >- Chứng minh: Nếu n là số lẻ thì n² cũng là số lẻ. Hãy suy luận từng bước. role: user model: o3-mini reasoning_effort: cao summary: o3_mini description: >- Khuyến nghị nâng cao: Kiểm soát mức độ nỗ lực của mô hình suy luận (reasoning_effort) qwen_max: value: extra_body: enable_thinking: true messages: - content: >- Tính toán: Nếu một hệ thống xử lý 120 yêu cầu mỗi giây, thì trong 5 phút hệ thống đó có thể xử lý bao nhiêu yêu cầu? Hãy trình bày quá trình tính. 5 phút = 5 × 60 = 300 giây Tổng số yêu cầu có thể xử lý = 120 × 300 = 36.000 yêu cầu Đáp án: Hệ thống có thể xử lý 36.000 yêu cầu trong 5 phút. role: user model: qwen-max summary: qwen_max description: >- Khuyến nghị nâng cao: sử dụng chế độ suy luận (`enable_thinking` / `extra_body.enable_thinking`) qwen_mt_turbo: value: messages: - content: >- Vui lòng dịch đoạn tiếng Anh dưới đây sang tiếng Trung giản thể, chỉ xuất bản dịch: Xin chào, chào mừng bạn đến với nền tảng API của chúng tôi. role: user model: qwen-mt-turbo stream: false summary: qwen_mt_turbo description: 'Đề xuất nâng cao: dịch máy · model(qwen-mt) + messages' responses: '200': description: '' content: application/json: schema: type: object required: - id - object - created - model - choices - usage - system_fingerprint - service_tier properties: choices: type: array items: type: object properties: finish_reason: type: string description: 'Lý do kết thúc, ví dụ: stop, length' index: type: integer description: Chỉ mục của mục ứng viên logprobs: type: string description: Thông tin xác suất lôgarit (nếu được bật) nullable: true message: type: object required: - role - content - refusal - annotations properties: annotations: type: array items: type: string description: Chú thích / thông tin trích dẫn content: type: string description: Nội dung tin nhắn hoặc yêu cầu refusal: type: string description: Nội dung từ chối (nếu có) nullable: true role: type: string description: >- Vai trò của tin nhắn, ví dụ: system / user / assistant / model description: Vui lòng cung cấp nội dung tài liệu cần dịch. x-apifox-orders: - annotations - content - refusal - role x-apidog-orders: - annotations - content - refusal - role x-apifox-orders: - finish_reason - index - logprobs - message x-apidog-orders: - finish_reason - index - logprobs - message description: Danh sách các kết quả ứng viên created: type: integer description: Thời gian tạo (dấu thời gian Unix) id: type: string description: ID tài nguyên hoặc tác vụ model: type: string description: Tên mô hình / mã định danh mô hình object: type: string description: 'Định danh kiểu đối tượng, ví dụ: chat.completion' service_tier: type: string description: Cấp dịch vụ / mức ưu tiên system_fingerprint: type: string description: Dấu vân tay cấu hình phía máy chủ usage: type: object required: - prompt_tokens - completion_tokens - total_tokens - prompt_tokens_details - completion_tokens_details - latency_checkpoint properties: completion_tokens: type: integer description: Số lượng token hoàn thành completion_tokens_details: type: object required: - reasoning_tokens - audio_tokens - accepted_prediction_tokens - rejected_prediction_tokens properties: accepted_prediction_tokens: type: integer description: Số lượng token dự đoán được chấp nhận audio_tokens: type: integer description: Số lượng token liên quan đến âm thanh reasoning_tokens: type: integer description: Số token được sử dụng trong quá trình suy luận rejected_prediction_tokens: type: integer description: Số lượng token dự đoán bị từ chối description: Phân tích chi tiết số token hoàn thành x-apifox-orders: - accepted_prediction_tokens - audio_tokens - reasoning_tokens - rejected_prediction_tokens x-apidog-orders: - accepted_prediction_tokens - audio_tokens - reasoning_tokens - rejected_prediction_tokens latency_checkpoint: type: object required: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms properties: engine_tbt_ms: type: integer description: Thời gian giữa các token của engine (ms) engine_ttft_ms: type: integer description: Thời gian của bộ máy đến token đầu tiên (ms) engine_ttlt_ms: type: integer description: Tổng độ trễ của bộ máy (ms) pre_inference_ms: type: integer description: Thời gian chuẩn bị trước khi suy luận (ms) service_tbt_ms: type: integer description: >- Khoảng thời gian giữa các token ở phía dịch vụ (ms) service_ttft_ms: type: integer description: Thời gian từ phía dịch vụ đến mã từ đầu tiên (ms) service_ttlt_ms: type: integer description: Tổng độ trễ phía dịch vụ (ms) total_duration_ms: type: integer description: Tổng thời lượng (ms) user_visible_ttft_ms: type: integer description: >- Thời gian đến token đầu tiên mà người dùng nhìn thấy (ms) description: Thông tin điểm kiểm tra độ trễ x-apifox-orders: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms x-apidog-orders: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms prompt_tokens: type: integer description: Số lượng token trong lời nhắc prompt_tokens_details: type: object required: - cached_tokens - audio_tokens properties: audio_tokens: type: integer description: Số lượng token liên quan đến âm thanh cached_tokens: type: integer description: Số lượng token trúng bộ nhớ đệm description: Phân tích chi tiết token của lời nhắc x-apifox-orders: - audio_tokens - cached_tokens x-apidog-orders: - audio_tokens - cached_tokens total_tokens: type: integer description: Tổng số token description: Thống kê mức sử dụng token x-apifox-orders: - completion_tokens - completion_tokens_details - latency_checkpoint - prompt_tokens - prompt_tokens_details - total_tokens x-apidog-orders: - completion_tokens - completion_tokens_details - latency_checkpoint - prompt_tokens - prompt_tokens_details - total_tokens refName: V1ChatCompletionsResponse x-apifox-orders: - choices - created - id - model - object - service_tier - system_fingerprint - usage x-apidog-orders: - choices - created - id - model - object - service_tier - system_fingerprint - usage examples: example: summary: example value: choices: - finish_reason: dừng index: 0 logprobs: '' message: annotations: [] content: Xin chào, hôm nay tôi có thể hỗ trợ bạn như thế nào? refusal: '' role: >- Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. created: 1677652288 id: chatcmpl-123 model: gpt-4o object: chat.completion service_tier: mặc định system_fingerprint: fp_abc123 usage: completion_tokens: 12 completion_tokens_details: accepted_prediction_tokens: 0 audio_tokens: 0 reasoning_tokens: 0 rejected_prediction_tokens: 0 latency_checkpoint: engine_tbt_ms: 0 engine_ttft_ms: 0 engine_ttlt_ms: 0 pre_inference_ms: 0 service_tbt_ms: 0 service_ttft_ms: 0 service_ttlt_ms: 0 total_duration_ms: 0 user_visible_ttft_ms: 0 prompt_tokens: 9 prompt_tokens_details: audio_tokens: 0 cached_tokens: 0 total_tokens: 21 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/ChatGpt/Trò chuyện ChatGPT x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208823-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Liệt kê các mô hình" Nguồn: https://docs.openaihub.net/api-45208824/ > 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: /v1/models: get: summary: Liệt kê các mô hình deprecated: false description: Liệt kê các mô hình mà mã thông báo API hiện tại có thể truy cập. operationId: v1_models tags: - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/ChatGpt/Trò chuyện ChatGPT - Mô hình parameters: - name: content-type in: header description: Content-Type của phần thân yêu cầu, thường là application/json required: true example: application/json schema: type: string - name: Authorization in: header description: mã thông báo hệ thống required: false example: Bearer {{YOUR_API_KEY}} schema: type: string 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: '' security: [] x-apidog-folder: OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/ChatGpt/Trò chuyện ChatGPT x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208824-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Đã tạo xong" Nguồn: https://docs.openaihub.net/api-45208825/ > 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: /v1/completions: post: summary: Đã tạo xong deprecated: false description: >- Khi được cung cấp một gợi ý, mô hình sẽ trả về một hoặc nhiều phần hoàn thành được dự đoán và cũng có thể trả về xác suất của dấu thay thế tại mỗi vị trí. Tạo phần hoàn thành cho các lời nhắc và tham số đã cung cấp https://platform.openai.com/docs/api-reference/completions operationId: v1_completions tags: - >- OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/ChatGpt/Các lượt hoàn tất của ChatGPT - Hoàn tất parameters: - name: Authorization in: header description: Khóa API Bearer required: false example: Bearer {{YOUR_API_KEY}} schema: type: string requestBody: content: application/json: schema: type: object required: - model - prompt - user properties: best_of: type: integer description: >- Mặc định là 1. Tạo best_of phương án hoàn thành ở phía máy chủ và trả về phương án hoàn thành "tốt nhất" (phương án có xác suất log cao nhất cho từng token). Không thể truyền phát kết quả. Khi được dùng cùng với n, best_of kiểm soát số lượng phương án hoàn thành ứng viên, còn n chỉ định số lượng phương án được trả về – best_of phải lớn hơn n. Lưu ý: Vì tham số này tạo ra nhiều phương án hoàn thành, nó có thể nhanh chóng tiêu hao hạn mức token của bạn. Vui lòng thận trọng khi sử dụng và bảo đảm rằng bạn thiết lập các giá trị hợp lý cho max_tokens và stop. echo: type: boolean description: >- Giá trị mặc định là false. Ngoài phần hoàn thành, các lời nhắc cũng được hiển thị lại. frequency_penalty: type: number description: >- Mặc định là 0 - một số nằm trong khoảng từ 2.0 đến 2.0. Các giá trị dương phạt những token mới dựa trên tần suất hiện tại của chúng trong văn bản, làm giảm khả năng mô hình lặp lại nguyên văn cùng một dòng. logit_bias: type: object description: >- Mặc định là null Xác suất xuất hiện của token được chỉ định trong phần hoàn thành chỉnh sửa. Chấp nhận một đối tượng JSON ánh xạ một token (được chỉ định bằng ID token trong bộ tách token GPT) tới một giá trị độ lệch tương ứng, từ -100 đến 100. Bạn có thể dùng công cụ tách token này (có sẵn cho GPT-2 và GPT-3) để chuyển đổi văn bản thành các ID token. Về mặt toán học, độ lệch được cộng vào logit thu được trước khi mô hình được lấy mẫu. Tác động chính xác khác nhau tùy theo từng mô hình, nhưng các giá trị từ -1 đến 1 sẽ làm giảm hoặc tăng khả năng được chọn; các giá trị như -100 hoặc 100 sẽ khiến token liên quan bị cấm hoặc được chọn riêng biệt. Ví dụ, bạn có thể truyền {"50256": -100} để ngăn token <|endoftext|> được tạo. x-apidog-orders: [] logprobs: type: string description: >- Mặc định là null Bao gồm xác suất logarit của các token có khả năng cao nhất trong logprobs, cũng như token đã chọn. Ví dụ, nếu logprobs là 5, API sẽ trả về danh sách 5 token có khả năng cao nhất. API luôn trả về xác suất logarit của token được lấy mẫu, vì vậy phản hồi có thể có tối đa logprobs+1 phần tử. Giá trị tối đa của logprobs là 5. nullable: true max_tokens: type: integer description: >- Mặc định là 16 Số lượng token tối đa được tạo trong phần hoàn thành. Tổng số token của gợi ý và `max_tokens` không được vượt quá độ dài ngữ cảnh của mô hình. Ví dụ mã Python để đếm token. model: type: string description: >- ID của mô hình cần sử dụng. Bạn có thể dùng API Liệt kê mô hình để xem tất cả các mô hình hiện có, hoặc xem phần Tổng quan về mô hình để đọc mô tả của chúng. 'n': type: integer description: >- Mặc định là 1 Số lượng phương án hoàn thành được tạo cho mỗi lời nhắc. Lưu ý: Vì tham số này tạo ra nhiều phương án hoàn thành, nó có thể nhanh chóng làm cạn hạn mức token của bạn. Vui lòng sử dụng thận trọng và đảm bảo bạn đã thiết lập các giá trị hợp lý cho max_tokens và stop. presence_penalty: type: number description: >- Mặc định là 0 - một số nằm trong khoảng từ 2.0 đến 2.0. Các giá trị dương phạt các token mới dựa trên việc chúng có xuất hiện trong văn bản hiện tại hay không, làm tăng khả năng mô hình thảo luận các chủ đề mới. Để biết thêm thông tin về mức phạt tần suất và mức phạt hiện diện, hãy xem . prompt: type: string description: >- Tạo một lời nhắc hoàn chỉnh, được mã hóa dưới dạng một chuỗi, một mảng chuỗi, một mảng token hoặc một mảng các mảng token. Lưu ý rằng <|endoftext|> là dấu phân cách tài liệu mà mô hình nhìn thấy trong quá trình huấn luyện, vì vậy nếu không chỉ định gợi ý nào, mô hình sẽ tạo phần mở đầu của một tài liệu mới. seed: type: integer description: >- Nếu được chỉ định, hệ thống của chúng tôi sẽ cố gắng hết sức để lấy mẫu theo cách xác định, nhờ đó các yêu cầu lặp lại với cùng seed và các tham số sẽ trả về cùng kết quả. Tính xác định không được bảo đảm và bạn nên tham chiếu tham số phản hồi system_fingerprint để theo dõi các thay đổi ở backend của mình. stop: type: string description: >- Mặc định là null, với tối đa 4 chuỗi mà tại đó API sẽ ngừng tạo thêm token. Văn bản được trả về sẽ không chứa các chuỗi dừng. stream: type: boolean description: >- Mặc định là false, cho biết có truyền ngược lại một phần tiến trình hay không. Nếu được bật, token sẽ được gửi dưới dạng sự kiện do máy chủ gửi chỉ chứa dữ liệu khi có sẵn, và luồng sẽ kết thúc bằng thông báo data: [DONE]. Thông báo dạng đối tượng. Các ví dụ mã Python. suffix: type: string description: >- Mặc định là null. Hậu tố xuất hiện sau khi hoàn tất văn bản được chèn. temperature: type: integer description: >- Mặc định là 1. Nhiệt độ lấy mẫu được sử dụng, nằm trong khoảng từ 0 đến 2. Giá trị cao hơn (như 0.8) sẽ làm cho đầu ra ngẫu nhiên hơn, trong khi giá trị thấp hơn (như 0.2) sẽ làm cho đầu ra tập trung và có tính xác định cao hơn. Nhìn chung, chúng tôi khuyến nghị chỉ thay đổi tham số này hoặc top_p, không thay đổi cả hai. top_p: type: integer description: >- Đại diện cho một mã định danh duy nhất của người dùng cuối, có thể giúp OpenAI giám sát và phát hiện hành vi lạm dụng. Tìm hiểu thêm. user: type: string description: >- Mã định danh người dùng cuối (để kiểm soát rủi ro / thanh toán) refName: PostV1CompletionsRequest x-apifox-orders: - best_of - echo - frequency_penalty - logit_bias - logprobs - max_tokens - model - 'n' - presence_penalty - prompt - seed - stop - stream - suffix - temperature - top_p - user x-apidog-orders: - best_of - echo - frequency_penalty - logit_bias - logprobs - max_tokens - model - 'n' - presence_penalty - prompt - seed - stop - stream - suffix - temperature - top_p - user examples: gpt_3_5_turbo_instruct: value: max_tokens: 30 model: gpt-3.5-turbo-instruct prompt: Xin chào, temperature: 0 user: default-user summary: gpt_3_5_turbo_instruct description: Đã tạo xong responses: '200': description: '' content: application/json: schema: type: object required: - id - object - created - model - system_fingerprint - choices - usage properties: choices: type: array items: type: object properties: finish_reason: type: string description: 'Lý do kết thúc, ví dụ: stop, length' index: type: integer description: Chỉ mục của mục ứng viên logprobs: type: string description: Thông tin xác suất lôgarit (nếu được bật) nullable: true text: type: string description: Vui lòng cung cấp nội dung văn bản cần dịch. x-apifox-orders: - finish_reason - index - logprobs - text x-apidog-orders: - finish_reason - index - logprobs - text description: Danh sách các kết quả ứng viên created: type: integer description: Thời gian tạo (dấu thời gian Unix) id: type: string description: ID tài nguyên hoặc tác vụ model: type: string description: Tên mô hình / mã định danh mô hình object: type: string description: 'Định danh kiểu đối tượng, ví dụ: chat.completion' system_fingerprint: type: string description: Dấu vân tay cấu hình phía máy chủ usage: type: object required: - prompt_tokens - completion_tokens - total_tokens properties: completion_tokens: type: integer description: Số lượng token hoàn thành prompt_tokens: type: integer description: Số lượng token trong lời nhắc total_tokens: type: integer description: Tổng số token description: Thống kê mức sử dụng token x-apifox-orders: - completion_tokens - prompt_tokens - total_tokens x-apidog-orders: - completion_tokens - prompt_tokens - total_tokens refName: PostV1CompletionsResponse x-apifox-orders: - choices - created - id - model - object - system_fingerprint - usage x-apidog-orders: - choices - created - id - model - object - system_fingerprint - usage examples: example: summary: example value: choices: - finish_reason: độ dài index: 0 logprobs: '' text: >- Tôi là Tiểu Băng, rất vui được làm quen với bạn. Tôi là một trợ lý trí tuệ nhân tạo, có thể trả created: 1753859563 id: cmpl-ByvHP6AWeB1L5vWZSPNHsB12sU9db model: gpt-3.5-turbo-instruct object: text_completion system_fingerprint: fp_abc123 usage: completion_tokens: 30 prompt_tokens: 3 total_tokens: 33 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/ChatGpt/Các lượt hoàn tất của ChatGPT x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208825-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Tạo các vectơ nhúng" Nguồn: https://docs.openaihub.net/api-45208826/ > 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: /v1/embeddings: post: summary: Tạo các vectơ nhúng deprecated: false description: >- Tạo các phần nhúng vectơ văn bản. Chọn dịch vụ nguồn thông qua `model` (chẳng hạn như `text-embedding-3-small` của OpenAI hoặc mô hình phần nhúng của Gemini). Tài liệu chính thức của OpenAI: https://platform.openai.com/docs/api-reference/embeddings operationId: v1_embeddings tags: - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/ChatGpt/Nhúng ChatGPT - Nhúng parameters: [] requestBody: content: application/json: schema: type: object required: - model - input properties: dimensions: type: integer description: Số chiều của vectơ input: type: string description: Vui lòng cung cấp nội dung tài liệu cần dịch. model: type: string description: Tên mô hình / mã định danh mô hình refName: V1EmbeddingsRequest x-apifox-orders: - dimensions - input - model x-apidog-orders: - dimensions - input - model examples: minimal: value: input: Món ăn rất ngon và nhân viên phục vụ rất thân thiện. model: text-embedding-3-small summary: minimal description: Mức tối thiểu khả dụng responses: '200': description: Được content: application/json: schema: type: object properties: data: type: array items: type: object x-apidog-orders: [] description: >- Phần dữ liệu (thường là Base64 hoặc một đối tượng có cấu trúc) model: type: string description: Tên mô hình / mã định danh mô hình object: type: string description: 'Định danh kiểu đối tượng, ví dụ: chat.completion' usage: type: object description: Thống kê mức sử dụng token x-apidog-orders: [] refName: V1EmbeddingsResponse x-apifox-orders: - data - model - object - usage x-apidog-orders: - data - model - object - usage examples: example: summary: example value: data: - {} model: chuỗi object: chuỗi usage: {} headers: {} x-apidog-name: Được '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/ChatGpt/Nhúng ChatGPT x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208826-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Tìm kiếm trên web" Nguồn: https://docs.openaihub.net/api-45208827/ > 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: /v1/chat/completions: post: summary: Tìm kiếm trên web deprecated: false description: >- Cổng tương thích OpenAI hợp nhất. Chọn nguồn thượng nguồn thông qua `model`, ví dụ: - `gpt-4o` / `gpt-4o-audio-preview` → OpenAI - `gemini-2.5-flash-all` → Google Gemini (định dạng tương thích) - Với các mô hình khác, xem `GET /v1/models` Tài liệu chính thức của OpenAI: https://platform.openai.com/docs/api-reference/chat/create Định dạng tên mô hình là: gpt-4-gizmo-*, và hệ thống sẽ tự động nhận dạng. Ví dụ, GPTs này: https://chatgpt.com/g/g-B3hgivKK9-write-for-me Khi đó, tên mô hình của nó phải được điền là: gpt-4-gizmo-g-B3hgivKK9 Danh sách GPTs: https://chatgpt.com/gpts operationId: v1_chat_completions tags: - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/ChatGpt/Tìm kiếm trên web - Trò chuyện parameters: [] requestBody: content: application/json: schema: type: object required: - model - messages properties: enable_thinking: type: boolean description: >- Có bật chế độ suy luận hay không (phần mở rộng của kho này). Chỉ giá trị Boolean `true` mới có hiệu lực; hãy chọn một trong các giá trị của `extra_body.enable_thinking`. extra_body: type: object properties: enable_thinking: type: boolean description: >- Bật chế độ suy luận trong `extra_body`; chỉ chấp nhận giá trị `true`. google: type: object description: >- Các phần mở rộng hộp thoại Gemini như thinking_config, response_modalities. x-apidog-orders: [] description: >- Các tham số mở rộng cho hội thoại. Thường dùng: enable_thinking; một số mô hình Gemini có thể dùng google.thinking_config, vân vân. Việc tham số có hiệu lực hay không phụ thuộc vào kênh và mô hình. x-apifox-orders: - enable_thinking - google x-apidog-orders: - enable_thinking - google frequency_penalty: type: number description: >- Hệ số phạt tần suất, khoảng -2~2. Giá trị dương làm giảm xác suất lặp lại cùng một từ. logit_bias: type: object description: >- Điều chỉnh xác suất xuất hiện theo ID token, và giá trị là một đối tượng ánh xạ với các giá trị nằm trong khoảng từ -100 đến 100. x-apidog-orders: [] max_completion_tokens: type: integer description: >- Giới hạn token tối đa cho phần hoàn thành (thường được dùng hơn trong các mô hình suy luận như dòng o và GPT-5). `max_tokens` có thể được kế thừa khi không được thiết lập. max_tokens: type: integer description: >- Số lượng token tối đa được tạo trong phản hồi này (các trường dùng chung). messages: type: array items: type: object required: - role - content properties: content: oneOf: - type: string - type: array items: type: object required: - type properties: image_url: type: object required: - url properties: detail: type: string enum: - auto - low - high description: >- Độ chính xác khi hiểu hình ảnh: tự động/thấp/cao. url: type: string description: >- URL hình ảnh hoặc data:image/...;base64,... . description: >- Hình ảnh khi type=image_url. Nếu cổng kết nối bật proxy hình ảnh, url có thể bị thay thế. x-apifox-orders: - detail - url x-apidog-orders: - detail - url text: type: string description: Nội dung văn bản khi type=text. type: type: string enum: - text - image_url description: >- Loại khối nội dung: `text` là văn bản, `image_url` là hình ảnh. refName: Phần nội dung x-apifox-orders: - image_url - text - type x-apidog-orders: - image_url - text - type description: >- Nội dung tin nhắn: văn bản thuần túy hoặc mảng kết hợp hình ảnh và văn bản (xem ContentPart). name: type: string description: >- Tùy chọn. Phân biệt tên người nói trong các tình huống có nhiều người dùng. reasoning_content: type: string description: >- Văn bản về quá trình suy luận/tư duy (được dùng khi suy luận về các mô hình và tiếp nối ngữ cảnh). role: type: string enum: - system - user - assistant - tool - developer description: >- Vai trò của thông điệp. system: cài đặt hệ thống; user: người dùng; assistant: mô hình; tool: kết quả trả về của công cụ. tool_call_id: type: string description: >- Bắt buộc khi role là tool, tương ứng với tool_calls[].id của nội dung được trả về tại một thời điểm nhất định. tool_calls: type: array items: type: object properties: function: type: object properties: arguments: type: string description: Các tham số dưới dạng chuỗi JSON. name: type: string description: Tên description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - arguments - name x-apidog-orders: - arguments - name id: type: string description: >- Mã định danh lời gọi, thông điệp của công cụ cần tương ứng với tool_call_id. type: type: string enum: - function description: Kiểu x-apifox-orders: - function - id - type x-apidog-orders: - function - id - type description: >- Một danh sách các yêu cầu gọi công cụ (do mô hình khởi tạo) trong thông điệp của trợ lý. refName: Thông điệp x-apifox-orders: - content - name - reasoning_content - role - tool_call_id - tool_calls x-apidog-orders: - content - name - reasoning_content - role - tool_call_id - tool_calls description: >- Danh sách các tin nhắn trong cuộc hội thoại, ít nhất một tin nhắn. Hỗ trợ nhiều lượt: system/user/assistant/tool. model: type: string description: >- ID mô hình cần sử dụng. Cổng sẽ chọn các kênh bằng cách nhóm mã thông báo và có thể thực hiện ánh xạ tên mô hình hoặc phân giải hậu tố (chẳng hạn như -thinking, -search). 'n': type: integer description: >- Dịch tài liệu kỹ thuật này sang tiếng Việt. Giữ nguyên Markdown, mã nguồn, định danh, URL, đường dẫn, phần giữ chỗ, cấu trúc JSON và định dạng. Chỉ trả về văn bản đã dịch và không để lại ký tự Hán nào. Tạo một số phương án trả lời của trợ lý cho cùng một lượt đầu vào. parallel_tool_calls: type: boolean description: >- Có cho phép thực hiện nhiều lệnh gọi công cụ song song trong một phản hồi hay không (khi hệ thống đầu nguồn hỗ trợ). presence_penalty: type: number description: >- Có một hệ số phạt, khoảng -2~2. Giá trị dương làm giảm sự lặp lại của các biểu thức chủ đề đã xuất hiện. reasoning_effort: type: string description: >- Mức độ mạnh của mô hình suy luận (chẳng hạn như thấp / trung bình / cao). Giá trị này cũng có thể được cổng kết nối tự động chèn thông qua hậu tố của tên mô hình. response_format: type: object properties: json_schema: type: object description: Định nghĩa cấu trúc đầu ra khi type=json_schema. x-apidog-orders: [] type: type: string enum: - text - json_object - json_schema description: >- text: văn bản thông thường; json_object: đối tượng JSON; json_schema: đầu ra có cấu trúc theo schema. refName: ResponseFormat x-apifox-orders: - json_schema - type x-apidog-orders: - json_schema - type seed: type: number description: >- Hạt giống ngẫu nhiên, dùng để cố gắng thu được kết quả có thể tái tạo với cùng các tham số (không đảm bảo tính nhất quán hoàn toàn). Lưu ý rằng trường này có tên là seed. stop: oneOf: - type: string - type: array items: type: string description: >- Dừng việc tạo nội dung khi gặp các chuỗi này. Có thể là một chuỗi đơn hoặc một mảng chuỗi (tối đa 4 chuỗi). stream: type: boolean description: >- Có truyền phát đầu ra hay không. false: Trả về toàn bộ JSON trong một lần; true: Đẩy tăng dần qua SSE, kết thúc bằng data: [DONE]. stream_options: type: object properties: include_usage: type: boolean description: >- Liệu mức sử dụng (token prompt/completion) có được bao gồm ở cuối luồng hay không. refName: StreamOptions x-apifox-orders: - include_usage x-apidog-orders: - include_usage temperature: type: number description: >- Nhiệt độ lấy mẫu, thường nằm trong khoảng 0~2. Giá trị càng cao, phản hồi càng ngẫu nhiên; giá trị càng thấp, phản hồi càng ổn định. Thông thường, chỉ điều chỉnh một trong hai tham số này cùng với top_p. tool_choice: oneOf: - type: string enum: - none - auto - required - type: object properties: function: type: object required: - name properties: name: type: string description: Tên hàm bắt buộc phải được gọi. description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - name x-apidog-orders: - name type: type: string x-apifox-orders: - function - type x-apidog-orders: - function - type description: >- Dịch tài liệu kỹ thuật này sang tiếng Việt. Giữ nguyên Markdown, mã, định danh, URL, đường dẫn, phần giữ chỗ, cấu trúc JSON và định dạng. Chỉ trả về văn bản đã dịch và không để lại ký tự Hán nào. Kiểm soát việc có gọi công cụ hay không: none (không gọi), auto (tự động), required (bắt buộc phải gọi), hoặc chỉ định một hàm. tools: type: array items: type: object required: - type - function properties: function: type: object required: - name properties: description: type: string description: >- Phần mô tả chức năng giúp mô hình quyết định thời điểm gọi chức năng đó. name: type: string description: Tên hàm mà mô hình dùng để khởi tạo lệnh gọi. parameters: type: object description: Lược đồ JSON của các tham số hàm. x-apidog-orders: [] description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - description - name - parameters x-apidog-orders: - description - name - parameters type: type: string enum: - function description: Đã sửa thành hàm. refName: Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. x-apifox-orders: - function - type x-apidog-orders: - function - type description: >- Danh sách các công cụ (hàm) mà mô hình có thể gọi, được dùng để gọi hàm trong các cuộc hội thoại. top_p: type: number description: >- Lấy mẫu hạt nhân, 0~1. Chỉ lấy mẫu các token có xác suất tích lũy đạt đến top_p. user: type: string description: >- Mã định danh duy nhất của người dùng cuối giúp phát hiện hành vi lạm dụng và thống kê ở phía nền tảng. web_search_options: type: object properties: search_context_size: type: string enum: - high - medium - low description: >- Kích thước ngữ cảnh tìm kiếm trên Internet; nếu không được truyền, cổng mặc định sử dụng mức trung bình. user_location: type: object description: >- Vị trí địa lý của người dùng, v.v., được sử dụng cho kết quả tìm kiếm đã bản địa hóa (cấu trúc phụ thuộc vào nguồn cung cấp phía trên). x-apidog-orders: [] refName: WebSearchOptions x-apifox-orders: - search_context_size - user_location x-apidog-orders: - search_context_size - user_location refName: V1ChatCompletionsRequest description: >- Chỉ áp dụng cho các tình huống hội thoại nhiều lượt, tương ứng với các trường liên quan đến hội thoại của dto.GeneralOpenAIRequest. Bắt buộc: model, messages (không được để trống). Xác thực: Authorization: Bearer {API Key}. x-apifox-orders: - enable_thinking - extra_body - frequency_penalty - logit_bias - max_completion_tokens - max_tokens - messages - model - 'n' - parallel_tool_calls - presence_penalty - reasoning_effort - response_format - seed - stop - stream - stream_options - temperature - tool_choice - tools - top_p - user - web_search_options x-apidog-orders: - enable_thinking - extra_body - frequency_penalty - logit_bias - max_completion_tokens - max_tokens - messages - model - 'n' - parallel_tool_calls - presence_penalty - reasoning_effort - response_format - seed - stop - stream - stream_options - temperature - tool_choice - tools - top_p - user - web_search_options examples: deepseek_chat: value: extra_body: enable_thinking: true messages: - content: >- Có ba chiếc hộp, chỉ một hộp có phần thưởng. Bạn chọn hộp số 2, người dẫn chương trình mở hộp số 3 (trống), rồi hỏi bạn có muốn đổi sang hộp số 1 không? Hãy phân tích và đưa ra lời khuyên. role: user model: deepseek-chat stream: true stream_options: include_usage: true summary: deepseek_chat description: >- Khuyến nghị nâng cao: Hội thoại suy luận DeepSeek (truyền phát) · stream + extra_body.enable_thinking deepseek_ocr: value: messages: - content: - text: >- Hãy nhận dạng toàn bộ văn bản trong hình ảnh và xuất theo đúng thứ tự của bản gốc, không giải thích. type: text - image_url: detail: cao url: https://example.com/document-scan.png type: image_url role: user model: deepseek-ocr stream: false summary: deepseek_ocr description: >- Khuyến nghị nâng cao: DeepSeek-OCR để nhận dạng văn bản · image_url + từ khóa nhắc nhận dạng hình ảnh gemini_multimodal: value: messages: - content: - text: Trong bức ảnh này có gì? Vui lòng mô tả chi tiết. type: text - image_url: url: >- https://lsky.zhongzhuan.chat/i/2024/10/17/6711068a14527.png type: image_url role: user model: gemini-2.5-flash-all stream: true temperature: 0.5 top_p: 1 summary: gemini_multimodal description: Gemini đa phương thức (khả năng hiểu hình ảnh) gpt4o_audio: value: audio: format: wav voice: hợp kim messages: - content: >- Chó golden retriever có phải là giống chó phù hợp với gia đình không? role: user modalities: - văn bản - âm thanh model: gpt-4o-audio-preview summary: gpt4o_audio description: Đầu ra âm thanh của GPT-4o gpt_4_gizmo_g_2fkfe8rbu: value: messages: - content: Bạn là ai? role: user model: gpt-4-gizmo-g-2fkFE8rbu stream: false summary: gpt_4_gizmo_g_2fkfe8rbu description: Đối thoại GPTs gpt_4o: value: messages: - content: Bạn là một cô gái mèo luôn sẵn lòng giúp đỡ mọi người. role: Vui lòng cung cấp tài liệu kỹ thuật cần dịch. - content: Hãy giúp tôi tóm tắt HTTP là gì. role: user model: gpt-4o summary: gpt_4o description: >- Khuyến nghị cho người mới bắt đầu: hội thoại cơ bản (không truyền phát) gpt_4o_10: value: messages: - content: - text: Tóm tắt nội dung hình ảnh và trả lời theo từng ý. type: text - image_url: detail: cao url: https://example.com/demo.jpg type: image_url role: user model: gpt-4o stream: false summary: gpt_4o_10 description: >- Đề xuất nâng cao: Hình ảnh hội thoại (không truyền phát) · extra_body.google.response_modalities + image_config gpt_4o_11: value: max_tokens: 256 messages: - content: Giới thiệu API gateway là gì trong một câu. role: user model: gpt-4o 'n': 2 temperature: 0.8 summary: gpt_4o_11 description: 'Khuyến nghị nâng cao: nhiều phản hồi ứng viên · n' gpt_4o_12: value: functions: - description: Tra cứu thời tiết thành phố name: get_weather parameters: properties: city: description: Tên thành phố type: string x-i18n: en-US: description: tên thành phố required: - city type: object x-i18n: en-US: description: Kiểm tra thời tiết thành phố messages: - content: Thời tiết ở Bắc Kinh hiện giờ thế nào? role: user model: gpt-4o tool_choice: tự động summary: gpt_4o_12 description: >- Khuyến nghị nâng cao: Gọi hàm (phiên bản cũ) · functions + tool_choice gpt_4o_2: value: messages: - content: >- Hãy dùng 3 câu để giải thích token là gì và đưa ra một ví dụ. role: user model: gpt-4o stream: true stream_options: include_usage: true summary: gpt_4o_2 description: >- Khuyến nghị cho người mới: Hội thoại truyền phát · stream + stream_options.include_usage gpt_4o_3: value: messages: - content: >- Viết một đoạn nội dung quảng bá sản phẩm không quá 200 chữ; khi gặp STOP thì dừng lại. role: user model: gpt-4o stop: - Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. - DỪNG LẠI temperature: 0.4 top_p: 0.9 summary: gpt_4o_3 description: >- Khuyến nghị nâng cao: Kiểm soát lấy mẫu: temperature + top_p + stop gpt_4o_4: value: messages: - content: Thời tiết ở Bắc Kinh hôm nay thế nào? role: user model: gpt-4o tool_choice: tự động tools: - function: description: Lấy thông tin thời tiết của thành phố được chỉ định name: get_weather parameters: properties: city: description: Tên thành phố type: string x-i18n: en-US: description: tên thành phố required: - city type: object x-i18n: en-US: description: >- Lấy thông tin thời tiết cho một thành phố được chỉ định type: function summary: gpt_4o_4 description: 'Khuyến nghị nâng cao: gọi công cụ (tools + tool_choice)' gpt_4o_5: value: messages: - content: >- {"title":"Cách viết tài liệu API","bullets":["Mô tả mục đích, phạm vi và đối tượng sử dụng của API.","Liệt kê URL, phương thức HTTP, tiêu đề yêu cầu và cơ chế xác thực.","Giải thích rõ tham số đường dẫn, tham số truy vấn và nội dung yêu cầu, bao gồm kiểu dữ liệu, điều kiện bắt buộc và giá trị mẫu.","Cung cấp ví dụ yêu cầu và phản hồi, đồng thời giữ nguyên định dạng JSON.","Ghi rõ mã trạng thái HTTP, mã lỗi, thông báo lỗi và cách xử lý.","Nêu quy tắc phân trang, giới hạn tần suất, phiên bản API và lịch sử thay đổi."]} role: user model: gpt-4o response_format: type: json_object summary: gpt_4o_5 description: >- Khuyến nghị nâng cao: Bắt buộc đầu ra có cấu trúc (response_format) gpt_4o_6: value: messages: - content: - text: >- Trong bức ảnh này có gì? Vui lòng mô tả bằng tiếng Trung và đưa ra những bối cảnh có thể xảy ra. type: text - image_url: detail: cao url: https://example.com/image.jpg type: image_url role: user model: gpt-4o summary: gpt_4o_6 description: >- Khuyến nghị nâng cao: Ví dụ đa phương thức: messages.content với hình ảnh (image_url gpt_4o_7: value: messages: - content: >- Gần đây có những bài viết chất lượng cao nào về tác nhân AI? Hãy cung cấp cho tôi 3 bài và mô tả ngắn gọn. role: user model: gpt-4o web_search_options: search_context_size: trung bình summary: gpt_4o_7 description: >- Khuyến nghị nâng cao: Các tùy chọn mạng/tìm kiếm (web_search_options) gpt_4o_8: value: messages: - content: - text: Hãy mô tả bức ảnh này bằng tiếng Trung. type: text - image_url: detail: cao url: https://example.com/demo.jpg type: image_url role: user model: gpt-4o stream: true summary: gpt_4o_8 description: >- Đề xuất nâng cao: Hội thoại bằng hình ảnh và văn bản (truyền liên tục) · stream + image_url.url gpt_4o_9: value: messages: - content: - text: Chữ trong hình là gì? type: text - image_url: detail: tự động url: >- data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg== type: image_url role: user model: gpt-4o stream: true summary: gpt_4o_9 description: >- Khuyến nghị nâng cao: Đối thoại bằng hình ảnh và văn bản (truyền phát) · stream + image_url (base64) o3_mini: value: max_completion_tokens: 2000 messages: - content: >- Chứng minh: Nếu n là số lẻ thì n² cũng là số lẻ. Hãy suy luận từng bước. role: user model: o3-mini reasoning_effort: cao summary: o3_mini description: >- Khuyến nghị nâng cao: Kiểm soát mức độ nỗ lực của mô hình suy luận (reasoning_effort) qwen_max: value: extra_body: enable_thinking: true messages: - content: >- Tính toán: Nếu một hệ thống xử lý 120 yêu cầu mỗi giây, thì trong 5 phút hệ thống đó có thể xử lý bao nhiêu yêu cầu? Hãy trình bày quá trình tính. 5 phút = 5 × 60 = 300 giây Tổng số yêu cầu có thể xử lý = 120 × 300 = 36.000 yêu cầu Đáp án: Hệ thống có thể xử lý 36.000 yêu cầu trong 5 phút. role: user model: qwen-max summary: qwen_max description: >- Khuyến nghị nâng cao: sử dụng chế độ suy luận (`enable_thinking` / `extra_body.enable_thinking`) qwen_mt_turbo: value: messages: - content: >- Vui lòng dịch đoạn tiếng Anh dưới đây sang tiếng Trung giản thể, chỉ xuất bản dịch: Xin chào, chào mừng bạn đến với nền tảng API của chúng tôi. role: user model: qwen-mt-turbo stream: false summary: qwen_mt_turbo description: 'Đề xuất nâng cao: dịch máy · model(qwen-mt) + messages' responses: '200': description: '' content: application/json: schema: type: object required: - id - object - created - model - choices - usage - system_fingerprint - service_tier properties: choices: type: array items: type: object properties: finish_reason: type: string description: 'Lý do kết thúc, ví dụ: stop, length' index: type: integer description: Chỉ mục của mục ứng viên logprobs: type: string description: Thông tin xác suất lôgarit (nếu được bật) nullable: true message: type: object required: - role - content - refusal - annotations properties: annotations: type: array items: type: string description: Chú thích / thông tin trích dẫn content: type: string description: Nội dung tin nhắn hoặc yêu cầu refusal: type: string description: Nội dung từ chối (nếu có) nullable: true role: type: string description: >- Vai trò của tin nhắn, ví dụ: system / user / assistant / model description: Vui lòng cung cấp nội dung tài liệu cần dịch. x-apifox-orders: - annotations - content - refusal - role x-apidog-orders: - annotations - content - refusal - role x-apifox-orders: - finish_reason - index - logprobs - message x-apidog-orders: - finish_reason - index - logprobs - message description: Danh sách các kết quả ứng viên created: type: integer description: Thời gian tạo (dấu thời gian Unix) id: type: string description: ID tài nguyên hoặc tác vụ model: type: string description: Tên mô hình / mã định danh mô hình object: type: string description: 'Định danh kiểu đối tượng, ví dụ: chat.completion' service_tier: type: string description: Cấp dịch vụ / mức ưu tiên system_fingerprint: type: string description: Dấu vân tay cấu hình phía máy chủ usage: type: object required: - prompt_tokens - completion_tokens - total_tokens - prompt_tokens_details - completion_tokens_details - latency_checkpoint properties: completion_tokens: type: integer description: Số lượng token hoàn thành completion_tokens_details: type: object required: - reasoning_tokens - audio_tokens - accepted_prediction_tokens - rejected_prediction_tokens properties: accepted_prediction_tokens: type: integer description: Số lượng token dự đoán được chấp nhận audio_tokens: type: integer description: Số lượng token liên quan đến âm thanh reasoning_tokens: type: integer description: Số token được sử dụng trong quá trình suy luận rejected_prediction_tokens: type: integer description: Số lượng token dự đoán bị từ chối description: Phân tích chi tiết số token hoàn thành x-apifox-orders: - accepted_prediction_tokens - audio_tokens - reasoning_tokens - rejected_prediction_tokens x-apidog-orders: - accepted_prediction_tokens - audio_tokens - reasoning_tokens - rejected_prediction_tokens latency_checkpoint: type: object required: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms properties: engine_tbt_ms: type: integer description: Thời gian giữa các token của engine (ms) engine_ttft_ms: type: integer description: Thời gian của bộ máy đến token đầu tiên (ms) engine_ttlt_ms: type: integer description: Tổng độ trễ của bộ máy (ms) pre_inference_ms: type: integer description: Thời gian chuẩn bị trước khi suy luận (ms) service_tbt_ms: type: integer description: >- Khoảng thời gian giữa các token ở phía dịch vụ (ms) service_ttft_ms: type: integer description: Thời gian từ phía dịch vụ đến mã từ đầu tiên (ms) service_ttlt_ms: type: integer description: Tổng độ trễ phía dịch vụ (ms) total_duration_ms: type: integer description: Tổng thời lượng (ms) user_visible_ttft_ms: type: integer description: >- Thời gian đến token đầu tiên mà người dùng nhìn thấy (ms) description: Thông tin điểm kiểm tra độ trễ x-apifox-orders: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms x-apidog-orders: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms prompt_tokens: type: integer description: Số lượng token trong lời nhắc prompt_tokens_details: type: object required: - cached_tokens - audio_tokens properties: audio_tokens: type: integer description: Số lượng token liên quan đến âm thanh cached_tokens: type: integer description: Số lượng token trúng bộ nhớ đệm description: Phân tích chi tiết token của lời nhắc x-apifox-orders: - audio_tokens - cached_tokens x-apidog-orders: - audio_tokens - cached_tokens total_tokens: type: integer description: Tổng số token description: Thống kê mức sử dụng token x-apifox-orders: - completion_tokens - completion_tokens_details - latency_checkpoint - prompt_tokens - prompt_tokens_details - total_tokens x-apidog-orders: - completion_tokens - completion_tokens_details - latency_checkpoint - prompt_tokens - prompt_tokens_details - total_tokens refName: V1ChatCompletionsResponse x-apifox-orders: - choices - created - id - model - object - service_tier - system_fingerprint - usage x-apidog-orders: - choices - created - id - model - object - service_tier - system_fingerprint - usage examples: example: summary: example value: choices: - finish_reason: dừng index: 0 logprobs: '' message: annotations: [] content: Xin chào, hôm nay tôi có thể hỗ trợ bạn như thế nào? refusal: '' role: >- Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. created: 1677652288 id: chatcmpl-123 model: gpt-4o object: chat.completion service_tier: mặc định system_fingerprint: fp_abc123 usage: completion_tokens: 12 completion_tokens_details: accepted_prediction_tokens: 0 audio_tokens: 0 reasoning_tokens: 0 rejected_prediction_tokens: 0 latency_checkpoint: engine_tbt_ms: 0 engine_ttft_ms: 0 engine_ttlt_ms: 0 pre_inference_ms: 0 service_tbt_ms: 0 service_ttft_ms: 0 service_ttlt_ms: 0 total_duration_ms: 0 user_visible_ttft_ms: 0 prompt_tokens: 9 prompt_tokens_details: audio_tokens: 0 cached_tokens: 0 total_tokens: 21 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/ChatGpt/Tìm kiếm trên web x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208827-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Tạo giọng nói gpt-4o-mini-tts" Nguồn: https://docs.openaihub.net/api-45208828/ > 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: /v1/audio/speech: post: summary: Tạo giọng nói gpt-4o-mini-tts deprecated: false description: >- Tài liệu chính thức: https://platform.openai.com/docs/guides/text-to-speech operationId: v1_audio_speech tags: - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/ChatGpt/Âm thanh ChatGPT - Âm thanh parameters: [] requestBody: content: application/json: schema: type: object required: - model - input - voice properties: input: type: string description: Văn bản dùng để tạo âm thanh. Độ dài tối đa là 4096 ký tự. model: type: string description: 'Một trong các mô hình TTS có sẵn: tts-1 hoặc tts-1-hd' response_format: type: string description: >- Định dạng âm thanh mặc định là mp3. Các định dạng được hỗ trợ gồm: mp3, opus, aac và flac. speed: type: number description: >- Mặc định là 1. Tốc độ âm thanh được tạo. Chọn một giá trị từ 0.25 đến 4.0. Giá trị mặc định là 1.0. voice: type: string description: >- Giọng nói được sử dụng khi tạo âm thanh. Các giọng nói được hỗ trợ gồm: alloy, echo, fable, onyx, nova và shimmer. refName: V1AudioSpeechRequest x-apifox-orders: - input - model - response_format - speed - voice x-apidog-orders: - input - model - response_format - speed - voice examples: gpt_4o_mini_tts: value: input: Con cáo nâu nhanh nhẹn đã nhảy qua con chó lười biếng. model: gpt-4o-mini-tts voice: hợp kim summary: gpt_4o_mini_tts description: Tạo giọng nói gpt-4o-mini-tts responses: '200': description: Được 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: Được '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/ChatGpt/Âm thanh ChatGPT x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208828-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Âm thanh thành văn bản gpt-4o-transcribe" Nguồn: https://docs.openaihub.net/api-45208829/ > 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: /v1/audio/transcriptions: post: summary: Âm thanh thành văn bản gpt-4o-transcribe deprecated: false description: >- Tai lieu chinh thuc: https://platform.openai.com/docs/guides/speech-to-text operationId: v1_audio_transcriptions tags: - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/ChatGpt/Âm thanh ChatGPT - Âm thanh parameters: [] requestBody: content: multipart/form-data: schema: type: object properties: file: type: string format: binary description: >- Đối tượng tệp âm thanh (không phải tên tệp) cần được chuyển thành văn bản, ở định dạng: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav hoặc webm. example: '' language: type: string description: Mã ngôn ngữ ISO-639-1 để cải thiện độ chính xác. example: '' model: type: string description: >- Hiện tại whisper-1, gpt-4o-mini-transcribe, gpt-4o-transcribe, v.v. example: '' prompt: type: string description: Lời nhắc văn bản example: '' response_format: type: string description: json, văn bản, v.v. example: '' temperature: type: number description: >- Nhiệt độ lấy mẫu; giá trị càng cao thì kết quả càng ngẫu nhiên example: 0 required: - file - model examples: {} responses: '200': description: Được content: application/json: schema: type: object required: - text properties: text: type: string description: Vui lòng cung cấp nội dung văn bản cần dịch. x-apifox-orders: - text x-apidog-orders: - text examples: success: summary: success value: text: một hai ba bốn năm sáu bảy tám chín mười headers: {} x-apidog-name: Được '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/ChatGpt/Âm thanh ChatGPT x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208829-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Tạo bản dịch (không được hỗ trợ)" Nguồn: https://docs.openaihub.net/api-45208830/ > 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: /v1/audio/translations: post: summary: Tạo bản dịch (không được hỗ trợ) deprecated: false description: >- Chuyển âm thanh thành văn bản tiếng Anh. Tài liệu chính thức: https://platform.openai.com/docs/api-reference/audio/createTranslation operationId: v1_audio_translations tags: - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/ChatGpt/Âm thanh ChatGPT - Âm thanh parameters: [] requestBody: content: multipart/form-data: schema: type: object properties: file: type: string format: binary description: >- Tệp âm thanh cần được dịch ở định dạng: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav hoặc webm. example: '' model: type: string description: Hiện tại whisper-1, v.v. example: '' prompt: type: string description: Lời nhắc văn bản example: '' response_format: type: string description: Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. example: '' temperature: type: number description: >- Nhiệt độ lấy mẫu; giá trị càng cao thì kết quả càng ngẫu nhiên example: 0 required: - file - model examples: {} responses: '200': description: Được content: application/json: schema: type: object required: - text properties: text: type: string description: Vui lòng cung cấp nội dung văn bản cần dịch. x-apifox-orders: - text x-apidog-orders: - text examples: example: summary: example value: text: >- Xin chào, tôi tên là Wolfgang và tôi đến từ Đức. Hôm nay bạn đang đi đâu? headers: {} x-apidog-name: Được '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/ChatGpt/Âm thanh ChatGPT x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208830-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "GPT-4o-audio" Nguồn: https://docs.openaihub.net/api-45208831/ > 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: /v1/chat/completions: post: summary: GPT-4o-audio deprecated: false description: >- Cổng tương thích OpenAI hợp nhất. Chọn nguồn thượng nguồn thông qua `model`, ví dụ: - `gpt-4o` / `gpt-4o-audio-preview` → OpenAI - `gemini-2.5-flash-all` → Google Gemini (định dạng tương thích) - Với các mô hình khác, xem `GET /v1/models` Tài liệu chính thức của OpenAI: https://platform.openai.com/docs/api-reference/chat/create Định dạng tên mô hình là: gpt-4-gizmo-*, và hệ thống sẽ tự động nhận dạng. Ví dụ, GPTs này: https://chatgpt.com/g/g-B3hgivKK9-write-for-me Khi đó, tên mô hình của nó phải được điền là: gpt-4-gizmo-g-B3hgivKK9 Danh sách GPTs: https://chatgpt.com/gpts operationId: v1_chat_completions tags: - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/ChatGpt/Âm thanh ChatGPT - Trò chuyện parameters: [] requestBody: content: application/json: schema: type: object required: - model - messages properties: enable_thinking: type: boolean description: >- Có bật chế độ suy luận hay không (phần mở rộng của kho này). Chỉ giá trị Boolean `true` mới có hiệu lực; hãy chọn một trong các giá trị của `extra_body.enable_thinking`. extra_body: type: object properties: enable_thinking: type: boolean description: >- Bật chế độ suy luận trong `extra_body`; chỉ chấp nhận giá trị `true`. google: type: object description: >- Các phần mở rộng hộp thoại Gemini như thinking_config, response_modalities. x-apidog-orders: [] description: >- Các tham số mở rộng cho hội thoại. Thường dùng: enable_thinking; một số mô hình Gemini có thể dùng google.thinking_config, vân vân. Việc tham số có hiệu lực hay không phụ thuộc vào kênh và mô hình. x-apifox-orders: - enable_thinking - google x-apidog-orders: - enable_thinking - google frequency_penalty: type: number description: >- Hệ số phạt tần suất, khoảng -2~2. Giá trị dương làm giảm xác suất lặp lại cùng một từ. logit_bias: type: object description: >- Điều chỉnh xác suất xuất hiện theo ID token, và giá trị là một đối tượng ánh xạ với các giá trị nằm trong khoảng từ -100 đến 100. x-apidog-orders: [] max_completion_tokens: type: integer description: >- Giới hạn token tối đa cho phần hoàn thành (thường được dùng hơn trong các mô hình suy luận như dòng o và GPT-5). `max_tokens` có thể được kế thừa khi không được thiết lập. max_tokens: type: integer description: >- Số lượng token tối đa được tạo trong phản hồi này (các trường dùng chung). messages: type: array items: type: object required: - role - content properties: content: oneOf: - type: string - type: array items: type: object required: - type properties: image_url: type: object required: - url properties: detail: type: string enum: - auto - low - high description: >- Độ chính xác khi hiểu hình ảnh: tự động/thấp/cao. url: type: string description: >- URL hình ảnh hoặc data:image/...;base64,... . description: >- Hình ảnh khi type=image_url. Nếu cổng kết nối bật proxy hình ảnh, url có thể bị thay thế. x-apifox-orders: - detail - url x-apidog-orders: - detail - url text: type: string description: Nội dung văn bản khi type=text. type: type: string enum: - text - image_url description: >- Loại khối nội dung: `text` là văn bản, `image_url` là hình ảnh. refName: Phần nội dung x-apifox-orders: - image_url - text - type x-apidog-orders: - image_url - text - type description: >- Nội dung tin nhắn: văn bản thuần túy hoặc mảng kết hợp hình ảnh và văn bản (xem ContentPart). name: type: string description: >- Tùy chọn. Phân biệt tên người nói trong các tình huống có nhiều người dùng. reasoning_content: type: string description: >- Văn bản về quá trình suy luận/tư duy (được dùng khi suy luận về các mô hình và tiếp nối ngữ cảnh). role: type: string enum: - system - user - assistant - tool - developer description: >- Vai trò của thông điệp. system: cài đặt hệ thống; user: người dùng; assistant: mô hình; tool: kết quả trả về của công cụ. tool_call_id: type: string description: >- Bắt buộc khi role là tool, tương ứng với tool_calls[].id của nội dung được trả về tại một thời điểm nhất định. tool_calls: type: array items: type: object properties: function: type: object properties: arguments: type: string description: Các tham số dưới dạng chuỗi JSON. name: type: string description: Tên description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - arguments - name x-apidog-orders: - arguments - name id: type: string description: >- Mã định danh lời gọi, thông điệp của công cụ cần tương ứng với tool_call_id. type: type: string enum: - function description: Kiểu x-apifox-orders: - function - id - type x-apidog-orders: - function - id - type description: >- Một danh sách các yêu cầu gọi công cụ (do mô hình khởi tạo) trong thông điệp của trợ lý. refName: Thông điệp x-apifox-orders: - content - name - reasoning_content - role - tool_call_id - tool_calls x-apidog-orders: - content - name - reasoning_content - role - tool_call_id - tool_calls description: >- Danh sách các tin nhắn trong cuộc hội thoại, ít nhất một tin nhắn. Hỗ trợ nhiều lượt: system/user/assistant/tool. model: type: string description: >- ID mô hình cần sử dụng. Cổng sẽ chọn các kênh bằng cách nhóm mã thông báo và có thể thực hiện ánh xạ tên mô hình hoặc phân giải hậu tố (chẳng hạn như -thinking, -search). 'n': type: integer description: >- Dịch tài liệu kỹ thuật này sang tiếng Việt. Giữ nguyên Markdown, mã nguồn, định danh, URL, đường dẫn, phần giữ chỗ, cấu trúc JSON và định dạng. Chỉ trả về văn bản đã dịch và không để lại ký tự Hán nào. Tạo một số phương án trả lời của trợ lý cho cùng một lượt đầu vào. parallel_tool_calls: type: boolean description: >- Có cho phép thực hiện nhiều lệnh gọi công cụ song song trong một phản hồi hay không (khi hệ thống đầu nguồn hỗ trợ). presence_penalty: type: number description: >- Có một hệ số phạt, khoảng -2~2. Giá trị dương làm giảm sự lặp lại của các biểu thức chủ đề đã xuất hiện. reasoning_effort: type: string description: >- Mức độ mạnh của mô hình suy luận (chẳng hạn như thấp / trung bình / cao). Giá trị này cũng có thể được cổng kết nối tự động chèn thông qua hậu tố của tên mô hình. response_format: type: object properties: json_schema: type: object description: Định nghĩa cấu trúc đầu ra khi type=json_schema. x-apidog-orders: [] type: type: string enum: - text - json_object - json_schema description: >- text: văn bản thông thường; json_object: đối tượng JSON; json_schema: đầu ra có cấu trúc theo schema. refName: ResponseFormat x-apifox-orders: - json_schema - type x-apidog-orders: - json_schema - type seed: type: number description: >- Hạt giống ngẫu nhiên, dùng để cố gắng thu được kết quả có thể tái tạo với cùng các tham số (không đảm bảo tính nhất quán hoàn toàn). Lưu ý rằng trường này có tên là seed. stop: oneOf: - type: string - type: array items: type: string description: >- Dừng việc tạo nội dung khi gặp các chuỗi này. Có thể là một chuỗi đơn hoặc một mảng chuỗi (tối đa 4 chuỗi). stream: type: boolean description: >- Có truyền phát đầu ra hay không. false: Trả về toàn bộ JSON trong một lần; true: Đẩy tăng dần qua SSE, kết thúc bằng data: [DONE]. stream_options: type: object properties: include_usage: type: boolean description: >- Liệu mức sử dụng (token prompt/completion) có được bao gồm ở cuối luồng hay không. refName: StreamOptions x-apifox-orders: - include_usage x-apidog-orders: - include_usage temperature: type: number description: >- Nhiệt độ lấy mẫu, thường nằm trong khoảng 0~2. Giá trị càng cao, phản hồi càng ngẫu nhiên; giá trị càng thấp, phản hồi càng ổn định. Thông thường, chỉ điều chỉnh một trong hai tham số này cùng với top_p. tool_choice: oneOf: - type: string enum: - none - auto - required - type: object properties: function: type: object required: - name properties: name: type: string description: Tên hàm bắt buộc phải được gọi. description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - name x-apidog-orders: - name type: type: string x-apifox-orders: - function - type x-apidog-orders: - function - type description: >- Dịch tài liệu kỹ thuật này sang tiếng Việt. Giữ nguyên Markdown, mã, định danh, URL, đường dẫn, phần giữ chỗ, cấu trúc JSON và định dạng. Chỉ trả về văn bản đã dịch và không để lại ký tự Hán nào. Kiểm soát việc có gọi công cụ hay không: none (không gọi), auto (tự động), required (bắt buộc phải gọi), hoặc chỉ định một hàm. tools: type: array items: type: object required: - type - function properties: function: type: object required: - name properties: description: type: string description: >- Phần mô tả chức năng giúp mô hình quyết định thời điểm gọi chức năng đó. name: type: string description: Tên hàm mà mô hình dùng để khởi tạo lệnh gọi. parameters: type: object description: Lược đồ JSON của các tham số hàm. x-apidog-orders: [] description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - description - name - parameters x-apidog-orders: - description - name - parameters type: type: string enum: - function description: Đã sửa thành hàm. refName: Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. x-apifox-orders: - function - type x-apidog-orders: - function - type description: >- Danh sách các công cụ (hàm) mà mô hình có thể gọi, được dùng để gọi hàm trong các cuộc hội thoại. top_p: type: number description: >- Lấy mẫu hạt nhân, 0~1. Chỉ lấy mẫu các token có xác suất tích lũy đạt đến top_p. user: type: string description: >- Mã định danh duy nhất của người dùng cuối giúp phát hiện hành vi lạm dụng và thống kê ở phía nền tảng. web_search_options: type: object properties: search_context_size: type: string enum: - high - medium - low description: >- Kích thước ngữ cảnh tìm kiếm trên Internet; nếu không được truyền, cổng mặc định sử dụng mức trung bình. user_location: type: object description: >- Vị trí địa lý của người dùng, v.v., được sử dụng cho kết quả tìm kiếm đã bản địa hóa (cấu trúc phụ thuộc vào nguồn cung cấp phía trên). x-apidog-orders: [] refName: WebSearchOptions x-apifox-orders: - search_context_size - user_location x-apidog-orders: - search_context_size - user_location refName: V1ChatCompletionsRequest description: >- Chỉ áp dụng cho các tình huống hội thoại nhiều lượt, tương ứng với các trường liên quan đến hội thoại của dto.GeneralOpenAIRequest. Bắt buộc: model, messages (không được để trống). Xác thực: Authorization: Bearer {API Key}. x-apifox-orders: - enable_thinking - extra_body - frequency_penalty - logit_bias - max_completion_tokens - max_tokens - messages - model - 'n' - parallel_tool_calls - presence_penalty - reasoning_effort - response_format - seed - stop - stream - stream_options - temperature - tool_choice - tools - top_p - user - web_search_options x-apidog-orders: - enable_thinking - extra_body - frequency_penalty - logit_bias - max_completion_tokens - max_tokens - messages - model - 'n' - parallel_tool_calls - presence_penalty - reasoning_effort - response_format - seed - stop - stream - stream_options - temperature - tool_choice - tools - top_p - user - web_search_options examples: deepseek_chat: value: extra_body: enable_thinking: true messages: - content: >- Có ba chiếc hộp, chỉ một hộp có phần thưởng. Bạn chọn hộp số 2, người dẫn chương trình mở hộp số 3 (trống), rồi hỏi bạn có muốn đổi sang hộp số 1 không? Hãy phân tích và đưa ra lời khuyên. role: user model: deepseek-chat stream: true stream_options: include_usage: true summary: deepseek_chat description: >- Khuyến nghị nâng cao: Hội thoại suy luận DeepSeek (truyền phát) · stream + extra_body.enable_thinking deepseek_ocr: value: messages: - content: - text: >- Hãy nhận dạng toàn bộ văn bản trong hình ảnh và xuất theo đúng thứ tự của bản gốc, không giải thích. type: text - image_url: detail: cao url: https://example.com/document-scan.png type: image_url role: user model: deepseek-ocr stream: false summary: deepseek_ocr description: >- Khuyến nghị nâng cao: DeepSeek-OCR để nhận dạng văn bản · image_url + từ khóa nhắc nhận dạng hình ảnh gemini_multimodal: value: messages: - content: - text: Trong bức ảnh này có gì? Vui lòng mô tả chi tiết. type: text - image_url: url: >- https://lsky.zhongzhuan.chat/i/2024/10/17/6711068a14527.png type: image_url role: user model: gemini-2.5-flash-all stream: true temperature: 0.5 top_p: 1 summary: gemini_multimodal description: Gemini đa phương thức (khả năng hiểu hình ảnh) gpt4o_audio: value: audio: format: wav voice: hợp kim messages: - content: >- Chó golden retriever có phải là giống chó phù hợp với gia đình không? role: user modalities: - văn bản - âm thanh model: gpt-4o-audio-preview summary: gpt4o_audio description: Đầu ra âm thanh của GPT-4o gpt_4_gizmo_g_2fkfe8rbu: value: messages: - content: Bạn là ai? role: user model: gpt-4-gizmo-g-2fkFE8rbu stream: false summary: gpt_4_gizmo_g_2fkfe8rbu description: Đối thoại GPTs gpt_4o: value: messages: - content: Bạn là một cô gái mèo luôn sẵn lòng giúp đỡ mọi người. role: Vui lòng cung cấp tài liệu kỹ thuật cần dịch. - content: Hãy giúp tôi tóm tắt HTTP là gì. role: user model: gpt-4o summary: gpt_4o description: >- Khuyến nghị cho người mới bắt đầu: hội thoại cơ bản (không truyền phát) gpt_4o_10: value: messages: - content: - text: Tóm tắt nội dung hình ảnh và trả lời theo từng ý. type: text - image_url: detail: cao url: https://example.com/demo.jpg type: image_url role: user model: gpt-4o stream: false summary: gpt_4o_10 description: >- Đề xuất nâng cao: Hình ảnh hội thoại (không truyền phát) · extra_body.google.response_modalities + image_config gpt_4o_11: value: max_tokens: 256 messages: - content: Giới thiệu API gateway là gì trong một câu. role: user model: gpt-4o 'n': 2 temperature: 0.8 summary: gpt_4o_11 description: 'Khuyến nghị nâng cao: nhiều phản hồi ứng viên · n' gpt_4o_12: value: functions: - description: Tra cứu thời tiết thành phố name: get_weather parameters: properties: city: description: Tên thành phố type: string x-i18n: en-US: description: tên thành phố required: - city type: object x-i18n: en-US: description: Kiểm tra thời tiết thành phố messages: - content: Thời tiết ở Bắc Kinh hiện giờ thế nào? role: user model: gpt-4o tool_choice: tự động summary: gpt_4o_12 description: >- Khuyến nghị nâng cao: Gọi hàm (phiên bản cũ) · functions + tool_choice gpt_4o_2: value: messages: - content: >- Hãy dùng 3 câu để giải thích token là gì và đưa ra một ví dụ. role: user model: gpt-4o stream: true stream_options: include_usage: true summary: gpt_4o_2 description: >- Khuyến nghị cho người mới: Hội thoại truyền phát · stream + stream_options.include_usage gpt_4o_3: value: messages: - content: >- Viết một đoạn nội dung quảng bá sản phẩm không quá 200 chữ; khi gặp STOP thì dừng lại. role: user model: gpt-4o stop: - Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. - DỪNG LẠI temperature: 0.4 top_p: 0.9 summary: gpt_4o_3 description: >- Khuyến nghị nâng cao: Kiểm soát lấy mẫu: temperature + top_p + stop gpt_4o_4: value: messages: - content: Thời tiết ở Bắc Kinh hôm nay thế nào? role: user model: gpt-4o tool_choice: tự động tools: - function: description: Lấy thông tin thời tiết của thành phố được chỉ định name: get_weather parameters: properties: city: description: Tên thành phố type: string x-i18n: en-US: description: tên thành phố required: - city type: object x-i18n: en-US: description: >- Lấy thông tin thời tiết cho một thành phố được chỉ định type: function summary: gpt_4o_4 description: 'Khuyến nghị nâng cao: gọi công cụ (tools + tool_choice)' gpt_4o_5: value: messages: - content: >- {"title":"Cách viết tài liệu API","bullets":["Mô tả mục đích, phạm vi và đối tượng sử dụng của API.","Liệt kê URL, phương thức HTTP, tiêu đề yêu cầu và cơ chế xác thực.","Giải thích rõ tham số đường dẫn, tham số truy vấn và nội dung yêu cầu, bao gồm kiểu dữ liệu, điều kiện bắt buộc và giá trị mẫu.","Cung cấp ví dụ yêu cầu và phản hồi, đồng thời giữ nguyên định dạng JSON.","Ghi rõ mã trạng thái HTTP, mã lỗi, thông báo lỗi và cách xử lý.","Nêu quy tắc phân trang, giới hạn tần suất, phiên bản API và lịch sử thay đổi."]} role: user model: gpt-4o response_format: type: json_object summary: gpt_4o_5 description: >- Khuyến nghị nâng cao: Bắt buộc đầu ra có cấu trúc (response_format) gpt_4o_6: value: messages: - content: - text: >- Trong bức ảnh này có gì? Vui lòng mô tả bằng tiếng Trung và đưa ra những bối cảnh có thể xảy ra. type: text - image_url: detail: cao url: https://example.com/image.jpg type: image_url role: user model: gpt-4o summary: gpt_4o_6 description: >- Khuyến nghị nâng cao: Ví dụ đa phương thức: messages.content với hình ảnh (image_url gpt_4o_7: value: messages: - content: >- Gần đây có những bài viết chất lượng cao nào về tác nhân AI? Hãy cung cấp cho tôi 3 bài và mô tả ngắn gọn. role: user model: gpt-4o web_search_options: search_context_size: trung bình summary: gpt_4o_7 description: >- Khuyến nghị nâng cao: Các tùy chọn mạng/tìm kiếm (web_search_options) gpt_4o_8: value: messages: - content: - text: Hãy mô tả bức ảnh này bằng tiếng Trung. type: text - image_url: detail: cao url: https://example.com/demo.jpg type: image_url role: user model: gpt-4o stream: true summary: gpt_4o_8 description: >- Đề xuất nâng cao: Hội thoại bằng hình ảnh và văn bản (truyền liên tục) · stream + image_url.url gpt_4o_9: value: messages: - content: - text: Chữ trong hình là gì? type: text - image_url: detail: tự động url: >- data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg== type: image_url role: user model: gpt-4o stream: true summary: gpt_4o_9 description: >- Khuyến nghị nâng cao: Đối thoại bằng hình ảnh và văn bản (truyền phát) · stream + image_url (base64) o3_mini: value: max_completion_tokens: 2000 messages: - content: >- Chứng minh: Nếu n là số lẻ thì n² cũng là số lẻ. Hãy suy luận từng bước. role: user model: o3-mini reasoning_effort: cao summary: o3_mini description: >- Khuyến nghị nâng cao: Kiểm soát mức độ nỗ lực của mô hình suy luận (reasoning_effort) qwen_max: value: extra_body: enable_thinking: true messages: - content: >- Tính toán: Nếu một hệ thống xử lý 120 yêu cầu mỗi giây, thì trong 5 phút hệ thống đó có thể xử lý bao nhiêu yêu cầu? Hãy trình bày quá trình tính. 5 phút = 5 × 60 = 300 giây Tổng số yêu cầu có thể xử lý = 120 × 300 = 36.000 yêu cầu Đáp án: Hệ thống có thể xử lý 36.000 yêu cầu trong 5 phút. role: user model: qwen-max summary: qwen_max description: >- Khuyến nghị nâng cao: sử dụng chế độ suy luận (`enable_thinking` / `extra_body.enable_thinking`) qwen_mt_turbo: value: messages: - content: >- Vui lòng dịch đoạn tiếng Anh dưới đây sang tiếng Trung giản thể, chỉ xuất bản dịch: Xin chào, chào mừng bạn đến với nền tảng API của chúng tôi. role: user model: qwen-mt-turbo stream: false summary: qwen_mt_turbo description: 'Đề xuất nâng cao: dịch máy · model(qwen-mt) + messages' responses: '200': description: '' content: application/json: schema: type: object required: - id - object - created - model - choices - usage - system_fingerprint - service_tier properties: choices: type: array items: type: object properties: finish_reason: type: string description: 'Lý do kết thúc, ví dụ: stop, length' index: type: integer description: Chỉ mục của mục ứng viên logprobs: type: string description: Thông tin xác suất lôgarit (nếu được bật) nullable: true message: type: object required: - role - content - refusal - annotations properties: annotations: type: array items: type: string description: Chú thích / thông tin trích dẫn content: type: string description: Nội dung tin nhắn hoặc yêu cầu refusal: type: string description: Nội dung từ chối (nếu có) nullable: true role: type: string description: >- Vai trò của tin nhắn, ví dụ: system / user / assistant / model description: Vui lòng cung cấp nội dung tài liệu cần dịch. x-apifox-orders: - annotations - content - refusal - role x-apidog-orders: - annotations - content - refusal - role x-apifox-orders: - finish_reason - index - logprobs - message x-apidog-orders: - finish_reason - index - logprobs - message description: Danh sách các kết quả ứng viên created: type: integer description: Thời gian tạo (dấu thời gian Unix) id: type: string description: ID tài nguyên hoặc tác vụ model: type: string description: Tên mô hình / mã định danh mô hình object: type: string description: 'Định danh kiểu đối tượng, ví dụ: chat.completion' service_tier: type: string description: Cấp dịch vụ / mức ưu tiên system_fingerprint: type: string description: Dấu vân tay cấu hình phía máy chủ usage: type: object required: - prompt_tokens - completion_tokens - total_tokens - prompt_tokens_details - completion_tokens_details - latency_checkpoint properties: completion_tokens: type: integer description: Số lượng token hoàn thành completion_tokens_details: type: object required: - reasoning_tokens - audio_tokens - accepted_prediction_tokens - rejected_prediction_tokens properties: accepted_prediction_tokens: type: integer description: Số lượng token dự đoán được chấp nhận audio_tokens: type: integer description: Số lượng token liên quan đến âm thanh reasoning_tokens: type: integer description: Số token được sử dụng trong quá trình suy luận rejected_prediction_tokens: type: integer description: Số lượng token dự đoán bị từ chối description: Phân tích chi tiết số token hoàn thành x-apifox-orders: - accepted_prediction_tokens - audio_tokens - reasoning_tokens - rejected_prediction_tokens x-apidog-orders: - accepted_prediction_tokens - audio_tokens - reasoning_tokens - rejected_prediction_tokens latency_checkpoint: type: object required: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms properties: engine_tbt_ms: type: integer description: Thời gian giữa các token của engine (ms) engine_ttft_ms: type: integer description: Thời gian của bộ máy đến token đầu tiên (ms) engine_ttlt_ms: type: integer description: Tổng độ trễ của bộ máy (ms) pre_inference_ms: type: integer description: Thời gian chuẩn bị trước khi suy luận (ms) service_tbt_ms: type: integer description: >- Khoảng thời gian giữa các token ở phía dịch vụ (ms) service_ttft_ms: type: integer description: Thời gian từ phía dịch vụ đến mã từ đầu tiên (ms) service_ttlt_ms: type: integer description: Tổng độ trễ phía dịch vụ (ms) total_duration_ms: type: integer description: Tổng thời lượng (ms) user_visible_ttft_ms: type: integer description: >- Thời gian đến token đầu tiên mà người dùng nhìn thấy (ms) description: Thông tin điểm kiểm tra độ trễ x-apifox-orders: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms x-apidog-orders: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms prompt_tokens: type: integer description: Số lượng token trong lời nhắc prompt_tokens_details: type: object required: - cached_tokens - audio_tokens properties: audio_tokens: type: integer description: Số lượng token liên quan đến âm thanh cached_tokens: type: integer description: Số lượng token trúng bộ nhớ đệm description: Phân tích chi tiết token của lời nhắc x-apifox-orders: - audio_tokens - cached_tokens x-apidog-orders: - audio_tokens - cached_tokens total_tokens: type: integer description: Tổng số token description: Thống kê mức sử dụng token x-apifox-orders: - completion_tokens - completion_tokens_details - latency_checkpoint - prompt_tokens - prompt_tokens_details - total_tokens x-apidog-orders: - completion_tokens - completion_tokens_details - latency_checkpoint - prompt_tokens - prompt_tokens_details - total_tokens refName: V1ChatCompletionsResponse x-apifox-orders: - choices - created - id - model - object - service_tier - system_fingerprint - usage x-apidog-orders: - choices - created - id - model - object - service_tier - system_fingerprint - usage examples: example: summary: example value: choices: - finish_reason: dừng index: 0 logprobs: '' message: annotations: [] content: Xin chào, hôm nay tôi có thể hỗ trợ bạn như thế nào? refusal: '' role: >- Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. created: 1677652288 id: chatcmpl-123 model: gpt-4o object: chat.completion service_tier: mặc định system_fingerprint: fp_abc123 usage: completion_tokens: 12 completion_tokens_details: accepted_prediction_tokens: 0 audio_tokens: 0 reasoning_tokens: 0 rejected_prediction_tokens: 0 latency_checkpoint: engine_tbt_ms: 0 engine_ttft_ms: 0 engine_ttlt_ms: 0 pre_inference_ms: 0 service_tbt_ms: 0 service_ttft_ms: 0 service_ttlt_ms: 0 total_duration_ms: 0 user_visible_ttft_ms: 0 prompt_tokens: 9 prompt_tokens_details: audio_tokens: 0 cached_tokens: 0 total_tokens: 21 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/ChatGpt/Âm thanh ChatGPT x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208831-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Tạo nội dung hoàn tất cuộc trò chuyện (truyền trực tuyến) [định dạng gốc]" Nguồn: https://docs.openaihub.net/api-45208832/ > 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: /v1/messages: post: summary: >- Tạo nội dung hoàn tất cuộc trò chuyện (truyền trực tuyến) [định dạng gốc] deprecated: false description: >- Điểm cuối trò chuyện văn bản MiniMax (đường dẫn xuất của Apifox là `/v1/messages`, không có tiền tố `/minimax/v1/`). https://platform.minimaxi.com/docs/api-reference/text-post operationId: minimax_v1_messages tags: - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/Claude/Định dạng gốc - MiniMax parameters: [] requestBody: content: application/json: schema: type: object required: - model - messages properties: max_completion_tokens: type: integer description: Số lượng token hoàn thành tối đa messages: type: array items: type: object required: - role - name - content properties: content: type: string description: Nội dung tin nhắn hoặc yêu cầu name: type: string description: Tên role: type: string description: >- Vai trò của tin nhắn, ví dụ: system / user / assistant / model x-apifox-orders: - content - name - role x-apidog-orders: - content - name - role description: Danh sách các tin nhắn trong cuộc trò chuyện model: type: string description: Tên mô hình / mã định danh mô hình stream: type: boolean description: Có truyền phát phản hồi hay không stream_options: type: object required: - include_usage properties: include_usage: type: boolean description: Có bao gồm thông tin sử dụng ở cuối luồng hay không description: Tùy chọn truyền luồng x-apifox-orders: - include_usage x-apidog-orders: - include_usage temperature: type: number description: >- Nhiệt độ lấy mẫu; giá trị càng cao thì kết quả càng ngẫu nhiên top_p: type: number description: Ngưỡng xác suất lấy mẫu nucleus refName: PostV1MessagesRequest x-apifox-orders: - max_completion_tokens - messages - model - stream - stream_options - temperature - top_p x-apidog-orders: - max_completion_tokens - messages - model - stream - stream_options - temperature - top_p examples: minimax_m2_1: value: max_completion_tokens: 2048 messages: - content: Bạn là một trợ lý AI chuyên nghiệp và thân thiện. name: Trợ lý AI role: Vui lòng cung cấp tài liệu kỹ thuật cần dịch. x-i18n: en-US: name: AI assistant - content: Hãy giúp tôi viết một bài thơ về mùa thu. name: Trương Tam role: user x-i18n: en-US: name: John Doe model: MiniMax-M2.1 stream: true stream_options: include_usage: true temperature: 0.9 top_p: 0.95 summary: minimax_m2_1 description: tổng hợp văn bản responses: '200': description: '' content: application/json: schema: type: object required: - id - choices - created - model - object - usage - input_sensitive - output_sensitive - input_sensitive_type - output_sensitive_type - output_sensitive_int - base_resp properties: base_resp: type: object required: - status_code - status_msg properties: status_code: type: integer description: Mã trạng thái status_msg: type: string description: Thông báo trạng thái description: >- Trình bao phản hồi của dịch vụ nền (mã trạng thái / thông báo) x-apifox-orders: - status_code - status_msg x-apidog-orders: - status_code - status_msg choices: type: array items: type: object properties: finish_reason: type: string description: 'Lý do kết thúc, ví dụ: stop, length' index: type: integer description: Chỉ mục của mục ứng viên message: type: object required: - content - role - name - audio_content - reasoning_content properties: audio_content: type: string description: Nội dung âm thanh (thường ở dạng Base64) content: type: string description: Nội dung tin nhắn hoặc yêu cầu name: type: string description: Tên reasoning_content: type: string description: Văn bản về quá trình suy luận role: type: string description: >- Vai trò của tin nhắn, ví dụ: system / user / assistant / model description: Vui lòng cung cấp nội dung tài liệu cần dịch. x-apifox-orders: - audio_content - content - name - reasoning_content - role x-apidog-orders: - audio_content - content - name - reasoning_content - role x-apifox-orders: - finish_reason - index - message x-apidog-orders: - finish_reason - index - message description: Danh sách các kết quả ứng viên created: type: integer description: Thời gian tạo (dấu thời gian Unix) id: type: string description: ID tài nguyên hoặc tác vụ input_sensitive: type: boolean description: >- Liệu đầu vào có kích hoạt cơ chế phát hiện nội dung nhạy cảm hay không input_sensitive_type: type: integer description: Loại nội dung nhạy cảm đầu vào model: type: string description: Tên mô hình / mã định danh mô hình object: type: string description: 'Định danh kiểu đối tượng, ví dụ: chat.completion' output_sensitive: type: boolean description: >- Liệu đầu ra có kích hoạt cơ chế phát hiện nội dung nhạy cảm hay không output_sensitive_int: type: integer description: Mức độ nội dung nhạy cảm của đầu ra output_sensitive_type: type: integer description: Loại nội dung nhạy cảm trong đầu ra usage: type: object required: - total_tokens - total_characters - prompt_tokens - completion_tokens - completion_tokens_details properties: completion_tokens: type: integer description: Số lượng token hoàn thành completion_tokens_details: type: object required: - reasoning_tokens properties: reasoning_tokens: type: integer description: Số token được sử dụng trong quá trình suy luận description: Phân tích chi tiết số token hoàn thành x-apifox-orders: - reasoning_tokens x-apidog-orders: - reasoning_tokens prompt_tokens: type: integer description: Số lượng token trong lời nhắc total_characters: type: integer description: Tổng số ký tự total_tokens: type: integer description: Tổng số token description: Thống kê mức sử dụng token x-apifox-orders: - completion_tokens - completion_tokens_details - prompt_tokens - total_characters - total_tokens x-apidog-orders: - completion_tokens - completion_tokens_details - prompt_tokens - total_characters - total_tokens refName: PostV1MessagesResponse x-apifox-orders: - base_resp - choices - created - id - input_sensitive - input_sensitive_type - model - object - output_sensitive - output_sensitive_int - output_sensitive_type - usage x-apidog-orders: - base_resp - choices - created - id - input_sensitive - input_sensitive_type - model - object - output_sensitive - output_sensitive_int - output_sensitive_type - usage examples: example: summary: example value: base_resp: status_code: 0 status_msg: '' choices: - finish_reason: dừng index: 0 message: audio_content: '' content: Xin chào! Tôi có thể giúp gì cho bạn? name: MiniMax AI reasoning_content: ...đã lược bỏ role: >- Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. created: 1755153113 id: 04ecb5d9b1921ae0fb0e8da9017a5474 input_sensitive: false input_sensitive_type: 0 model: MiniMax-M1 object: chat.completion output_sensitive: false output_sensitive_int: 0 output_sensitive_type: 0 usage: completion_tokens: 223 completion_tokens_details: reasoning_tokens: 214 prompt_tokens: 26 total_characters: 0 total_tokens: 249 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/Claude/Định dạng gốc x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208832-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Tạo cuộc trò chuyện tư duy" Nguồn: https://docs.openaihub.net/api-45208833/ > 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: /v1/chat/completions: post: summary: Tạo cuộc trò chuyện tư duy deprecated: false description: >- Cổng tương thích OpenAI hợp nhất. Chọn nguồn thượng nguồn thông qua `model`, ví dụ: - `gpt-4o` / `gpt-4o-audio-preview` → OpenAI - `gemini-2.5-flash-all` → Google Gemini (định dạng tương thích) - Với các mô hình khác, xem `GET /v1/models` Tài liệu chính thức của OpenAI: https://platform.openai.com/docs/api-reference/chat/create Định dạng tên mô hình là: gpt-4-gizmo-*, và hệ thống sẽ tự động nhận dạng. Ví dụ, GPTs này: https://chatgpt.com/g/g-B3hgivKK9-write-for-me Khi đó, tên mô hình của nó phải được điền là: gpt-4-gizmo-g-B3hgivKK9 Danh sách GPTs: https://chatgpt.com/gpts operationId: v1_chat_completions tags: - >- OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/Claude/Định dạng tương thích - Trò chuyện parameters: [] requestBody: content: application/json: schema: type: object required: - model - messages properties: enable_thinking: type: boolean description: >- Có bật chế độ suy luận hay không (phần mở rộng của kho này). Chỉ giá trị Boolean `true` mới có hiệu lực; hãy chọn một trong các giá trị của `extra_body.enable_thinking`. extra_body: type: object properties: enable_thinking: type: boolean description: >- Bật chế độ suy luận trong `extra_body`; chỉ chấp nhận giá trị `true`. google: type: object description: >- Các phần mở rộng hộp thoại Gemini như thinking_config, response_modalities. x-apidog-orders: [] description: >- Các tham số mở rộng cho hội thoại. Thường dùng: enable_thinking; một số mô hình Gemini có thể dùng google.thinking_config, vân vân. Việc tham số có hiệu lực hay không phụ thuộc vào kênh và mô hình. x-apifox-orders: - enable_thinking - google x-apidog-orders: - enable_thinking - google frequency_penalty: type: number description: >- Hệ số phạt tần suất, khoảng -2~2. Giá trị dương làm giảm xác suất lặp lại cùng một từ. logit_bias: type: object description: >- Điều chỉnh xác suất xuất hiện theo ID token, và giá trị là một đối tượng ánh xạ với các giá trị nằm trong khoảng từ -100 đến 100. x-apidog-orders: [] max_completion_tokens: type: integer description: >- Giới hạn token tối đa cho phần hoàn thành (thường được dùng hơn trong các mô hình suy luận như dòng o và GPT-5). `max_tokens` có thể được kế thừa khi không được thiết lập. max_tokens: type: integer description: >- Số lượng token tối đa được tạo trong phản hồi này (các trường dùng chung). messages: type: array items: type: object required: - role - content properties: content: oneOf: - type: string - type: array items: type: object required: - type properties: image_url: type: object required: - url properties: detail: type: string enum: - auto - low - high description: >- Độ chính xác khi hiểu hình ảnh: tự động/thấp/cao. url: type: string description: >- URL hình ảnh hoặc data:image/...;base64,... . description: >- Hình ảnh khi type=image_url. Nếu cổng kết nối bật proxy hình ảnh, url có thể bị thay thế. x-apifox-orders: - detail - url x-apidog-orders: - detail - url text: type: string description: Nội dung văn bản khi type=text. type: type: string enum: - text - image_url description: >- Loại khối nội dung: `text` là văn bản, `image_url` là hình ảnh. refName: Phần nội dung x-apifox-orders: - image_url - text - type x-apidog-orders: - image_url - text - type description: >- Nội dung tin nhắn: văn bản thuần túy hoặc mảng kết hợp hình ảnh và văn bản (xem ContentPart). name: type: string description: >- Tùy chọn. Phân biệt tên người nói trong các tình huống có nhiều người dùng. reasoning_content: type: string description: >- Văn bản về quá trình suy luận/tư duy (được dùng khi suy luận về các mô hình và tiếp nối ngữ cảnh). role: type: string enum: - system - user - assistant - tool - developer description: >- Vai trò của thông điệp. system: cài đặt hệ thống; user: người dùng; assistant: mô hình; tool: kết quả trả về của công cụ. tool_call_id: type: string description: >- Bắt buộc khi role là tool, tương ứng với tool_calls[].id của nội dung được trả về tại một thời điểm nhất định. tool_calls: type: array items: type: object properties: function: type: object properties: arguments: type: string description: Các tham số dưới dạng chuỗi JSON. name: type: string description: Tên description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - arguments - name x-apidog-orders: - arguments - name id: type: string description: >- Mã định danh lời gọi, thông điệp của công cụ cần tương ứng với tool_call_id. type: type: string enum: - function description: Kiểu x-apifox-orders: - function - id - type x-apidog-orders: - function - id - type description: >- Một danh sách các yêu cầu gọi công cụ (do mô hình khởi tạo) trong thông điệp của trợ lý. refName: Thông điệp x-apifox-orders: - content - name - reasoning_content - role - tool_call_id - tool_calls x-apidog-orders: - content - name - reasoning_content - role - tool_call_id - tool_calls description: >- Danh sách các tin nhắn trong cuộc hội thoại, ít nhất một tin nhắn. Hỗ trợ nhiều lượt: system/user/assistant/tool. model: type: string description: >- ID mô hình cần sử dụng. Cổng sẽ chọn các kênh bằng cách nhóm mã thông báo và có thể thực hiện ánh xạ tên mô hình hoặc phân giải hậu tố (chẳng hạn như -thinking, -search). 'n': type: integer description: >- Dịch tài liệu kỹ thuật này sang tiếng Việt. Giữ nguyên Markdown, mã nguồn, định danh, URL, đường dẫn, phần giữ chỗ, cấu trúc JSON và định dạng. Chỉ trả về văn bản đã dịch và không để lại ký tự Hán nào. Tạo một số phương án trả lời của trợ lý cho cùng một lượt đầu vào. parallel_tool_calls: type: boolean description: >- Có cho phép thực hiện nhiều lệnh gọi công cụ song song trong một phản hồi hay không (khi hệ thống đầu nguồn hỗ trợ). presence_penalty: type: number description: >- Có một hệ số phạt, khoảng -2~2. Giá trị dương làm giảm sự lặp lại của các biểu thức chủ đề đã xuất hiện. reasoning_effort: type: string description: >- Mức độ mạnh của mô hình suy luận (chẳng hạn như thấp / trung bình / cao). Giá trị này cũng có thể được cổng kết nối tự động chèn thông qua hậu tố của tên mô hình. response_format: type: object properties: json_schema: type: object description: Định nghĩa cấu trúc đầu ra khi type=json_schema. x-apidog-orders: [] type: type: string enum: - text - json_object - json_schema description: >- text: văn bản thông thường; json_object: đối tượng JSON; json_schema: đầu ra có cấu trúc theo schema. refName: ResponseFormat x-apifox-orders: - json_schema - type x-apidog-orders: - json_schema - type seed: type: number description: >- Hạt giống ngẫu nhiên, dùng để cố gắng thu được kết quả có thể tái tạo với cùng các tham số (không đảm bảo tính nhất quán hoàn toàn). Lưu ý rằng trường này có tên là seed. stop: oneOf: - type: string - type: array items: type: string description: >- Dừng việc tạo nội dung khi gặp các chuỗi này. Có thể là một chuỗi đơn hoặc một mảng chuỗi (tối đa 4 chuỗi). stream: type: boolean description: >- Có truyền phát đầu ra hay không. false: Trả về toàn bộ JSON trong một lần; true: Đẩy tăng dần qua SSE, kết thúc bằng data: [DONE]. stream_options: type: object properties: include_usage: type: boolean description: >- Liệu mức sử dụng (token prompt/completion) có được bao gồm ở cuối luồng hay không. refName: StreamOptions x-apifox-orders: - include_usage x-apidog-orders: - include_usage temperature: type: number description: >- Nhiệt độ lấy mẫu, thường nằm trong khoảng 0~2. Giá trị càng cao, phản hồi càng ngẫu nhiên; giá trị càng thấp, phản hồi càng ổn định. Thông thường, chỉ điều chỉnh một trong hai tham số này cùng với top_p. tool_choice: oneOf: - type: string enum: - none - auto - required - type: object properties: function: type: object required: - name properties: name: type: string description: Tên hàm bắt buộc phải được gọi. description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - name x-apidog-orders: - name type: type: string x-apifox-orders: - function - type x-apidog-orders: - function - type description: >- Dịch tài liệu kỹ thuật này sang tiếng Việt. Giữ nguyên Markdown, mã, định danh, URL, đường dẫn, phần giữ chỗ, cấu trúc JSON và định dạng. Chỉ trả về văn bản đã dịch và không để lại ký tự Hán nào. Kiểm soát việc có gọi công cụ hay không: none (không gọi), auto (tự động), required (bắt buộc phải gọi), hoặc chỉ định một hàm. tools: type: array items: type: object required: - type - function properties: function: type: object required: - name properties: description: type: string description: >- Phần mô tả chức năng giúp mô hình quyết định thời điểm gọi chức năng đó. name: type: string description: Tên hàm mà mô hình dùng để khởi tạo lệnh gọi. parameters: type: object description: Lược đồ JSON của các tham số hàm. x-apidog-orders: [] description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - description - name - parameters x-apidog-orders: - description - name - parameters type: type: string enum: - function description: Đã sửa thành hàm. refName: Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. x-apifox-orders: - function - type x-apidog-orders: - function - type description: >- Danh sách các công cụ (hàm) mà mô hình có thể gọi, được dùng để gọi hàm trong các cuộc hội thoại. top_p: type: number description: >- Lấy mẫu hạt nhân, 0~1. Chỉ lấy mẫu các token có xác suất tích lũy đạt đến top_p. user: type: string description: >- Mã định danh duy nhất của người dùng cuối giúp phát hiện hành vi lạm dụng và thống kê ở phía nền tảng. web_search_options: type: object properties: search_context_size: type: string enum: - high - medium - low description: >- Kích thước ngữ cảnh tìm kiếm trên Internet; nếu không được truyền, cổng mặc định sử dụng mức trung bình. user_location: type: object description: >- Vị trí địa lý của người dùng, v.v., được sử dụng cho kết quả tìm kiếm đã bản địa hóa (cấu trúc phụ thuộc vào nguồn cung cấp phía trên). x-apidog-orders: [] refName: WebSearchOptions x-apifox-orders: - search_context_size - user_location x-apidog-orders: - search_context_size - user_location refName: V1ChatCompletionsRequest description: >- Chỉ áp dụng cho các tình huống hội thoại nhiều lượt, tương ứng với các trường liên quan đến hội thoại của dto.GeneralOpenAIRequest. Bắt buộc: model, messages (không được để trống). Xác thực: Authorization: Bearer {API Key}. x-apifox-orders: - enable_thinking - extra_body - frequency_penalty - logit_bias - max_completion_tokens - max_tokens - messages - model - 'n' - parallel_tool_calls - presence_penalty - reasoning_effort - response_format - seed - stop - stream - stream_options - temperature - tool_choice - tools - top_p - user - web_search_options x-apidog-orders: - enable_thinking - extra_body - frequency_penalty - logit_bias - max_completion_tokens - max_tokens - messages - model - 'n' - parallel_tool_calls - presence_penalty - reasoning_effort - response_format - seed - stop - stream - stream_options - temperature - tool_choice - tools - top_p - user - web_search_options examples: deepseek_chat: value: extra_body: enable_thinking: true messages: - content: >- Có ba chiếc hộp, chỉ một hộp có phần thưởng. Bạn chọn hộp số 2, người dẫn chương trình mở hộp số 3 (trống), rồi hỏi bạn có muốn đổi sang hộp số 1 không? Hãy phân tích và đưa ra lời khuyên. role: user model: deepseek-chat stream: true stream_options: include_usage: true summary: deepseek_chat description: >- Khuyến nghị nâng cao: Hội thoại suy luận DeepSeek (truyền phát) · stream + extra_body.enable_thinking deepseek_ocr: value: messages: - content: - text: >- Hãy nhận dạng toàn bộ văn bản trong hình ảnh và xuất theo đúng thứ tự của bản gốc, không giải thích. type: text - image_url: detail: cao url: https://example.com/document-scan.png type: image_url role: user model: deepseek-ocr stream: false summary: deepseek_ocr description: >- Khuyến nghị nâng cao: DeepSeek-OCR để nhận dạng văn bản · image_url + từ khóa nhắc nhận dạng hình ảnh gemini_multimodal: value: messages: - content: - text: Trong bức ảnh này có gì? Vui lòng mô tả chi tiết. type: text - image_url: url: >- https://lsky.zhongzhuan.chat/i/2024/10/17/6711068a14527.png type: image_url role: user model: gemini-2.5-flash-all stream: true temperature: 0.5 top_p: 1 summary: gemini_multimodal description: Gemini đa phương thức (khả năng hiểu hình ảnh) gpt4o_audio: value: audio: format: wav voice: hợp kim messages: - content: >- Chó golden retriever có phải là giống chó phù hợp với gia đình không? role: user modalities: - văn bản - âm thanh model: gpt-4o-audio-preview summary: gpt4o_audio description: Đầu ra âm thanh của GPT-4o gpt_4_gizmo_g_2fkfe8rbu: value: messages: - content: Bạn là ai? role: user model: gpt-4-gizmo-g-2fkFE8rbu stream: false summary: gpt_4_gizmo_g_2fkfe8rbu description: Đối thoại GPTs gpt_4o: value: messages: - content: Bạn là một cô gái mèo luôn sẵn lòng giúp đỡ mọi người. role: Vui lòng cung cấp tài liệu kỹ thuật cần dịch. - content: Hãy giúp tôi tóm tắt HTTP là gì. role: user model: gpt-4o summary: gpt_4o description: >- Khuyến nghị cho người mới bắt đầu: hội thoại cơ bản (không truyền phát) gpt_4o_10: value: messages: - content: - text: Tóm tắt nội dung hình ảnh và trả lời theo từng ý. type: text - image_url: detail: cao url: https://example.com/demo.jpg type: image_url role: user model: gpt-4o stream: false summary: gpt_4o_10 description: >- Đề xuất nâng cao: Hình ảnh hội thoại (không truyền phát) · extra_body.google.response_modalities + image_config gpt_4o_11: value: max_tokens: 256 messages: - content: Giới thiệu API gateway là gì trong một câu. role: user model: gpt-4o 'n': 2 temperature: 0.8 summary: gpt_4o_11 description: 'Khuyến nghị nâng cao: nhiều phản hồi ứng viên · n' gpt_4o_12: value: functions: - description: Tra cứu thời tiết thành phố name: get_weather parameters: properties: city: description: Tên thành phố type: string x-i18n: en-US: description: tên thành phố required: - city type: object x-i18n: en-US: description: Kiểm tra thời tiết thành phố messages: - content: Thời tiết ở Bắc Kinh hiện giờ thế nào? role: user model: gpt-4o tool_choice: tự động summary: gpt_4o_12 description: >- Khuyến nghị nâng cao: Gọi hàm (phiên bản cũ) · functions + tool_choice gpt_4o_2: value: messages: - content: >- Hãy dùng 3 câu để giải thích token là gì và đưa ra một ví dụ. role: user model: gpt-4o stream: true stream_options: include_usage: true summary: gpt_4o_2 description: >- Khuyến nghị cho người mới: Hội thoại truyền phát · stream + stream_options.include_usage gpt_4o_3: value: messages: - content: >- Viết một đoạn nội dung quảng bá sản phẩm không quá 200 chữ; khi gặp STOP thì dừng lại. role: user model: gpt-4o stop: - Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. - DỪNG LẠI temperature: 0.4 top_p: 0.9 summary: gpt_4o_3 description: >- Khuyến nghị nâng cao: Kiểm soát lấy mẫu: temperature + top_p + stop gpt_4o_4: value: messages: - content: Thời tiết ở Bắc Kinh hôm nay thế nào? role: user model: gpt-4o tool_choice: tự động tools: - function: description: Lấy thông tin thời tiết của thành phố được chỉ định name: get_weather parameters: properties: city: description: Tên thành phố type: string x-i18n: en-US: description: tên thành phố required: - city type: object x-i18n: en-US: description: >- Lấy thông tin thời tiết cho một thành phố được chỉ định type: function summary: gpt_4o_4 description: 'Khuyến nghị nâng cao: gọi công cụ (tools + tool_choice)' gpt_4o_5: value: messages: - content: >- {"title":"Cách viết tài liệu API","bullets":["Mô tả mục đích, phạm vi và đối tượng sử dụng của API.","Liệt kê URL, phương thức HTTP, tiêu đề yêu cầu và cơ chế xác thực.","Giải thích rõ tham số đường dẫn, tham số truy vấn và nội dung yêu cầu, bao gồm kiểu dữ liệu, điều kiện bắt buộc và giá trị mẫu.","Cung cấp ví dụ yêu cầu và phản hồi, đồng thời giữ nguyên định dạng JSON.","Ghi rõ mã trạng thái HTTP, mã lỗi, thông báo lỗi và cách xử lý.","Nêu quy tắc phân trang, giới hạn tần suất, phiên bản API và lịch sử thay đổi."]} role: user model: gpt-4o response_format: type: json_object summary: gpt_4o_5 description: >- Khuyến nghị nâng cao: Bắt buộc đầu ra có cấu trúc (response_format) gpt_4o_6: value: messages: - content: - text: >- Trong bức ảnh này có gì? Vui lòng mô tả bằng tiếng Trung và đưa ra những bối cảnh có thể xảy ra. type: text - image_url: detail: cao url: https://example.com/image.jpg type: image_url role: user model: gpt-4o summary: gpt_4o_6 description: >- Khuyến nghị nâng cao: Ví dụ đa phương thức: messages.content với hình ảnh (image_url gpt_4o_7: value: messages: - content: >- Gần đây có những bài viết chất lượng cao nào về tác nhân AI? Hãy cung cấp cho tôi 3 bài và mô tả ngắn gọn. role: user model: gpt-4o web_search_options: search_context_size: trung bình summary: gpt_4o_7 description: >- Khuyến nghị nâng cao: Các tùy chọn mạng/tìm kiếm (web_search_options) gpt_4o_8: value: messages: - content: - text: Hãy mô tả bức ảnh này bằng tiếng Trung. type: text - image_url: detail: cao url: https://example.com/demo.jpg type: image_url role: user model: gpt-4o stream: true summary: gpt_4o_8 description: >- Đề xuất nâng cao: Hội thoại bằng hình ảnh và văn bản (truyền liên tục) · stream + image_url.url gpt_4o_9: value: messages: - content: - text: Chữ trong hình là gì? type: text - image_url: detail: tự động url: >- data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg== type: image_url role: user model: gpt-4o stream: true summary: gpt_4o_9 description: >- Khuyến nghị nâng cao: Đối thoại bằng hình ảnh và văn bản (truyền phát) · stream + image_url (base64) o3_mini: value: max_completion_tokens: 2000 messages: - content: >- Chứng minh: Nếu n là số lẻ thì n² cũng là số lẻ. Hãy suy luận từng bước. role: user model: o3-mini reasoning_effort: cao summary: o3_mini description: >- Khuyến nghị nâng cao: Kiểm soát mức độ nỗ lực của mô hình suy luận (reasoning_effort) qwen_max: value: extra_body: enable_thinking: true messages: - content: >- Tính toán: Nếu một hệ thống xử lý 120 yêu cầu mỗi giây, thì trong 5 phút hệ thống đó có thể xử lý bao nhiêu yêu cầu? Hãy trình bày quá trình tính. 5 phút = 5 × 60 = 300 giây Tổng số yêu cầu có thể xử lý = 120 × 300 = 36.000 yêu cầu Đáp án: Hệ thống có thể xử lý 36.000 yêu cầu trong 5 phút. role: user model: qwen-max summary: qwen_max description: >- Khuyến nghị nâng cao: sử dụng chế độ suy luận (`enable_thinking` / `extra_body.enable_thinking`) qwen_mt_turbo: value: messages: - content: >- Vui lòng dịch đoạn tiếng Anh dưới đây sang tiếng Trung giản thể, chỉ xuất bản dịch: Xin chào, chào mừng bạn đến với nền tảng API của chúng tôi. role: user model: qwen-mt-turbo stream: false summary: qwen_mt_turbo description: 'Đề xuất nâng cao: dịch máy · model(qwen-mt) + messages' responses: '200': description: '' content: application/json: schema: type: object required: - id - object - created - model - choices - usage - system_fingerprint - service_tier properties: choices: type: array items: type: object properties: finish_reason: type: string description: 'Lý do kết thúc, ví dụ: stop, length' index: type: integer description: Chỉ mục của mục ứng viên logprobs: type: string description: Thông tin xác suất lôgarit (nếu được bật) nullable: true message: type: object required: - role - content - refusal - annotations properties: annotations: type: array items: type: string description: Chú thích / thông tin trích dẫn content: type: string description: Nội dung tin nhắn hoặc yêu cầu refusal: type: string description: Nội dung từ chối (nếu có) nullable: true role: type: string description: >- Vai trò của tin nhắn, ví dụ: system / user / assistant / model description: Vui lòng cung cấp nội dung tài liệu cần dịch. x-apifox-orders: - annotations - content - refusal - role x-apidog-orders: - annotations - content - refusal - role x-apifox-orders: - finish_reason - index - logprobs - message x-apidog-orders: - finish_reason - index - logprobs - message description: Danh sách các kết quả ứng viên created: type: integer description: Thời gian tạo (dấu thời gian Unix) id: type: string description: ID tài nguyên hoặc tác vụ model: type: string description: Tên mô hình / mã định danh mô hình object: type: string description: 'Định danh kiểu đối tượng, ví dụ: chat.completion' service_tier: type: string description: Cấp dịch vụ / mức ưu tiên system_fingerprint: type: string description: Dấu vân tay cấu hình phía máy chủ usage: type: object required: - prompt_tokens - completion_tokens - total_tokens - prompt_tokens_details - completion_tokens_details - latency_checkpoint properties: completion_tokens: type: integer description: Số lượng token hoàn thành completion_tokens_details: type: object required: - reasoning_tokens - audio_tokens - accepted_prediction_tokens - rejected_prediction_tokens properties: accepted_prediction_tokens: type: integer description: Số lượng token dự đoán được chấp nhận audio_tokens: type: integer description: Số lượng token liên quan đến âm thanh reasoning_tokens: type: integer description: Số token được sử dụng trong quá trình suy luận rejected_prediction_tokens: type: integer description: Số lượng token dự đoán bị từ chối description: Phân tích chi tiết số token hoàn thành x-apifox-orders: - accepted_prediction_tokens - audio_tokens - reasoning_tokens - rejected_prediction_tokens x-apidog-orders: - accepted_prediction_tokens - audio_tokens - reasoning_tokens - rejected_prediction_tokens latency_checkpoint: type: object required: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms properties: engine_tbt_ms: type: integer description: Thời gian giữa các token của engine (ms) engine_ttft_ms: type: integer description: Thời gian của bộ máy đến token đầu tiên (ms) engine_ttlt_ms: type: integer description: Tổng độ trễ của bộ máy (ms) pre_inference_ms: type: integer description: Thời gian chuẩn bị trước khi suy luận (ms) service_tbt_ms: type: integer description: >- Khoảng thời gian giữa các token ở phía dịch vụ (ms) service_ttft_ms: type: integer description: Thời gian từ phía dịch vụ đến mã từ đầu tiên (ms) service_ttlt_ms: type: integer description: Tổng độ trễ phía dịch vụ (ms) total_duration_ms: type: integer description: Tổng thời lượng (ms) user_visible_ttft_ms: type: integer description: >- Thời gian đến token đầu tiên mà người dùng nhìn thấy (ms) description: Thông tin điểm kiểm tra độ trễ x-apifox-orders: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms x-apidog-orders: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms prompt_tokens: type: integer description: Số lượng token trong lời nhắc prompt_tokens_details: type: object required: - cached_tokens - audio_tokens properties: audio_tokens: type: integer description: Số lượng token liên quan đến âm thanh cached_tokens: type: integer description: Số lượng token trúng bộ nhớ đệm description: Phân tích chi tiết token của lời nhắc x-apifox-orders: - audio_tokens - cached_tokens x-apidog-orders: - audio_tokens - cached_tokens total_tokens: type: integer description: Tổng số token description: Thống kê mức sử dụng token x-apifox-orders: - completion_tokens - completion_tokens_details - latency_checkpoint - prompt_tokens - prompt_tokens_details - total_tokens x-apidog-orders: - completion_tokens - completion_tokens_details - latency_checkpoint - prompt_tokens - prompt_tokens_details - total_tokens refName: V1ChatCompletionsResponse x-apifox-orders: - choices - created - id - model - object - service_tier - system_fingerprint - usage x-apidog-orders: - choices - created - id - model - object - service_tier - system_fingerprint - usage examples: example: summary: example value: choices: - finish_reason: dừng index: 0 logprobs: '' message: annotations: [] content: Xin chào, hôm nay tôi có thể hỗ trợ bạn như thế nào? refusal: '' role: >- Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. created: 1677652288 id: chatcmpl-123 model: gpt-4o object: chat.completion service_tier: mặc định system_fingerprint: fp_abc123 usage: completion_tokens: 12 completion_tokens_details: accepted_prediction_tokens: 0 audio_tokens: 0 reasoning_tokens: 0 rejected_prediction_tokens: 0 latency_checkpoint: engine_tbt_ms: 0 engine_ttft_ms: 0 engine_ttlt_ms: 0 pre_inference_ms: 0 service_tbt_ms: 0 service_ttft_ms: 0 service_ttlt_ms: 0 total_duration_ms: 0 user_visible_ttft_ms: 0 prompt_tokens: 9 prompt_tokens_details: audio_tokens: 0 cached_tokens: 0 total_tokens: 21 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/Claude/Định dạng tương thích x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208833-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch." Nguồn: https://docs.openaihub.net/api-45208834/ > 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: /v1/messages: post: summary: Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. deprecated: false description: >- Điểm cuối trò chuyện văn bản MiniMax (đường dẫn xuất của Apifox là `/v1/messages`, không có tiền tố `/minimax/v1/`). https://platform.minimaxi.com/docs/api-reference/text-post operationId: minimax_v1_messages tags: - >- OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/Claude/Định dạng gốc · có cấu trúc / tìm kiếm trên web - MiniMax parameters: [] requestBody: content: application/json: schema: type: object required: - model - messages properties: max_completion_tokens: type: integer description: Số lượng token hoàn thành tối đa messages: type: array items: type: object required: - role - name - content properties: content: type: string description: Nội dung tin nhắn hoặc yêu cầu name: type: string description: Tên role: type: string description: >- Vai trò của tin nhắn, ví dụ: system / user / assistant / model x-apifox-orders: - content - name - role x-apidog-orders: - content - name - role description: Danh sách các tin nhắn trong cuộc trò chuyện model: type: string description: Tên mô hình / mã định danh mô hình stream: type: boolean description: Có truyền phát phản hồi hay không stream_options: type: object required: - include_usage properties: include_usage: type: boolean description: Có bao gồm thông tin sử dụng ở cuối luồng hay không description: Tùy chọn truyền luồng x-apifox-orders: - include_usage x-apidog-orders: - include_usage temperature: type: number description: >- Nhiệt độ lấy mẫu; giá trị càng cao thì kết quả càng ngẫu nhiên top_p: type: number description: Ngưỡng xác suất lấy mẫu nucleus refName: PostV1MessagesRequest x-apifox-orders: - max_completion_tokens - messages - model - stream - stream_options - temperature - top_p x-apidog-orders: - max_completion_tokens - messages - model - stream - stream_options - temperature - top_p examples: minimax_m2_1: value: max_completion_tokens: 2048 messages: - content: Bạn là một trợ lý AI chuyên nghiệp và thân thiện. name: Trợ lý AI role: Vui lòng cung cấp tài liệu kỹ thuật cần dịch. x-i18n: en-US: name: AI assistant - content: Hãy giúp tôi viết một bài thơ về mùa thu. name: Trương Tam role: user x-i18n: en-US: name: John Doe model: MiniMax-M2.1 stream: true stream_options: include_usage: true temperature: 0.9 top_p: 0.95 summary: minimax_m2_1 description: tổng hợp văn bản responses: '200': description: '' content: application/json: schema: type: object required: - id - choices - created - model - object - usage - input_sensitive - output_sensitive - input_sensitive_type - output_sensitive_type - output_sensitive_int - base_resp properties: base_resp: type: object required: - status_code - status_msg properties: status_code: type: integer description: Mã trạng thái status_msg: type: string description: Thông báo trạng thái description: >- Trình bao phản hồi của dịch vụ nền (mã trạng thái / thông báo) x-apifox-orders: - status_code - status_msg x-apidog-orders: - status_code - status_msg choices: type: array items: type: object properties: finish_reason: type: string description: 'Lý do kết thúc, ví dụ: stop, length' index: type: integer description: Chỉ mục của mục ứng viên message: type: object required: - content - role - name - audio_content - reasoning_content properties: audio_content: type: string description: Nội dung âm thanh (thường ở dạng Base64) content: type: string description: Nội dung tin nhắn hoặc yêu cầu name: type: string description: Tên reasoning_content: type: string description: Văn bản về quá trình suy luận role: type: string description: >- Vai trò của tin nhắn, ví dụ: system / user / assistant / model description: Vui lòng cung cấp nội dung tài liệu cần dịch. x-apifox-orders: - audio_content - content - name - reasoning_content - role x-apidog-orders: - audio_content - content - name - reasoning_content - role x-apifox-orders: - finish_reason - index - message x-apidog-orders: - finish_reason - index - message description: Danh sách các kết quả ứng viên created: type: integer description: Thời gian tạo (dấu thời gian Unix) id: type: string description: ID tài nguyên hoặc tác vụ input_sensitive: type: boolean description: >- Liệu đầu vào có kích hoạt cơ chế phát hiện nội dung nhạy cảm hay không input_sensitive_type: type: integer description: Loại nội dung nhạy cảm đầu vào model: type: string description: Tên mô hình / mã định danh mô hình object: type: string description: 'Định danh kiểu đối tượng, ví dụ: chat.completion' output_sensitive: type: boolean description: >- Liệu đầu ra có kích hoạt cơ chế phát hiện nội dung nhạy cảm hay không output_sensitive_int: type: integer description: Mức độ nội dung nhạy cảm của đầu ra output_sensitive_type: type: integer description: Loại nội dung nhạy cảm trong đầu ra usage: type: object required: - total_tokens - total_characters - prompt_tokens - completion_tokens - completion_tokens_details properties: completion_tokens: type: integer description: Số lượng token hoàn thành completion_tokens_details: type: object required: - reasoning_tokens properties: reasoning_tokens: type: integer description: Số token được sử dụng trong quá trình suy luận description: Phân tích chi tiết số token hoàn thành x-apifox-orders: - reasoning_tokens x-apidog-orders: - reasoning_tokens prompt_tokens: type: integer description: Số lượng token trong lời nhắc total_characters: type: integer description: Tổng số ký tự total_tokens: type: integer description: Tổng số token description: Thống kê mức sử dụng token x-apifox-orders: - completion_tokens - completion_tokens_details - prompt_tokens - total_characters - total_tokens x-apidog-orders: - completion_tokens - completion_tokens_details - prompt_tokens - total_characters - total_tokens refName: PostV1MessagesResponse x-apifox-orders: - base_resp - choices - created - id - input_sensitive - input_sensitive_type - model - object - output_sensitive - output_sensitive_int - output_sensitive_type - usage x-apidog-orders: - base_resp - choices - created - id - input_sensitive - input_sensitive_type - model - object - output_sensitive - output_sensitive_int - output_sensitive_type - usage examples: example: summary: example value: base_resp: status_code: 0 status_msg: '' choices: - finish_reason: dừng index: 0 message: audio_content: '' content: Xin chào! Tôi có thể giúp gì cho bạn? name: MiniMax AI reasoning_content: ...đã lược bỏ role: >- Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. created: 1755153113 id: 04ecb5d9b1921ae0fb0e8da9017a5474 input_sensitive: false input_sensitive_type: 0 model: MiniMax-M1 object: chat.completion output_sensitive: false output_sensitive_int: 0 output_sensitive_type: 0 usage: completion_tokens: 223 completion_tokens_details: reasoning_tokens: 214 prompt_tokens: 26 total_characters: 0 total_tokens: 249 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/Claude/Định dạng gốc · có cấu trúc / tìm kiếm trên web x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208834-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "tạo văn bản" Nguồn: https://docs.openaihub.net/api-45208835/ > 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/gemini-2.5-pro:generateContent: post: summary: tạo văn bản deprecated: false description: >- Tài liệu chính thức: https://ai.google.dev/gemini-api/docs/video-understanding?hl=zh-cn operationId: gemini_v1beta_2_5_pro_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 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: >- Phần dữ liệu (thường là Base64 hoặc một đối tượng có cấu trúc) mime_type: type: string description: >- Loại MIME của phương tiện, ví dụ: image/png, audio/wav description: Dữ liệu phương tiện nội tuyến 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: Các phần nội dung (văn bản, hình ảnh, âm thanh, v.v.) x-apifox-orders: - parts x-apidog-orders: - parts description: Danh sách nội dung (nhiều lượt / đa phương thức) x-apifox-orders: - contents x-apidog-orders: - contents examples: _url_single: value: contents: - parts: - file_data: file_uri: >- Vui lòng dán nội dung tài liệu cần dịch; URL API này không thể được truy cập trực tiếp nếu không có thông tin xác thực. mime_type: video/mp4 - text: Vui lòng tóm tắt video trong 3 câu. role: user summary: _url_single description: Khả năng hiểu video-url [định dạng gốc] đang được phát triển 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-45208835-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Sinh văn bản (luồng)" Nguồn: https://docs.openaihub.net/api-45208836/ > 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/gemini-3-pro-preview:streamGenerateContent: post: summary: Sinh văn bản (luồng) deprecated: false description: >- Vui lòng cung cấp nội dung tài liệu cần dịch. Tôi không thể truy cập trực tiếp nội dung từ URL đã cung cấp. operationId: gemini_v1beta_3_pro_preview_stream_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: alt in: query description: Định dạng phản hồi; sse thường được dùng để truyền phát trực tuyến required: false example: sse 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 properties: contents: type: array items: type: object properties: parts: type: array items: type: object properties: text: type: string description: Vui lòng cung cấp nội dung văn bản cần dịch. x-apifox-orders: - text x-apidog-orders: - text description: Các phần nội dung (văn bản, hình ảnh, âm thanh, v.v.) x-apifox-orders: - parts x-apidog-orders: - parts description: Danh sách nội dung (nhiều lượt / đa phương thức) x-apifox-orders: - contents x-apidog-orders: - contents examples: __single: value: contents: - parts: - text: Xin chào role: user generationConfig: temperature: 1 thinkingConfig: includeThoughts: true thinkingBudget: 26240 topP: 1 systemInstruction: parts: - text: Bạn là một con mèo. Tên của bạn là Neko. summary: __single description: luồng tạo văn bản 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-45208836-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Tạo văn bản + suy luận (luồng)" Nguồn: https://docs.openaihub.net/api-45208837/ > 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/gemini-2.5-pro:streamGenerateContent: post: summary: Tạo văn bản + suy luận (luồng) deprecated: false description: >- Vui lòng cung cấp nội dung tài liệu cần dịch. Tôi không thể truy cập trực tiếp nội dung từ URL đã cung cấp. operationId: gemini_v1beta_2_5_pro_stream_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: alt in: query description: Định dạng phản hồi; sse thường được dùng để truyền phát trực tuyến required: false example: sse 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 properties: contents: type: array items: type: object properties: parts: type: array items: type: object properties: text: type: string description: Vui lòng cung cấp nội dung văn bản cần dịch. x-apifox-orders: - text x-apidog-orders: - text description: Các phần nội dung (văn bản, hình ảnh, âm thanh, v.v.) x-apifox-orders: - parts x-apidog-orders: - parts description: Danh sách nội dung (nhiều lượt / đa phương thức) x-apifox-orders: - contents x-apidog-orders: - contents examples: __single: value: contents: - parts: - text: 1+2+3+4+5+....+999? role: user generationConfig: temperature: 1 thinkingConfig: includeThoughts: true thinkingBudget: 26240 topP: 1 safetySettings: - category: HARM_CATEGORY_HATE_SPEECH threshold: TẮT - category: HARM_CATEGORY_SEXUALLY_EXPLICIT threshold: TẮT - category: HẠNG_MỤC_GÂY_RỐI threshold: TẮT - category: HARM_CATEGORY_DANGEROUS_CONTENT threshold: TẮT - category: HARM_CATEGORY_CIVIC_INTEGRITY threshold: BLOCK_NONE systemInstruction: parts: - text: xin chào role: user tools: [] summary: __single description: Tạo văn bản + luồng suy nghĩ 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-45208837-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Tạo hình ảnh" Nguồn: https://docs.openaihub.net/api-45208838/ > 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/{modeName}:generateContent: post: summary: Tạo hình ảnh deprecated: false description: >- Tài liệu chính thức: https://ai.google.dev/gemini-api/docs/image-generation?hl=zh-cn operationId: gemini_v1beta_mode_name_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: modeName in: path description: |- Tên mô hình: gemini-2.5-flash-image gemini-2.5-flash-image-preview gemini-3-pro-image-preview gemini-3.1-flash-image-preview required: true example: gemini-2.5-flash-image-preview schema: type: string - 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 properties: contents: type: array items: type: object required: - parts properties: parts: type: array items: type: object properties: inline_data: type: object required: - mime_type - data properties: data: type: string description: >- Base64 của hình ảnh hỗ trợ tối đa 14 hình ảnh đầu vào. mime_type: type: string description: Kiểu MIME của hình ảnh description: Dữ liệu được nhúng trong hình ảnh x-apifox-orders: - data - mime_type x-apidog-orders: - data - mime_type text: type: string description: từ trong lời nhắc 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 properties: imageConfig: type: object properties: aspectRatio: type: string description: >- Tỷ lệ khung hình: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 hỗ trợ tất cả các mô hình 1:4, 1:8, 4:1 và 8:1 chỉ hỗ trợ các mô hình Gemini 3.1. imageSize: type: string description: >- Độ phân giải: 0.5K, 1K, 2K, 4K Mặc định: 1K Lưu ý: Gemini 2.5 chỉ hỗ trợ 1K, 0.5K chỉ hỗ trợ mô hình Gemini 3.1, giá trị phải được điền là "512" description: Cấu hình hình ảnh x-apifox-orders: - aspectRatio - imageSize x-apidog-orders: - aspectRatio - imageSize responseModalities: type: array items: type: string description: |- Chế độ phản hồi: Text, Image Mặc định: ["Text", "Image"] description: Tạo cấu hình x-apifox-orders: - imageConfig - responseModalities x-apidog-orders: - imageConfig - 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: PostV1betaModelsModeNameGenerateContentRequest x-apifox-orders: - contents - generationConfig - response_format x-apidog-orders: - contents - generationConfig - response_format examples: {} 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-45208838-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Tạo hình ảnh gemini-2.5-flash-image" Nguồn: https://docs.openaihub.net/api-45208839/ > 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/gemini-2.5-flash-image:generateContent: post: summary: Tạo hình ảnh gemini-2.5-flash-image 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_2_5_flash_image_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 - imageConfig properties: imageConfig: type: object required: - aspectRatio properties: aspectRatio: type: string description: >- Tỷ lệ khung hình của ảnh đầu ra, ví dụ: 1:1, 16:9, 9:16 description: Cấu hình đầu ra hình ảnh x-apifox-orders: - aspectRatio x-apidog-orders: - aspectRatio 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: - imageConfig - responseModalities x-apidog-orders: - imageConfig - 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: PostV1betaModelsGemini25FlashImageGenerateContentRequest x-apifox-orders: - contents - generationConfig - response_format x-apidog-orders: - contents - generationConfig - response_format examples: gemini_25_flash_image_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: '16:9' responseModalities: - Vui lòng cung cấp nội dung tài liệu cần dịch. - HÌNH ẢNH summary: gemini_25_flash_image_single description: >- Tính năng tạo ảnh gemini-2.5-flash-image kiểm soát tỷ lệ khung hình gemini_25_flash_image_single_2: 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: '16:9' 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: gemini_25_flash_image_single_2 description: >- Tính năng tạo ảnh gemini-2.5-flash-image kiểm soát tỷ lệ khung hì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-45208839-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Tạo ảnh bằng gemini-3-pro-image-preview, kiểm soát tỷ lệ khung hình + độ rõ nét" Nguồn: https://docs.openaihub.net/api-45208840/ > 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/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: [] ``` --- # "tìm kiếm trên Google" Nguồn: https://docs.openaihub.net/api-45208841/ > 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/gemini-2.5-flash:generateContent: post: summary: tìm kiếm trên Google 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_2_5_flash_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 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: >- Phần dữ liệu (thường là Base64 hoặc một đối tượng có cấu trúc) mime_type: type: string description: >- Loại MIME của phương tiện, ví dụ: image/png, audio/wav description: Dữ liệu phương tiện nội tuyến 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: Các phần nội dung (văn bản, hình ảnh, âm thanh, v.v.) x-apifox-orders: - parts x-apidog-orders: - parts description: Danh sách nội dung (nhiều lượt / đa phương thức) x-apifox-orders: - contents x-apidog-orders: - contents examples: google_search_single: value: contents: - parts: - text: Hôm nay thời tiết ở Trùng Khánh thế nào? role: user tools: - googleSearch: {} summary: google_search_single description: tìm kiếm trên Google 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-45208841-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Imagen 4 đang được phát triển" Nguồn: https://docs.openaihub.net/api-45208842/ > 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-generate-001:predict: post: summary: Imagen 4 đang được phát triển deprecated: false description: >- Tài liệu chính thức: https://ai.google.dev/gemini-api/docs/image-generation?hl=zh-cn operationId: gemini_v1beta_imagen_4_0_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: PostV1betaModelsImagen40Generate001PredictRequest x-apifox-orders: - instances - parameters x-apidog-orders: - instances - parameters examples: imagen_4_single: value: instances: - prompt: Bé gái parameters: sampleCount: 4 summary: imagen_4_single description: Imagen 4 đang được phát triển 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-45208842-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Tạo văn bản gemini-3-pro-preview:generateContent" Nguồn: https://docs.openaihub.net/api-45208843/ > 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/gemini-3-pro-preview:generateContent: post: summary: Tạo văn bản gemini-3-pro-preview:generateContent deprecated: false description: >- Vui lòng cung cấp nội dung tài liệu cần dịch. Tôi không thể truy cập trực tiếp nội dung từ URL đã cung cấp. operationId: gemini_v1beta_3_pro_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 properties: contents: type: array items: type: object properties: parts: type: array items: type: object properties: text: type: string description: Vui lòng cung cấp nội dung văn bản cần dịch. x-apifox-orders: - text x-apidog-orders: - text description: Các phần nội dung (văn bản, hình ảnh, âm thanh, v.v.) x-apifox-orders: - parts x-apidog-orders: - parts description: Danh sách nội dung (nhiều lượt / đa phương thức) x-apifox-orders: - contents x-apidog-orders: - contents examples: gemini_3_pro_previewgeneratecontent_single: value: contents: - parts: - text: Bạn là ai? role: user generationConfig: temperature: 1 thinkingConfig: includeThoughts: true thinkingBudget: 26240 topP: 1 systemInstruction: parts: - text: >- Bạn là một chú heo con. Bạn sẽ thêm 'ụt ịt' vào đầu câu trả lời. summary: gemini_3_pro_previewgeneratecontent_single description: Tạo văn bản gemini-3-pro-preview:generateContent 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-45208843-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "gemini-tts chuyển văn bản thành giọng nói" Nguồn: https://docs.openaihub.net/api-45208844/ > 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/gemini-2.5-pro-preview-tts:generateContent: post: summary: gemini-tts chuyển văn bản thành giọng nói deprecated: false description: >- Vui lòng cung cấp nội dung tài liệu cần dịch. Tôi không thể truy cập trực tiếp nội dung từ URL đã cung cấp. operationId: gemini_v1beta_2_5_pro_preview_tts_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: text: type: string description: Nội dung văn bản để tổng hợp thành giọng nói description: Phần văn bản x-apifox-orders: - text x-apidog-orders: - text description: Các phần nội dung; TTS sử dụng văn bản description: Nội dung một lượt x-apifox-orders: - parts x-apidog-orders: - parts description: >- Nội dung cuộc trò chuyện; cung cấp văn bản để đọc trong parts.text generationConfig: type: object required: - responseModalities - speechConfig properties: responseModalities: type: array items: type: string description: Tên phương thức, thường là AUDIO description: >- Các phương thức phản hồi; đối với TTS, hãy sử dụng ["AUDIO"] speechConfig: type: object required: - voiceConfig properties: voiceConfig: type: object required: - prebuiltVoiceConfig properties: prebuiltVoiceConfig: type: object required: - voiceName properties: voiceName: type: string description: >- Tên giọng nói cài sẵn, ví dụ: Kore, Puck, Charon, Fenrir, Aoede description: >- Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. x-apifox-orders: - voiceName x-apidog-orders: - voiceName description: Cấu hình giọng nói; chỉ định tên giọng nói định sẵn x-apifox-orders: - prebuiltVoiceConfig x-apidog-orders: - prebuiltVoiceConfig description: Cấu hình tổng hợp giọng nói x-apifox-orders: - voiceConfig x-apidog-orders: - voiceConfig description: >- Cấu hình tạo; phải bao gồm phương thức AUDIO và cấu hình giọng nói x-apifox-orders: - responseModalities - speechConfig x-apidog-orders: - responseModalities - speechConfig refName: PostV1betaModelsGemini25ProPreviewTtsGenerateContentRequest description: >- Nội dung yêu cầu chuyển văn bản thành giọng nói của Gemini 2.5 Pro Preview TTS x-apifox-orders: - contents - generationConfig x-apidog-orders: - contents - generationConfig examples: gemini_tts_single: value: contents: - parts: - text: Chúc bạn một ngày thật tuyệt vời! generationConfig: responseModalities: - ÂM THANH speechConfig: voiceConfig: prebuiltVoiceConfig: voiceName: Kore summary: gemini_tts_single description: gemini-tts chuyển văn bản thành giọng nói responses: '200': description: '' content: application/json: schema: type: object x-apidog-orders: [] examples: example: summary: example value: candidates: - content: parts: - inlineData: data: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... mimeType: audio/L16;codec=pcm;rate=24000 role: mô hình finishReason: DỪNG LẠI index: 0 safetyRatings: [] modelVersion: gemini-2.5-pro-preview-tts promptFeedback: safetyRatings: [] responseId: nXxoaf7mPM6j_uMPyICzkQo usageMetadata: candidatesTokenCount: 51 promptTokenCount: 9 promptTokensDetails: - modality: Vui lòng cung cấp nội dung tài liệu cần dịch. tokenCount: 9 thoughtsTokenCount: 0 totalTokenCount: 60 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-45208844-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Nhúng" Nguồn: https://docs.openaihub.net/api-45208845/ > 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/gemini-embedding-001:embedContent: post: summary: Nhúng deprecated: false description: >- https://ai.google.dev/gemini-api/docs/embeddings?hl=zh-cn#rest_3 Tài liệu chính thức operationId: gemini_v1beta_embedding_001_embed_content tags: - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/Gemini/Định dạng gốc - Gemini v1beta parameters: - 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: false example: application/json schema: type: string requestBody: content: application/json: schema: type: object required: - content properties: content: type: object properties: parts: type: array items: type: object properties: text: type: string description: Vui lòng cung cấp nội dung văn bản cần dịch. x-apifox-orders: - text x-apidog-orders: - 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. description: Nội dung cần nhúng. x-apifox-orders: - parts x-apidog-orders: - parts output_dimensionality: type: integer description: Tùy chọn giảm số chiều của biểu diễn nhúng đầu ra. taskType: type: string description: Loại tác vụ tùy chọn mà embedding sẽ được sử dụng cho. refName: PostV1betaModelsGeminiEmbedding001EmbedContentRequest x-apifox-orders: - content - output_dimensionality - taskType x-apidog-orders: - content - output_dimensionality - taskType examples: example_single: value: content: parts: - text: Ý nghĩa của cuộc sống là gì? output_dimensionality: 768 taskType: SEMANTIC_SIMILARITY summary: example_single description: nhúng văn bản responses: '200': description: '' content: application/json: schema: type: object properties: embeddings: type: object description: Danh sách các vectơ nhúng x-apidog-orders: [] x-apifox-orders: - embeddings x-apidog-orders: - embeddings examples: example: summary: example value: embedding: values: - -0.0296398 - -0.010636787 - 0.012426536 - -0.043735605 - -0.012861362 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-45208845-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "gemini-3.1-flash-lite-image" Nguồn: https://docs.openaihub.net/api-45208846/ > 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/gemini-3.1-flash-lite-image:generateContent: post: summary: gemini-3.1-flash-lite-image deprecated: false description: >- Tài liệu chính thức: https://ai.google.dev/gemini-api/docs/image-generation — Gemini 3.1 Flash-Lite Image (Nano Banana 2 Lite) hỗ trợ chuyển văn bản thành hình ảnh, hình ảnh thành hình ảnh, video thành hình ảnh và chỉnh sửa hình ảnh. operationId: gemini_v1beta_3_1_flash_lite_image_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: Authorization in: header description: Khóa API Bearer required: false example: Bearer {{YOUR_API_KEY}} schema: type: string requestBody: content: application/json: schema: type: object required: - contents properties: contents: type: array items: type: object required: - parts properties: parts: type: array items: type: object properties: fileData: type: object required: - mimeType - fileUri properties: fileUri: type: string description: >- URI của tệp phương tiện, chẳng hạn như gs://bucket/object hoặc URI tệp do API Tệp của Google trả về. Ràng buộc từ hệ thống đầu nguồn: Mô hình phải có khả năng truy cập tệp. mimeType: type: string enum: - image/png - image/jpeg - image/webp - video/mp4 enumDetails: - value: image/png displayName: PNG description: Hình ảnh tham chiếu / nguồn để chỉnh sửa - value: image/jpeg displayName: JPEG description: Hình ảnh tham chiếu / nguồn để chỉnh sửa - value: image/webp displayName: WebP description: Hình ảnh tham khảo - value: video/mp4 displayName: MP4 description: Đầu vào video thành hình ảnh description: Loại MIME của tệp. description: >- Các tệp phương tiện được tham chiếu bằng URI, thường được dùng cho các hình ảnh tham khảo được tải lên bằng GCS/File API. x-apifox-orders: - fileUri - mimeType x-apidog-orders: - fileUri - mimeType inlineData: type: object required: - mimeType - data properties: data: type: string description: >- Nội dung phương tiện được mã hóa Base64 không có tiền tố URI dữ liệu. Các giới hạn từ hệ thống nguồn: Tổng kích thước của một tệp đơn lẻ là ≤500MB. mimeType: type: string enum: - image/png - image/jpeg - image/webp - image/gif - video/mp4 - video/quicktime - video/webm enumDetails: - value: image/png displayName: Hình ảnh PNG description: >- Phù hợp cho các trường hợp chỉnh sửa và nền trong suốt - value: image/jpeg displayName: Hình ảnh JPEG description: >- Phù hợp với hình ảnh tham chiếu giống ảnh chụp - value: image/webp displayName: Hình ảnh WebP description: Tham chiếu hình ảnh đã nén - value: image/gif displayName: Hình ảnh GIF description: >- Tham chiếu động; được xử lý như một khung hình tĩnh - value: video/mp4 displayName: Video MP4 description: >- Đầu vào từ video sang hình ảnh; được lấy mẫu ở tốc độ 1 khung hình/giây - value: video/quicktime displayName: Video MOV description: Đầu vào video thành hình ảnh - value: video/webm displayName: Video WebM description: Đầu vào video thành hình ảnh description: >- Loại MIME của phương tiện. image/png, image/jpeg thường được dùng cho hình ảnh; video/mp4 thường được dùng cho video. Ràng buộc từ hệ thống nguồn: Trả về 400 khi định dạng không hợp lệ. description: >- Dữ liệu phương tiện nội tuyến, thường được dùng để tải ảnh/video cục bộ lên bằng Base64. Các giới hạn từ dịch vụ nguồn: Mỗi ảnh được tính phí tương đương 1120 token đầu vào; video được lấy mẫu ở tốc độ 1 khung hình/giây, với 70 token cho mỗi khung hình, và rãnh âm thanh bị bỏ qua. x-apifox-orders: - data - mimeType x-apidog-orders: - data - mimeType text: type: string description: >- Các từ trong lời nhắc văn bản hoặc hướng dẫn chỉnh sửa. Bắt buộc khi tạo ảnh từ văn bản; được sử dụng kết hợp với phần ảnh khi tạo hoặc chỉnh sửa ảnh. anyOf: - type: string - type: string - type: string description: >- Một phần nội dung đơn lẻ bị phân mảnh. Thông thường, chỉ một loại nội dung chính được sử dụng cho cùng một phần. x-apifox-orders: - fileData - inlineData - text x-apidog-orders: - fileData - inlineData - text description: >- Danh sách các đoạn tin nhắn. Mỗi phần chứa ít nhất một trong các trường text, inlineData và fileData. Số lượng ảnh tham chiếu tối đa là 14, và khuyến nghị chính thức là ≤3 để đạt độ nhất quán tốt nhất. role: type: string enum: - user - model enumDetails: - value: user displayName: Người dùng description: >- Dữ liệu đầu vào của người dùng bao gồm văn bản, hình ảnh, video, v.v. - value: mô hình displayName: Mô hình description: >- Phản hồi lịch sử mô hình cho ngữ cảnh chỉnh sửa hình ảnh nhiều lượt description: >- Vai trò của tin nhắn. Mục đầu tiên thường là `user`; bạn có thể luân phiên giữa `user`/`model` trong nhiều vòng chỉnh sửa. x-apifox-orders: - parts - role x-apidog-orders: - parts - role description: >- Danh sách nội dung hội thoại là bắt buộc. Phải bao gồm ít nhất 1 tin nhắn của người dùng khi tạo sơ đồ; phải đính kèm inlineData hoặc fileData vào parts khi tạo/chỉnh sửa sơ đồ; trong nhiều vòng chỉnh sửa, các tin nhắn trước đó phải được thêm vào theo thứ tự thời gian. Các giới hạn của hệ thống thượng nguồn: Tổng số token đầu vào không vượt quá 65536; dữ liệu đầu vào của mỗi tệp không vượt quá 500MB. generationConfig: type: object properties: candidateCount: type: integer description: >- Số lượng kết quả ứng viên. Mô hình này được cố định là 1; các giá trị khác được truyền vào có thể bị bỏ qua hoặc gây ra lỗi. imageConfig: type: object properties: aspectRatio: type: string enum: - '1:1' - '3:2' - '2:3' - '3:4' - '4:3' - '1:4' - '4:1' - '4:5' - '5:4' - '1:8' - '8:1' - '9:16' - '16:9' - '21:9' enumDetails: - value: '1:1' displayName: Hình vuông 1:1 description: >- Mặc định; phù hợp cho bài đăng trên mạng xã hội và ảnh đại diện - value: '3:2' displayName: 3:2 nằm ngang description: Tỷ lệ ảnh ngang tiêu chuẩn - value: '2:3' displayName: Chân dung 2:3 description: Tỷ lệ ảnh chân dung tiêu chuẩn - value: '3:4' displayName: Chân dung 3:4 description: Áp phích khổ dọc - value: '4:3' displayName: Khung ngang 4:3 description: Tỷ lệ khung hình ngang cổ điển - value: '1:4' displayName: Chân dung siêu hẹp 1:4 description: Dải dọc siêu cao - value: '4:1' displayName: khổ ngang siêu rộng 4:1 description: Dải ngang siêu rộng - value: '4:5' displayName: Chân dung 4:5 description: Tỷ lệ ảnh chân dung Instagram phổ biến - value: '5:4' displayName: 5:4 chiều ngang description: Khổ ngang gần vuông - value: '1:8' displayName: 1:8 dọc siêu hẹp description: Hình ảnh cực cao - value: '8:1' displayName: 8:1 khung hình ngang siêu rộng description: Hình ảnh cực rộng - value: '9:16' displayName: 9:16 dọc description: >- Ảnh bìa video ngắn và ảnh chân dung chụp bằng điện thoại - value: '16:9' displayName: 16:9 ngang description: Biểu ngữ, hình thu nhỏ, bài thuyết trình - value: '21:9' displayName: Màn hình siêu rộng 21:9 description: Diện mạo màn ảnh rộng đậm chất điện ảnh description: >- Tỷ lệ khung hình của ảnh đầu ra. Mặc định là 1:1. Chỉ tỷ lệ được thay đổi, không thay đổi độ lớn 1K pixel. imageSize: type: string description: >- Độ phân giải đầu ra. Mô hình này chỉ hỗ trợ 1K (xấp xỉ 1024×1024 pixel). Đầu vào 512, 2K, 4K sẽ bị từ chối hoặc bỏ qua. Bắt buộc phải dùng chữ K viết hoa. outputMimeType: type: string enum: - image/png - image/jpeg - image/webp enumDetails: - value: image/png displayName: PNG description: >- Khuyến nghị mặc định; phù hợp khi cần tính minh bạch - value: image/jpeg displayName: JPEG description: Kích thước nhỏ hơn; phù hợp với đầu ra kiểu ảnh - value: image/webp displayName: WebP description: Định dạng hình ảnh nén cao description: >- Kiểu MIME của ảnh đầu ra. Nếu không được truyền vào, kiểu này sẽ do dịch vụ nguồn quyết định. description: >- Cấu hình tạo ảnh. Mô hình này chỉ hỗ trợ đầu ra 1K; không hỗ trợ 512px / 2K / 4K. x-apifox-orders: - aspectRatio - imageSize - outputMimeType x-apidog-orders: - aspectRatio - imageSize - outputMimeType maxOutputTokens: type: integer description: >- Số lượng token đầu ra tối đa. Đầu ra của mô hình bị giới hạn ở 4096. Đầu ra hình ảnh được tính phí ở mức 1120 token/hình ảnh. responseModalities: type: array items: type: string enum: - IMAGE - TEXT enumDetails: - value: HÌNH ẢNH displayName: Hình ảnh description: >- Dịch tài liệu kỹ thuật này sang tiếng Việt. Giữ nguyên Markdown, mã, định danh, URL, đường dẫn, chỗ dành sẵn, cấu trúc JSON và định dạng. Chỉ trả về văn bản đã dịch và không còn ký tự Hán nào. Trả về các hình ảnh đã tạo; bắt buộc đối với việc tạo hình ảnh - value: Vui lòng cung cấp nội dung tài liệu cần dịch. displayName: Vui lòng cung cấp nội dung tài liệu cần dịch. description: >- Cũng có thể trả về ghi chú dạng văn bản; chỉ văn bản sẽ không tạo ra hình ảnh description: >- Danh sách phương thức đầu ra. Phải bao gồm IMAGE khi tạo hình ảnh; nếu cũng cần mô tả bằng văn bản, có thể truyền ["IMAGE", "TEXT"]. Sẽ không trả về hình ảnh khi chỉ truyền TEXT. temperature: type: number description: >- Nhiệt độ lấy mẫu. Giá trị càng cao thì kết quả càng đa dạng. Giá trị mặc định của dịch vụ nguồn là 1.0. thinkingConfig: type: object properties: includeThoughts: type: boolean description: >- Có trả về quá trình suy luận trong phản hồi hay không. Mặc định là false. Phần suy luận được trả về không được hiển thị trong hình ảnh cuối cùng. thinkingLevel: type: string enum: - MINIMAL - HIGH enumDetails: - value: TỐI THIỂU displayName: >- Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. description: >- Giảm thiểu số token dùng cho suy luận; phù hợp với việc tạo hình ảnh đơn giản và độ trễ thấp - value: CAO displayName: >- Vui lòng gửi nội dung tài liệu kỹ thuật cần dịch. description: >- Suy luận nội bộ nhiều hơn; phù hợp với việc soạn nội dung phức tạp và các lời nhắc chi tiết description: >- Cường độ suy luận. Không thể sử dụng cùng với thinkingBudget. description: >- Cấu hình chế độ suy luận, không bắt buộc. Thực hiện suy luận nội bộ trước khi sử dụng chế độ này trong các tác vụ soạn thảo phức tạp. MINIMAL phù hợp khi cần độ trễ thấp; HIGH phù hợp với các lời nhắc phức tạp. Token suy luận được tính vào chi phí đầu ra. x-apifox-orders: - includeThoughts - thinkingLevel x-apidog-orders: - includeThoughts - thinkingLevel topP: type: number description: >- Ngưỡng lấy mẫu kernel. Giá trị mặc định từ nguồn thượng nguồn là 0.95. description: >- Tạo cấu hình. Trong các trường hợp ảnh thô, responseModalities phải chứa IMAGE; imageConfig kiểm soát tỷ lệ khung hình và định dạng đầu ra; thinkingConfig là tùy chọn. x-apifox-orders: - candidateCount - imageConfig - maxOutputTokens - responseModalities - temperature - thinkingConfig - topP x-apidog-orders: - candidateCount - imageConfig - maxOutputTokens - responseModalities - temperature - thinkingConfig - topP 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. safetySettings: type: array items: type: object required: - category - threshold properties: category: type: string enum: - HARM_CATEGORY_HARASSMENT - HARM_CATEGORY_HATE_SPEECH - HARM_CATEGORY_SEXUALLY_EXPLICIT - HARM_CATEGORY_DANGEROUS_CONTENT description: Danh mục bảo mật. threshold: type: string enum: - BLOCK_NONE - BLOCK_ONLY_HIGH - BLOCK_MEDIUM_AND_ABOVE - BLOCK_LOW_AND_ABOVE description: Ngưỡng chặn. x-apifox-orders: - category - threshold x-apidog-orders: - category - threshold description: >- Cài đặt bảo mật, không bắt buộc. Kiểm soát các ngưỡng lọc đối với nhiều loại nội dung có hại. systemInstruction: type: object required: - parts properties: parts: type: array items: type: object required: - text properties: text: type: string description: Văn bản lệnh hệ thống. x-apifox-orders: - text x-apidog-orders: - 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. description: >- Lệnh hệ thống, không bắt buộc. Được dùng để giới hạn phong cách, ngôn ngữ, định dạng đầu ra, v.v. Khi tạo hình ảnh, bắt buộc phải "chỉ xuất các mô tả liên quan đến hình ảnh" hoặc giới hạn nội dung đầu ra trong các tình huống dịch thuật. x-apifox-orders: - parts x-apidog-orders: - parts refName: PostV1betaModelsGemini31FlashLiteImageGenerateContentRequest description: >- Phần thân yêu cầu tạo ảnh phía nguồn của Gemini 3.1 Flash-Lite Image (gemini-3.1-flash-lite-image / Nano Banana 2 Lite). Hỗ trợ chuyển văn bản thành ảnh, chuyển ảnh thành ảnh, chuyển video thành ảnh và chỉnh sửa ảnh trong một hoặc nhiều lượt. Mô hình này chỉ hỗ trợ đầu ra 1K và không hỗ trợ Google Search Grounding, Function Calling hay Live API. x-apifox-orders: - contents - generationConfig - response_format - safetySettings - systemInstruction x-apidog-orders: - contents - generationConfig - response_format - safetySettings - systemInstruction examples: '1': value: contents: - parts: - text: >- Một chú mèo dễ thương đang ngồi trên một chiếc bàn gỗ, theo phong cách màu nước. role: user generationConfig: imageConfig: aspectRatio: '1:1' responseModalities: - HÌNH ẢNH response_format: url summary: '1' description: Được đề xuất cho người mới bắt đầu · Hình ảnh Vincentian · 1:1 '2': value: contents: - parts: - text: >- Một áp phích tối giản cho quán cà phê, tông màu ấm, khoảng trống phía trên dành cho kiểu chữ gọn gàng. role: user generationConfig: imageConfig: aspectRatio: '9:16' responseModalities: - HÌNH ẢNH summary: '2' description: >- Khuyến nghị cho người mới · Hình ảnh Vincentian · Màn hình dọc 9:16 '3': value: contents: - parts: - text: >- Logo thể thao chuyên nghiệp cho một đội bóng rổ hư cấu ở Seattle có tên là Seattle Sasquatch. Phong cách nhận diện thể thao hiện đại, đường viền đậm và gọn gàng. Bảng màu: xanh rêu, nâu tuyết tùng và màu đồng. Phong cách đồ họa vector, tách biệt trên nền đen đồng nhất. role: user generationConfig: imageConfig: aspectRatio: '3:2' outputMimeType: image/png responseModalities: - HÌNH ẢNH thinkingConfig: includeThoughts: false thinkingLevel: CAO summary: '3' description: Đề xuất nâng cao · Biểu đồ Vincentian · Suy luận + đầu ra PNG '4': value: contents: - parts: - inlineData: data: '{{test_image_base64}}' mimeType: image/png - text: >- Tạo một phiên bản theo phong cách vẽ nguệch ngoạc của bông hoa màu đỏ trong hình ảnh này. role: user generationConfig: responseModalities: - HÌNH ẢNH summary: '4' description: Khuyến nghị nâng cao · Chỉnh sửa hình ảnh trong một lượt '5': value: contents: - parts: - inlineData: data: '{{ref_image_1_base64}}' mimeType: image/jpeg - inlineData: data: '{{ref_image_2_base64}}' mimeType: image/png - text: >- Hình kết xuất nhân vật 3D cách điệu về một người phụ nữ vui vẻ và chú chó dễ thương của cô ấy. Màu sắc sống động, đôi mắt biểu cảm, nền màu trơn gọn gàng, bố cục ảnh đại diện cân giữa. role: user generationConfig: imageConfig: aspectRatio: '4:3' responseModalities: - HÌNH ẢNH summary: '5' description: >- Đề xuất nâng cao · Tổng hợp hình ảnh đa tham chiếu (≤3 hình ảnh) '6': value: contents: - parts: - inlineData: data: '{{test_video_base64}}' mimeType: video/mp4 - text: Tạo một tấm bưu thiếp về khung cảnh trong video này. role: user generationConfig: responseModalities: - HÌNH ẢNH summary: '6' description: Đề xuất nâng cao · Chuyển đổi video thành hình ảnh responses: '200': description: '' content: application/json: schema: type: object required: - candidates - usageMetadata - modelVersion - createTime - responseId properties: candidates: type: array items: type: object properties: content: type: object required: - role - parts properties: parts: type: array items: type: object properties: inlineData: type: object required: - mimeType - 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:) mimeType: type: string description: >- Loại MIME của phương tiện, ví dụ: image/png, image/jpeg description: >- Dữ liệu phương tiện nội tuyến (hình ảnh/âm thanh/v.v.) x-apifox-orders: - data - mimeType x-apidog-orders: - data - mimeType thoughtSignature: type: string description: Chữ ký suy luận (nếu được mô hình trả về) x-apifox-orders: - inlineData - thoughtSignature x-apidog-orders: - inlineData - thoughtSignature 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. role: type: string description: >- Vai trò của thông điệp, ví dụ: mô hình, người dùng description: Vui lòng cung cấp đối tượng nội dung cần dịch. x-apifox-orders: - parts - role x-apidog-orders: - parts - role finishReason: type: string description: 'Ly do ket thuc, vi du: STOP, MAX_TOKENS, SAFETY' x-apifox-orders: - content - finishReason x-apidog-orders: - content - finishReason description: Các câu trả lời ứng viên của mô hình createTime: type: string description: Thời gian tạo phản hồi modelVersion: type: string description: Phiên bản mô hình thực tế được sử dụng responseId: type: string description: ID duy nhất cho phản hồi này usageMetadata: type: object required: - promptTokenCount - candidatesTokenCount - totalTokenCount - trafficType - promptTokensDetails - candidatesTokensDetails properties: candidatesTokenCount: type: integer description: >- Dịch tài liệu kỹ thuật này sang tiếng Việt. Giữ nguyên Markdown, mã, định danh, URL, đường dẫn, chỗ giữ chỗ, cấu trúc JSON và định dạng. Chỉ trả về văn bản đã dịch và không để lại bất kỳ chữ Hán nào. Số token được các câu trả lời ứng viên sử dụng candidatesTokensDetails: type: array items: type: object properties: modality: type: string description: 'Loại phương thức, ví dụ: TEXT, IMAGE, AUDIO' tokenCount: type: integer description: >- Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. x-apifox-orders: - modality - tokenCount x-apidog-orders: - modality - tokenCount description: Phân tích chi tiết token ứng viên theo từng dạng thức promptTokenCount: type: integer description: Số token được lời nhắc sử dụng promptTokensDetails: type: array items: type: object properties: modality: type: string description: 'Loại phương thức, ví dụ: TEXT, IMAGE, AUDIO' tokenCount: type: integer description: >- Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. x-apifox-orders: - modality - tokenCount x-apidog-orders: - modality - tokenCount description: Phân tích token trong lời nhắc theo từng phương thức totalTokenCount: type: integer description: Tổng số token trafficType: type: string description: Loại lưu lượng (liên quan đến thanh toán/hạn mức) description: Siêu dữ liệu về mức sử dụng token x-apifox-orders: - candidatesTokenCount - candidatesTokensDetails - promptTokenCount - promptTokensDetails - totalTokenCount - trafficType x-apidog-orders: - candidatesTokenCount - candidatesTokensDetails - promptTokenCount - promptTokensDetails - totalTokenCount - trafficType refName: PostV1betaModelsGemini31FlashLiteImageGenerateContentResponse x-apifox-orders: - candidates - createTime - modelVersion - responseId - usageMetadata x-apidog-orders: - candidates - createTime - modelVersion - responseId - usageMetadata examples: example: summary: example value: candidates: - content: parts: - inlineData: data: chuỗi mimeType: chuỗi thoughtSignature: chuỗi role: chuỗi finishReason: chuỗi createTime: chuỗi modelVersion: chuỗi responseId: chuỗi usageMetadata: candidatesTokenCount: 0 candidatesTokensDetails: - modality: chuỗi tokenCount: 0 promptTokenCount: 0 promptTokensDetails: - modality: chuỗi tokenCount: 0 totalTokenCount: 0 trafficType: chuỗi 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-45208846-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "TTS chuyển văn bản thành giọng nói" Nguồn: https://docs.openaihub.net/api-45208847/ > 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/gemini-2.5-flash-preview-tts:generateContent: post: summary: TTS chuyển văn bản thành giọng nói 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_2_5_flash_preview_tts_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: >- Kiểu nội dung của phần thân yêu cầu, được cố định 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ố data:) mime_type: type: string description: >- Loại MIME của phương tiện, ví dụ: audio/wav, audio/mpeg description: >- Dữ liệu nhị phân nội tuyến (ví dụ: âm thanh tham chiếu); không bắt buộc đối với TTS thuần túy x-apifox-orders: - data - mime_type x-apidog-orders: - data - mime_type text: type: string description: Nội dung văn bản để tổng hợp thành giọng nói description: >- Dịch tài liệu kỹ thuật này sang tiếng Việt. Giữ nguyên Markdown, mã, định danh, URL, đường dẫn, phần giữ chỗ, cấu trúc JSON và định dạng. Chỉ trả về văn bản đã dịch và không để lại bất kỳ ký tự Hán nào. Một phần duy nhất; sử dụng văn bản và/hoặc inline_data x-apifox-orders: - inline_data - text x-apidog-orders: - inline_data - text description: >- Các phần nội dung; TTS chủ yếu sử dụng văn bản; có thể bao gồm âm thanh tham chiếu `inline_data` nếu hệ thống nguồn hỗ trợ description: Nội dung một lượt (vai trò mặc định là người dùng) x-apifox-orders: - parts x-apidog-orders: - parts description: >- Nội dung cuộc trò chuyện; TTS thường cần một tin nhắn của người dùng chứa văn bản để đọc thành từng phần generationConfig: type: object required: - responseModalities properties: responseModalities: type: array items: type: string description: >- Tên phương thức, thường là AUDIO; có thể kết hợp với TEXT, v.v. tùy theo mô hình description: >- Các phương thức phản hồi; đối với TTS, hãy sử dụng ["AUDIO"] speechConfig: type: object required: - voiceConfig properties: voiceConfig: type: object required: - prebuiltVoiceConfig properties: prebuiltVoiceConfig: type: object required: - voiceName properties: voiceName: type: string description: >- Tên giọng nói cài sẵn, ví dụ: Kore, Puck, Charon, Fenrir, Aoede description: >- Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. x-apifox-orders: - voiceName x-apidog-orders: - voiceName description: Cấu hình giọng nói x-apifox-orders: - prebuiltVoiceConfig x-apidog-orders: - prebuiltVoiceConfig description: >- Cấu hình tổng hợp giọng nói; các tùy chọn về giọng đọc và cách phát âm x-apifox-orders: - voiceConfig x-apidog-orders: - voiceConfig description: >- Cấu hình tạo sinh; TTS phải khai báo phương thức AUDIO và cấu hình giọng nói x-apifox-orders: - responseModalities - speechConfig x-apidog-orders: - responseModalities - speechConfig refName: PostV1betaModelsGemini25FlashPreviewTtsGenerateContentRequest description: >- Nội dung yêu cầu chuyển văn bản thành giọng nói của Gemini 2.5 Flash Preview TTS x-apifox-orders: - contents - generationConfig x-apidog-orders: - contents - generationConfig examples: gemini_2_5_flash_preview_tts: value: contents: - parts: - text: Nói ra,tôi là ai,ai là tôi generationConfig: responseModalities: - ÂM THANH speechConfig: voiceConfig: prebuiltVoiceConfig: voiceName: Kore model: gemini-2.5-flash-preview-tts summary: gemini_2_5_flash_preview_tts description: TTS chuyển văn bản thành giọng nói 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-45208847-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "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: [] ``` --- # "Tao anh bang gemini-nano-banana-2.1" Nguồn: https://docs.openaihub.net/api-45208849/ > 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/gemini-nano-banana-2.1:generateContent: post: summary: Tao anh bang gemini-nano-banana-2.1 deprecated: false description: >- ## Mô tả mô hình `gemini-nano-banana-2.1` là mô hình tạo/chỉnh sửa hình ảnh thuộc dòng Gemini, hỗ trợ chuyển văn bản thành hình ảnh và chỉnh sửa dựa trên nhiều hình ảnh tham chiếu (hoán đổi khuôn mặt, thay đổi trang phục, chuyển đổi phong cách, v.v.). - Định dạng yêu cầu: `generateContent` gốc của Gemini - Đầu ra: `inlineData` (base64) trong `candidates[0].content.parts[]`; trả về URL hình ảnh khi truyền `response_format: "url"` (chỉ khi không phát trực tuyến) - Độ phân giải: `imageConfig.imageSize` chỉ hỗ trợ `1K` / `2K` / `4K`, mặc định là `1K`, không hỗ trợ `512` - Tỉ lệ khung hình: `imageConfig.aspectRatio` hỗ trợ `1:1, 16:9, 9:16, 4:3, 3:4, 2:3, 3:2, 4:5, 5:4, 1:4, 4:1, 1:8, 8:1, 21:9` - Suy luận: `thinkingConfig.thinkingLevel` chỉ hỗ trợ `minimal` / `high`, không hỗ trợ `thinkingBudget`; cũng có thể dùng hậu tố tên mô hình `-thinking` / `-nothinking` - Tính phí: Dựa trên các mức độ phân giải, 1K ×1.0, 2K ×1.5, 4K ×3.375 (dựa trên giá mô hình trong bảng điều khiển) Tài liệu chính thức: https://ai.google.dev/gemini-api/docs/image-generation?hl=en#gemini-image-editing operationId: post-v1beta-models-gemini-nano-banana-2.1:generateContent tags: - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/Gemini/Định dạng gốc - Google Gemini/định dạng gốc parameters: - name: Content-Type in: header description: '' required: true example: application/json schema: type: string requestBody: content: application/json: schema: type: object required: - contents properties: contents: type: array items: type: object required: - parts properties: parts: type: array items: type: object properties: inline_data: type: object required: - mime_type - data properties: data: type: string description: >- Chuỗi Base64 của hình ảnh, không bao gồm tiền tố data:image/...;base64, mime_type: type: string enum: - image/jpeg - image/png - image/webp description: Kiểu MIME của hình ảnh description: >- Hình ảnh tham chiếu (base64). Cũng tương thích với cách viết camelCase `inlineData` / `mimeType`. x-apifox-orders: - data - mime_type x-apidog-orders: - data - mime_type text: type: string description: >- Lời nhắc văn bản. Mô tả cảnh bạn muốn tạo/chỉnh sửa; không đưa kích thước hoặc tỷ lệ khung hình vào lời nhắc, hãy kiểm soát chúng bằng imageConfig. x-apifox-orders: - inline_data - text x-apidog-orders: - inline_data - text description: >- Mảng các đoạn nội dung, mỗi phần tử chỉ được điền vào một trong hai trường `text` hoặc `inline_data`. role: type: string enum: - user description: Vai trò, phải được đặt thành `user` x-apifox-orders: - parts - role x-apidog-orders: - parts - role description: >- Nội dung hội thoại. Đối với chuyển văn bản thành hình ảnh, chỉ nên đặt một văn bản; đối với chỉnh sửa hình ảnh/tham chiếu nhiều hình ảnh, hãy đặt một văn bản + nhiều `inline_data` trong cùng một `parts`. generationConfig: type: object properties: imageConfig: type: object properties: aspectRatio: type: string enum: - '1:1' - '16:9' - '9:16' - '4:3' - '3:4' - '2:3' - '3:2' - '4:5' - '5:4' - '1:4' - '4:1' - '1:8' - '8:1' - '21:9' description: >- Tỷ lệ khung hình của ảnh đầu ra, mặc định là 1:1 nếu không được cung cấp (sử dụng tỷ lệ của ảnh tham chiếu nếu có) imageSize: type: string enum: - 1K - 2K - 4K description: >- Cấp độ phân giải đầu ra, mặc định là 1K nếu không được cung cấp. Không hỗ trợ 512. Hệ số tính phí: 1K ×1.0, 2K ×1.5, 4K ×3.375. description: Cấu hình đầu ra hình ảnh x-apifox-orders: - aspectRatio - imageSize x-apidog-orders: - aspectRatio - imageSize responseModalities: type: array items: type: string enum: - TEXT - IMAGE description: >- Phương thức đầu ra. Nên truyền rõ ràng ["TEXT","IMAGE"] khi tạo hình ảnh; nếu chỉ truyền ["IMAGE"] thì sẽ không trả về phần mô tả bằng văn bản. thinkingConfig: type: object properties: thinkingLevel: type: string enum: - minimal - high description: >- Muc do suy luan. `minimal` nhanh hon, `high` cho chat luong tot hon nhung cham hon. Cung co the su dung hau to ten mo hinh `gemini-nano-banana-2.1-thinking` / `-nothinking`. description: >- Cấu hình suy luận (tùy chọn). Không hỗ trợ thinkingBudget, chỉ hỗ trợ thinkingLevel. x-apifox-orders: - thinkingLevel x-apidog-orders: - thinkingLevel description: >- Cấu hình tạo nội dung. Lưu ý: aspectRatio / imageSize phải được đặt bên trong imageConfig; nếu đặt chúng ở cấp cao nhất của generationConfig thì chúng sẽ bị bỏ qua; các trường negativePrompt và resolution không được hỗ trợ. x-apifox-orders: - imageConfig - responseModalities - thinkingConfig x-apidog-orders: - imageConfig - responseModalities - thinkingConfig response_format: type: string enum: - base64 - url description: >- Định dạng trả về của hình ảnh (trường mở rộng của nền tảng, không phải là tham số Gemini chính thức). base64: hình ảnh được trả về trong parts[].inlineData.data (mặc định); url: hình ảnh trả về một liên kết tạm thời trong parts[].fileData.fileUri, chỉ được hỗ trợ cho các yêu cầu không truyền trực tuyến; việc truyền url trong chế độ truyền trực tuyến sẽ dẫn đến lỗi 400. x-apifox-orders: - contents - generationConfig - response_format x-apidog-orders: - contents - generationConfig - response_format examples: example: value: contents: - parts: - text: >- Thay thế hoàn toàn khuôn mặt và tóc của nhân vật trong Hình 1 vào nhân vật trong Hình 2: các đường nét và chi tiết khuôn mặt phải hoàn toàn lấy từ Hình 1, không giữ lại đặc điểm khuôn mặt của Hình 2; điều chỉnh góc khuôn mặt theo tư thế đầu trong Hình 2; giữ nguyên trang phục, phần cơ thể không bao gồm phụ kiện tóc và phông nền của Hình 2; màu da, ánh sáng và bóng đổ hòa quyện tự nhiên, không xuất hiện đường nối ghép rõ ràng; phong cách chân thực ở cấp độ nhiếp ảnh. - text: 'Hình tham khảo 1 ("Hình 1" trong câu lệnh):' - inlineData: data: >- mimeType: image/jpeg - text: 'Tham khảo Hình 2 ("Hình 2" trong lời nhắc):' - inlineData: data: >- mimeType: image/jpeg role: user generationConfig: imageConfig: aspectRatio: '3:4' imageSize: 2K responseModalities: - Vui lòng cung cấp nội dung tài liệu cần dịch. - HÌNH ẢNH response_format: base64 summary: example responses: '200': description: '' content: application/json: schema: type: object required: - candidates properties: candidates: type: array items: type: object required: - content - finishReason properties: content: type: object required: - parts properties: parts: type: array items: type: object properties: fileData: type: object required: - mimeType - fileUri properties: fileUri: type: string description: >- Liên kết tải xuống tạm thời cho hình ảnh có giới hạn thời gian, vui lòng tải xuống và lưu lại ngay. mimeType: type: string description: >- Được trả về khi `response_format` là `url`. x-apifox-orders: - fileUri - mimeType x-apidog-orders: - fileUri - mimeType inlineData: type: object required: - mimeType - data properties: data: type: string description: >- Chuỗi Base64 của hình ảnh, không bao gồm tiền tố data:; khi giải mã, chuỗi này cho ra dữ liệu nhị phân của hình ảnh. mimeType: type: string description: Kiểu MIME của hình ảnh description: >- Được trả về khi response_format là base64 (mặc định). x-apifox-orders: - data - mimeType x-apidog-orders: - data - mimeType text: type: string description: >- Phần mô tả văn bản do mô hình cung cấp, có thể không xuất hiện. x-apifox-orders: - fileData - inlineData - text x-apidog-orders: - fileData - inlineData - text description: >- Mảng các phân đoạn được trả về. Phần mô tả bằng văn bản nằm trong text, hình ảnh nằm trong inlineData (base64) hoặc fileData (url); chỉ cần lấy phần tử đầu tiên có chứa hình ảnh. role: type: string description: Đã cố định theo mô hình x-apifox-orders: - parts - role x-apidog-orders: - parts - role finishReason: type: string enum: - STOP - MAX_TOKENS - SAFETY - RECITATION - PROHIBITED_CONTENT - OTHER description: >- Lý do kết thúc. STOP cho biết quá trình hoàn tất bình thường; SAFETY / PROHIBITED_CONTENT cho biết yêu cầu đã bị chính sách an toàn chặn lại, trong trường hợp này không có hình ảnh nào được trả về. index: type: integer x-apifox-orders: - content - finishReason - index x-apidog-orders: - content - finishReason - index description: Mảng kết quả tạo sinh, thường chỉ chứa 1 phần tử modelVersion: type: string description: Phiên bản mô hình thực sự đã xử lý yêu cầu. responseId: type: string description: >- ID yêu cầu cho phiên làm việc này, vui lòng cung cấp khi xử lý sự cố. usageMetadata: type: object properties: candidatesTokenCount: type: integer description: Số lượng token đầu ra (bao gồm cả hình ảnh được tạo). promptTokenCount: type: integer description: >- Số lượng token đầu vào (bao gồm cả hình ảnh tham chiếu). totalTokenCount: type: integer description: Tổng số token. description: Thống kê mức sử dụng token, tính phí dựa trên console. x-apifox-orders: - candidatesTokenCount - promptTokenCount - totalTokenCount x-apidog-orders: - candidatesTokenCount - promptTokenCount - totalTokenCount x-apifox-orders: - candidates - modelVersion - responseId - usageMetadata x-apidog-orders: - candidates - modelVersion - responseId - usageMetadata examples: example: summary: example value: candidates: - content: parts: - text: >- Đã thay khuôn mặt trong Hình 1 vào Hình 2, đồng thời giữ nguyên trang phục và phông nền của Hình 2. - inlineData: data: >- /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/...(da cat ngan) mimeType: image/jpeg role: mô hình finishReason: DỪNG LẠI index: 0 modelVersion: gemini-nano-banana-2.1 responseId: abc123xyz usageMetadata: candidatesTokenCount: 1290 promptTokenCount: 1083 totalTokenCount: 2373 headers: {} x-apidog-name: '' 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-45208849-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "giao diện tạo hình ảnh gemini [định dạng tương thích với trò chuyện]" Nguồn: https://docs.openaihub.net/api-45208850/ > 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: /v1/chat/completions: post: summary: giao diện tạo hình ảnh gemini [định dạng tương thích với trò chuyện] deprecated: false description: >- Cổng tương thích OpenAI hợp nhất. Chọn nguồn thượng nguồn thông qua `model`, ví dụ: - `gpt-4o` / `gpt-4o-audio-preview` → OpenAI - `gemini-2.5-flash-all` → Google Gemini (định dạng tương thích) - Với các mô hình khác, xem `GET /v1/models` Tài liệu chính thức của OpenAI: https://platform.openai.com/docs/api-reference/chat/create Định dạng tên mô hình là: gpt-4-gizmo-*, và hệ thống sẽ tự động nhận dạng. Ví dụ, GPTs này: https://chatgpt.com/g/g-B3hgivKK9-write-for-me Khi đó, tên mô hình của nó phải được điền là: gpt-4-gizmo-g-B3hgivKK9 Danh sách GPTs: https://chatgpt.com/gpts operationId: v1_chat_completions tags: - >- OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/Gemini/Định dạng tương thích với trò chuyện - Trò chuyện parameters: [] requestBody: content: application/json: schema: type: object required: - model - messages properties: enable_thinking: type: boolean description: >- Có bật chế độ suy luận hay không (phần mở rộng của kho này). Chỉ giá trị Boolean `true` mới có hiệu lực; hãy chọn một trong các giá trị của `extra_body.enable_thinking`. extra_body: type: object properties: enable_thinking: type: boolean description: >- Bật chế độ suy luận trong `extra_body`; chỉ chấp nhận giá trị `true`. google: type: object description: >- Các phần mở rộng hộp thoại Gemini như thinking_config, response_modalities. x-apidog-orders: [] description: >- Các tham số mở rộng cho hội thoại. Thường dùng: enable_thinking; một số mô hình Gemini có thể dùng google.thinking_config, vân vân. Việc tham số có hiệu lực hay không phụ thuộc vào kênh và mô hình. x-apifox-orders: - enable_thinking - google x-apidog-orders: - enable_thinking - google frequency_penalty: type: number description: >- Hệ số phạt tần suất, khoảng -2~2. Giá trị dương làm giảm xác suất lặp lại cùng một từ. logit_bias: type: object description: >- Điều chỉnh xác suất xuất hiện theo ID token, và giá trị là một đối tượng ánh xạ với các giá trị nằm trong khoảng từ -100 đến 100. x-apidog-orders: [] max_completion_tokens: type: integer description: >- Giới hạn token tối đa cho phần hoàn thành (thường được dùng hơn trong các mô hình suy luận như dòng o và GPT-5). `max_tokens` có thể được kế thừa khi không được thiết lập. max_tokens: type: integer description: >- Số lượng token tối đa được tạo trong phản hồi này (các trường dùng chung). messages: type: array items: type: object required: - role - content properties: content: oneOf: - type: string - type: array items: type: object required: - type properties: image_url: type: object required: - url properties: detail: type: string enum: - auto - low - high description: >- Độ chính xác khi hiểu hình ảnh: tự động/thấp/cao. url: type: string description: >- URL hình ảnh hoặc data:image/...;base64,... . description: >- Hình ảnh khi type=image_url. Nếu cổng kết nối bật proxy hình ảnh, url có thể bị thay thế. x-apifox-orders: - detail - url x-apidog-orders: - detail - url text: type: string description: Nội dung văn bản khi type=text. type: type: string enum: - text - image_url description: >- Loại khối nội dung: `text` là văn bản, `image_url` là hình ảnh. refName: Phần nội dung x-apifox-orders: - image_url - text - type x-apidog-orders: - image_url - text - type description: >- Nội dung tin nhắn: văn bản thuần túy hoặc mảng kết hợp hình ảnh và văn bản (xem ContentPart). name: type: string description: >- Tùy chọn. Phân biệt tên người nói trong các tình huống có nhiều người dùng. reasoning_content: type: string description: >- Văn bản về quá trình suy luận/tư duy (được dùng khi suy luận về các mô hình và tiếp nối ngữ cảnh). role: type: string enum: - system - user - assistant - tool - developer description: >- Vai trò của thông điệp. system: cài đặt hệ thống; user: người dùng; assistant: mô hình; tool: kết quả trả về của công cụ. tool_call_id: type: string description: >- Bắt buộc khi role là tool, tương ứng với tool_calls[].id của nội dung được trả về tại một thời điểm nhất định. tool_calls: type: array items: type: object properties: function: type: object properties: arguments: type: string description: Các tham số dưới dạng chuỗi JSON. name: type: string description: Tên description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - arguments - name x-apidog-orders: - arguments - name id: type: string description: >- Mã định danh lời gọi, thông điệp của công cụ cần tương ứng với tool_call_id. type: type: string enum: - function description: Kiểu x-apifox-orders: - function - id - type x-apidog-orders: - function - id - type description: >- Một danh sách các yêu cầu gọi công cụ (do mô hình khởi tạo) trong thông điệp của trợ lý. refName: Thông điệp x-apifox-orders: - content - name - reasoning_content - role - tool_call_id - tool_calls x-apidog-orders: - content - name - reasoning_content - role - tool_call_id - tool_calls description: >- Danh sách các tin nhắn trong cuộc hội thoại, ít nhất một tin nhắn. Hỗ trợ nhiều lượt: system/user/assistant/tool. model: type: string description: >- ID mô hình cần sử dụng. Cổng sẽ chọn các kênh bằng cách nhóm mã thông báo và có thể thực hiện ánh xạ tên mô hình hoặc phân giải hậu tố (chẳng hạn như -thinking, -search). 'n': type: integer description: >- Dịch tài liệu kỹ thuật này sang tiếng Việt. Giữ nguyên Markdown, mã nguồn, định danh, URL, đường dẫn, phần giữ chỗ, cấu trúc JSON và định dạng. Chỉ trả về văn bản đã dịch và không để lại ký tự Hán nào. Tạo một số phương án trả lời của trợ lý cho cùng một lượt đầu vào. parallel_tool_calls: type: boolean description: >- Có cho phép thực hiện nhiều lệnh gọi công cụ song song trong một phản hồi hay không (khi hệ thống đầu nguồn hỗ trợ). presence_penalty: type: number description: >- Có một hệ số phạt, khoảng -2~2. Giá trị dương làm giảm sự lặp lại của các biểu thức chủ đề đã xuất hiện. reasoning_effort: type: string description: >- Mức độ mạnh của mô hình suy luận (chẳng hạn như thấp / trung bình / cao). Giá trị này cũng có thể được cổng kết nối tự động chèn thông qua hậu tố của tên mô hình. response_format: type: object properties: json_schema: type: object description: Định nghĩa cấu trúc đầu ra khi type=json_schema. x-apidog-orders: [] type: type: string enum: - text - json_object - json_schema description: >- text: văn bản thông thường; json_object: đối tượng JSON; json_schema: đầu ra có cấu trúc theo schema. refName: ResponseFormat x-apifox-orders: - json_schema - type x-apidog-orders: - json_schema - type seed: type: number description: >- Hạt giống ngẫu nhiên, dùng để cố gắng thu được kết quả có thể tái tạo với cùng các tham số (không đảm bảo tính nhất quán hoàn toàn). Lưu ý rằng trường này có tên là seed. stop: oneOf: - type: string - type: array items: type: string description: >- Dừng việc tạo nội dung khi gặp các chuỗi này. Có thể là một chuỗi đơn hoặc một mảng chuỗi (tối đa 4 chuỗi). stream: type: boolean description: >- Có truyền phát đầu ra hay không. false: Trả về toàn bộ JSON trong một lần; true: Đẩy tăng dần qua SSE, kết thúc bằng data: [DONE]. stream_options: type: object properties: include_usage: type: boolean description: >- Liệu mức sử dụng (token prompt/completion) có được bao gồm ở cuối luồng hay không. refName: StreamOptions x-apifox-orders: - include_usage x-apidog-orders: - include_usage temperature: type: number description: >- Nhiệt độ lấy mẫu, thường nằm trong khoảng 0~2. Giá trị càng cao, phản hồi càng ngẫu nhiên; giá trị càng thấp, phản hồi càng ổn định. Thông thường, chỉ điều chỉnh một trong hai tham số này cùng với top_p. tool_choice: oneOf: - type: string enum: - none - auto - required - type: object properties: function: type: object required: - name properties: name: type: string description: Tên hàm bắt buộc phải được gọi. description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - name x-apidog-orders: - name type: type: string x-apifox-orders: - function - type x-apidog-orders: - function - type description: >- Dịch tài liệu kỹ thuật này sang tiếng Việt. Giữ nguyên Markdown, mã, định danh, URL, đường dẫn, phần giữ chỗ, cấu trúc JSON và định dạng. Chỉ trả về văn bản đã dịch và không để lại ký tự Hán nào. Kiểm soát việc có gọi công cụ hay không: none (không gọi), auto (tự động), required (bắt buộc phải gọi), hoặc chỉ định một hàm. tools: type: array items: type: object required: - type - function properties: function: type: object required: - name properties: description: type: string description: >- Phần mô tả chức năng giúp mô hình quyết định thời điểm gọi chức năng đó. name: type: string description: Tên hàm mà mô hình dùng để khởi tạo lệnh gọi. parameters: type: object description: Lược đồ JSON của các tham số hàm. x-apidog-orders: [] description: Định nghĩa hoặc kết quả của lời gọi hàm x-apifox-orders: - description - name - parameters x-apidog-orders: - description - name - parameters type: type: string enum: - function description: Đã sửa thành hàm. refName: Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. x-apifox-orders: - function - type x-apidog-orders: - function - type description: >- Danh sách các công cụ (hàm) mà mô hình có thể gọi, được dùng để gọi hàm trong các cuộc hội thoại. top_p: type: number description: >- Lấy mẫu hạt nhân, 0~1. Chỉ lấy mẫu các token có xác suất tích lũy đạt đến top_p. user: type: string description: >- Mã định danh duy nhất của người dùng cuối giúp phát hiện hành vi lạm dụng và thống kê ở phía nền tảng. web_search_options: type: object properties: search_context_size: type: string enum: - high - medium - low description: >- Kích thước ngữ cảnh tìm kiếm trên Internet; nếu không được truyền, cổng mặc định sử dụng mức trung bình. user_location: type: object description: >- Vị trí địa lý của người dùng, v.v., được sử dụng cho kết quả tìm kiếm đã bản địa hóa (cấu trúc phụ thuộc vào nguồn cung cấp phía trên). x-apidog-orders: [] refName: WebSearchOptions x-apifox-orders: - search_context_size - user_location x-apidog-orders: - search_context_size - user_location refName: V1ChatCompletionsRequest description: >- Chỉ áp dụng cho các tình huống hội thoại nhiều lượt, tương ứng với các trường liên quan đến hội thoại của dto.GeneralOpenAIRequest. Bắt buộc: model, messages (không được để trống). Xác thực: Authorization: Bearer {API Key}. x-apifox-orders: - enable_thinking - extra_body - frequency_penalty - logit_bias - max_completion_tokens - max_tokens - messages - model - 'n' - parallel_tool_calls - presence_penalty - reasoning_effort - response_format - seed - stop - stream - stream_options - temperature - tool_choice - tools - top_p - user - web_search_options x-apidog-orders: - enable_thinking - extra_body - frequency_penalty - logit_bias - max_completion_tokens - max_tokens - messages - model - 'n' - parallel_tool_calls - presence_penalty - reasoning_effort - response_format - seed - stop - stream - stream_options - temperature - tool_choice - tools - top_p - user - web_search_options examples: deepseek_chat: value: extra_body: enable_thinking: true messages: - content: >- Có ba chiếc hộp, chỉ một hộp có phần thưởng. Bạn chọn hộp số 2, người dẫn chương trình mở hộp số 3 (trống), rồi hỏi bạn có muốn đổi sang hộp số 1 không? Hãy phân tích và đưa ra lời khuyên. role: user model: deepseek-chat stream: true stream_options: include_usage: true summary: deepseek_chat description: >- Khuyến nghị nâng cao: Hội thoại suy luận DeepSeek (truyền phát) · stream + extra_body.enable_thinking deepseek_ocr: value: messages: - content: - text: >- Hãy nhận dạng toàn bộ văn bản trong hình ảnh và xuất theo đúng thứ tự của bản gốc, không giải thích. type: text - image_url: detail: cao url: https://example.com/document-scan.png type: image_url role: user model: deepseek-ocr stream: false summary: deepseek_ocr description: >- Khuyến nghị nâng cao: DeepSeek-OCR để nhận dạng văn bản · image_url + từ khóa nhắc nhận dạng hình ảnh gemini_multimodal: value: messages: - content: - text: Trong bức ảnh này có gì? Vui lòng mô tả chi tiết. type: text - image_url: url: >- https://lsky.zhongzhuan.chat/i/2024/10/17/6711068a14527.png type: image_url role: user model: gemini-2.5-flash-all stream: true temperature: 0.5 top_p: 1 summary: gemini_multimodal description: Gemini đa phương thức (khả năng hiểu hình ảnh) gpt4o_audio: value: audio: format: wav voice: hợp kim messages: - content: >- Chó golden retriever có phải là giống chó phù hợp với gia đình không? role: user modalities: - văn bản - âm thanh model: gpt-4o-audio-preview summary: gpt4o_audio description: Đầu ra âm thanh của GPT-4o gpt_4_gizmo_g_2fkfe8rbu: value: messages: - content: Bạn là ai? role: user model: gpt-4-gizmo-g-2fkFE8rbu stream: false summary: gpt_4_gizmo_g_2fkfe8rbu description: Đối thoại GPTs gpt_4o: value: messages: - content: Bạn là một cô gái mèo luôn sẵn lòng giúp đỡ mọi người. role: Vui lòng cung cấp tài liệu kỹ thuật cần dịch. - content: Hãy giúp tôi tóm tắt HTTP là gì. role: user model: gpt-4o summary: gpt_4o description: >- Khuyến nghị cho người mới bắt đầu: hội thoại cơ bản (không truyền phát) gpt_4o_10: value: messages: - content: - text: Tóm tắt nội dung hình ảnh và trả lời theo từng ý. type: text - image_url: detail: cao url: https://example.com/demo.jpg type: image_url role: user model: gpt-4o stream: false summary: gpt_4o_10 description: >- Đề xuất nâng cao: Hình ảnh hội thoại (không truyền phát) · extra_body.google.response_modalities + image_config gpt_4o_11: value: max_tokens: 256 messages: - content: Giới thiệu API gateway là gì trong một câu. role: user model: gpt-4o 'n': 2 temperature: 0.8 summary: gpt_4o_11 description: 'Khuyến nghị nâng cao: nhiều phản hồi ứng viên · n' gpt_4o_12: value: functions: - description: Tra cứu thời tiết thành phố name: get_weather parameters: properties: city: description: Tên thành phố type: string x-i18n: en-US: description: tên thành phố required: - city type: object x-i18n: en-US: description: Kiểm tra thời tiết thành phố messages: - content: Thời tiết ở Bắc Kinh hiện giờ thế nào? role: user model: gpt-4o tool_choice: tự động summary: gpt_4o_12 description: >- Khuyến nghị nâng cao: Gọi hàm (phiên bản cũ) · functions + tool_choice gpt_4o_2: value: messages: - content: >- Hãy dùng 3 câu để giải thích token là gì và đưa ra một ví dụ. role: user model: gpt-4o stream: true stream_options: include_usage: true summary: gpt_4o_2 description: >- Khuyến nghị cho người mới: Hội thoại truyền phát · stream + stream_options.include_usage gpt_4o_3: value: messages: - content: >- Viết một đoạn nội dung quảng bá sản phẩm không quá 200 chữ; khi gặp STOP thì dừng lại. role: user model: gpt-4o stop: - Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. - DỪNG LẠI temperature: 0.4 top_p: 0.9 summary: gpt_4o_3 description: >- Khuyến nghị nâng cao: Kiểm soát lấy mẫu: temperature + top_p + stop gpt_4o_4: value: messages: - content: Thời tiết ở Bắc Kinh hôm nay thế nào? role: user model: gpt-4o tool_choice: tự động tools: - function: description: Lấy thông tin thời tiết của thành phố được chỉ định name: get_weather parameters: properties: city: description: Tên thành phố type: string x-i18n: en-US: description: tên thành phố required: - city type: object x-i18n: en-US: description: >- Lấy thông tin thời tiết cho một thành phố được chỉ định type: function summary: gpt_4o_4 description: 'Khuyến nghị nâng cao: gọi công cụ (tools + tool_choice)' gpt_4o_5: value: messages: - content: >- {"title":"Cách viết tài liệu API","bullets":["Mô tả mục đích, phạm vi và đối tượng sử dụng của API.","Liệt kê URL, phương thức HTTP, tiêu đề yêu cầu và cơ chế xác thực.","Giải thích rõ tham số đường dẫn, tham số truy vấn và nội dung yêu cầu, bao gồm kiểu dữ liệu, điều kiện bắt buộc và giá trị mẫu.","Cung cấp ví dụ yêu cầu và phản hồi, đồng thời giữ nguyên định dạng JSON.","Ghi rõ mã trạng thái HTTP, mã lỗi, thông báo lỗi và cách xử lý.","Nêu quy tắc phân trang, giới hạn tần suất, phiên bản API và lịch sử thay đổi."]} role: user model: gpt-4o response_format: type: json_object summary: gpt_4o_5 description: >- Khuyến nghị nâng cao: Bắt buộc đầu ra có cấu trúc (response_format) gpt_4o_6: value: messages: - content: - text: >- Trong bức ảnh này có gì? Vui lòng mô tả bằng tiếng Trung và đưa ra những bối cảnh có thể xảy ra. type: text - image_url: detail: cao url: https://example.com/image.jpg type: image_url role: user model: gpt-4o summary: gpt_4o_6 description: >- Khuyến nghị nâng cao: Ví dụ đa phương thức: messages.content với hình ảnh (image_url gpt_4o_7: value: messages: - content: >- Gần đây có những bài viết chất lượng cao nào về tác nhân AI? Hãy cung cấp cho tôi 3 bài và mô tả ngắn gọn. role: user model: gpt-4o web_search_options: search_context_size: trung bình summary: gpt_4o_7 description: >- Khuyến nghị nâng cao: Các tùy chọn mạng/tìm kiếm (web_search_options) gpt_4o_8: value: messages: - content: - text: Hãy mô tả bức ảnh này bằng tiếng Trung. type: text - image_url: detail: cao url: https://example.com/demo.jpg type: image_url role: user model: gpt-4o stream: true summary: gpt_4o_8 description: >- Đề xuất nâng cao: Hội thoại bằng hình ảnh và văn bản (truyền liên tục) · stream + image_url.url gpt_4o_9: value: messages: - content: - text: Chữ trong hình là gì? type: text - image_url: detail: tự động url: >- data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg== type: image_url role: user model: gpt-4o stream: true summary: gpt_4o_9 description: >- Khuyến nghị nâng cao: Đối thoại bằng hình ảnh và văn bản (truyền phát) · stream + image_url (base64) o3_mini: value: max_completion_tokens: 2000 messages: - content: >- Chứng minh: Nếu n là số lẻ thì n² cũng là số lẻ. Hãy suy luận từng bước. role: user model: o3-mini reasoning_effort: cao summary: o3_mini description: >- Khuyến nghị nâng cao: Kiểm soát mức độ nỗ lực của mô hình suy luận (reasoning_effort) qwen_max: value: extra_body: enable_thinking: true messages: - content: >- Tính toán: Nếu một hệ thống xử lý 120 yêu cầu mỗi giây, thì trong 5 phút hệ thống đó có thể xử lý bao nhiêu yêu cầu? Hãy trình bày quá trình tính. 5 phút = 5 × 60 = 300 giây Tổng số yêu cầu có thể xử lý = 120 × 300 = 36.000 yêu cầu Đáp án: Hệ thống có thể xử lý 36.000 yêu cầu trong 5 phút. role: user model: qwen-max summary: qwen_max description: >- Khuyến nghị nâng cao: sử dụng chế độ suy luận (`enable_thinking` / `extra_body.enable_thinking`) qwen_mt_turbo: value: messages: - content: >- Vui lòng dịch đoạn tiếng Anh dưới đây sang tiếng Trung giản thể, chỉ xuất bản dịch: Xin chào, chào mừng bạn đến với nền tảng API của chúng tôi. role: user model: qwen-mt-turbo stream: false summary: qwen_mt_turbo description: 'Đề xuất nâng cao: dịch máy · model(qwen-mt) + messages' responses: '200': description: '' content: application/json: schema: type: object required: - id - object - created - model - choices - usage - system_fingerprint - service_tier properties: choices: type: array items: type: object properties: finish_reason: type: string description: 'Lý do kết thúc, ví dụ: stop, length' index: type: integer description: Chỉ mục của mục ứng viên logprobs: type: string description: Thông tin xác suất lôgarit (nếu được bật) nullable: true message: type: object required: - role - content - refusal - annotations properties: annotations: type: array items: type: string description: Chú thích / thông tin trích dẫn content: type: string description: Nội dung tin nhắn hoặc yêu cầu refusal: type: string description: Nội dung từ chối (nếu có) nullable: true role: type: string description: >- Vai trò của tin nhắn, ví dụ: system / user / assistant / model description: Vui lòng cung cấp nội dung tài liệu cần dịch. x-apifox-orders: - annotations - content - refusal - role x-apidog-orders: - annotations - content - refusal - role x-apifox-orders: - finish_reason - index - logprobs - message x-apidog-orders: - finish_reason - index - logprobs - message description: Danh sách các kết quả ứng viên created: type: integer description: Thời gian tạo (dấu thời gian Unix) id: type: string description: ID tài nguyên hoặc tác vụ model: type: string description: Tên mô hình / mã định danh mô hình object: type: string description: 'Định danh kiểu đối tượng, ví dụ: chat.completion' service_tier: type: string description: Cấp dịch vụ / mức ưu tiên system_fingerprint: type: string description: Dấu vân tay cấu hình phía máy chủ usage: type: object required: - prompt_tokens - completion_tokens - total_tokens - prompt_tokens_details - completion_tokens_details - latency_checkpoint properties: completion_tokens: type: integer description: Số lượng token hoàn thành completion_tokens_details: type: object required: - reasoning_tokens - audio_tokens - accepted_prediction_tokens - rejected_prediction_tokens properties: accepted_prediction_tokens: type: integer description: Số lượng token dự đoán được chấp nhận audio_tokens: type: integer description: Số lượng token liên quan đến âm thanh reasoning_tokens: type: integer description: Số token được sử dụng trong quá trình suy luận rejected_prediction_tokens: type: integer description: Số lượng token dự đoán bị từ chối description: Phân tích chi tiết số token hoàn thành x-apifox-orders: - accepted_prediction_tokens - audio_tokens - reasoning_tokens - rejected_prediction_tokens x-apidog-orders: - accepted_prediction_tokens - audio_tokens - reasoning_tokens - rejected_prediction_tokens latency_checkpoint: type: object required: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms properties: engine_tbt_ms: type: integer description: Thời gian giữa các token của engine (ms) engine_ttft_ms: type: integer description: Thời gian của bộ máy đến token đầu tiên (ms) engine_ttlt_ms: type: integer description: Tổng độ trễ của bộ máy (ms) pre_inference_ms: type: integer description: Thời gian chuẩn bị trước khi suy luận (ms) service_tbt_ms: type: integer description: >- Khoảng thời gian giữa các token ở phía dịch vụ (ms) service_ttft_ms: type: integer description: Thời gian từ phía dịch vụ đến mã từ đầu tiên (ms) service_ttlt_ms: type: integer description: Tổng độ trễ phía dịch vụ (ms) total_duration_ms: type: integer description: Tổng thời lượng (ms) user_visible_ttft_ms: type: integer description: >- Thời gian đến token đầu tiên mà người dùng nhìn thấy (ms) description: Thông tin điểm kiểm tra độ trễ x-apifox-orders: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms x-apidog-orders: - engine_tbt_ms - engine_ttft_ms - engine_ttlt_ms - pre_inference_ms - service_tbt_ms - service_ttft_ms - service_ttlt_ms - total_duration_ms - user_visible_ttft_ms prompt_tokens: type: integer description: Số lượng token trong lời nhắc prompt_tokens_details: type: object required: - cached_tokens - audio_tokens properties: audio_tokens: type: integer description: Số lượng token liên quan đến âm thanh cached_tokens: type: integer description: Số lượng token trúng bộ nhớ đệm description: Phân tích chi tiết token của lời nhắc x-apifox-orders: - audio_tokens - cached_tokens x-apidog-orders: - audio_tokens - cached_tokens total_tokens: type: integer description: Tổng số token description: Thống kê mức sử dụng token x-apifox-orders: - completion_tokens - completion_tokens_details - latency_checkpoint - prompt_tokens - prompt_tokens_details - total_tokens x-apidog-orders: - completion_tokens - completion_tokens_details - latency_checkpoint - prompt_tokens - prompt_tokens_details - total_tokens refName: V1ChatCompletionsResponse x-apifox-orders: - choices - created - id - model - object - service_tier - system_fingerprint - usage x-apidog-orders: - choices - created - id - model - object - service_tier - system_fingerprint - usage examples: example: summary: example value: choices: - finish_reason: dừng index: 0 logprobs: '' message: annotations: [] content: Xin chào, hôm nay tôi có thể hỗ trợ bạn như thế nào? refusal: '' role: >- Vui lòng cung cấp nội dung tài liệu kỹ thuật cần dịch. created: 1677652288 id: chatcmpl-123 model: gpt-4o object: chat.completion service_tier: mặc định system_fingerprint: fp_abc123 usage: completion_tokens: 12 completion_tokens_details: accepted_prediction_tokens: 0 audio_tokens: 0 reasoning_tokens: 0 rejected_prediction_tokens: 0 latency_checkpoint: engine_tbt_ms: 0 engine_ttft_ms: 0 engine_ttlt_ms: 0 pre_inference_ms: 0 service_tbt_ms: 0 service_ttft_ms: 0 service_ttlt_ms: 0 total_duration_ms: 0 user_visible_ttft_ms: 0 prompt_tokens: 9 prompt_tokens_details: audio_tokens: 0 cached_tokens: 0 total_tokens: 21 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 tương thích với trò chuyện x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208850-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Nhúng văn bản [định dạng tương thích với trò chuyện]" Nguồn: https://docs.openaihub.net/api-45208851/ > 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: /v1/embeddings: post: summary: Nhúng văn bản [định dạng tương thích với trò chuyện] deprecated: false description: >- Tạo các phần nhúng vectơ văn bản. Chọn dịch vụ nguồn thông qua `model` (chẳng hạn như `text-embedding-3-small` của OpenAI hoặc mô hình phần nhúng của Gemini). Tài liệu chính thức của OpenAI: https://platform.openai.com/docs/api-reference/embeddings operationId: v1_embeddings tags: - >- OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/Gemini/Định dạng tương thích với trò chuyện - Nhúng parameters: [] requestBody: content: application/json: schema: type: object required: - model - input properties: dimensions: type: integer description: Số chiều của vectơ input: type: string description: Vui lòng cung cấp nội dung tài liệu cần dịch. model: type: string description: Tên mô hình / mã định danh mô hình refName: V1EmbeddingsRequest x-apifox-orders: - dimensions - input - model x-apidog-orders: - dimensions - input - model examples: minimal: value: input: Món ăn rất ngon và nhân viên phục vụ rất thân thiện. model: text-embedding-3-small summary: minimal description: Mức tối thiểu khả dụng responses: '200': description: Được content: application/json: schema: type: object properties: data: type: array items: type: object x-apidog-orders: [] description: >- Phần dữ liệu (thường là Base64 hoặc một đối tượng có cấu trúc) model: type: string description: Tên mô hình / mã định danh mô hình object: type: string description: 'Định danh kiểu đối tượng, ví dụ: chat.completion' usage: type: object description: Thống kê mức sử dụng token x-apidog-orders: [] refName: V1EmbeddingsResponse x-apifox-orders: - data - model - object - usage x-apidog-orders: - data - model - object - usage examples: example: summary: example value: data: - {} model: chuỗi object: chuỗi usage: {} headers: {} x-apidog-name: Được '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 tương thích với trò chuyện x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208851-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "Tạo phản hồi của mô hình" Nguồn: https://docs.openaihub.net/api-45208852/ > 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: /v1/responses: post: summary: Tạo phản hồi của mô hình deprecated: false description: >- https://platform.openai.com/docs/api-reference/responses/create Một số mô hình OpenAI chỉ hỗ trợ định dạng Response, chẳng hạn như o3-pro, codex-mini-latest operationId: v1_responses tags: - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/Trò chuyện (Phản hồi) - Phản hồi parameters: - name: Content-Type in: header description: Content-Type của phần thân yêu cầu, thường là application/json required: true example: application/json schema: type: string - name: Accept in: header description: Content-Type dự kiến của phản hồi required: true example: application/json schema: type: string - name: Authorization in: header description: Khóa API Bearer required: false example: Bearer {{YOUR_API_KEY}} schema: type: string requestBody: content: application/json: schema: type: object properties: input: type: array items: type: object properties: content: type: string description: Nội dung tin nhắn hoặc yêu cầu role: type: string description: >- Vai trò của tin nhắn, ví dụ: system / user / assistant / model x-apifox-orders: - content - role x-apidog-orders: - content - role description: Vui lòng cung cấp nội dung tài liệu cần dịch. model: type: string description: >- Mã định danh của mô hình cần sử dụng. Để biết thêm thông tin về những mô hình có thể được sử dụng với Chat API, hãy xem bảng tương thích điểm cuối của mô hình. refName: PostV1ResponsesRequest x-apifox-orders: - input - model x-apidog-orders: - input - model examples: gpt_4_1: value: '[long payload omitted: 3,821 units]' summary: gpt_4_1 description: Tạo lệnh gọi hàm Sao chép responses: '200': description: '' content: application/json: schema: type: object required: - id - object - created - choices - usage properties: choices: type: array items: type: object properties: finish_reason: type: string description: 'Lý do kết thúc, ví dụ: stop, length' index: type: integer description: Chỉ mục của mục ứng viên message: type: object required: - role - content properties: content: type: string description: Nội dung tin nhắn hoặc yêu cầu role: type: string description: >- Vai trò của tin nhắn, ví dụ: system / user / assistant / model description: Vui lòng cung cấp nội dung tài liệu cần dịch. x-apifox-orders: - content - role x-apidog-orders: - content - role x-apifox-orders: - finish_reason - index - message x-apidog-orders: - finish_reason - index - message description: Danh sách các kết quả ứng viên created: type: integer description: Thời gian tạo (dấu thời gian Unix) id: type: string description: ID tài nguyên hoặc tác vụ object: type: string description: 'Định danh kiểu đối tượng, ví dụ: chat.completion' usage: type: object required: - prompt_tokens - completion_tokens - total_tokens properties: completion_tokens: type: integer description: Số lượng token hoàn thành prompt_tokens: type: integer description: Số lượng token trong lời nhắc total_tokens: type: integer description: Tổng số token description: Thống kê mức sử dụng token x-apifox-orders: - completion_tokens - prompt_tokens - total_tokens x-apidog-orders: - completion_tokens - prompt_tokens - total_tokens refName: PostV1ResponsesResponse x-apifox-orders: - choices - created - id - object - usage x-apidog-orders: - choices - created - id - object - usage examples: example: summary: example value: '[long payload omitted: 1,698 units]' 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/Trò chuyện (Phản hồi) x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208852-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ``` --- # "nén ngữ cảnh gpt" Nguồn: https://docs.openaihub.net/api-45208853/ > 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: /v1/responses/compact: post: summary: nén ngữ cảnh gpt deprecated: false description: Nén ngữ cảnh trò chuyện GPT để giảm số lượng token cho các yêu cầu sau. operationId: v1_responses_compact tags: - OpenAiHub Việt Nam/OpenAiHub Tiếng Việt/Trò chuyện/Trò chuyện (Phản hồi) - Phản hồi parameters: [] requestBody: content: application/json: schema: type: object required: - model - input properties: input: type: array items: type: object required: - type - role - content properties: content: type: string description: Nội dung thông điệp role: type: string description: >- Vai trò của tin nhắn, các giá trị tùy chọn: user/assistant/system type: type: string description: Loại thông điệp, giá trị cố định là message x-apifox-orders: - content - role - type x-apidog-orders: - content - role - type description: Danh sách các tin nhắn trong lịch sử cần được nén model: type: string description: Tên mô hình, chẳng hạn như gpt-5-codex refName: PostV1ResponsesCompactRequest x-apifox-orders: - input - model x-apidog-orders: - input - model examples: gpt_5_4: value: input: - content: Xin chào, đây là một bài kiểm tra ngắn gọn. role: user type: message model: gpt-5.4 summary: gpt_5_4 description: nén ngữ cảnh gpt responses: '200': description: '' content: application/json: schema: type: object x-apidog-orders: [] examples: example: summary: example value: '[long payload omitted: 1,684 units]' 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/Trò chuyện (Phản hồi) x-apidog-status: released x-run-in-apidog: https://app.apidog.com/web/project/1218648/apis/api-45208853-run components: schemas: {} securitySchemes: {} servers: - url: https://api.openaihub.net description: Prod Env security: [] ```