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

# Spend per team

> Cost, tokens and requests per team over a window of at most 366 days; defaults to the last 30 days (Enterprise)



## OpenAPI

````yaml /swagger/5.16/ai-studio-swagger.yml get /analytics/team-costs
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/team-costs:
    get:
      tags:
        - Analytics
      summary: Spend per team
      description: >-
        Cost, tokens and requests per team over a window of at most 366 days;
        defaults to the last 30 days (Enterprise)
      parameters:
        - name: start_date
          in: query
          description: Start date (YYYY-MM-DD)
          schema:
            type: string
        - name: end_date
          in: query
          description: End date (YYYY-MM-DD, inclusive)
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/team_budget.TeamCosts'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    team_budget.TeamCosts:
      type: object
      properties:
        end:
          type: string
        start:
          type: string
        teams:
          type: array
          items:
            $ref: '#/components/schemas/models.TeamCostRow'
        unattributed:
          type: object
          description: Unattributed is spend no team could be resolved for.
          allOf:
            - $ref: '#/components/schemas/models.TeamCostRow'
    api.ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              detail:
                type: string
              title:
                type: string
      description: Error response model
    models.TeamCostRow:
      type: object
      properties:
        cost:
          type: number
        deleted:
          type: boolean
          description: |-
            Deleted marks a team deleted since it spent: its name may since have
            been reused, and it has no page to link to.
        requests:
          type: integer
        team_id:
          type: integer
        team_name:
          type: string
        tokens:
          type: integer
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````