OpenAI Agents SDK × NeoMundi
🟢 New here? Start with Getting Started — From Integration to Verifiable Evidence. It is the single source of truth for the whole path: exact versions, executable commands, measured outputs, the common errors — and 🔴 which steps are still blocked, and why.
Measure every model call your agent loop makes, including the call that decides on a tool and the call that reads its result. One trace processor next to the ones you already run, the latency the SDK recorded, and only token counts the provider published.
Quickstart · What it refuses to do · Notebook · Limitations · Cost
Evidence level: E2. Four model calls of a real
Agentrun, through the realRunneronOpenAIResponsesModelagainst a local Ollama's/v1/responses, were measured on the service verification account on 2026-11-26 and re-read from the API as persisted: 4/4, servedmeasurement_version3.5.0, 0.12 CHF. A tool run produced two model calls and both were measured. Proof:evidence/e2_qualification_20261126T140137Z.json. See LIMITATIONS.md §9.
What this is
NeoMundiTraceProcessor is an Agents SDK TracingProcessor. You install
it once, and it appends itself to the processors already registered.
For each model call on the Responses API (the SDK's default model class)
it takes three things. The token count comes from the provider's own
Response object. The latency is the span's ended_at - started_at, as
the SDK recorded it. The agent and the tools come from the agent loop. It
then submits to NeoMundi's POST /v1/govern through the neomundi SDK, on
a worker thread, so the agent never waits for it.
A tool-using run makes one model call per step, and each one is measured separately. Tool executions, agent steps, turns and the run total are reported by name and not measured: they are not model calls, or they are sums of calls already measured.
What it is not
- Not a way to measure Chat Completions or LiteLLM agents. Their spans carry a usage dict the SDK rebuilt. It is zero-filled when the provider is silent, and on the LiteLLM route we measured it carrying a local estimate (21/7/28) where the provider published nothing. These spans are refused (LIMITATIONS §1).
- Not a reader of exported traces.
export()drops the provider'sResponse. The measurement is only possible in-process, from a processor. - Not a measurement of tools. A tool execution has no model and no token count, so it is named on the outcome, never billed.
- Not a tracer, evaluator or truth checker. Every submission is a billed measurement. NeoMundi verifies integrity and authenticity, not whether an answer was true.
Install
pip install openai-agents-neomundi
Python ≥ 3.11. Depends on openai-agents>=0.26.0,<0.27 (pinned to the
minor whose tracing surface was verified) and neomundi>=2.1.0,<3.0.
🔴 pip install does not ship examples/, notebooks/ or evidence/. Measured on 2026-12-01 against the eight published wheels: each ships its package and its metadata, and none carries those directories. They live in the repository — integrations/openai-agents/ — so every path this page states relative to them is a repository path, not a file your install contains.
Quickstart
⚠ A wiring sketch, not a runnable program. Its await is at module level, so pasted into a .py file it raises SyntaxError: 'await' outside function before anything else — put it in an async def and call it with asyncio.run(...). It also assumes your own agent and Runner. The block that runs as published is just below, and the fuller example is examples/01_offline_agent.py — 🔴 in the repository, not in the wheel.
from openai_agents_neomundi import NeoMundiTraceProcessor
processor = NeoMundiTraceProcessor(
api_key=..., base_url="https://api.neomundi.io"
).install() # add_trace_processor -- NEVER set_trace_processors
result = await Runner.run(agent, "What is the weather in Paris?")
processor.flush() # submissions run off the agent's thread
for outcome in processor.outcomes:
print(outcome.span_type, outcome.status, outcome.token_count, outcome.request_id)
Runnable as published — no key, no provider, no network
🟢 Needs nothing but pip install openai-agents-neomundi. The model is the host's real OpenAIResponsesModel; only its HTTP transport is a stub, so the spans the processor reads are the ones the Agents SDK really writes.
🔴 The three refusals are the point. A turn span and a task span are sums of model calls already measured one by one, and an agent span is not a model call at all — each is refused by name rather than counted twice.
⚠ On the Chat Completions route the count is refused, as not_submitted_unverified_token_count: that route's span cannot be traced back to the provider's own payload. That is why this block uses the Responses route, which is the SDK's default.
import asyncio
import httpx
from agents import Agent, OpenAIResponsesModel, Runner
from openai import AsyncOpenAI
from openai_agents_neomundi import NeoMundiTraceProcessor
def stub_provider() -> AsyncOpenAI:
"""No provider is called: the transport answers with a canned Responses reply."""
def handler(request: httpx.Request) -> httpx.Response:
return httpx.Response(
200,
json={
"id": "resp_quickstart",
"object": "response",
"created_at": 1764300000,
"model": "stub-model",
"status": "completed",
"output": [
{
"type": "message",
"id": "msg_1",
"role": "assistant",
"status": "completed",
"content": [{"type": "output_text", "text": "Paris.", "annotations": []}],
}
],
"parallel_tool_calls": True,
"tool_choice": "auto",
"tools": [],
# The counts a PROVIDER would have declared.
"usage": {
"input_tokens": 11,
"input_tokens_details": {"cached_tokens": 0},
"output_tokens": 3,
"output_tokens_details": {"reasoning_tokens": 0},
"total_tokens": 14,
},
},
)
return AsyncOpenAI(
api_key="not-a-real-key",
base_url="https://provider.example.invalid/v1",
max_retries=0,
http_client=httpx.AsyncClient(transport=httpx.MockTransport(handler)),
)
processor = NeoMundiTraceProcessor(submit=False).install() # no key: nothing is sent
agent = Agent(
name="quickstart-agent",
instructions="Answer in one word.",
model=OpenAIResponsesModel(model="stub-model", openai_client=stub_provider()),
)
result = asyncio.run(Runner.run(agent, "Capital of France?"))
processor.flush() # submissions run off the agent's thread
print("final_output :", result.final_output)
for outcome in processor.outcomes:
line = f"{outcome.span_type:<18} {outcome.status}"
if outcome.token_count is not None:
line += f" tokens={outcome.token_count} ({outcome.token_source})"
print(line)
It prints exactly this:
final_output : Paris.
ResponseSpanData not_submitted_local_only tokens=14 (provider_response_usage_total)
TurnSpanData not_submitted_aggregate_span
AgentSpanData not_submitted_not_a_model_call
TaskSpanData not_submitted_aggregate_span
Where a real key comes from
Ask for one at https://neomundi.io/contact-us/ — verified reachable, and the only route this page states. ⚠ It is not a claim that no other route exists; it is the one we can point you to today.
🟢 You do not need one to evaluate this package. The offline test suite
needs no credential, and the evidence committed in evidence/ can be checked
without an account.
🔴 Do not use set_trace_processors([processor]). It replaces the
list. That silently removes the SDK's own exporter to the OpenAI dashboard,
and any processor your application registered.
Free first: NeoMundiTraceProcessor(submit=False) needs no key, opens no
socket, and tells you which of your calls would be measured. Runnable,
offline: examples/01_offline_agent.py
and the notebook.
Two lines, no key, and you see it happen: examples/03_the_count_you_see.py
runs an agent whose provider publishes no usage — the run reports 0 tokens,
and the processor refuses it, because a zero-filled dict is not a count.
Refusals
Every span ends with an Outcome and an explicit status. Nothing is
submitted, and nothing is billed, when:
| Status | Why |
|---|---|
not_submitted_unverified_token_count |
a Chat Completions / LiteLLM generation span; the provider published no usage or a partial one; or AnyLLMModel is loaded, which rebuilds Response objects |
not_submitted_no_provider_response |
the run does not record sensitive data (trace_include_sensitive_data=False), so the span carries no provider object |
not_submitted_aggregate_span |
a turn or task span: a sum of calls already measured |
not_submitted_not_a_model_call |
a tool execution, an agent step, a handoff or a guardrail, named on the outcome |
not_submitted_unsupported_span |
speech, transcription, or an unknown span type |
not_submitted_application_error |
the model call failed, or the response did not complete |
not_submitted_no_latency |
the span has no usable start and end |
skipped_sampling / not_submitted_local_only |
sample_rate excluded it / submit=False |
not_submitted_queue_full / not_submitted_processor_closed |
dropped rather than blocking the agent / after shutdown() |
not_submitted_transport_error |
the API was unreachable, and your run was not affected |
No exception from this package reaches your agent. Outcomes carry no
prompt, response, tool input or output, or key. They carry only lengths,
names and identifiers. examples/02_refusals.py
shows each refusal on a real run.
What it costs
🔴 Every submitted observation is a billed measurement (0.030 CHF on
TIER_03). An agent run is billed once per model call: a run that calls
one tool makes two calls and costs two observations. sample_rate
(default 1.0) is deterministic in the span id. Kill switch:
processor.sample_rate = 0.0, immediate. Installing a second processor
retires the first, so re-running a notebook cell does not bill twice.
Honest status
| Offline test suite | 45 tests, green on Python 3.12 / Linux locally; CI runs 3.11–3.13 on Linux, macOS, Windows |
| Real execution | E2: 4 observations submitted to https://api.neomundi.io, 4/4 re-read as persisted (2026-11-26, Python 3.12, neomundi 2.1.0). See evidence/ |
| Maturity | beta |
Read LIMITATIONS.md before drawing a conclusion from any score.
License
Apache-2.0. See LICENSE.
Metadata
Release files for openai-agents-neomundi 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openai_agents_neomundi-0.1.1.tar.gz | 27.9 kB | With provenance | Details for openai_agents_neomundi-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openai_agents_neomundi-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for openai_agents_neomundi-0.1.1-py3-none-any.whl |
Total release size: 44.5 kB
Release files / openai_agents_neomundi-0.1.1.tar.gz
| Download URL | openai_agents_neomundi-0.1.1.tar.gz |
|---|---|
| Size | 27.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32ded19564ba861cf32f1805eb8cc37c562cfc8aa64515241ee1e316f96dd1b0
|
|
BLAKE2b-256 checksum How to use checksums |
3a2867a97a5eb28f8b1e0b9cdf2b422690458157be560b3e43b94ab208d53dbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / openai_agents_neomundi-0.1.1-py3-none-any.whl
| Download URL | openai_agents_neomundi-0.1.1-py3-none-any.whl |
|---|---|
| Size | 16.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f16c3749b6e108d9a22a694cf334b38874464ce9b18b9003443ee24648f2fe09
|
|
BLAKE2b-256 checksum How to use checksums |
b7fc7be9340ae83dcfe64dbbf87ac1e32cc06b495ab93228740ae2cbc89bd048
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for openai-agents-neomundi 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for openai_agents_neomundi-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.