Integrations

Two paths to capture

AtlasBurn captures AI usage through two complementary surfaces. Pick whichever fits your stack — both write to the same Forensic Ledger.

  • SDK auto-detect (@atlasburn/sdk) — JavaScript/TypeScript only. Patches globalThis.fetch and captures any call to a recognized provider host. Soft (in-process) enforcement: the gate is checked before each call, and blocks fail open so the host request is never broken.
  • Cloudflare Edge Proxy (proxy.atlasburn.com) — language-agnostic, any HTTP client. Point your client at a provider prefix (e.g. /openai/, /anthropic/, /mistral/). This is the hard-enforcement path — guardrail kill flags are read from Cloudflare KV before traffic ever reaches the provider, out-of-process and unbypassable by the caller.

SDK vs. proxy — different guarantees

The SDK is instant but in-process (a caller could bypass it); the proxy is an out-of-process wall that can't be bypassed, but its KV kill-flag propagates in up to ~60s. Run both for instant-and-durable coverage. A handful of providers (Vertex, Azure OpenAI, Bedrock) are SDK-detectable but not edge-proxyable — see the matrix.

Provider Matrix

ProviderSDK auto-detectCloudflare proxyPricedNotes
OpenAIYes/openai/YesStandard usage object. Streaming usage injected via stream_options.include_usage.
AnthropicYes/anthropic/YesStandard usage object.
Google GeminiYes/gemini/YesusageMetadata field. Watch for schema drift between API versions.
OpenRouterYes/openrouter/YesAuto-detected (openrouter.ai). Tokenizer drift from upstream routing — Layer 4 RPS is the safety net.
MistralYes/mistral/YesBoth paths. OpenAI-compatible usage object.
CohereYes/cohere/YesBoth paths. Tokens nested under usage.billed_units.
GroqYes/groq/YesBoth paths. Priced by the underlying model (Llama, Mixtral, …).
Together AIYes/together/YesBoth paths. Priced by the underlying model.
DeepSeekYes/deepseek/YesBoth paths.
xAI (Grok)Yes/xai/YesBoth paths.
Google Vertex AIYesSDK onlyYesSDK auto-detects (vertexai.googleapis.com). NOT edge-proxyable — OAuth bearer + region host + project/location path can't be transparently re-hosted. Use the SDK or /api/ingest.
Azure OpenAIYesSDK onlyYesSDK auto-detects (*.openai.azure.com). NOT edge-proxyable — deployment-scoped host + api-key header. Use the SDK or /api/ingest.
AWS BedrockBest-effortSDK onlyYesSDK auto-detects (bedrock-runtime); token counts read from response headers (best-effort). NOT edge-proxyable — SigV4 request signing is host-bound, so re-hosting breaks the signature. Use the SDK or /api/ingest.
Meta / Llama (self-host)NoFront via proxyYesNo fixed public host to auto-detect. Capture by fronting your gateway with the proxy, or POST events to /api/ingest. Priced by model.

Both paths, one ledger

Ten providers work on both surfaces — OpenAI, Anthropic, Gemini, OpenRouter, Mistral, Cohere, Groq, Together, DeepSeek, and xAI. Whichever you choose, events normalize into the same Forensic Ledger and price through the same cost engine.

How SDK auto-detect works

Auto-detect monkey-patches globalThis.fetch and inspects the request URL. When it matches a recognized provider host — OpenAI, Anthropic, Gemini, Vertex, Azure OpenAI, OpenRouter, Cohere, Mistral, Groq, Together, DeepSeek, xAI, and AWS Bedrock — it extracts usage metadata from the JSON or SSE response. No wrappers, no middleware. Only token counts and metadata are ever sent to AtlasBurn; prompt and completion content never leaves your process.

Schema drift — Google

Google occasionally renames fields inside usageMetadata. If Gemini or Vertex token counts disappear after a provider update, upgrade @atlasburn/sdk.

How the proxy works

The proxy is a Cloudflare Worker. It forwards to the upstream provider with the original auth header you passed, reads kill flags from Cloudflare KV synchronously, and emits one normalized telemetry event per request. Because enforcement happens at the edge, a tripped guardrail blocks traffic before the provider charges you.

Supported routes today: /openai/, /anthropic/, /gemini/, /openrouter/, /mistral/, /cohere/, /groq/, /together/, /deepseek/, /xai/. See Proxy Quickstart.

SDK-detectable but not edge-proxyable

Google Vertex AI, Azure OpenAI, and AWS Bedrock are captured by the SDK but cannot be routed through the transparent proxy — each uses per-request auth or hostnames that a generic prefix-rewrite would break:

  • AWS Bedrock — SigV4 request signing is bound to the target host; re-hosting through the proxy invalidates the signature. Edge hard-enforcement would require a Bedrock-specific re-signing proxy.
  • Azure OpenAI — deployment-scoped hostname (<resource>.openai.azure.com) plus an api-key header, so there is no fixed host to prefix-map.
  • Google Vertex AI — OAuth bearer + region host + project/location in the path.

For these three, use the SDK (soft, in-process enforcement) or POST normalized events to /api/ingest. Bedrock token counts arrive via response headers and are best-effort.

Posting events manually

For a self-hosted model gateway (e.g. your own Llama endpoint) or any provider you don't route through the SDK or proxy, POST normalized events directly to /api/ingest. See the API Reference.

Next Steps