Skip to Content

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 ai 7, the official @ai-sdk/otel package emits the spans, and init() registers it for you. It needs Node 22 or newer.
  • On ai 5 and 6, OpenTelemetry is built in, and each call turns it on with experimental_telemetry set to isEnabled: 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

  1. Install the SDK and, on ai 7, the telemetry package. On ai 5 and 6 you skip @ai-sdk/otel.

    npm install @glassflow-ai/rius @opentelemetry/api npm install @ai-sdk/otel
  2. Call init() at startup, then make your AI SDK calls as you do today. Wait on ready so the integration is registered before the first call, and call shutdown() 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
  3. On ai 5 and 6, add telemetry to each call:

    const { text } = await generateText({ model: openai('gpt-4o-mini'), prompt: 'Summarize this ticket', experimental_telemetry: { isEnabled: true }, })
  4. 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-Auth header 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.

  5. Move your Helicone headers onto Rius scopes. Helicone-Session-Id becomes withSession, and Helicone-User-Id becomes withUser. Every span started inside a scope carries session.id or user.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 a Helicone-Session-Path structure, nest spans the same way.

  6. Run one call and open the trace. If no spans appear on ai 7, check the log. Rius warns at init() when it finds ai 7 without @ai-sdk/otel. On ai 5 and 6, the usual cause is a call without isEnabled set 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 a chat span for each model call and an execute_tool span 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: false and a mask apply 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 ai 5 and 6, image, speech and transcription calls are not traced because they take no telemetry settings. On ai 7 they are traced.
  • For other libraries and frameworks, see the integrations list.

Still stuck? Get help

Last updated on