Crusoe Billing API

The Billing API from Crusoe — 3 operation(s) for billing.

OpenAPI Specification

crusoe-energy-billing-api-openapi.yml Raw ↑
swagger: '2.0'
info:
  description: The API Gateway exposes all publicly available API endpoints for Crusoe Cloud products.
  title: Crusoe Cloud API Gateway Audit Logs Billing API
  version: v1alpha5
host: api.crusoecloud.com
basePath: /v1alpha5
schemes:
- https
consumes:
- application/json
produces:
- application/json
tags:
- name: Billing
paths:
  /organizations/{organization_id}/billing/costs:
    get:
      tags:
      - Billing
      summary: Get the daily spend for a specified organization by project.
      operationId: getBillingCosts
      parameters:
      - type: string
        example: ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab
        x-go-name: OrgID
        name: organization_id
        in: path
        required: true
      responses:
        '200':
          $ref: '#/responses/billingCostsGetResponse'
        '400':
          $ref: '#/responses/badReqError'
        '401':
          $ref: '#/responses/authError'
        '403':
          $ref: '#/responses/permissionsError'
        '500':
          $ref: '#/responses/serverError'
  /organizations/{organization_id}/billing/export:
    get:
      produces:
      - text/csv
      tags:
      - Billing
      summary: Return the daily spend per resource.
      operationId: getBillingExport
      parameters:
      - type: string
        example: ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab
        x-go-name: OrgID
        name: organization_id
        in: path
        required: true
      - type: array
        items:
          type: string
        example: '"json","csv"'
        x-go-name: Format
        name: format
        in: query
      - type: array
        items:
          type: string
        example:
        - d8f58dfd-dd86-4ee4-8f01-643e6d0f15bb
        x-go-name: Projects
        name: projects
        in: query
      - type: array
        items:
          type: string
        example:
        - d8f58dfd-dd86-4ee4-8f01-643e6d0f15bb
        x-go-name: Resources
        name: resources
        in: query
      - type: array
        items:
          type: string
        example:
        - persistent-ssd
        - l40s-48gb.1x
        x-go-name: ResourceTypes
        name: resource_types
        in: query
      - type: array
        items:
          type: string
        example:
        - us-east1
        - us-southcentral1
        x-go-name: Regions
        name: regions
        in: query
      - type: string
        example: '"2022-07-01"'
        x-go-name: StartDate
        name: start_date
        in: query
        required: true
      - type: string
        example: '"2023-08-08"'
        x-go-name: EndDate
        name: end_date
        in: query
        required: true
      responses:
        '200':
          $ref: '#/responses/billingExportGetResponse'
        '400':
          $ref: '#/responses/badReqError'
        '401':
          $ref: '#/responses/authError'
        '403':
          $ref: '#/responses/permissionsError'
        '500':
          $ref: '#/responses/serverError'
  /organizations/{organization_id}/billing/options:
    get:
      tags:
      - Billing
      summary: Get options which exist for filters for /billing/costs and /billing/export routes.
      operationId: getBillingOptions
      parameters:
      - type: string
        example: ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab
        x-go-name: OrgID
        name: organization_id
        in: path
        required: true
      - type: string
        example: '"2025-05-01"'
        x-go-name: StartDate
        name: start_date
        in: query
      - type: string
        example: '"2025-05-20"'
        x-go-name: EndDate
        name: end_date
        in: query
      responses:
        '200':
          $ref: '#/responses/billingOptionsGetResponse'
        '400':
          $ref: '#/responses/badReqError'
        '401':
          $ref: '#/responses/authError'
        '403':
          $ref: '#/responses/permissionsError'
        '500':
          $ref: '#/responses/serverError'
definitions:
  BillingResourcesResponse:
    type: object
    required:
    - data
    properties:
      data:
        type: array
        items:
          $ref: '#/definitions/BillingResourceDatum'
        x-go-name: Data
    x-go-package: gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers
  BillingCostData:
    type: object
    title: UsageByProjectGetResponse is the response type for GET requests to the usage.usageByProject endpoint.
    required:
    - data
    properties:
      data:
        type: array
        items:
          $ref: '#/definitions/BillingCostDatum'
        x-go-name: Data
      last_updated:
        type: string
        x-go-name: LastUpdated
    x-go-package: gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers
  UsageOptions:
    description: 'UsageOptions contains the values which exist for the fields which we allow filtering

      on for the usageByProjectGet endpoint.'
    type: object
    required:
    - projects
    - resource_types
    - regions
    - start_date
    - end_date
    properties:
      end_date:
        type: string
        x-go-name: EndDate
        example: '"2023-08-08"'
      projects:
        type: array
        items:
          type: string
        x-go-name: Projects
        example:
        - d8f58dfd-dd86-4ee4-8f01-643e6d0f15bb
      regions:
        type: array
        items:
          type: string
        x-go-name: Regions
        example:
        - us-east1
        - us-southcentral1
      resource_types:
        type: array
        items:
          type: string
        x-go-name: ResourceTypes
        example:
        - persistent-ssd
        - l40s-48gb.1x
      start_date:
        type: string
        x-go-name: StartDate
        example: '"2022-07-01"'
    x-go-package: gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers
  BillingResourceDatum:
    type: object
    required:
    - date
    - project_name
    - project_id
    - resource_name
    - resource_id
    - resource_type
    - region
    - quantity
    - billable_metric
    properties:
      billable_metric:
        type: string
        x-go-name: BillableMetric
        example: '"instance-hours"'
      date:
        type: string
        x-go-name: Date
        example: '"2025-07-04"'
      project_id:
        type: string
        x-go-name: ProjectID
        example: '"d8f58dfd-dd86-4ee4-8f01-643e6d0f15bb"'
      project_name:
        type: string
        x-go-name: ProjectName
        example: '"Apollo 11"'
      quantity:
        type: string
        x-go-name: Quantity
        example: '"2.123"'
      region:
        type: string
        x-go-name: Region
        example: '"us-southcentral1"'
      resource_id:
        type: string
        x-go-name: ResourceID
        example: '"d8f58dfd-dd86-4ee4-8f01-643e6d0f15bb"'
      resource_name:
        type: string
        x-go-name: ResourceName
        example: '"My H200"'
      resource_type:
        type: string
        x-go-name: ResourceType
        example: '"h200-141gb-sxm-ib.8x"'
      total_price:
        type: string
        x-go-name: TotalPrice
        example: '"12.34"'
      unit_price:
        type: string
        x-go-name: UnitPrice
        example: '"1.23"'
    x-go-package: gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers
  BillingCostDatum:
    type: object
    required:
    - resource_type
    - project_id
    - region
    - date
    - quantity
    - billable_metric
    properties:
      billable_metric:
        type: string
        x-go-name: BillableMetric
        example: '"gpu-hours"'
      cost:
        type: number
        format: double
        x-go-name: Cost
        example: 12.34
      date:
        type: string
        x-go-name: Date
        example: '"2022-07-01"'
      project_id:
        type: string
        x-go-name: ProjectID
        example: '"d8f58dfd-dd86-4ee4-8f01-643e6d0f15bb"'
      quantity:
        type: number
        format: double
        x-go-name: Quantity
        example: 2.123
      region:
        type: string
        x-go-name: Region
        example: '"us-southcentral1"'
      resource_type:
        type: string
        x-go-name: ResourceType
        example: '"l40s-48gb.1x"'
      unit_price:
        type: number
        format: double
        x-go-name: UnitPrice
        example: 1.23
    x-go-package: gitlab.com/crusoeenergy/island/rest-gateway/internal/handlers
responses:
  billingExportGetResponse:
    description: ''
    schema:
      $ref: '#/definitions/BillingResourcesResponse'
  billingOptionsGetResponse:
    description: ''
    schema:
      $ref: '#/definitions/UsageOptions'
  billingCostsGetResponse:
    description: ''
    schema:
      $ref: '#/definitions/BillingCostData'
  serverError:
    description: Error Internal Server
    schema:
      type: object
      required:
      - code
      - message
      properties:
        code:
          type: string
          x-go-name: Code
          example: '500'
        message:
          type: string
          x-go-name: Message
          example: internal_error
  badReqError:
    description: Error Bad Request
    schema:
      type: object
      required:
      - code
      - message
      properties:
        code:
          type: string
          x-go-name: Code
          example: '400'
        message:
          type: string
          x-go-name: Message
          example: bad_request
  permissionsError:
    description: Error Permissions
    schema:
      type: object
      required:
      - code
      - message
      properties:
        code:
          type: string
          x-go-name: Code
          example: '403'
        message:
          type: string
          x-go-name: Message
          example: unauthorized
  authError:
    description: Error Authentication Failed
    schema:
      type: object
      required:
      - code
      - message
      properties:
        code:
          type: string
          x-go-name: Code
          example: '401'
        message:
          type: string
          x-go-name: Message
          example: bad_credential
x-tagGroups:
- name: Compute
  tags:
  - VMs
  - VM Operations
  - Images
  - Instance Templates
  - Custom Images
  - Custom Image Operations
- name: Organizations
  tags:
  - Projects
  - Entities
  - Prospects
  - Billing
  - Usage
  - Quotas
  - Audit Logs
  - Reservations
- name: Users
  tags:
  - Identities
  - Roles
  - SSH Keys
  - Tokens
- name: Storage
  tags:
  - Disks
  - Disk Operations
  - Snapshots
  - Snapshot Operations
- name: Networking
  tags:
  - VPC Firewall Rules
  - VPC Firewall Rule Operations
  - VPC Networks
  - VPC Subnets
  - IB Partitions
  - Load Balancers
- name: Orchestration
  tags:
  - Kubernetes Clusters
  - Kubernetes Cluster Operations
  - Kubernetes Node Pools
  - Kubernetes Node Pool Operations
  - Kubernetes Versions
  - AutoClusters
  - AutoCluster Operations
- name: Locations
  tags:
  - Locations
- name: Capacities
  tags:
  - Capacities