Usage and Logs
Every request is recorded automatically. Use the console overview, analysis, usage, and logs screens to track spend, tokens, latency, errors, and per-request cost.
What is usage tracking in OpenGateway?#
Every request that reaches OpenGateway is recorded with its team, API key, model, provider, status, tokens, latency, and charged cost. Nothing needs to be installed: the console screens below read from the same records, so you can go from a spike on a chart to the exact request behind it.
| Console page | Use it to |
|---|---|
| Overview | See requests, latency, error rate, retry rate, and spend for a period at a glance. |
| Analysis | Compare spend, billed calls, and tokens with the previous period. |
| Billing → Usage | Break usage down by key, model, provider, and status, and export CSV. |
| Logs | Inspect individual requests, attempts, errors, and their cost breakdown. |
All team members can view these pages. See Teams.
Overview#
The Overview page shows headline numbers for the selected period:
- Requests, with requests per second.
- Avg. latency, with the p95 end-to-end response time.
- Error rate and Retry rate, with the number of failed and retried requests.
- Usage cost in USD.
Charts underneath show request volume (successful and failed), response time, and spend over time.
Analysis#
Analysis summarizes the current team's spend in USD, billed calls, and total tokens for a period (up to 92 days) and compares them with the previous period of the same length. Amounts are the USD actually debited from the balance; consumption of paid credits and bonus or redeemed credits is not split.
Usage breakdown and CSV export#
The Usage tab on the Billing page is the place for detailed cost analysis.
- Pick a range (24h, 7d, 30d, 90d, or custom) and an hourly or daily bucket.
- Filter by API key, model, provider, and status, and group by any of them.
- Read requests, error rate, input, output, cache-read and cache-write tokens, cost, p50 and p95 latency, and time to first token, each compared with the previous period.
- See Cost by API key, and switch the table between By key and By key × model.
- Download Table CSV or Time-series CSV for your own reporting.
Input token counts include cached tokens; cache reads and writes are also shown separately so you can check how well prompt caching is working.
Logs#
The Logs page lists individual requests. Filter by time, status, model, API key, and other fields, or turn on live tail to watch requests as they arrive. Use Columns to choose what the table shows:
| Column | Meaning |
|---|---|
| Job ID / Attempt | Unique request ID and the attempt number. Retries and fallbacks appear as separate attempts of the same job. |
| Requested At | When the request arrived. |
| Status | SUCCESS or FAILURE. |
| API Type | The endpoint, such as chat completions, responses, messages, embeddings, images, or decisions. |
| Model Owner / Model Name | The model that served the attempt. |
| Tokens, Latency | Token usage and end-to-end latency. |
| API Key | The key that sent the request. |
| user-id, session-id | Values you sent in the x-opengateway-user-id and x-opengateway-session-id request headers. |
| Error | The error code for failed requests. |
Open a row to see its timestamps (attempted, time to first token, responded), token usage, request headers, metadata, and billing status.
Cost breakdown#
Each request shows the charged amount (after discounts) and how it was computed: the list price, any discount, and separate lines for input and output, split into text, image, cached, cache-write, search, and embedding parts where they apply. Web search calls appear as their own search line.
Requests on models with a long-context price band show which band applied. See UltraFast.
Tag requests for easier filtering#
Send x-opengateway-user-id and x-opengateway-session-id with your requests to attribute traffic to your own users and sessions, then filter logs by them. Using one API key per service or environment also makes the key filter much more useful. See API keys.
Related#
- Billing for balance, top-ups, and payment history.
- API keys for per-key spending limits.
- Debug mode to see routing and normalization details in the response itself.