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

# AI 模型调用

> Proxy chat completions through a model provider with automatic token billing.



## OpenAPI

````yaml POST /openapi/v1/events/chat
openapi: 3.0.0
info:
  title: Profy App API
  version: 1.0.0
  description: OAuth 2.0 and Events API for Profy App integrations.
servers:
  - url: https://app.profy.cn
    description: Production
security: []
paths:
  /openapi/v1/events/chat:
    post:
      tags:
        - Events
      summary: AI model event — OpenAI compatible (METERED)
      description: >-
        Proxy chat completions through a model provider with automatic token
        billing.
      operationId: postChatEvent
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  example: deepseek-chat
                messages:
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                      content:
                        type: string
                    required:
                      - role
                      - content
                  minItems: 1
                stream:
                  type: boolean
                temperature:
                  type: number
                max_tokens:
                  type: number
                top_p:
                  type: number
                frequency_penalty:
                  type: number
                presence_penalty:
                  type: number
                stop:
                  anyOf:
                    - type: string
                    - type: array
                      items:
                        type: string
              required:
                - model
                - messages
      responses:
        '200':
          description: Chat completion response (JSON or SSE stream)
        '400':
          description: Missing required fields or model not available
        '401':
          description: Unauthorized
        '502':
          description: Model provider error
      security:
        - Bearer: []
components:
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth2 access token issued via POST /oauth/token

````