Blog/Integrations

CostGraph launches support for Stripe

IntegrationsCostGraph Team3 min read
Ask about this post:ClaudeChatGPTPerplexity
CostGraph and Stripe

Stripe has become synonymous with internet payments. When we started shipping integrations, one question came up more than any other: how do infrastructure and usage costs show up as line items in a system like Stripe?

For us and for many of our users, turning cloud spend into something a customer can be billed for is a nightmare for engineers and finance alike. The spend lives in the cloud bill. The invoice lives in Stripe. In between sit scripts, spreadsheets, and a reconciliation meeting at the end of the month.

Today we are launching support for Stripe. Unlike most of our integrations, which bring cost data into CostGraph, Stripe is one of our first export integrations. Data flows the other way. CostGraph reports each customer's attributed cloud spend to a Stripe billing meter every night, and a usage-based price on that meter turns it into an invoice. You decide who spent what. Stripe bills them for it.

The export integrations on the CostGraph integrations page: Autumn, Chargebee, Lago, Metronome, OpenMeter, Orb, and Stripe

Setup is two things. Create a meter in Stripe with a sum aggregation and attach a usage-based price to it. Then connect Stripe in CostGraph with a secret key and bind a virtual tag key to the meter. CostGraph verifies the key against Stripe before it saves anything, and stores it encrypted.

The Connect Stripe dialog, with a connection name and a secret key field

Attribution is done with virtual tags. You write one rule per customer, and the value the rule assigns is the Stripe customer id the spend is reported under. Any field works as the match: a linked account, a resource name prefix, a project, or an existing tag. Nothing is written back to your infrastructure, and Graph AI can draft the rules from a plain English description.

A new stripe_customer tag with one rule assigning a Stripe customer id as the tag value

Each customer-day lands in Stripe as one meter event. It carries the customer, the amount in cents, the day the spend belongs to, and whether it corrects a day reported earlier. Cloud providers restate recent spend, so CostGraph holds each day for two days before reporting it and keeps reconciling the last 35 days. A correction is sent as the difference, so the meter's sum settles to the right total.

Group your cost overview by the tag key and you see what each customer will be billed before it is reported.

Check out the docs to get started.

If this sounds useful, get started for free or book a demo today.

Frequently Asked Questions

What is being launched?

CostGraph can now report attributed cloud spend to Stripe.

Teams already use CostGraph to see what their infrastructure costs and which customer each charge belongs to. The integration sends that per-customer spend to a Stripe billing meter every night, so the usage your customers generate and the usage you bill them for come from the same numbers.

What is an export integration?

Most CostGraph integrations read from a provider: they pull your bill and usage in so you can see it in one place. An export integration writes out. Stripe, like Autumn before it, receives the per-customer spend CostGraph has already attributed and bills it. Nothing about how CostGraph reads your cloud accounts changes.

Is this how I pay for CostGraph?

No. This is your customers' billing. It has nothing to do with how you pay CostGraph.

How does the integration work?

A virtual tag assigns each charge to a customer, and every value the tag produces is a Stripe customer id. A meter binds that tag key to one billing meter in your Stripe account. Each night CostGraph reports every customer's spend for each settled day to that meter as meter events, and the usage-based price on the meter turns them into invoices.

CostGraph is the metering source. Stripe is the billing system.

What does setup involve?

In Stripe, create a meter with a sum aggregation, attach a usage-based price, and copy a secret key. In CostGraph, connect Stripe with the key, create a virtual tag key with the stripe_ prefix whose values are your Stripe customer ids, and bind it to the meter. A test key exercises the whole flow without invoicing anyone.

What unit is spend reported in?

Integer cents. Price the meter per cent, or use a transform quantity in Stripe to group 100 units into one priced dollar. Stripe does not check the unit, so a price set as if the values were dollars bills 100 times too much.

How frequently is spend reported?

Once a night. Cloud providers restate recent spend, so CostGraph holds each day for two days before reporting it, then keeps reconciling the last 35 days. An unchanged day sends nothing.

What happens when a day's spend changes after it was reported?

CostGraph sends the difference as a correction, which can be negative, and the meter's sum settles to the new total. If that period's invoice is still a draft, the correction lands on it. After the invoice is finalized, the event no longer changes it, and the difference is settled with a credit note or an adjustment in Stripe.

What if a tag value is not a real Stripe customer?

Stripe rejects the event, and CostGraph records the day with the rejection instead of billing it. Customer ids are opaque, so check the tag's values against your Stripe customers before you bind the meter.

Can I change the rules after billing has started?

Yes, with guardrails. A bound tag key drives invoices, so rules on it cannot be reordered, and a new or edited rule must start on a date that has not been reported yet. To retire a rule, give it an end date instead of editing it in place.

What permissions does CostGraph require?

A Stripe secret key. CostGraph uses it to list your meters and to send meter events. Prices, invoices, and payment collection stay in Stripe.

Is historical spend backfilled when I connect Stripe?

CostGraph reports spend from the moment the meter is bound. Stripe will not accept a meter event timestamped more than 35 days back, which matches CostGraph's reconciliation window.

Which other billing platforms are supported?

Autumn, Chargebee, Lago, Metronome, OpenMeter, and Orb, each with its own page in the docs. They differ in what they bill and how they treat corrections, and the Billing exports overview compares them.