# "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: []

```
