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

# App Cost Breakdown

> Return a per-service cost breakdown for an app over a billing period.



## OpenAPI

````yaml https://api.getfloo.com/openapi.json get /v1/billing/apps/{app_id}/cost-breakdown
openapi: 3.1.0
info:
  title: floo API
  version: 0.1.0
servers:
  - url: https://api.getfloo.com
security: []
paths:
  /v1/billing/apps/{app_id}/cost-breakdown:
    get:
      tags:
        - billing
      summary: App Cost Breakdown
      description: Return a per-service cost breakdown for an app over a billing period.
      operationId: billing_app_cost_breakdown
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: App Id
        - name: period
          in: query
          required: false
          schema:
            type: string
            description: >-
              Period to query: "current_billing_period", "current_month",
              "last_month", or "last_7d".
            default: current_billing_period
            title: Period
          description: >-
            Period to query: "current_billing_period", "current_month",
            "last_month", or "last_7d".
        - $ref: '#/components/parameters/X-Floo-Org-Id'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppCostBreakdownResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  parameters:
    X-Floo-Org-Id:
      name: X-Floo-Org-Id
      in: header
      required: false
      schema:
        type: string
        format: uuid
      description: Organization to act in; defaults to the one joined most recently.
  schemas:
    AppCostBreakdownResponse:
      properties:
        app_id:
          type: string
          format: uuid
          title: App Id
        period:
          $ref: '#/components/schemas/CostBreakdownPeriod'
        total_cost_usd:
          type: number
          title: Total Cost Usd
        services:
          items:
            $ref: '#/components/schemas/ServiceCostBreakdown'
          type: array
          title: Services
        managed_resources:
          items:
            $ref: '#/components/schemas/ManagedResourceCostBreakdown'
          type: array
          title: Managed Resources
        unattributed_cost_usd:
          type: number
          title: Unattributed Cost Usd
          default: 0
      type: object
      required:
        - app_id
        - period
        - total_cost_usd
        - services
      title: AppCostBreakdownResponse
      description: Per-app cost breakdown response.
    ErrorResponse:
      properties:
        detail:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Body of every error response except request validation (422).
    CostBreakdownPeriod:
      properties:
        start:
          type: string
          format: date-time
          title: Start
        end:
          type: string
          format: date-time
          title: End
        label:
          type: string
          title: Label
      type: object
      required:
        - start
        - end
        - label
      title: CostBreakdownPeriod
      description: Time period for a cost breakdown query.
    ServiceCostBreakdown:
      properties:
        service_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Service Id
        name:
          type: string
          title: Name
        costs:
          additionalProperties:
            $ref: '#/components/schemas/ResourceCost'
          type: object
          title: Costs
        lines:
          items:
            $ref: '#/components/schemas/CostLine'
          type: array
          title: Lines
        total_usd:
          type: number
          title: Total Usd
      type: object
      required:
        - service_id
        - name
        - costs
        - total_usd
      title: ServiceCostBreakdown
      description: Per-service cost breakdown.
    ManagedResourceCostBreakdown:
      properties:
        managed_service_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Managed Service Id
        env_managed_resource_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Env Managed Resource Id
        name:
          type: string
          title: Name
        env:
          anyOf:
            - type: string
            - type: 'null'
          title: Env
        costs:
          additionalProperties:
            $ref: '#/components/schemas/ResourceCost'
          type: object
          title: Costs
        lines:
          items:
            $ref: '#/components/schemas/CostLine'
          type: array
          title: Lines
        total_usd:
          type: number
          title: Total Usd
      type: object
      required:
        - managed_service_id
        - env_managed_resource_id
        - name
        - env
        - costs
        - total_usd
      title: ManagedResourceCostBreakdown
      description: Per-managed-resource cost breakdown.
    ErrorDetail:
      properties:
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
      additionalProperties: true
      type: object
      required:
        - code
        - message
      title: ErrorDetail
      description: Standard error envelope with operation-specific JSON context.
    ResourceCost:
      properties:
        cost_usd:
          type: number
          title: Cost Usd
      type: object
      required:
        - cost_usd
      title: ResourceCost
      description: Cost for a single resource type — customer-facing amount only.
    CostLine:
      properties:
        rate_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Rate Key
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
        quantity:
          type: number
          title: Quantity
        unit:
          type: string
          title: Unit
        display_unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Unit
        rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Rate
        display_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Display Rate
        rate_card_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Rate Card Version
        effective_from:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Effective From
        cost_usd:
          type: number
          title: Cost Usd
        resource_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Resource Type
        env:
          anyOf:
            - type: string
            - type: 'null'
          title: Env
      type: object
      required:
        - rate_key
        - label
        - quantity
        - unit
        - display_unit
        - rate
        - display_rate
        - rate_card_version
        - effective_from
        - cost_usd
      title: CostLine
      description: >-
        Recorded quantity and price evidence; legacy rate metadata stays
        unknown.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A `floo_` API key.

````

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