Skip to content
SegmentStream/ Docs

Loading documentation…

↑ ↓ to navigate  ↵ to open  Esc to close
Website Console
Section menu

Read rated workspace usage

GET /api/workspaces/{workspaceId}/usage

Endpoint

GET/api/workspaces/{workspaceId}/usage

Inspect usage quantities, rates and charges for the requested window. This is a repeatable read. See costs_readWorkspaceCosts. Required personal key scopes: workspace:view.

Authorization

Bearer token · workspace:view

Parameters

workspaceId path · uuid · required
Workspace UUID returned by list workspaces.
from query · string · optional
Start of the requested reporting interval.
to query · string · optional
End of the requested reporting interval.
granularity query · string · optional
Time unit for grouping observations into buckets. Allowed values: day, month
API-Version header · string · optional
Optional platform API major version. Omit to use the current default. Allowed values: 1

Responses

200 Success
application/json schema
{
  "type": "object",
  "properties": {
    "workspaceId": {
      "type": "string",
      "description": "Workspace UUID returned by list workspaces."
    },
    "window": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "Start of the requested reporting interval."
        },
        "to": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "End of the requested reporting interval."
        },
        "granularity": {
          "type": "string",
          "enum": [
            "day",
            "month"
          ],
          "description": "Time unit for grouping observations into buckets."
        },
        "timeZone": {
          "type": "string",
          "enum": [
            "UTC"
          ],
          "description": "Time zone used to group the reporting period."
        }
      },
      "required": [
        "from",
        "to",
        "granularity",
        "timeZone"
      ],
      "additionalProperties": false,
      "description": "Reporting interval used to aggregate observations."
    },
    "currency": {
      "type": "string",
      "enum": [
        "USD"
      ],
      "description": "Currency code for the monetary values in this report."
    },
    "totals": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "string",
          "pattern": "^-?\\d+\\.\\d{2}$",
          "description": "Quantity or monetary amount in the stated unit."
        },
        "provisional": {
          "type": "string",
          "pattern": "^-?\\d+\\.\\d{2}$",
          "description": "Portion of the usage charge that is still provisional."
        }
      },
      "required": [
        "amount",
        "provisional"
      ],
      "additionalProperties": false,
      "description": "Aggregates over all entries in the selected scope."
    },
    "compute": {
      "type": "object",
      "properties": {
        "ssu": {
          "type": "string",
          "pattern": "^\\d+(\\.\\d+)?$",
          "description": "Usage measured in SegmentStream units."
        },
        "amount": {
          "type": "string",
          "pattern": "^-?\\d+\\.\\d{2}$",
          "description": "Quantity or monetary amount in the stated unit."
        }
      },
      "required": [
        "ssu",
        "amount"
      ],
      "additionalProperties": false,
      "description": "Compute usage recorded for the selected interval."
    },
    "series": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string",
            "description": "`YYYY-MM-DD` for daily windows, `YYYY-MM` for monthly ones."
          },
          "item": {
            "type": "string",
            "enum": [
              "ontology.database",
              "ontology.requests",
              "ontology.memory",
              "ontology.invocations",
              "ontology.transfer",
              "app.requests",
              "app.memory",
              "app.invocations",
              "app.transfer",
              "agent.code",
              "agent.memory",
              "agent.invocations",
              "agent.machine",
              "agent.machine-memory",
              "agent.steps",
              "agent.browser",
              "agent.browser-transfer",
              "agent.browser-proxy",
              "agent.transfer",
              "agent.machine-transfer",
              "workflows.code",
              "workflows.memory",
              "workflows.invocations",
              "workflows.steps",
              "workflows.transfer",
              "pipelines.runs",
              "pipelines.runs-memory",
              "pipelines.orchestration",
              "pipelines.orchestration-memory",
              "pipelines.code",
              "pipelines.memory",
              "pipelines.invocations",
              "pipelines.steps",
              "pipelines.transfer",
              "pipelines.runs-transfer",
              "pipelines.orchestration-transfer",
              "builds.deploy",
              "builds.images",
              "builds.images-memory",
              "builds.images-transfer",
              "warehouse.queries",
              "storage.database",
              "storage.database-transfer",
              "storage.files",
              "storage.files-transfer",
              "storage.warehouse",
              "storage.warehouse-transfer",
              "events.accepted",
              "transfer.egress",
              "ai.models"
            ],
            "description": "Billable product item to which this usage is attributed."
          },
          "amount": {
            "type": "string",
            "pattern": "^-?\\d+\\.\\d{2}$",
            "description": "Quantity or monetary amount in the stated unit."
          }
        },
        "required": [
          "period",
          "item",
          "amount"
        ],
        "additionalProperties": false
      },
      "description": "Observations indexed by time or reporting period."
    },
    "breakdown": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "area": {
            "type": "string",
            "enum": [
              "compute",
              "storage",
              "warehouse",
              "events",
              "transfer",
              "ai"
            ],
            "description": "Product area to which the usage is attributed."
          },
          "sku": {
            "type": "string",
            "enum": [
              "ontology",
              "app",
              "agent",
              "workflows",
              "pipelines",
              "builds",
              "warehouse.queries",
              "storage.database",
              "storage.files",
              "storage.warehouse",
              "events.accepted",
              "transfer.egress",
              "ai.models"
            ],
            "description": "Billable SKU on the applicable price list."
          },
          "item": {
            "type": "string",
            "enum": [
              "ontology.database",
              "ontology.requests",
              "ontology.memory",
              "ontology.invocations",
              "ontology.transfer",
              "app.requests",
              "app.memory",
              "app.invocations",
              "app.transfer",
              "agent.code",
              "agent.memory",
              "agent.invocations",
              "agent.machine",
              "agent.machine-memory",
              "agent.steps",
              "agent.browser",
              "agent.browser-transfer",
              "agent.browser-proxy",
              "agent.transfer",
              "agent.machine-transfer",
              "workflows.code",
              "workflows.memory",
              "workflows.invocations",
              "workflows.steps",
              "workflows.transfer",
              "pipelines.runs",
              "pipelines.runs-memory",
              "pipelines.orchestration",
              "pipelines.orchestration-memory",
              "pipelines.code",
              "pipelines.memory",
              "pipelines.invocations",
              "pipelines.steps",
              "pipelines.transfer",
              "pipelines.runs-transfer",
              "pipelines.orchestration-transfer",
              "builds.deploy",
              "builds.images",
              "builds.images-memory",
              "builds.images-transfer",
              "warehouse.queries",
              "storage.database",
              "storage.database-transfer",
              "storage.files",
              "storage.files-transfer",
              "storage.warehouse",
              "storage.warehouse-transfer",
              "events.accepted",
              "transfer.egress",
              "ai.models"
            ],
            "description": "Billable product item to which this usage is attributed."
          },
          "unit": {
            "type": "string",
            "enum": [
              "ssu",
              "database_storage",
              "file_storage",
              "warehouse_storage",
              "warehouse_queries",
              "events",
              "transfer",
              "ai"
            ],
            "description": "Unit used to interpret the reported quantity."
          },
          "quantity": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?$",
            "description": "Usage quantity measured in the associated unit."
          },
          "quantityUnit": {
            "type": "string",
            "enum": [
              "vCPU-hour",
              "GB-hour",
              "million-invocations",
              "million-events",
              "step",
              "GB-month",
              "TB",
              "event",
              "GB",
              "USD",
              "browser-hour"
            ],
            "description": "Unit in which usage quantity is measured."
          },
          "ssu": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\d+(\\.\\d+)?$"
              },
              {
                "type": "null"
              }
            ],
            "description": "The item's SSU over the window; null outside SSU."
          },
          "unitPrice": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?$",
            "description": "USD per quantity unit in force on the window's last day: the SSU price times the item's SSU rate for compute. Amounts sum the exact per-day prices. An item whose unit changed between price versions has one row per unit in the window; a row in a unit no longer in force carries the price its latest day was rated at."
          },
          "amount": {
            "type": "string",
            "pattern": "^-?\\d+\\.\\d{2}$",
            "description": "Quantity or monetary amount in the stated unit."
          }
        },
        "required": [
          "area",
          "sku",
          "item",
          "unit",
          "quantity",
          "quantityUnit",
          "ssu",
          "unitPrice",
          "amount"
        ],
        "additionalProperties": false
      },
      "description": "Totals split by reporting category."
    },
    "aiModels": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "model": {
                "type": "string",
                "allOf": [
                  {
                    "description": "Model ID used for these requests, such as anthropic/claude-opus-5-5. Empty when unspecified."
                  }
                ]
              },
              "requests": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": [
                      "Infinity",
                      "-Infinity",
                      "NaN"
                    ]
                  }
                ],
                "allOf": [
                  {
                    "description": "Number of requests counted during the interval."
                  }
                ]
              },
              "amount": {
                "type": "string",
                "pattern": "^-?\\d+\\.\\d{2}$",
                "description": "Quantity or monetary amount in the stated unit."
              }
            },
            "required": [
              "model",
              "requests",
              "amount"
            ],
            "additionalProperties": false
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "AI Gateway spend by model, largest first; absent from a backend that does not read it."
    },
    "dataThrough": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        {
          "type": "null"
        }
      ],
      "description": "The last day with any final rated line; null before the first."
    },
    "exempt": {
      "type": "boolean",
      "description": "The workspace is rated but never charged."
    },
    "priceList": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string",
          "description": "Version of the declared format or resource."
        },
        "effectiveFrom": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "First date or time at which the setting or price applies."
        },
        "ssuPrice": {
          "type": "string",
          "pattern": "^\\d+(\\.\\d+)?$",
          "description": "USD per SSU."
        }
      },
      "required": [
        "version",
        "effectiveFrom",
        "ssuPrice"
      ],
      "additionalProperties": false,
      "description": "Price list used to rate the usage."
    },
    "access": {
      "type": "object",
      "properties": {
        "resourceId": {
          "type": "string",
          "description": "Identifier of the resource."
        },
        "resourceType": {
          "type": "string",
          "enum": [
            "workspace",
            "application",
            "repository",
            "connection",
            "secret",
            "warehouse",
            "ontology",
            "ontology_entity",
            "semantic_model",
            "pipeline",
            "job",
            "asset",
            "schedule",
            "event_stream",
            "agent"
          ],
          "description": "Type of platform resource to which the observation applies."
        },
        "generation": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Generation of the resource or deployment being observed."
        },
        "permissions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Permission observations or grants applicable to this subject."
        },
        "complete": {
          "type": "boolean",
          "description": "Whether the result covers all entries in its scope."
        },
        "observedAt": {
          "type": "string",
          "description": "Time when the item was observed."
        }
      },
      "required": [
        "resourceId",
        "resourceType",
        "generation",
        "permissions",
        "complete",
        "observedAt"
      ],
      "additionalProperties": false,
      "description": "Permissions observed for this resource when the server handled the request."
    }
  },
  "required": [
    "workspaceId",
    "window",
    "currency",
    "totals",
    "compute",
    "series",
    "breakdown",
    "dataThrough",
    "exempt",
    "priceList",
    "access"
  ],
  "additionalProperties": false
}
Full schema and referenced types ↗
Example
{
  "workspaceId": "00000000-0000-4000-8000-000000000001",
  "window": {
    "from": "2026-11-01",
    "to": "2026-11-15",
    "granularity": "day",
    "timeZone": "UTC"
  },
  "currency": "USD",
  "totals": {
    "amount": "0.00",
    "provisional": "0.00"
  },
  "compute": {
    "ssu": "0",
    "amount": "0.00"
  },
  "series": [],
  "breakdown": [],
  "dataThrough": null,
  "exempt": false,
  "priceList": {
    "version": "2026-11.ssu-20",
    "effectiveFrom": "2026-11-01",
    "ssuPrice": "0.300000"
  },
  "access": {
    "resourceId": "00000000-0000-4000-8000-000000000001",
    "resourceType": "workspace",
    "generation": 1,
    "permissions": [],
    "complete": false,
    "observedAt": "2026-01-15T12:00:00Z"
  }
}
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
Deprecation
Present when the operation is deprecated. RFC 9745 date in seconds since the Unix epoch.
Sunset
Present when retirement is scheduled. HTTP date of planned removal, per RFC 8594.
400 Error
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
401 Error
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
403 Error
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
404 Error
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
406 Unsupported platform API version
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
409 Error
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
429 Request limit reached
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
Retry-After
Seconds to wait before retrying the request.
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
500 Error
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).
503 Error
application/json schema
{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Machine-readable error code or diagnostic reported by the operation."
    },
    "detail": {
      "type": "string",
      "description": "Human-readable explanation of the failure."
    },
    "requestId": {
      "type": "string",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
      "format": "uuid",
      "description": "Correlation ID for tracing the request with support."
    },
    "retryable": {
      "type": "boolean",
      "description": "Whether retrying the same failed request may succeed."
    }
  },
  "required": [
    "error",
    "detail",
    "requestId",
    "retryable"
  ],
  "additionalProperties": true
}
Full schema and referenced types ↗
Response headers
API-Version
Supported platform API major version.
RateLimit
Remaining quota (r) and seconds until reset (t), when admission is available.
RateLimit-Policy
Request quota (q) and window in seconds (w).