Skip to main content
Your applications can report spend that no billing export carries, such as LLM tokens through your own gateway or per-request database charges, as it happens. Cloud Capital stores it with your other cost data, so it appears in Cost Insights and forecasts after the nightly load.

Setup

1

Create the integration

Choose Realtime Spend. The integration starts as a draft. A draft checks and counts the rows you send, then discards them, so you can test without adding spend.
2

Create an ingest key

Select Create key and copy the key. It is shown once. An ingest key can only send spend to this integration and cannot read anything; keep it in your server-side configuration.
3

Send a test row

Run the curl command the page shows. The page’s Activity section shows the rows it has received.
4

Enable

Set the status to Enabled and save. Spend loads into your cost data each night.

Sending spend

POST a JSON array of 1 to 100 rows to the endpoint on the integration page, with Authorization: Bearer <ingest key>.
Credits and refunds use cost_type: "Credit" with a negative cost. They lower your spend and show as savings.

Responses

A 200 response lists what was accepted. Valid rows are stored even when others in the batch are rejected; each rejected row is listed with its position and the field that failed. countsByDimension counts every row this integration has accepted, by vendor, service and usage unit. It lists the 1,000 most counted values of each.

Retries

If a call times out or fails, you cannot tell whether its rows were stored. Retrying it without an idempotency key can store them twice and double-count that spend. Send an Idempotency-Key header on each call, such as a new UUID, and reuse it when you retry that call:
For 24 hours, a retry with the same key and body returns the first response and stores nothing new. The response then has the header Idempotency-Replayed: true. Use a new key for each new batch.

Keys

Rotate a key from the integration page: the new key is shown once and the old one stops working within a minute. Revoking works the same way.