Skip to main content

estimated_usage

Creates, updates, deletes, gets or lists an estimated_usage resource.

Overview​

Nameestimated_usage
TypeResource
Idrailway.billing.estimated_usage

Fields​

The following fields are returned by SELECT queries:

One row per EstimatedUsage. The estimated usage of a single measurement.

NameDatatypeDescription
project_idstring
estimated_valuenumberThe estimated value.
measurementstringThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectmeasurementsinclude_deleted, project_id, workspace_idGet 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.

NameDatatypeDescription
measurementsstringGraphQL list literal of MetricMeasurement values, for example [AGENT_CACHE_READ_TOKENS, AGENT_CACHE_WRITE_TOKENS].
include_deletedbooleanWhether to include deleted projects in estimations.
project_idstring
workspace_idstring

SELECT examples​

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 }}'
;