User ID Tracking | Proxyify Docs
Docs User ID Tracking

User ID Tracking

Embed one Proxyify key in your app and serve thousands of users — then see exactly who spent what, all from your dashboard.

Why you need this

A typical SaaS setup looks like this: you hold one Proxyify key on your backend, your app makes AI calls on behalf of many end-users, and you want to know per-user cost for billing, abuse detection, or debugging. Without user tracking, all requests look identical in the dashboard — you can only see aggregate usage.

With X-Proxyify-User-Id you get a per-user breakdown without managing a separate API key per user.

How it works

Add the header to every request your backend makes to Proxyify. Use whatever identifier you already use in your system — a database primary key, a UUID, or a hashed email.

http
POST /v1/chat/completions HTTP/1.1 Authorization: Bearer prx-... Content-Type: application/json X-Proxyify-User-Id: user_7a3f { "model": "openai/gpt-4o", "messages": [{ "role": "user", "content": "Hello" }] }

Proxyify reads the header, stores it as end_user_id on every log entry, and never forwards it to the upstream provider.

Code examples

python
import requests def chat(user_id: str, message: str): return requests.post( "https://proxyify.dev/v1/chat/completions", headers={ "Authorization": "Bearer prx-...", "Content-Type": "application/json", "X-Proxyify-User-Id": user_id, # e.g. str(request.user.pk) }, json={ "model": "openai/gpt-4o", "messages": [{"role": "user", "content": message}], }, ).json()
javascript (node)
async function chat(userId, message) { const res = await fetch("https://proxyify.dev/v1/chat/completions", { method: "POST", headers: { "Authorization": "Bearer prx-...", "Content-Type": "application/json", "X-Proxyify-User-Id": userId, }, body: JSON.stringify({ model: "openai/gpt-4o", messages: [{ role: "user", content: message }], }), }); return res.json(); }

Viewing in the dashboard

Go to Dashboard → Usage. Every log row shows a User ID column:

  • If no User ID was sent — the cell shows
  • If a User ID was sent — it appears as a clickable blue badge
  • Clicking the badge instantly filters the log table to show only that user's requests
  • You can also type a User ID directly into the End-User ID filter field
  • The Export CSV button respects the current filter — export all requests for a single user with one click

Rules & limits

PropertyValue
Header nameX-Proxyify-User-Id
Max length255 characters (truncated silently if longer)
Allowed charactersAny printable string — UUID, integer, slug, hashed email
Optional?Yes — omitting it never causes an error
Forwarded upstream?No — Proxyify strips it before forwarding
Applies toAll modalities: text, image, video, STT, TTS

Security note

The User ID is a label you assign — Proxyify does not verify or authenticate it. Never use raw user-supplied input (e.g. request.GET["user_id"]) as the header value without sanitising it first. Use your own internal identifier (a database PK or a server-signed token) to prevent spoofing.