Agent Frameworks

How to connect AtlasBurn to the common agent frameworks. Every setup on this page was run with real model calls on 15 November 2026, and the tokens AtlasBurn recorded were compared with the usage the framework itself reported.

Which path to use

  • JavaScript or TypeScript agents running in your own Node process: use the SDK. Start it before you create any AI client; nothing else changes.
  • Python agents, and agents that run as a separate program (the Claude Agent SDK, Hermes Agent): use the Edge Proxy. You change the base URL and add one header.

Use SDK 1.11.5 or later

Earlier SDK versions broke streamed calls to OpenAI's Responses API, which the OpenAI Agents SDK uses by default. Upgrade with npm install @atlasburn/sdk@latest.

What was tested

FrameworkVersionPathResult
OpenAI Agents SDK (TypeScript)0.22SDKExact match, streamed and not, with a tool loop
LangChain (JavaScript)@langchain/anthropic 1.6SDKExact match, streamed and not
Vercel AI SDKai 7.0SDKExact match, streamed and not
Anthropic TypeScript SDK (your own agent loop)1.8SDKExact match across 976 calls
Claude Agent SDK0.3ProxyExact match, prompt caching included
OpenAI Agents SDK (Python)0.24ProxyExact match; streamed runs need include_usage (below)
LangChain (Python)langchain-anthropic 1.7ProxyExact match, streamed and not
Anthropic and OpenAI Python clientsatlasburn 0.1.1ProxyExact match, streamed and not
Hermes Agent0.19.0ProxyExact match with the config below

All of these ran against Claude models. The OpenAI Agents SDK was also run in its default Responses mode against a test server that replays OpenAI's documented response format; a full run against the live OpenAI API is still pending.

OpenAI Agents SDK (TypeScript)

Start AtlasBurn first. The Agents SDK then works unchanged, in both Responses and Chat Completions mode.

agent.ts
typescript
import { initAtlasBurnAuto } from "@atlasburn/sdk";
initAtlasBurnAuto({ apiKey: process.env.ATLASBURN_KEY, metadata: { featureId: "support-agent" } });

import { Agent, run } from "@openai/agents";

const agent = new Agent({ name: "Support", instructions: "Help the customer.", model: "gpt-4.1-mini" });
const result = await run(agent, "Where is my order?");

metadata.featureId labels every call from this process. See SDK Integration for tagging single calls.

OpenAI Agents SDK (Python)

Give the Agents SDK a client that points at the proxy. The atlasburn package builds the base URL and headers.

bash
pip install openai-agents atlasburn
agent.py
python
import atlasburn
from openai import AsyncOpenAI
from agents import Agent, Runner, ModelSettings, set_default_openai_client

# Reads ATLASBURN_KEY from the environment. Your OpenAI key stays in OPENAI_API_KEY.
client = AsyncOpenAI(**atlasburn.openai_config(feature="support-agent"))
set_default_openai_client(client, use_for_tracing=False)

agent = Agent(name="Support", instructions="Help the customer.", model="gpt-4.1-mini")
result = Runner.run_sync(agent, "Where is my order?")
  • use_for_tracing=False keeps the Agents SDK's own trace upload going straight to OpenAI.
  • Other providers in Chat Completions mode (set_default_openai_api("chat_completions") with atlasburn.openai_config("groq"), "deepseek" and so on): add model_settings=ModelSettings(include_usage=True) to the agent. Without it, streamed runs carry no token counts, and AtlasBurn can only estimate them.

Claude Agent SDK

The Claude Agent SDK runs Claude Code as a separate program, so the Node SDK cannot see its calls. Use the proxy by setting two environment variables. This was tested with the TypeScript Agent SDK; the Python Agent SDK and Claude Code itself run the same program and read the same variables.

.env
bash
ANTHROPIC_BASE_URL=https://proxy.atlasburn.com/anthropic
ANTHROPIC_CUSTOM_HEADERS="AtlasBurn-API-Key: abn_xxxxxxxxxxxxxxxxxxxx
x-atlasburn-feature: coding-agent"

Or pass them when you start the agent:

agent.ts
typescript
import { query } from "@anthropic-ai/claude-agent-sdk";

for await (const message of query({
  prompt: "Summarise the open issues.",
  options: {
    env: {
      ...process.env,
      ANTHROPIC_BASE_URL: "https://proxy.atlasburn.com/anthropic",
      ANTHROPIC_CUSTOM_HEADERS: `AtlasBurn-API-Key: ${process.env.ATLASBURN_KEY}\nx-atlasburn-feature: coding-agent`,
    },
  },
})) {
  // handle messages
}
  • Put each header on its own line, as Name: Value.
  • AtlasBurn records every call the agent makes, including small background calls that the Agent SDK leaves out of its own usage total. Expect AtlasBurn's number to be slightly higher, and closer to your invoice.

LangChain and the Vercel AI SDK

JavaScript: start the SDK at the top of your entry file, as in the OpenAI Agents example above. LangChain, LangGraph and the Vercel AI SDK need no other change.

Python: pass the proxy settings to the chat model.

chain.py
python
import atlasburn
from langchain_anthropic import ChatAnthropic

cfg = atlasburn.anthropic_config(feature="research-chain")
llm = ChatAnthropic(model="claude-haiku-4-5", base_url=cfg["base_url"], default_headers=cfg["default_headers"])

Hermes Agent

Add AtlasBurn as a provider in Hermes Agent's config.yaml. Hermes sends the AtlasBurn key through extra_headers.

config.yaml
yaml
model:
  provider: atlasburn
  default: claude-haiku-4-5
  api_mode: chat_completions
  max_tokens: 2048

providers:
  atlasburn:
    name: AtlasBurn proxy
    api: https://proxy.atlasburn.com/anthropic/v1
    key_env: ANTHROPIC_API_KEY
    extra_headers:
      AtlasBurn-API-Key: "abn_xxxxxxxxxxxxxxxxxxxx"
      x-atlasburn-feature: hermes

Three details matter in Hermes Agent 0.19.0:

  • End the address with /v1. Hermes treats an address ending in /anthropic as Anthropic's native API and does not send extra headers there, so the proxy answers “Missing AtlasBurn-API-Key header”.
  • Set api_mode: chat_completions so Hermes uses the OpenAI-compatible route.
  • Set max_tokens. Hermes's default is higher than some Claude models accept, and the provider rejects the call.

For another provider, change api to that provider's proxy address (for example https://proxy.atlasburn.com/openrouter/v1) and key_env to its key.

Limits

  • Streaming through the proxy on non-OpenAI routes: the client must ask for usage (stream_options.include_usage). Most frameworks do. If one does not, AtlasBurn records an estimate.
  • Realtime and voice agents use WebSockets, which neither the SDK nor the proxy captures yet.
  • Bedrock, Vertex AI and Azure OpenAI cannot go through the proxy. See the Provider Matrix.
  • One feature label per process unless your framework lets you set headers on single calls. Guardrails act per feature, so give each agent its own label where you can.

Next Steps