> ## 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.

# 上报计费事件

> Report a billable event for a PER_USE meter. Charges the authorized user's credits based on the meter pricing. Requires OAuth Bearer token (not API Key).



## OpenAPI

````yaml POST /v1/events
openapi: 3.0.0
info:
  title: Profy Platform API
  version: 1.0.0
  description: >-
    Platform API for building on Profy — invoke Experts, use models, report
    billing events, and manage OAuth.
servers:
  - url: https://api.profy.cn
    description: Production
security: []
paths:
  /v1/events:
    post:
      tags:
        - Platform API
      summary: Report custom billing event (PER_USE, OAuth only)
      description: >-
        Report a billable event for a PER_USE meter. Charges the authorized
        user's credits based on the meter pricing. Requires OAuth Bearer token
        (not API Key).
      operationId: reportEvent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                event:
                  type: string
                  maxLength: 100
                  description: Event name matching a configured billing meter
                  example: generate_report
                idempotency_key:
                  type: string
                  maxLength: 128
                  description: Unique key to prevent duplicate charges
                  example: order-12345
                metadata:
                  type: object
                  additionalProperties:
                    type: string
                  description: Arbitrary key-value pairs for tracking
              required:
                - event
                - idempotency_key
      responses:
        '200':
          description: Event processed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  charged:
                    type: number
                    description: Credits charged for this event
                  balance_remaining:
                    type: number
                    description: Remaining credit balance
                  idempotent_replay:
                    type: boolean
                    description: >-
                      True if this was a duplicate request (no additional
                      charge)
                required:
                  - charged
                  - balance_remaining
        '400':
          description: Invalid request, missing fields, or unknown event name
        '401':
          description: OAuth token required (API Key not accepted)
        '429':
          description: Daily spending limit exceeded
      security:
        - BearerToken: []
components:
  securitySchemes:
    BearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth2 access token issued via POST /oauth/token

````