For the complete documentation index, see llms.txt. This page is also available as Markdown.

Cost to Serve

Retrieve workspace-level cost-to-serve data for LLM inference and infrastructure, scoped to closed months.

The cost-to-serve endpoints provide workspace-level visibility into what Amigo pays to operate a workspace. Two endpoints cover distinct cost domains:

Endpoint
Cost domain
Interpretation

LLM Inference

Recorded token usage priced by rate card

Depends on usage and pricing coverage

Infrastructure

Usage-weighted share of pooled resources

Depends on allocation rules and usage weights

Both endpoints are read-only and return data from the monthly cost-allocation close. Only closed months can be queried.

These staff-only routes are not included in the current public Platform API OpenAPI document. They are a separately restricted operational interface, not a workspace-customer analytics capability. Confirm staff access and the current internal contract before integrating.

LLM Inference Cost

GET /v1/{workspace_id}/cost-to-serve/llm-inference

Returns per-model LLM inference cost for a closed month. Pricing uses the per-call tier and rates effective on the usage date. Missing rates or required usage counters leave usage unpriced; the reported total excludes it.

Query Parameters

Parameter
Type
Required
Description

close_month

date

Yes

Any date within the closed month to report, e.g. 2026-07-01. Must be a month that has already closed.

Response Body

Field
Type
Description

close_month

date

First day of the closed month this breakdown covers.

currency

string

Currency of every amount in the response. Always USD.

total_cost_usd

number

Sum of priced models. Excludes any model where is_priced is false.

has_unpriced_usage

boolean

True when some usage could not be priced, meaning total_cost_usd understates actual spend.

models

array

Per-model breakdown.

Model Object

Field
Type
Description

model

string

Model identifier.

input_tokens

integer

Input tokens consumed.

output_tokens

integer

Output tokens consumed.

cached_tokens

integer

Cached tokens consumed.

cost_usd

number or null

Token cost in USD. Null when the recorded usage cannot be priced with the available rates and counters.

is_priced

boolean

Whether the applicable rates and required usage counters support pricing this usage.

Response Codes

Status
Description

200

Cost data returned.

400

close_month is in the current or a future month.

403

Caller is not an Amigo administrator.

429

Rate limited.

Example Request

Example Response


Infrastructure Cost

GET /v1/{workspace_id}/cost-to-serve/infrastructure

Returns per-component infrastructure cost for a closed month.

Query Parameters

Parameter
Type
Required
Description

close_month

date

Yes

Any date within the closed month to report, e.g. 2026-07-01. Must be a month that has already closed.

Response Body

Field
Type
Description

close_month

date

First day of the closed month this breakdown covers.

currency

string

Currency of every amount in the response. Always USD.

total_cost_usd

number

Sum of all components for the month.

components

array

Per-component breakdown.

Component Object

Field
Type
Description

component

string

Infrastructure component category (e.g. pipelines, model serving, warehouse, storage).

allocation

string

How the cost was determined: shared (usage-weighted share of a pooled resource) or direct (spend tagged to this workspace).

cost_usd

number

Cost in USD for this component.

Response Codes

Status
Description

200

Cost data returned.

400

close_month is in the current or a future month.

403

Caller is not an Amigo administrator.

429

Rate limited.

Example Request

Example Response

Notes

  • Both endpoints return data only for months whose cost-allocation close has completed. Querying the current or a future month returns a 400 error.

  • Components or models with no spend in the requested month are omitted from the response.

  • Account-level overhead that cannot be attributed to a workspace is excluded.

  • When multiple close runs exist for the same month (e.g. after a correction), only the latest run is returned.

  • These endpoints are rate-limited. Excessive requests return 429.

Last updated

Was this helpful?