How do I switch from Helicone to Rius for the Vercel AI SDK?
Rius traces the Vercel AI SDK through its own OpenTelemetry telemetry, so you replace Helicone’s base URL or logger with one init() call from the Rius SDK. Each AI SDK call then arrives with its messages, model, token usage and a server-side cost, nested under an agent span. You can keep the Helicone gateway in place while you compare both tools, and remove it when you are ready. The Migrate to Rius guide covers the general approach.
How it works
Helicone is mainly a proxy. Your provider client sends requests through a Helicone base URL with a Helicone-Auth header, and Helicone logs them on the way. Rius works differently. The Rius SDK runs inside your process and exports OpenTelemetry spans, so nothing sits between your code and the model provider.
For the Vercel AI SDK, the spans come from the AI SDK’s own telemetry:
- On
ai7, the official@ai-sdk/otelpackage emits the spans, andinit()registers it for you. It needs Node 22 or newer. - On
ai5 and 6, OpenTelemetry is built in, and each call turns it on withexperimental_telemetryset toisEnabled: true. Nothing else is installed.
The Rius SDK does not read Helicone’s request logs, so the Helicone proxy cannot be pointed at Rius. Existing Helicone history stays in Helicone, and Rius starts from the first span you send. The Helicone migration guide maps the rest of Helicone’s concepts.
Set it up
-
Install the SDK and, on
ai7, the telemetry package. Onai5 and 6 you skip@ai-sdk/otel.npm install @glassflow-ai/rius @opentelemetry/api npm install @ai-sdk/otel -
Call
init()at startup, then make your AI SDK calls as you do today. Wait onreadyso the integration is registered before the first call, and callshutdown()in short scripts so queued spans are exported.import { init } from '@glassflow-ai/rius' import { openai } from '@ai-sdk/openai' import { generateText } from 'ai' const rius = init({ apiKey: 'ri_...', serviceName: 'my-agent' }) await rius.ready // the AI SDK integration is registered before the first call const { text } = await generateText({ model: openai('gpt-4o-mini'), prompt: 'Summarize this ticket', }) await rius.shutdown() // export queued spans before the process exits -
On
ai5 and 6, add telemetry to each call:const { text } = await generateText({ model: openai('gpt-4o-mini'), prompt: 'Summarize this ticket', experimental_telemetry: { isEnabled: true }, }) -
Decide what happens to Helicone. If you use the async logger, delete it rather than running both in one process. Both register the process-wide OpenTelemetry tracer provider, only the first registration is kept, and the calls reach only one tool. If you use the proxy, keep the Helicone base URL and
Helicone-Authheader in your provider setup for now. The AI SDK’s telemetry runs in your process, so calls are traced whatever base URL they use, and both tools see the same traffic while you compare. -
Move your Helicone headers onto Rius scopes.
Helicone-Session-IdbecomeswithSession, andHelicone-User-IdbecomeswithUser. Every span started inside a scope carriessession.idoruser.id.import { withSession, withUser } from '@glassflow-ai/rius' await withSession(sessionId, () => withUser(userId, async () => { await generateText({ model: openai('gpt-4o-mini'), prompt }) }), )Replace
Helicone-Property-*values with span attributes, or resource attributes for per-deployment values. To keep aHelicone-Session-Pathstructure, nest spans the same way. -
Run one call and open the trace. If no spans appear on
ai7, check the log. Rius warns atinit()when it findsai7 without@ai-sdk/otel. Onai5 and 6, the usual cause is a call withoutisEnabledset to true. Once the numbers match on the same traffic, remove the Helicone base URL and headers, unless you rely on caching, rate limits or fallbacks, and revoke the Helicone key once nothing sends to it.
What you get
- A full tree for each call. An agent span (
invoke_agent) wraps the steps of a tool-calling loop. Inside it you see achatspan for each model call and anexecute_toolspan for each tool execution, not only the LLM requests. - Model call details. Each model call shows input and output messages, tool definitions, the resolved model, and token usage including cache reads, cache writes when the AI SDK reports them, and reasoning tokens. Streamed calls carry time to first token.
- Cost without extra work. Rius computes cost from the model and token counts. Costs are list-price estimates in US dollars, not billed amounts. Each model call is counted once, and the wrapper span still shows the run’s total.
- Sessions and users. Traces group by session, and each user appears on the Users page with their traces, failures and cost.
- Privacy controls.
captureContent: falseand amaskapply to prompts, responses, system prompts, tool definitions and tool arguments and results.
See the Vercel AI SDK integration for the full list of what each version records.
When something else fits
- Rius is not a gateway. Caching, rate limits, retries, fallbacks, prompt management, scores, datasets and evals do not carry over, so keep those in Helicone or another tool.
- On
ai5 and 6, image, speech and transcription calls are not traced because they take no telemetry settings. Onai7 they are traced. - For other libraries and frameworks, see the integrations list.