Opsmeter.io logo
Opsmeter.io
AI Cost & Inference Control
OpenAI integration

OpenAI cost tracking integration

OpenAI usage is easy to collect but hard to operationalize. Opsmeter adds endpoint and tenant ownership so teams can investigate spikes quickly.

OpenAI account totals do not tell operators which deploy, endpoint, or tenant changed cost behavior.

First ingest path5 minto first dashboard signal
Proxy requirementNonekeep current app network path
Attribution depthrequest-levelendpoint + tenant + prompt context

Why default tooling falls short

OpenAI account totals do not tell operators which deploy, endpoint, or tenant changed cost behavior.

Ownership visibility

Attribute OpenAI spend to endpoint, tenant, and user in one model.

Budget posture

Use warning/exceeded workflows tied to request-level context.

Release safety

Catch prompt regressions with current-vs-baseline comparisons.

Setup checklist

Step 1

Capture usage on every OpenAI response

Read input/output token usage and preserve a stable externalRequestId across retries.

Step 2

Attach ownership metadata

Include endpointTag, tenantId, userId, promptVersion, and environment on each ingest row.

Step 3

Route to Opsmeter ingest

POST request telemetry directly to Opsmeter ingest without introducing a gateway rewrite.

Example event mapping

FieldExample valueWhy it matters
externalRequestIdreq_6f12b5cDedupes retries and links traces to one cost event.
endpointTagsupport.replyEnables feature-level cost ownership and containment.
promptVersionsupport_v9Detects deploy-linked cost/request regressions quickly.
tenantIdenterprise-alphaSupports per-tenant profitability decisions.

How Opsmeter operationalizes this path

Instrument request payloads

Send externalRequestId, endpointTag, promptVersion, userId, and tenantId with usage fields.

Ingest into no-proxy endpoint

Keep app path unchanged while posting usage telemetry to Opsmeter ingest.

Investigate deltas in dashboard

Use Top Endpoints, Top Users, and Prompt Versions to isolate change drivers.

Ship attribution without gateway rewrites

No proxy rewrite required. Keep your current app path and enrich request metadata.