Users

Track per-user metrics, set budgets, and apply rate limits to your LLM users.

  1. Sign up — Create an account at platform.respan.ai
  2. Create an API key — Generate one on the API keys page
  3. Add credits or a provider key — Add credits on the Credits page or connect your own provider key on the Integrations page

Add the Docs MCP to your AI coding tool to get help building with Respan. No API key needed.

1{
2 "mcpServers": {
3 "respan-docs": {
4 "url": "https://mcp.respan.ai/mcp/docs"
5 }
6 }
7}

Respan’s Users page lets you track per-user LLM usage, set budgets, and apply rate limits. Pass a customer_identifier with your logs or traces to enable user analytics.

Users Page

Enable user analytics

Pass customer_params to associate logs and traces with a user.

1import requests
2
3url = "https://api.respan.ai/api/request-logs/"
4payload = {
5 "model": "gpt-4o-mini",
6 "input": [{"role": "user", "content": "Hi"}],
7 "output": {"role": "assistant", "content": "Hello!"},
8 "customer_params": {
9 "customer_identifier": "customer_1",
10 "name": "Hendrix Liu",
11 "email": "hendrix@respan.ai"
12 }
13}
14headers = {
15 "Authorization": "Bearer YOUR_RESPAN_API_KEY",
16 "Content-Type": "application/json"
17}
18response = requests.post(url, headers=headers, json=payload)

See Log fields & parameters for all available fields.

See user data on the platform

After you pass customer_identifier, user data appears in 3 places:

1. Users page — per-user detail and LLM usage.

Users Page

2. Dashboard — top users, daily active users, cost by user.

Dashboard user metrics

3. Logs page — filter logs by user identifier.

Logs user filter

Users are created automatically the first time you send a log, trace, or gateway request with a customer_identifier. After that, use the User Update endpoint to adjust budgets or profile fields.


Rate limits

This feature is only available for AI gateway users.

Set a per-user rate limit (requests per minute) to prevent abuse. Pass rate_limit inside customer_params:

1response = client.chat.completions.create(
2 model="gpt-4o-mini",
3 messages=[{"role": "user", "content": "Hello"}],
4 extra_body={
5 "customer_params": {
6 "customer_identifier": "customer_1",
7 "rate_limit": 100 # requests per minute
8 }
9 }
10)

Budgets

Only available for users using the LLM Gateway.

Set spending limits per user by passing budget parameters inside customer_params:

1response = client.chat.completions.create(
2 model="gpt-4o-mini",
3 messages=[{"role": "user", "content": "Hello"}],
4 extra_body={
5 "customer_params": {
6 "customer_identifier": "customer_1",
7 "budget_duration": "monthly",
8 "period_budget": 1000,
9 "total_budget": 10000
10 }
11 }
12)

Budget parameters

ParameterTypeDescription
budget_durationstringmonthly, weekly, or daily
period_budgetfloatBudget limit for the current period (USD)
total_budgetfloatLifetime budget limit (USD)
period_startstringCustom period start (YYYY-MM-DD). Defaults to today.
period_endstringCustom period end (YYYY-MM-DD). Auto-calculated from budget_duration if omitted.
markup_percentagefloatMarkup percentage applied to usage reports for this user

You can use period_start and period_end instead of budget_duration for custom budget periods.

You can also set budgets via the User Update endpoint after the user has been created automatically from usage.