Skip to Content

How do I move my user ids from Helicone to Rius?

Rius maps Helicone-User-Id to a user scope: wrap the work in rius.user(id), or withUser in TypeScript, and every span inside carries user.id. You pass the same id value you sent to Helicone, from your own code instead of a request header. The Users page then lists each user with their traces, failures and cost. Helicone’s past user data stays in Helicone.

How it works

Helicone sets the user per request, with a Helicone-User-Id header that the proxy reads. Rius works inside your process, so the user is set in code, in a scope around the work.

  • Helicone-User-Id becomes user.id. rius.user(id) in Python and withUser(id, fn) in TypeScript stamp user.id on every span started inside the scope, including the spans that auto-instrumentation creates for each model call.
  • The id value carries over unchanged. Pass the same identifier you used in Helicone and the same person stays one user across the move. If you used to send an email, consider an opaque id instead, since Rius recommends opaque ids over emails.
  • There is no environment variable for users. Unlike a session, which can be set for a whole process with RIUS_SESSION_ID, a user is set only in code, by design.
  • Spans outside a scope have no user. A trace with no user.id counts as anonymous, so wrap the whole request, not only the model call.

If you also sent Helicone-Session-Id, that maps to rius.session(id) (withSession in TypeScript), which stamps session.id the same way. The full header-to-Rius mapping is in Migrate from Helicone, and Migrate to Rius covers the other tools.

Set it up

  1. Install the SDK with the integrations for the providers you call, and start it once at startup. The client then goes straight to the provider, or keeps its Helicone base URL while you compare both backends.

    pip install "glassflow-rius[openai,anthropic]" export RIUS_API_KEY="ri_..."
    import rius rius.init(service_name="my-agent") # reads RIUS_API_KEY
  2. Find the place where you set Helicone-User-Id and open a user scope around the same work, using the same id:

    with rius.user(request.user_id): handle(request) # every span of the request carries user.id
    import { withUser } from '@glassflow-ai/rius' await withUser(request.userId, async () => { await handle(request) // every span of the request carries user.id })

    In TypeScript, call init() and await client.ready before the first model call, so the instrumentation is attached.

  3. Open one trace in Rius and check that it shows the user. Then open the Users page and confirm the user appears with the trace. The user filter on the trace list also finds it.

  4. If you keep the Helicone gateway during side by side, leave its base URL and headers in place while you compare both backends. At cutover, remove the Helicone-User-Id header together with the other Helicone-* headers and the Helicone base URL, and revoke the Helicone API key once nothing sends to it.

What you get

  • A Users page that lists each end user your agents served, with their traces, failures and cost. Cost is a list-price estimate in US dollars that Rius computes from the model and token counts, so you never send it.
  • A user filter on the trace list, so you can open every trace for one person.
  • The same user on every span of a request, including the model calls and tool steps, because the scope covers everything started inside it.
  • Time to first token per user, computed by Rius from the spans.

What has no counterpart:

  • History. Rius has no import from Helicone. Users appear from the first span you send, and earlier per-user data stays in Helicone.
  • Per-property breakdowns. Attributes you set are filterable, but there is no cost or metric breakdown per custom property.
  • Product analytics. There are no active-user, retention or cohort views.

When something else fits

  • If you rely on Helicone for gateway features such as caching, rate limits, retries or fallbacks, keep the gateway. Add the Rius user scope next to it, since Rius is not a gateway.
  • If you need retention or cohort analytics on your users, keep that analysis in your product analytics tool. Rius shows each user’s traces, failures and cost, not user behavior over time.

Still stuck? Get help

Last updated on