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

# Get all unit costs for a cost report

> Return all UnitCosts for a CostReport.



## OpenAPI

````yaml https://api.vantage.sh/v2/oas_v3.json get /unit_costs
openapi: 3.0.1
info:
  title: Vantage
  description: Vantage API
  termsOfService: https://www.vantage.sh/terms-of-use
  contact:
    name: Vantage Support
    url: https://www.vantage.sh
    email: support@vantage.sh
  version: 2.0.0
servers:
  - url: https://api.vantage.sh/v2
security:
  - oauth2:
      - read
tags:
  - name: AccessGrants
    description: Operations about AccessGrants
  - name: AnomalyAlerts
    description: Operations about AnomalyAlerts
  - name: AnomalyNotifications
    description: Operations about AnomalyNotifications
  - name: AuditLogs
    description: Operations about AuditLogs
  - name: BillingProfiles
    description: Operations about BillingProfiles
  - name: BillingRules
    description: Operations about BillingRules
  - name: BudgetAlerts
    description: Operations about BudgetAlerts
  - name: Budgets
    description: Operations about Budgets
  - name: BusinessMetrics
    description: Operations about BusinessMetrics
  - name: Canvases
    description: Operations about Canvases
  - name: CostAlertEvents
    description: Operations about CostAlertEvents
  - name: CostAlerts
    description: Operations about CostAlerts
  - name: CostProvider
    description: Operations about CostProviders
  - name: CostProviderAccounts
    description: Operations about CostProviderAccounts
  - name: Costs
    description: Operations about Costs
  - name: CostService
    description: Operations about CostServices
  - name: Dashboards
    description: Operations about Dashboards
  - name: DataExports
    description: Operations about DataExports
  - name: ExchangeRates
    description: Operations about ExchangeRates
  - name: FinancialCommitmentReports
    description: Operations about FinancialCommitmentReports
  - name: FinancialCommitments
    description: Operations about FinancialCommitments
  - name: Folders
    description: Operations about Folders
  - name: Integrations
    description: Operations about Integrations
  - name: Invoices
    description: Operations about Invoices
  - name: KubernetesEfficiencyReports
    description: Operations about KubernetesEfficiencyReports
  - name: ManagedAccounts
    description: Operations about ManagedAccounts
  - name: Me
    description: Operations about Mes
  - name: NetworkFlowReports
    description: Operations about NetworkFlowReports
  - name: OpenAPISpecification
    description: Operations about OpenAPISpecifications
  - name: Ping
    description: Operations about Pings
  - name: Prices
    description: Operations about Prices
  - name: Recommendations
    description: Operations about Recommendations
  - name: RecommendationViews
    description: Operations about RecommendationViews
  - name: ReportNotifications
    description: Operations about ReportNotifications
  - name: ResourceReports
    description: Operations about ResourceReports
  - name: Resources
    description: Operations about Resources
  - name: SavedFilters
    description: Operations about SavedFilters
  - name: Segments
    description: Operations about Segments
  - name: Tags
    description: Operations about Tags
  - name: Teams
    description: Operations about Teams
  - name: UnitCosts
    description: Operations about UnitCosts
  - name: UserFeedback
    description: Operations about UserFeedbacks
  - name: Users
    description: Operations about Users
  - name: VirtualTags
    description: Operations about VirtualTags
  - name: Workspaces
    description: Operations about Workspaces
paths:
  /unit_costs:
    get:
      tags:
        - UnitCosts
      summary: Get all unit costs for a cost report
      description: Return all UnitCosts for a CostReport.
      operationId: getUnitCosts
      parameters:
        - name: cost_report_token
          in: query
          description: The CostReport token.
          required: true
          schema:
            type: string
        - name: start_date
          in: query
          description: >-
            First date you would like to filter unit costs from. Defaults to the
            report's default. ISO 8601 formatted.
          schema:
            type: string
        - name: end_date
          in: query
          description: >-
            Last date you would like to filter unit costs to. Defaults to the
            report's default. ISO 8601 formatted.
          schema:
            type: string
        - name: date_bin
          in: query
          description: >-
            The date bin of the unit costs. Defaults to the report's default or
            day.
          schema:
            type: string
            enum:
              - day
              - week
              - month
              - quarter
              - hour
        - name: order
          in: query
          description: >-
            Whether to order unit costs by date in an ascending or descending
            manner.
          schema:
            type: string
            default: desc
            enum:
              - asc
              - desc
        - name: limit
          in: query
          description: The amount of results to return. The maximum is 1000.
          schema:
            type: integer
            format: int32
        - name: page
          in: query
          description: The page of results to return.
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnitCosts'
              example:
                links:
                  self: >-
                    https://api.vantage.sh/v2/unit_costs?cost_report_token=rprt_ea7dbb4f5783d677
                  first: >-
                    https://api.vantage.sh/v2/unit_costs?cost_report_token=rprt_ea7dbb4f5783d677&page=1
                  next: null
                  last: null
                  prev: null
                unit_costs:
                  - business_metric_token: bsnss_mtrc_3080a050c04104ff
                    business_metric_title: Biz Metric
                    unit_cost_amount: '21.7'
                    business_metric_amount: '3.71'
                    scale: '1.0'
                    date: '2023-06-05'
                  - business_metric_token: bsnss_mtrc_4999b969d95095ef
                    business_metric_title: Different Biz Metric
                    unit_cost_amount: '101.11'
                    business_metric_amount: '43.21'
                    scale: '1.0'
                    date: '2023-06-05'
                  - business_metric_token: bsnss_mtrc_3080a050c04104ff
                    business_metric_title: Biz Metric
                    unit_cost_amount: '18.9'
                    business_metric_amount: '3.71'
                    scale: '1.0'
                    date: '2023-06-06'
                  - business_metric_token: bsnss_mtrc_4999b969d95095ef
                    business_metric_title: Different Biz Metric
                    unit_cost_amount: '121.12'
                    business_metric_amount: '38.1'
                    scale: '1.0'
                    date: '2023-06-06'
                  - business_metric_token: bsnss_mtrc_3080a050c04104ff
                    business_metric_title: Biz Metric
                    unit_cost_amount: '21.2'
                    business_metric_amount: '3.51'
                    scale: '1.0'
                    date: '2023-06-07'
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '402':
          description: PaymentRequired
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '404':
          description: NotFound
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      security:
        - oauth2:
            - read
components:
  schemas:
    UnitCosts:
      required:
        - unit_costs
      type: object
      properties:
        links:
          $ref: '#/components/schemas/Links'
        unit_costs:
          type: array
          items:
            $ref: '#/components/schemas/UnitCost'
      description: UnitCosts model
    Errors:
      required:
        - errors
      type: object
      properties:
        links:
          $ref: '#/components/schemas/Links'
        errors:
          type: array
          nullable: false
          items:
            type: string
      description: Errors model
    Links:
      type: object
      properties:
        self:
          type: string
          description: The URL of the current page of results.
          nullable: true
        first:
          type: string
          description: The URL of the first page of results.
          nullable: true
        next:
          type: string
          description: The URL of the next page of results, if one exists.
          nullable: true
        last:
          type: string
          description: The URL of the last page of results, if one exists.
          nullable: true
        prev:
          type: string
          description: The URL of the previous page of results, if one exists.
          nullable: true
    UnitCost:
      required:
        - business_metric_amount
        - business_metric_title
        - business_metric_token
        - date
        - scale
        - unit_cost_amount
      type: object
      properties:
        links:
          $ref: '#/components/schemas/Links'
        business_metric_token:
          type: string
          description: >-
            The token of the BusinessMetric for which the unit cost was
            calculated.
          nullable: false
          example: bsnss_mtrc_1234
        business_metric_title:
          type: string
          description: >-
            The title of the BusinessMetric for which the unit cost was
            calculated.
          nullable: false
          example: Total Revenue
        calculation_type:
          type: string
          description: The calculation type applied to produce this result.
          nullable: true
          example: unit_cost
          enum:
            - unit_cost
            - gross_margin
            - usage_unit_cost
            - raw_business_metric
        unit_cost_amount:
          type: string
          description: >-
            The amount of the unit cost. For raw_business_metric types, this
            equals the business_metric_amount.
          nullable: false
          example: '4.25'
        business_metric_amount:
          type: string
          description: The amount of the business metric.
          nullable: false
          example: '0.371'
        scale:
          type: number
          description: >-
            The scale of the BusinessMetric's values within a particular
            CostReport.
          format: float
          nullable: false
          example: 1
        date:
          type: string
          description: The date for which the unit cost was calculated. ISO 8601 Formatted.
          nullable: false
          example: 2023-09-05+00:00
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://console.vantage.sh/account/profile
          scopes:
            read: Grants read access
            write: Grants write access

````