How do I switch from Helicone to Rius for the OpenAI Agents SDK?
To switch from Helicone to Rius, you call rius.init(), wrap your agent entrypoint and tool functions with observe, then remove the Helicone base URL or async logger. The OpenAI Agents SDK drives the OpenAI client underneath, so Rius captures every model call with tokens and cost and computes the cost itself. The wrappers give the run and its tools their shape in the trace. This is a small code change in Python, and you can run both backends while you compare.
How it works
Helicone sits on the network path (a proxy base URL) or logs through an async logger. Rius works inside your process instead. Its openai integration patches the client library, so model calls made by the OpenAI Agents SDK are traced whatever base URL the client uses. Nothing sits between your code and the provider.
The framework keeps two things to itself, and each needs one line:
- Run structure. The agent loop and tool executions run inside the framework. Wrapping the entrypoint and the tool bodies with
observeputs them in the trace. - The framework’s own tracing. It uploads to the OpenAI platform, independent of OpenTelemetry. Call
set_tracing_disabled(True)if Rius should be your single telemetry path.
The Rius integration for the OpenAI Agents SDK is Python only. The OpenAI Agents SDK integration page covers it in full, and the integrations overview lists every supported framework. For the general Helicone concept map, see Migrate from Helicone, and for other tools see Migrate to Rius.
Set it up
-
Install the SDK with the OpenAI integration next to the framework:
pip install "glassflow-rius[openai]" openai-agents -
Replace your Helicone setup with
rius.init(), switch off the framework’s own tracing, and wrap the entrypoint and tools. Put@function_tooloutermost andobserveon the function body, so the framework still reads the signature for its tool schema:import rius from agents import Agent, Runner, function_tool, set_tracing_disabled from rius import SpanKind rius.init(api_key="ri_...", service_name="my-agent") set_tracing_disabled(True) @function_tool @rius.observe(kind=SpanKind.TOOL) def account_status(email: str) -> str: """Fetch a customer's account standing by email.""" return lookup(email) support_agent = Agent( name="support_agent", instructions="Answer support questions; check accounts with the tool.", tools=[account_status], model="gpt-5-mini", ) @rius.observe(name="handle-ticket", kind=SpanKind.AGENT) def handle_ticket(ticket: str) -> str: result = Runner.run_sync(support_agent, ticket) return str(result.final_output)Use the TOOL kind for your tool functions. A bare
observemakes a CHAIN span, which the Tool kind in the Spans tab’s All kinds menu and the Tool Loop alert never see. -
Handle Helicone, depending on how you used it:
- Proxy or AI Gateway: leave the Helicone base URL and the
Helicone-Authheader in place for now. Rius still traces the calls, so both tools see the same traffic while you compare. Use plain model names such asgpt-5-mini, not the gateway’smodel/providerform, or calls show tokens but no cost. - Async logger: delete the
HeliconeAsyncLoggersetup and itslogger.init()call. Do not run it and the Rius SDK in one process, because both register the process-wide OpenTelemetry tracer provider and only the first registration is kept.
- Proxy or AI Gateway: leave the Helicone base URL and the
-
Move your Helicone session and user headers onto Rius scopes. Reuse your conversation or ticket id for the session:
with rius.session(ticket_id): handle_ticket(ticket)Helicone-User-Idbecomesrius.user(user_id), which fills the Users page. -
Run one request that calls a tool and open the trace in the console. With the async logger, compare backends by running it in one service and Rius in another.
-
Once the numbers match, remove the Helicone base URL and
Helicone-Authheader so the client calls the provider directly, unless you rely on caching, rate limits or fallbacks, and revoke the Helicone key once nothing sends to it.
What you get
One request now looks like this in Rius:
handle-ticket AGENT 9.8s
├─ Response LLM 2.3s triage decides to hand off
├─ Response LLM 2.8s billing agent decides to call the tool
├─ execute_tool account_status TOOL 0ms
└─ Response LLM 4.6s billing agent answers- A root AGENT span from your entrypoint, with a span for each model call carrying model, tokens, cost and time to first token.
- A TOOL span for each wrapped tool function.
- Sessions from
rius.session()and per-user views fromrius.user(). - Cost per call computed by Rius from the model and token counts, as a list-price estimate in US dollars.
Know the blind spots. A handoff produces no span of its own, so you see it only as consecutive model calls from different agents. Model-call spans all share the generic name Response. Hyphens in agent names are rewritten in the generated handoff tool name, so use underscores. Streamed runs carry token counts only when usage is enabled on the underlying OpenAI client.
If you keep the Helicone gateway during the comparison, a response served from its cache is still recorded as a call and priced from its tokens, so Rius cost runs higher than Helicone’s by your cache-hit share.
When something else fits
- Keep the Helicone gateway if you depend on caching, rate limits, retries or fallbacks. Rius is not a gateway, so add it next to Helicone and treat the gateway as a separate project.
- Prompt management, datasets, scores and evals are not offered in Rius, and existing Helicone history does not import, so keep those workflows and old data where they are.