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

# Get costs



## OpenAPI

````yaml GET /v1/organization/costs
openapi: 3.1.0
info:
  title: Antara API
  version: 1.0.0
  description: OpenAI- and Anthropic-compatible inference plus organization management.
servers:
  - url: https://api.antarah.dev
security: []
paths:
  /v1/organization/costs:
    get:
      summary: Costs in daily UTC buckets (ascending)
      parameters:
        - schema:
            type: integer
            minimum: 0
            maximum: 253402300799
            description: Unix seconds; the first bucket starts at or before it
          required: true
          description: Unix seconds; the first bucket starts at or before it
          name: start_time
          in: query
        - schema:
            type:
              - integer
              - 'null'
            minimum: 0
            maximum: 253402300799
            description: 'Unix seconds, exclusive. Default: now'
          required: false
          description: 'Unix seconds, exclusive. Default: now'
          name: end_time
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          name: project_ids
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          name: api_key_ids
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 200
            description: '`next_page` from the previous response'
          required: false
          description: '`next_page` from the previous response'
          name: page
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          name: group_by
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 180
            default: 7
            description: Daily buckets per page
          required: false
          description: Daily buckets per page
          name: limit
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CostPage'
        '422':
          description: '`invalid_time_range`'
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        default:
          description: RFC 9457 problem details
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - adminKey: []
        - session: []
components:
  schemas:
    CostPage:
      type: object
      properties:
        object:
          type: string
          enum:
            - page
        data:
          type: array
          items:
            type: object
            properties:
              object:
                type: string
                enum:
                  - bucket
              start_time:
                type: integer
                description: Unix seconds
                example: 1793750400
              end_time:
                type: integer
                description: Unix seconds
                example: 1793750400
              results:
                type: array
                items:
                  $ref: '#/components/schemas/CostResult'
            required:
              - object
              - start_time
              - end_time
              - results
        has_more:
          type: boolean
        next_page:
          type:
            - string
            - 'null'
      required:
        - object
        - data
        - has_more
        - next_page
    Problem:
      type: object
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
        detail:
          type:
            - string
            - 'null'
        instance:
          type: string
        code:
          type: string
        request_id:
          type: string
        param:
          type:
            - string
            - 'null'
        errors:
          type: array
          items:
            type: object
            properties:
              pointer:
                type: string
              detail:
                type: string
            required:
              - pointer
              - detail
      required:
        - type
        - title
        - status
        - detail
        - instance
        - code
        - request_id
        - param
    CostResult:
      type: object
      properties:
        object:
          type: string
          enum:
            - organization.costs.result
        amount:
          type: object
          properties:
            value:
              type: string
              pattern: ^\d+\.\d{2}(\d{0,3}[1-9])?$
              example: '12.50'
            currency:
              type: string
              enum:
                - usd
          required:
            - value
            - currency
        line_item:
          type:
            - string
            - 'null'
          description: '`"<model> · input"`, `"… · cached input"`, `"… · output"`'
          example: a1 · input
        project_id:
          type:
            - string
            - 'null'
        api_key_id:
          type:
            - string
            - 'null'
          description: '`null` when ungrouped, or for Playground requests'
      required:
        - object
        - amount
        - line_item
        - project_id
        - api_key_id
  securitySchemes:
    adminKey:
      type: http
      scheme: bearer
      description: '`ak_admin_…` Admin API key'
    session:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Supabase access token + `Antara-Organization` (management) or
        `Antara-Project` (inference)

````

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