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

# Get cost by service

> Breaks down the hourly and monthly cost of each of your current services, with totals. With `teamID`, this needs the `billing.manage` permission.



## OpenAPI

````yaml /spec/platform-billing.yaml get /v1/usage-report
openapi: 3.0.1
info:
  title: Billing & Subscription
  version: 1.0.0
  description: |
    Check your balance and costs, add credit, download invoices and receipts,
    manage your subscription plan, and apply discount codes.

    All amounts are in Toman (IRT).

    With `teamID`, these endpoints work on the team's billing. Most of them
    need the `billing.manage` permission in the team; the description of each
    endpoint says which permission it needs.
servers:
  - url: https://api.liara.ir
security:
  - bearerAuth: []
tags:
  - name: Balance & Usage
    description: Balance, current costs and service counts.
  - name: Payments
    description: Add credit and list past payments.
  - name: Invoices & Receipts
    description: Monthly billing invoices and payment receipts.
  - name: Subscription
    description: View and change the account's subscription plan.
  - name: Discount Codes
    description: Check and apply discount codes.
paths:
  /v1/usage-report:
    get:
      tags:
        - Balance & Usage
      summary: Get cost by service
      description: >-
        Breaks down the hourly and monthly cost of each of your current
        services, with totals. With `teamID`, this needs the `billing.manage`
        permission.
      operationId: getUsageReport
      parameters:
        - $ref: '#/components/parameters/TeamID'
      responses:
        '200':
          description: >-
            Cost per service. The response can include additional fields not
            listed here.
          content:
            application/json:
              schema:
                type: object
                properties:
                  projects:
                    type: array
                    description: Apps.
                    items:
                      allOf:
                        - type: object
                          properties:
                            project_id:
                              type: string
                              description: The app's name.
                            type:
                              type: string
                              description: The app's platform.
                            isOneClickApp:
                              type: boolean
                            planID:
                              type: string
                            bundlePlanID:
                              type: string
                            planHourlyPrice:
                              type: number
                            bundlePlanHourlyPrice:
                              type: number
                            planMonthlyPrice:
                              type: number
                            bundlePlanMonthlyPrice:
                              type: number
                        - $ref: '#/components/schemas/CostTotals'
                  databases:
                    type: array
                    items:
                      allOf:
                        - type: object
                          properties:
                            hostname:
                              type: string
                            type:
                              type: string
                            planID:
                              type: string
                            bundlePlanID:
                              type: string
                            planHourlyPrice:
                              type: number
                            bundlePlanHourlyPrice:
                              type: number
                            planMonthlyPrice:
                              type: number
                            bundlePlanMonthlyPrice:
                              type: number
                        - $ref: '#/components/schemas/CostTotals'
                  buckets:
                    type: array
                    description: Object storage buckets.
                    items:
                      allOf:
                        - type: object
                          properties:
                            name:
                              type: string
                            planID:
                              type: string
                            planHourlyPrice:
                              type: number
                            planMonthlyPrice:
                              type: number
                        - $ref: '#/components/schemas/CostTotals'
                  mailservers:
                    type: array
                    description: Mail servers. Only a monthly price is given.
                    items:
                      type: object
                      properties:
                        domain:
                          type: string
                        planID:
                          type: string
                        monthlyPrice:
                          type: number
                  VMs:
                    type: array
                    description: >-
                      Virtual machines, including their public IPv4 addresses
                      and snapshots.
                    items:
                      allOf:
                        - type: object
                          properties:
                            name:
                              type: string
                            planID:
                              type: string
                            OS:
                              type: string
                            planHourlyPrice:
                              type: number
                            planMonthlyPrice:
                              type: number
                            IPv4sHourlyPrice:
                              type: number
                            IPv4sMonthlyPrice:
                              type: number
                            snapshotsHourlyPrice:
                              type: number
                            snapshotMonthlyPrice:
                              type: number
                        - $ref: '#/components/schemas/CostTotals'
                  workspaces:
                    type: array
                    description: AI workspaces.
                    items:
                      allOf:
                        - type: object
                          properties:
                            name:
                              type: string
                            planID:
                              type: string
                            planHourlyPrice:
                              type: number
                            planMonthlyPrice:
                              type: number
                        - $ref: '#/components/schemas/CostTotals'
                  managedWordpress:
                    type: array
                    description: >-
                      Managed WordPress sites, each with the combined cost of
                      its app and database.
                    items:
                      allOf:
                        - type: object
                          properties:
                            name:
                              type: string
                        - $ref: '#/components/schemas/CostTotals'
                  totalHourlyPrice:
                    type: number
                  totalMonthlyPrice:
                    type: number
              example:
                projects:
                  - project_id: my-app
                    type: node
                    isOneClickApp: false
                    planID: <plan-id>
                    bundlePlanID: <bundle-plan-id>
                    planHourlyPrice: 100
                    bundlePlanHourlyPrice: 20
                    planMonthlyPrice: 72000
                    bundlePlanMonthlyPrice: 14400
                    totalHourlyPrice: 120
                    totalMonthlyPrice: 86400
                databases: []
                buckets: []
                mailservers: []
                VMs: []
                workspaces: []
                managedWordpress: []
                totalHourlyPrice: 120
                totalMonthlyPrice: 86400
        '400':
          $ref: '#/components/responses/InvalidTeamID'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/TeamForbidden'
components:
  parameters:
    TeamID:
      name: teamID
      in: query
      required: false
      description: >-
        Run the request in the context of a team you belong to, instead of your
        personal account.
      schema:
        $ref: '#/components/schemas/ObjectID'
      example: '000000000000000000000002'
  schemas:
    CostTotals:
      type: object
      properties:
        totalHourlyPrice:
          type: number
        totalMonthlyPrice:
          type: number
    ObjectID:
      type: string
      pattern: ^[0-9a-fA-F]{24}$
      description: 24-character hexadecimal ID.
    Error:
      type: object
      description: Standard error body.
      properties:
        statusCode:
          type: integer
        error:
          type: string
          description: HTTP status text.
        message:
          type: string
          description: What went wrong.
        data:
          type: object
          nullable: true
          description: >-
            Extra details. When present, `code` is a stable, machine-readable
            error code.
          properties:
            code:
              type: string
    AuthError:
      type: object
      description: Error body returned when the API token is rejected.
      properties:
        error:
          type: string
  responses:
    InvalidTeamID:
      description: '`teamID` isn''t a valid ID.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 400
            error: Bad Request
            message: Invalid team ID.
            data: null
    Unauthorized:
      description: The API token is missing, invalid or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthError'
          example:
            error: Unauthorized.
    TeamForbidden:
      description: >-
        With `teamID`: you aren't a member of the team (`team_not_found`), or
        your role doesn't have the required permission (`no_permission`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            teamNotFound:
              summary: Not a team member
              value:
                statusCode: 403
                error: Forbidden
                message: Team not found
                data:
                  code: team_not_found
            noPermission:
              summary: Missing permission
              value:
                statusCode: 403
                error: Forbidden
                message: You do not have permission to access this resource.
                data:
                  code: no_permission
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Send your API token as `Authorization: Bearer <api-token>`.'

````

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