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

# Хэрэглээ

> Байгууллагын хэрэглээ, хоёр огноо оруулаад. 92 хоног хүртэл. Тооцоонд биш, харуулахад зориулсан тоо.

Шаардлагатай эрх: `analytics:read`

Зөвхөн байгууллагын API key.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/usage
openapi: 3.1.0
info:
  title: Raptora API
  version: 1.0.0
  description: >-
    Агент, хэрэгсэл, мэдлэгийн сан, виджет, webhook үүсгэж, агентаа нийтлэх,
    дуудлага, чат, үнэлгээгээ өөрийн системээс унших API.
servers:
  - url: https://api.raptora.io
security:
  - apiKey: []
tags:
  - name: Утасны дугаар
  - name: Агент
  - name: Дуудлага
  - name: Чат
  - name: Үнэлгээ
  - name: Үнэлгээний шалгуур
  - name: Төсөл
  - name: Хоолой
  - name: Хэрэгсэл
  - name: Мэдлэгийн сан
  - name: Виджет
  - name: Webhook
  - name: Хэрэглээ
paths:
  /v1/usage:
    get:
      tags:
        - Хэрэглээ
      summary: Хэрэглээ
      description: >-
        Байгууллагын хэрэглээ, хоёр огноо оруулаад. 92 хоног хүртэл. Тооцоонд
        биш, харуулахад зориулсан тоо.


        Шаардлагатай эрх: `analytics:read`


        Зөвхөн байгууллагын API key.
      operationId: usage.retrieve
      parameters:
        - name: from
          in: query
          required: true
          description: '`YYYY-MM-DD`, Улаанбаатарын цагаар.'
          schema:
            type: string
            format: date
            pattern: >-
              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
        - name: to
          in: query
          required: true
          description: '`YYYY-MM-DD`, Улаанбаатарын цагаар.'
          schema:
            type: string
            format: date
            pattern: >-
              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageReport'
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
components:
  schemas:
    UsageReport:
      type: object
      properties:
        object:
          type: string
          const: usage_report
        from:
          type: string
        to:
          type: string
        byFeature:
          type: array
          items:
            type: object
            properties:
              feature:
                $ref: '#/components/schemas/UsageFeature'
              meter:
                $ref: '#/components/schemas/UsageMeter'
              unit:
                $ref: '#/components/schemas/UsageUnit'
              quantity:
                type: number
              events:
                type: integer
                minimum: -9007199254740991
                maximum: 9007199254740991
            required:
              - feature
              - meter
              - unit
              - quantity
              - events
        byAgent:
          type: array
          items:
            type: object
            properties:
              agentId:
                anyOf:
                  - type: string
                    format: uuid
                  - type: 'null'
              meter:
                $ref: '#/components/schemas/UsageMeter'
              unit:
                $ref: '#/components/schemas/UsageUnit'
              quantity:
                type: number
            required:
              - agentId
              - meter
              - unit
              - quantity
        daily:
          type: array
          items:
            type: object
            properties:
              day:
                type: string
              meter:
                $ref: '#/components/schemas/UsageMeter'
              quantity:
                type: number
            required:
              - day
              - meter
              - quantity
      required:
        - object
        - from
        - to
        - byFeature
        - byAgent
        - daily
    UsageFeature:
      type: string
      enum:
        - VOICE_CALL_INBOUND
        - VOICE_CALL_OUTBOUND
        - WIDGET_CHAT
        - MESSENGER_CHAT
        - INSTAGRAM_CHAT
        - CALL_STEER
        - CALL_HANDOVER
        - CALL_BATCH
        - KNOWLEDGE_BASE
        - PHONE_LINE
        - AGENT_PREVIEW
        - COPILOT
        - SMART_OPERATOR
        - POST_CALL_ANALYSIS
        - LABELLING
        - CONSOLE_DICTATION
        - TURN_DETECTION
    UsageMeter:
      type: string
      enum:
        - AGENT_MINUTES
        - INPUT_TOKENS
        - OUTPUT_TOKENS
        - CACHE_READ_TOKENS
        - CACHE_WRITE_TOKENS
        - CALL_COUNT
        - CHAT_COUNT
        - TOOL_CALLS
        - PHONE_NUMBER_MONTHS
        - PHONE_LINE_MONTHS
        - STT_MINUTES
        - TELEPHONY_MINUTES
        - TTS_CHARACTERS
    UsageUnit:
      type: string
      enum:
        - MINUTE
        - TOKEN
        - COUNT
        - MONTH
        - CHARACTER
    Problem:
      type: object
      properties:
        type:
          type: string
          description: Алдааны төрлийг тодорхойлох URL.
        title:
          type: string
        status:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        detail:
          type: string
        requestId:
          type: string
          description: Тусламж хүсэхдээ энэ дугаарыг хэлнэ.
        errors:
          description: Буруу утгатай талбарууд.
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              message:
                type: string
            required:
              - path
              - message
        requiredScope:
          type: string
        retryAfter:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      required:
        - type
        - title
        - status
        - detail
        - requestId
      description: RFC 9457 алдааны хариу.
  responses:
    Error400:
      description: Параметр буруу.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error401:
      description: API key байхгүй эсвэл хүчингүй.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error403:
      description: API key-д энэ эрх байхгүй.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error429:
      description: >-
        Хэт олон хүсэлт. `Retry-After` header-т заасан секундын дараа дахин
        оролдоно.
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error500:
      description: Серверийн алдаа.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: '`rpt_live_` эсвэл `rpt_test_`-ээр эхэлсэн нууц API key.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.