Export to Mixpanel

Send LLM usage events from Future AGI's Prism Gateway to Mixpanel for product analytics.

📝
TL;DR

Connect your Mixpanel project and Future AGI will push LLM usage events from the Prism Gateway on every sync cycle. Each gateway request becomes a Mixpanel event you can use in funnels, retention, and reports.

What this does

This integration sends your Prism Gateway traffic to Mixpanel as tracked events. Every API call that passes through the gateway becomes a prism_request event with properties like model, provider, latency, token counts, and cost.

Useful when your product team tracks feature usage in Mixpanel and wants LLM call data in the same place - for example, to see which user segments generate the most tokens or how LLM latency correlates with session length.

What gets exported

Each Prism Gateway request becomes a Mixpanel event:

PropertyExampleDescription
eventprism_requestEvent name
properties.distinct_idprism-gatewayIdentifies the source
properties.modelgpt-4oModel used
properties.provideropenaiProvider
properties.latency_ms842End-to-end latency
properties.input_tokens1200Prompt tokens
properties.output_tokens323Completion tokens
properties.total_tokens1523Total tokens
properties.cost0.02Cost in USD
properties.status_code200HTTP status
properties.is_errorfalseWhether the request failed
properties.cache_hittrueWhether the response was cached

Tip

If you provide an API Secret during setup, events are sent via Mixpanel’s /import endpoint which supports historical timestamps. Without it, events go through /track which only accepts recent data.


Before you start

You’ll need:

  • A Mixpanel account (any plan)
  • Your Project Token, found in Mixpanel > Settings > Project Settings > Project Token
  • Optionally, your API Secret for historical data import (same settings page)
  • Admin or Owner role in your Future AGI workspace
  • The Prism Gateway set up and receiving traffic

Connect Mixpanel

Open Integrations

Go to Settings > Integrations in your Future AGI workspace. Click Add Integration or click the Mixpanel card.

Integrations list page

Enter your Mixpanel credentials

On the Credentials step, fill in:

FieldRequiredDescription
Project TokenYesYour Mixpanel project token.
API SecretNoEnables historical data import via the /import endpoint.

Mixpanel credentials form

Click Validate & Continue.

Configure sync settings

Set how often Future AGI batches and sends events to Mixpanel, and whether to backfill historical gateway data.

Mixpanel sync settings

Click Connect Integration.

Done

Events start flowing to Mixpanel on the next sync cycle.


Verify in Mixpanel

Once the first sync completes:

  • Go to Mixpanel > Events and search for prism_request
  • Or create an Insights report filtering on the prism_request event to see request volume over time

If nothing shows up after 10 minutes, check the sync status in Settings > Integrations.


Sync status

Monitor your integration from the detail page (Settings > Integrations > click your Mixpanel connection).

StatusMeaningAction
ActiveExporting on scheduleNone needed
SyncingA batch is being sent right nowWait for it to finish
PausedYou paused the export manuallyClick Resume when ready
ErrorProject token invalid or Mixpanel rejected the requestCheck your token

Troubleshooting

No events appearing in Mixpanel

Verify your project token is correct. Go to Mixpanel > Settings > Project Settings and compare. Also check that the Prism Gateway is actively receiving traffic - if there are no requests in the sync window, no events are sent.

Historical events not showing up

The /track endpoint only accepts events with recent timestamps. To import historical data, you need to provide an API Secret during setup. Edit the integration and add your API Secret, then re-run the backfill.

Connection shows Error status

Your project token may have been rotated. Get the current token from Mixpanel > Settings > Project Settings, then edit the integration to update it.


What’s next

Was this page helpful?

Questions & Discussion