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

# Get decision-model usage

> Decision-model traffic (/v1/decisions, /v1/systemone) for a period: totals, a per-day series and a per-model breakdown with cost per thousand decisions. Decision spend is also included in the general cost endpoints.



## OpenAPI

````yaml /swagger/5.16/ai-studio-swagger.yml get /analytics/decisions
openapi: 3.0.1
info:
  title: Midsommar API
  description: This is the API for the Midsommar user and group management system.
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    url: http://www.swagger.io/support
    email: support@swagger.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: //localhost:8080/api/v1
security: []
paths:
  /analytics/decisions:
    get:
      tags:
        - Analytics
      summary: Get decision-model usage
      description: >-
        Decision-model traffic (/v1/decisions, /v1/systemone) for a period:
        totals, a per-day series and a per-model breakdown with cost per
        thousand decisions. Decision spend is also included in the general cost
        endpoints.
      parameters:
        - name: start_date
          in: query
          description: Start date (YYYY-MM-DD)
          required: true
          schema:
            type: string
        - name: end_date
          in: query
          description: End date (YYYY-MM-DD)
          required: true
          schema:
            type: string
        - name: llm_id
          in: query
          description: Only this LLM
          schema:
            type: integer
        - name: app_id
          in: query
          description: Only this App
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/analytics.DecisionUsage'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    analytics.DecisionUsage:
      type: object
      properties:
        by_day:
          $ref: '#/components/schemas/analytics.DecisionDaySeries'
        by_model:
          type: array
          items:
            $ref: '#/components/schemas/analytics.DecisionModelUsage'
        totals:
          $ref: '#/components/schemas/analytics.DecisionTotals'
    models.ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              detail:
                type: string
              title:
                type: string
    analytics.DecisionDaySeries:
      type: object
      properties:
        cost:
          type: array
          items:
            type: number
        failed:
          type: array
          items:
            type: integer
        labels:
          type: array
          items:
            type: string
        questions:
          type: array
          items:
            type: integer
        refusals:
          type: array
          items:
            type: integer
        requests:
          type: array
          items:
            type: integer
    analytics.DecisionModelUsage:
      type: object
      properties:
        cost:
          type: number
        cost_per_thousand:
          type: number
          description: |-
            CostPerThousand is the cost of a thousand answered decision requests
            at this period's average, the number decision pricing is usually
            compared on.
        currency:
          type: string
        failed:
          type: integer
        input_tokens:
          type: integer
        model:
          type: string
        questions:
          type: integer
        refusals:
          type: integer
        requests:
          type: integer
        vendor:
          type: string
    analytics.DecisionTotals:
      type: object
      properties:
        answered:
          type: integer
        cost_by_currency:
          type: object
          additionalProperties:
            type: number
        failed:
          type: integer
        input_tokens:
          type: integer
        questions:
          type: integer
        refusals:
          type: integer
        requests:
          type: integer
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````