All work

Data · 2024

Orbit

Usage analytics for an API

Every call counted, billed and charted, so a developer platform could price by usage.

Client

Orbit Cloud

Year

2024

Role

Data and build

Built in

10 days

Result

2.3 billion events a month

Orbit's analytics: calls by endpoint, latency and the month's bill

The brief

A developer platform wanted to charge by usage but could not count it. Calls were logged in three places and nobody trusted the totals, so the new pricing waited on the numbers.

Claude Code

ClickHouse

Next.js

What I built

01

Every call counted once

One pipeline from the gateway to ClickHouse, deduplicated and checked against the logs each night.

02

Usage customers can see

Charts by endpoint and by key, so a bill never surprises anyone.

03

Billing that follows

Metered prices in Stripe, fed by the same numbers the customers see.

Orbit's analytics: calls by endpoint, latency and the month's bill

The build, day by day

Days 1–2

The three logs compared, and the reasons they disagreed.

Days 3–4

The pipeline into ClickHouse, with a check every night.

Days 5–7

The console for customers: usage, keys and the month's bill.

Days 8–9

Metered billing in Stripe, tested on a month of real traffic.

Day 10

Launch, and the first invoice that matched to the cent.

brief.md

The prompt that did the most

›

Write a query that counts calls per key per hour from the raw gateway log, and a second that counts them from the billing events. Then list every hour where the two disagree, and why.

What it does now

2.3B

events counted a month

$48k

billed in the first month

0

disputed invoices since

Ready to ship?

Let’s build together.

From the first version to production, at a startup’s speed and with a senior engineer’s care. Tell me about your product.

2 builds open for December

Ready to ship?

Let’s build together.

From the first version to production, at a startup’s speed and with a senior engineer’s care. Tell me about your product.

2 builds open for December

Ready to ship?

Let’s build together.

From the first version to production, at a startup’s speed and with a senior engineer’s care. Tell me about your product.

2 builds open for December

Create a free website with Framer, the website builder loved by startups, designers and agencies.