Requests and tokens
Compare input, output, cache and media usage by model. Separate provider-reported totals from estimates.
Track requests, tokens, latency, failures and estimated provider spend in one workspace. Keep your existing backend, use the secure gateway, or combine both.
A total is useful only when you can explain it. HyperProxy keeps request, model, client and session dimensions connected.
Compare input, output, cache and media usage by model. Separate provider-reported totals from estimates.
Apply the model catalog or your own price overrides. Unknown usage remains visibly incomplete instead of becoming a misleading zero.
Use the same date range across cost, latency, status codes and request history to find what changed.
Group calls with the client and session identifiers your application supplies. HyperProxy never guesses the platform.
Email at 80% and 100%, detect daily spend anomalies, or stop gateway traffic when recorded monthly spend reaches your budget.
Measure traffic routed through HyperProxy and server-reported events in the same project, with their sources clearly labelled.
Change the request origin and auth header. HyperProxy forwards the provider-native request and meters completed usage.
Keep direct provider calls in your backend. Submit one idempotent event after each completed call from a background worker.
Point an OTLP/HTTP trace exporter at the project endpoint and send completed GenAI client spans.
Send a sample event with cURL. You do not need a provider key, an SDK or a payment card to check the connection.
This example records sample metrics and uses one request from your monthly allowance. It does not call OpenAI or incur an AI provider charge.
When connecting your backend, replace the sample values with actual status, duration and token usage. Send one event after each completed call from a background worker. Provider keys, prompts and responses stay in your backend.
PROJECT_ID='YOUR_PROJECT_ID'
INGEST_KEY='YOUR_INGEST_KEY'
EVENT_ID=$(uuidgen)
OCCURRED_AT=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
curl --fail-with-body \
"https://app.hyperproxyai.com/api/v1/admin/projects/$PROJECT_ID/events" \
-H "Authorization: Bearer $INGEST_KEY" \
-H 'Content-Type: application/json' \
--data "{\"event_id\":\"$EVENT_ID\",\"occurred_at\":\"$OCCURRED_AT\",\"provider\":\"openai\",\"model\":\"gpt-4o-mini\",\"status_code\":200,\"duration_ms\":320,\"tokens_in\":1000,\"tokens_out\":500}"Accepted events return HTTP 201 with a request ID. A retry with the same event ID and payload returns 200 and does not count again. For retries, rerun only the cURL call with the saved variables, so the ID and timestamp stay the same. Read the production integration guide →
Start with the exact provider and model ID, then apply rates to the usage that request actually reports.
For token-based calls, input cost is input tokens × input rate / 1,000,000; output cost follows the same formula. Cache reads, cache writes, long-context tiers, tools and media can have separate rates and units.
Open Model prices in your project. Inspect the selected source, review date, alternative estimates and billing units. Project-specific overrides take precedence when you have an agreed provider rate.
As an illustrative calculation, 1,000 input tokens at $2 per million and 500 output tokens at $8 per million total $0.006. These are example rates, not a provider quote, and exclude additional meters. Missing usage or pricing stays incomplete.
To investigate a cost spike, compare model mix, output length, cache coverage and failed requests in the same period. For slower calls, follow the AI gateway latency guide; a request's duration does not isolate gateway overhead.
| Question | HyperProxy reports | Source of record |
|---|---|---|
| How much provider usage did the app record? | Requests, tokens and estimated model cost | HyperProxy analytics |
| What will the provider charge? | An operational estimate with coverage warnings | Provider invoice |
| What does HyperProxy itself cost? | Plan allowance and overage history | HyperProxy billing |
No. It gives you an operational estimate tied to request history. Provider invoices remain the billing source of record.
Yes. Use external events or OpenTelemetry from your backend. Those paths do not include provider credentials, prompts or response bodies.
The request is marked as incomplete cost. Totals show recorded cost and a coverage warning, so an unknown request never looks free.