How does user analytics work?

On Keywords AI, we built a Users page to help you understand your users and their behavior on your LLM applications. With our user analytics feature, you can;

  • Track user LLM usage
  • Set user budget
  • Filter logs by user identifier

Enable user analytics in the code

You can pass a customer_params to the request to track the user’s behavior on your LLM applications.

Here is an example of how to send a user’s data with the parameter customer_params to Keywords AI in the OpenAI Python SDK.

from openai import OpenAI

client = OpenAI(
    base_url="https://api.keywordsai.co/api/",
    api_key="YOUR_KEYWORDSAI_API_KEY",
)

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
        {"role": "user", "content": "Tell me a long story"}
    ],
    extra_body={
        "customer_params": {
            "customer_identifier": "customer_1",
            "name": "Hendrix Liu", # optional parameter 
            "email": "hendrix@keywordsai.co" # optional parameter
        }
    }
)

See user data on the platform

After you send the user’s data to Keywords AI, there are 3 places you can see the user’s data on the platform.

1. Users page

You will see each user’s detail information and their LLM usage on the Users page and the side panel.

2. Dashboard page

There are several charts on the Dashboard page to help you understand your users’ behavior, including;

  • Top users
  • Daily active users count
  • LLM cost by user

3. Logs page

For each LLM log, you can see the corresponding user’s data in the side panel. You can also filter logs by choosing a User Identifier.

Create a user without sending a log