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

# Get Cost Timeline

> Cost over time, grouped by day/week/month.



## OpenAPI

````yaml /openapi.json get /api/costs/timeline
openapi: 3.1.0
info:
  title: Nenyax API
  description: Backend API for Nenyax Voice Agent Platform
  version: 0.1.0
servers:
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /api/costs/timeline:
    get:
      tags:
        - Costs
      summary: Get Cost Timeline
      description: Cost over time, grouped by day/week/month.
      operationId: get_cost_timeline_api_costs_timeline_get
      parameters:
        - name: period
          in: query
          required: false
          schema:
            type: string
            pattern: ^(daily|weekly|monthly)$
            default: daily
            title: Period
        - name: start_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Start Date
        - name: end_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: End Date
        - name: x-user-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-User-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TimelinePointResponse'
                title: Response Get Cost Timeline Api Costs Timeline Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TimelinePointResponse:
      properties:
        date:
          type: string
          title: Date
        total_cost:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total Cost
        by_provider:
          additionalProperties:
            type: string
            pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          type: object
          title: By Provider
      type: object
      required:
        - date
        - total_cost
        - by_provider
      title: TimelinePointResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````