Describe what you bill on and get a ready-to-send usage event: JSON payload plus cURL, Node.js, Python and Go code for the MetricaOS ingest API.
Pick a common event type, or define your own.
The numbers you meter and bill on.
Send with a POST request and an X-API-Key header. The API replies 202 Accepted.
Create an API key with the events:write scope in the MetricaOS dashboard. Event IDs are idempotency keys: a repeated eventId is ignored, so retries are safe. Use a unique ID per billable action.
A usage event is a small, immutable record of one billable action: which customer, which product or model, and how much was consumed. Everything downstream (cost tracking, quotas, invoices, margin analysis) is built from this stream, so it pays to get the shape right early.
input_tokens, output_tokens, images or audio_seconds.Read more in the glossary: usage event, token metering and billable usage.
Sign in to MetricaOS and create a key under Settings → API Keys. Give it the events:write scope for ingestion. Keep it on your server and never expose it in browser code.
Include the customer's ID as metadata.customer_id. MetricaOS uses it to attribute usage and deduct from that customer's balance.
Events are deduplicated on eventId, so a retried request does not create a second charge.
No. It only generates code in your browser. Nothing is sent to MetricaOS until you run the code with your own API key.