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

# Retrieve organization costs



## OpenAPI

````yaml https://api.abliteration.ai/openapi.json get /v1/organization/costs
openapi: 3.1.0
info:
  title: Abliteration Platform API
  summary: Greenfield Abliteration backend and API gateway.
  version: 0.1.0
servers:
  - url: https://api.abliteration.ai
    description: Production environment
security: []
paths:
  /v1/organization/costs:
    get:
      tags:
        - Administration
      summary: Retrieve organization costs
      operationId: retrieveOrganizationCosts
      parameters:
        - name: start_time
          in: query
          required: true
          schema:
            type: integer
            minimum: 0
            description: Start of the reporting window as Unix seconds.
            title: Start Time
          description: Start of the reporting window as Unix seconds.
        - name: end_time
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 0
              - type: 'null'
            description: End of the reporting window as Unix seconds.
            title: End Time
          description: End of the reporting window as Unix seconds.
        - name: project_ids
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
                maxItems: 100
              - type: 'null'
            description: Public project IDs to include.
            title: Project Ids
          description: Public project IDs to include.
        - name: api_key_ids
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
                maxItems: 100
              - type: 'null'
            description: Public API key IDs to include.
            title: Api Key Ids
          description: Public API key IDs to include.
        - name: group_by
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
                maxItems: 3
              - type: 'null'
            description: Dimensions to group within each bucket.
            title: Group By
          description: Dimensions to group within each bucket.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 180
            minimum: 1
            description: Maximum number of daily cost buckets to return.
            default: 7
            title: Limit
          description: Maximum number of daily cost buckets to return.
        - name: page
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                minLength: 1
                maxLength: 500
              - type: 'null'
            description: Opaque page cursor.
            title: Page
          description: Opaque page cursor.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdministrationCostPage'
        '400':
          description: The request or cursor is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: The Admin API key is missing, invalid, expired, or revoked.
          headers:
            WWW-Authenticate:
              description: Authentication scheme required by the endpoint.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: The Admin API key lacks the required permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: The resource was not found in the credential's organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: The request conflicts with current resource or idempotency state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: The request parameters or body are invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: The credential or organization rate limit was exceeded.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
            X-RateLimit-Limit:
              description: Limit for the blocking rate-limit policy.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests or concurrency slots remaining.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Unix time when the blocking policy resets.
              schema:
                type: integer
            X-RateLimit-Scope:
              description: Credential or organization policy scope.
              schema:
                type: string
            X-RateLimit-Metric:
              description: Requests or concurrent requests.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: The request failed unexpectedly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: A required dependency is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - AdminApiKey: []
components:
  schemas:
    AdministrationCostPage:
      properties:
        object:
          type: string
          const: page
          title: Object
          default: page
        data:
          items:
            $ref: '#/components/schemas/AdministrationCostBucket'
          type: array
          title: Data
        has_more:
          type: boolean
          title: Has More
        next_page:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Page
      type: object
      required:
        - data
        - has_more
      title: AdministrationCostPage
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - error
      title: ErrorResponse
    AdministrationCostBucket:
      properties:
        object:
          type: string
          const: bucket
          title: Object
          default: bucket
        start_time:
          type: integer
          title: Start Time
        end_time:
          type: integer
          title: End Time
        results:
          items:
            $ref: '#/components/schemas/AdministrationCostResult'
          type: array
          title: Results
      type: object
      required:
        - start_time
        - end_time
        - results
      title: AdministrationCostBucket
    ErrorDetail:
      properties:
        code:
          type: string
          title: Code
          description: Stable machine-readable error code.
        message:
          type: string
          title: Message
          description: Bounded human-readable error message.
        type:
          $ref: '#/components/schemas/ErrorType'
          description: Broad stable error category.
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
          description: Request field related to the error.
        request_id:
          type: string
          title: Request Id
          description: Server-owned canonical request ID.
        doc_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Doc Url
          description: Documentation URL for the error.
      type: object
      required:
        - code
        - message
        - type
        - request_id
      title: ErrorDetail
    AdministrationCostResult:
      properties:
        object:
          type: string
          const: organization.costs.result
          title: Object
          default: organization.costs.result
        amount:
          $ref: '#/components/schemas/AdministrationCostAmount'
        line_item:
          anyOf:
            - type: string
            - type: 'null'
          title: Line Item
        project_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Project Id
        api_key_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Api Key Id
      type: object
      required:
        - amount
      title: AdministrationCostResult
    ErrorType:
      type: string
      enum:
        - auth_error
        - permission_error
        - validation_error
        - rate_limit_error
        - billing_error
        - moderation_error
        - policy_error
        - media_error
        - not_found_error
        - conflict_error
        - provider_error
        - internal_error
      title: ErrorType
    AdministrationCostAmount:
      properties:
        value:
          type: string
          title: Value
        currency:
          type: string
          const: usd
          title: Currency
          default: usd
      type: object
      required:
        - value
      title: AdministrationCostAmount
  securitySchemes:
    AdminApiKey:
      type: http
      description: >-
        Server-side organization-owned Abliteration Admin API key. Never expose
        this credential in browser code.
      scheme: bearer

````