Coding Agent Tracking
Observe native Claude Code and Codex accounting, or integrate compatible agent API traffic through the gateway.
Managing the gateway from an agent?
Choose a collection path
Native Claude Code and subscription Codex traffic can be observed from selected local logs. This does not transparently route subscription requests, optimize them, or demonstrate savings. Proxy integration is a separate option for clients that support a base URL and custom headers.
Opt-in native log collection
Obtain the qualified Windows client
The client repository and releases are private. Ask your administrator for the qualified Windows AMD64 ZIP and its independently trusted checksum, or use your granted repository access: restricted release and Restricted client ZIP. Access denial is not an Ingate key problem. Obtain the local ZIP without creating another application or key.
Qualified source/version: b2ad96617159126aaeaf1250a21282c2e3446217. ZIP SHA-256: 73cbcc69b251e34e3a5d271b8478448dfb8f352acb6a06dfcd6bbbc80cff354b. Expected ingate.exe SHA-256: 8f775cf220358f25aa7b60a54db5f0df11fbf1880c7cc9b349196661511593ad. These are the collector pins used by the dashboard's Connect coding-agent usage flow. This page does not offer Linux or macOS artifacts.
Client access may still be pending
Use Windows AMD64 and PowerShell 5.1 or newer. Receiving the ZIP and checking its hashes needs no Ingate key or model provider credential, but GitHub download access requires repository authorization. Native collection later needs explicitly selected inputs and an issued application-bound INGATE_API_KEY, configured privately. Keep it separate from provider authentication.
Verify the supplied local ZIP before extraction or execution. A checksum inside that same unverified archive is not a trust source. The block below matches the dashboard verification; choose a new extraction directory and retain successful setup resources while obtaining a missing client.
& {
$ErrorActionPreference = 'Stop'
try {
$taskArchive = Read-Host 'Absolute path to administrator-supplied ZIP'
$taskDestination = Read-Host 'Absolute path to a NEW extraction directory'
if ($taskArchive -notmatch '^(?:[a-zA-Z]:[\\/]|\\\\)' -or $taskDestination -notmatch '^(?:[a-zA-Z]:[\\/]|\\\\)') { throw 'Use absolute Windows paths; retry verification.' }
if (!(Test-Path -LiteralPath $taskArchive -PathType Leaf)) { throw 'ZIP file not found. Ask your administrator for the qualified ZIP, then retry verification.' }
if (Test-Path -LiteralPath $taskDestination) { throw 'Destination already exists. Choose a NEW directory; existing files will not be changed.' }
if ((Get-FileHash -LiteralPath $taskArchive -Algorithm SHA256).Hash -ne '73cbcc69b251e34e3a5d271b8478448dfb8f352acb6a06dfcd6bbbc80cff354b') { throw 'ZIP checksum mismatch. Do not extract or run it. Obtain the qualified ZIP and trusted checksum from your administrator, then retry.' }
Expand-Archive -LiteralPath $taskArchive -DestinationPath $taskDestination
$taskExe = Join-Path $taskDestination 'ingate.exe'
if ((Get-FileHash -LiteralPath $taskExe -Algorithm SHA256).Hash -ne '8f775cf220358f25aa7b60a54db5f0df11fbf1880c7cc9b349196661511593ad') { throw 'Executable checksum mismatch. Do not run it. Ask your administrator for the qualified ZIP; retry into another NEW directory.' }
Write-Output 'Client files verified against the pinned hashes. Collection has not started. Open PowerShell in the extraction directory to run the collector command.'
} catch { throw $_.Exception.Message }
}Open PowerShell in the verified extraction directory before running the collector. This guide does not configure login persistence, automatic restart or renewal; any workday collection remains supervised and finite.
Match collector and service
ingate agentlog reads Claude transcripts with --claude-log and native Codex rollouts with --codex-log. Select explicit inputs and a dedicated state file; without paths it discovers documented agent-home locations. No collection starts automatically.
# Inspect selected accounting only: no posting or state changes.
ingate agentlog --codex-log /chosen/rollout.jsonl --state /chosen/collector-state.json --dry-run --json
# After reviewing the dry run, explicitly opt in with an app-bound Ingate key.
# Set INGATE_API_KEY securely in your environment; no provider key is used.
ingate agentlog --codex-log /chosen/rollout.jsonl --state /chosen/collector-state.json --url http://localhost:7100 --jsonThe collector emits no prompt/completion content. Source files are read-only; it writes its own checkpoint on completion, including earlier terminal outcomes after normal errors. Dry-run needs no key and leaves state untouched. Never enroll other users' sessions implicitly.
# Inspect an explicitly selected transcript without posting or changing state.
ingate agentlog --claude-log /chosen/transcript.jsonl --state /chosen/claude-state.json --dry-run --json
# Set INGATE_API_KEY to an issued app-bound Ingate key; no provider credential is needed.
ingate agentlog --claude-log /chosen/transcript.jsonl --state /chosen/claude-state.json --url http://localhost:7100 --jsonReported Claude five-minute and one-hour cache writes are partitions of the existing write count. Native costs are API-equivalent estimates, not subscription charges or invoices. Read cache-cost evidence for conventions, unknown values and fallback assumptions. Upgrading does not reprice previously stored records. Keep original sources and checkpoints; a confirmed acceptance is not proof that an asynchronous row is stored.
- Claude accounting groups request observations; Codex uses native token_usage_record or, if absent in that file, last_token_usage deltas. Cumulative total_token_usage is not added.
- Missing counts stay unknown, explicit zero stays zero. Cached input is already inside OpenAI input; reasoning is inside output. Do not add those subsets twice. Anthropic cache classes use a different input convention. Available prices are estimates, not subscription invoices.
--codex-exec-logand turn.completed thread snapshots are refused, even in dry-run. Mixing snapshot and native inputs refuses the entire command before reading/posting; refusal is not zero usage. No subtraction of resumed totals establishes run billing.- Inspect accepted, rejected, unknown, incomplete and state_saved plus exit status. Checkpoints retain acceptances and permanent refusals, not proof of storage. Lost responses/crashes can replay; keep unchanged sources and state, use receipts where durable admission applies. Never delete state to force replay.
Separate proxy integrations
For clients such as Cursor, Aider or Cline, verify support for a custom gateway header before configuring the proxy. A base URL and API-key field alone are insufficient. Never put an Ingate key in a provider API-key or OAuth field. Existing subscription authentication is not a proven proxy setup.
Send X-Ingate-Key separately. OpenAI-compatible clients use http://localhost:7100/v1; Anthropic clients use http://localhost:7100. With provider API-key injection configured in Ingate, the SDK can use an unused placeholder. For passthrough, configure no provider credential injection and keep the actual upstream credential. The auth_passthrough setting alone does not override configured keys or authorization headers.
Use the complete Python, TypeScript or LangChain examples for compatible API clients.
How routing works
Ingate automatically detects the provider from the request path, no X-Ingate-Provider header needed:
| Path pattern | Auto-detected provider |
|---|---|
/v1/messages | anthropic |
/v1/chat/completions | openai |
/v1/completions | openai |
/v1/embeddings | openai |
/v1/models | openai |
/v1/responses | openai |
/api/generate | ollama |
/api/chat | ollama |
For any path not in this table, you can configure a fallback by marking a provider default: true.
Priority chain
X-Ingate-Provider header → path auto-detection → the provider marked default: true in config.What gets tracked
Recorded proxy exchanges expose the following data where capture policy and observations permit:
| Data | Where to see |
|---|---|
| Policy-permitted request/response bodies | Dashboard → Logs (/ui/#/logs) |
| Token counts (input/output) | Dashboard → Usage (/ui/#/usage) |
| Latency per request | Log detail view |
| Cost estimates | Dashboard → Usage breakdown |
| Model used | Logs filter by model |
| Provider | Logs filter by provider |
| Session timelines | Dashboard → Sessions (/ui/#/sessions) |
| User breakdown | Dashboard → User Analytics (/ui/#/user-analytics) |
Session tracking
To group requests into conversations, add the optional tracking headers X-Ingate-User-Id (who is making the request) and X-Ingate-Session-Id (which conversation/session this belongs to). Then view conversation timelines at /ui/#/sessions.
Usage analytics
Query usage by user or session:
# Who's using the most tokens?
curl http://localhost:7100/api/v1/usage/breakdown?group_by=user \
-H "Authorization: Bearer $TOKEN"
# What sessions are active?
curl http://localhost:7100/api/v1/sessions \
-H "Authorization: Bearer $TOKEN"
# Timeline of a specific session
curl http://localhost:7100/api/v1/sessions/SESSION_ID/timeline \
-H "Authorization: Bearer $TOKEN"Team setup
For a team of developers, each developer gets their own Ingate API key:
Send each developer's app key through X-Ingate-Key, independently of provider authentication. Use explicit user/session attribution and the configured capture policy.
Benefits:
- Centralized API key management (real keys never leave the server)
- Per-developer usage tracking and cost attribution
- Configured budget controls for supported proxy workflows
- Audit and usage records for supported, captured activity
- No need to distribute provider API keys to individual machines
Alternative: post-hoc ingestion
If you can't proxy (e.g., the tool doesn't support custom base URLs), use the Ingestion API to send logs after the fact:
curl -X POST http://localhost:7100/api/v1/ingest \
-H "X-Ingate-Key: $INGATE_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "anthropic",
"model": "claude-sonnet-4-20250514",
"path": "/v1/messages",
"status_code": 200,
"request_body": {"model": "claude-sonnet-4-20250514", "messages": [{"role": "user", "content": "Explain this code"}]},
"response_body": {"content": [{"type": "text", "text": "This code..."}], "usage": {"input_tokens": 50, "output_tokens": 200}},
"latency_ms": 1500,
"tags": {
"user_id": "dev@company.com",
"session_id": "coding-session-42",
"tool": "claude-code"
}
}'Alternative: OpenTelemetry
If your tool emits OpenTelemetry traces (or you instrument it), send traces to Ingate's OTLP receiver: Ingate accepts OTLP/HTTP at POST /v1/traces:
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:7100
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_HEADERS="X-Ingate-Key=$INGATE_KEY"Only the supported GenAI admission keys and typed attributes map to logs; controlled telemetry organizations refuse OTel/proxy producers. Legacy admission is asynchronous. See OpenTelemetry for details.