estimated_usage
Creates, updates, deletes, gets or lists an estimated_usage resource.
Overview​
| Name | estimated_usage |
| Type | Resource |
| Id | railway.billing.estimated_usage |
Fields​
The following fields are returned by SELECT queries:
- list
One row per EstimatedUsage. The estimated usage of a single measurement.
| Name | Datatype | Description |
|---|---|---|
project_id | string | |
estimated_value | number | The estimated value. |
measurement | string | The measurement that was estimated. (AGENT_CACHE_READ_TOKENS, AGENT_CACHE_WRITE_TOKENS, AGENT_INPUT_TOKENS, AGENT_OUTPUT_TOKENS, AGENT_SPEND_USD, BACKUP_USAGE_GB, CPU_LIMIT, CPU_USAGE, CPU_USAGE_2, DISK_USAGE_GB, EPHEMERAL_DISK_USAGE_GB, MEASUREMENT_UNSPECIFIED, MEMORY_LIMIT_GB, MEMORY_USAGE_GB, NETWORK_RX_GB, NETWORK_TX_GB, UNRECOGNIZED) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | measurements | include_deleted, project_id, workspace_id | Get the estimated total cost of the project at the end of the current billing cycle. If no startDate is provided, the usage for the current billing period of the project owner is returned. Backed by the Railway GraphQL query estimatedUsage. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
measurements | string | GraphQL list literal of MetricMeasurement values, for example [AGENT_CACHE_READ_TOKENS, AGENT_CACHE_WRITE_TOKENS]. |
include_deleted | boolean | Whether to include deleted projects in estimations. |
project_id | string | |
workspace_id | string |
SELECT examples​
- list
Get the estimated total cost of the project at the end of the current billing cycle. If no startDate is provided, the usage for the current billing period of the project owner is returned. Backed by the Railway GraphQL query estimatedUsage.
SELECT
project_id,
estimated_value,
measurement
FROM railway.billing.estimated_usage
WHERE measurements = '{{ measurements }}' -- required
AND include_deleted = '{{ include_deleted }}'
AND project_id = '{{ project_id }}'
AND workspace_id = '{{ workspace_id }}'
;