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

# Track conversation usage

> Usage of a conversation.



## OpenAPI

````yaml POST /bc/v1/events/event/conversation-usage
openapi: 3.0.0
info:
  title: Mindlytics API
  version: 1.0.0
servers:
  - url: https://app.mindlytics.ai
security:
  - APIKey: []
    APPId: []
paths:
  /bc/v1/events/event/conversation-usage:
    post:
      tags:
        - Events
      summary: Conversation usage
      description: Usage of a conversation.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                session_id:
                  type: string
                  description: A unique session ID generated by caller
                timestamp:
                  type: string
                  description: >-
                    The timestamp of the event, defaults to "now" if not
                    specified.
                user_id:
                  type: string
                  description: The unique ID of the user
                device_id:
                  type: string
                  description: The ID of the device, if applicable
                type:
                  type: string
                  enum:
                    - track
                  description: The event that tracks an arbitray event
                event:
                  type: string
                  enum:
                    - Conversation Usage
                  description: The event that represents a usage in a conversation
                conversation_id:
                  type: string
                  description: The ID of the conversation
                properties:
                  oneOf:
                    - type: object
                      properties:
                        model:
                          type: string
                          description: The model name
                        prompt_tokens:
                          type: number
                          description: The number of tokens in the prompt
                        completion_tokens:
                          type: number
                          description: The number of tokens in the completion
                      required:
                        - model
                        - prompt_tokens
                        - completion_tokens
                      description: >-
                        Common models have costs that are provided by a service
                        on the web.  If you are using one of these models, you
                        can provide the model name and the number of tokens in
                        the prompt and completion, and the cost will be
                        calculated for you.
                    - type: object
                      properties:
                        cost:
                          type: number
                          description: The cost of the event
                      required:
                        - cost
                      description: >-
                        If you know the cost of a conversation turn, you can
                        provide it directly. This will be accumulated in the
                        conversation analysis.
                  description: >-
                    Properties of a usage event.  Either model and tokens (cost
                    will be calculated if model is known), or cost directly.
              required:
                - session_id
                - type
                - event
                - conversation_id
                - properties
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - start_session
                        - end_session
                        - identify
                        - alias
                        - track
                      title: Event Type
                      description: The type of event being sent.
                  required:
                    - type
                  additionalProperties:
                    anyOf:
                      - type: string
                      - type: number
                      - type: boolean
                  title: Other properties
                  description: Propties that depend on the event type.
                title: Events
                description: >-
                  The events that were generated by the Mindlytics service as a
                  result of this event.
components:
  securitySchemes:
    APIKey:
      type: apiKey
      in: header
      name: Authorization
      description: API Key for your organization
    APPId:
      type: apiKey
      in: header
      name: X-App-ID
      description: Project ID

````