> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bibigpt.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Creates a summary completion for the given video url in chat message.

> Support video_url type, or url in text content in chat message, another text content could be custom prompot for summary.. Compatible with OpenAI Chat API format.



## OpenAPI

````yaml https://api.bibigpt.co/swagger.json post /api/v1/chat/completions
openapi: 3.0.1
info:
  title: BibiGPT OpenAPI 规范
  description: 音视频 AI 学习助理的开放 API，加速音视频内容的信息提取，借助 AI 直接采取行动。
  version: v1
servers:
  - url: https://api.bibigpt.co
security: []
tags: []
paths:
  /api/v1/chat/completions:
    post:
      summary: Creates a summary completion for the given video url in chat message.
      description: >-
        Support video_url type, or url in text content in chat message, another
        text content could be custom prompot for summary.. Compatible with
        OpenAI Chat API format.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - messages
              properties:
                messages:
                  type: array
                  items:
                    type: object
                    required:
                      - role
                      - content
                    properties:
                      role:
                        type: string
                        enum:
                          - system
                          - user
                          - assistant
                        description: The role of the message author
                      content:
                        oneOf:
                          - type: string
                            description: >-
                              Text content of the message. If it contains a
                              video URL (e.g.,
                              https://www.bilibili.com/video/BV1Sk4y1x7r2), the
                              video will be automatically summarized.
                            example: https://www.bilibili.com/video/BV1Sk4y1x7r2
                          - type: object
                            properties:
                              text:
                                type: string
                                description: >-
                                  The text content to process. If it contains a
                                  video URL, the video will be automatically
                                  summarized. When used with video_url type in
                                  the same request, this text will be used as a
                                  custom summary prompt.
                              type:
                                type: string
                                enum:
                                  - text
                                description: Specifies this is a text content type
                            required:
                              - text
                              - type
                            example:
                              text: 请帮我总结一下这个视频的内容，用中文回答
                              type: text
                          - type: object
                            properties:
                              video_url:
                                type: string
                                description: >-
                                  The URL of the video to analyze (e.g.,
                                  https://www.bilibili.com/video/BV1Sk4y1x7r2).
                                  Can be combined with a text message to
                                  customize the summary prompt.
                              type:
                                type: string
                                enum:
                                  - video_url
                                description: >-
                                  Explicitly specifies this is a video URL
                                  content type
                            required:
                              - video_url
                              - type
                            example:
                              video_url: https://www.bilibili.com/video/BV1Sk4y1x7r2
                              type: video_url
                          - type: object
                            properties:
                              image_url:
                                type: string
                                description: The URL of the image to analyze
                              type:
                                type: string
                                enum:
                                  - image_url
                                description: Specifies this is an image URL content type
                            required:
                              - image_url
                              - type
                            example:
                              image_url: https://example.com/image.jpg
                              type: image_url
                model:
                  type: string
                  description: >-
                    ID of the model to use. Defaults to 'bibigpt' if not
                    specified. Can be prefixed with 'bibigpt/' for custom
                    models.
                stream:
                  type: boolean
                  description: If set, partial message deltas will be sent as a stream.
                  default: false
            example:
              messages:
                - role: user
                  content: https://www.bilibili.com/video/BV1Sk4y1x7r2
              model: bibigpt
              stream: false
      responses:
        '200':
          description: Successful response with completion
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the completion
                  object:
                    type: string
                    enum:
                      - chat.completion
                  created:
                    type: integer
                    description: Unix timestamp of when the completion was created
                  model:
                    type: string
                    description: The model used for completion
                  choices:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                        message:
                          type: object
                          properties:
                            role:
                              type: string
                              enum:
                                - assistant
                            content:
                              type: string
                        finish_reason:
                          type: string
                          enum:
                            - stop
                            - length
                            - content_filter
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '429':
          description: Rate limit exceeded or insufficient credits
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
      security:
        - ApiKeyAuth: []
        - OAuth2:
            - read
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API Token for authentication. Use format 'Bearer YOUR_API_TOKEN'
    OAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://api.bibigpt.co/api/auth/authorize
          tokenUrl: https://api.bibigpt.co/api/auth/token
          scopes:
            read: Read access to BibiGPT APIs
            write: Write access to BibiGPT APIs

````