OpenAI Agents SDK

Track what your OpenAI Agents SDK runs cost

See what each agent run costs, including the HTTP tools it calls, in two lines, with no account and no proxy. Free, and it takes about a minute.

1Install

pip install focxle openai-agents

focxle has no dependencies, so nothing enters your environment and nothing can conflict with the versions you already pin.

2Two lines, then name your agents

focxle.init() goes as early as you can put it, before the clients are built. Naming agents is what makes the per agent number exist at all.

import focxle
focxle.init()

from agents import Agent, Runner

with focxle.agent("triage"):
    Runner.run_sync(agent, "handle this request")

3What you get

Printed when the process exits, or on demand with focxle.report():

  focxle spend                                     $8.40
  --------------------------------------------------------
  triage                                $8.40  (312 calls)
      openai                                        $8.40

Model calls and HTTP APIs in the same number, per agent. That second part is what no LLM-only tool can show you: the search, scraping and embedding calls your agent makes are real money and they appear on a different bill.

4How this was checked

Verified against the openai client the Agents SDK is built on, in a clean container: the call was attributed and priced from the vendor's own usage numbers.

The test runs against a real HTTP server speaking the OpenAI chat-completions shape, answering on the vendor’s own hostname so the same code path production uses is the one under test. Pointing it at localhost would have exercised different code and could have passed while the real thing failed.

Handoffs between agents stay inside whichever focxle.agent() block wraps the run, so a multi-agent run reports as one figure unless you name them separately.

Tool calls that hit an HTTP API are counted in the same total, which is the part no LLM-only tool can show you.

5What it does not do

It does not block anything. Out of the box it only measures, and it shows what a spending cap would have stopped so you can decide whether you want one before paying for one.

It is not a proxy. Your traffic never routes through us, so there is no new dependency on your live path and we never hold your prompts. It makes no network calls at all on the free path, which the test suite proves by deleting socket.socket and running anyway.

It fails open. If anything inside it breaks, your call still goes through and the failure is counted and printed at the end.

Other frameworks

The setup is the same everywhere, because nothing here is framework-specific.