Quick Start

Get started with Paygent in less than 5 minutes. Choose your SDK and start tracking AI usage immediately.

Step 1 — Get Your API Key

Sign up at withpaygent.com and get your API key from the dashboard.


Step 2 — Install the SDK

Terminal
$pip install paygent-sdk

Step 3 — Set up Agents and Indicators

Define your AI agents and the indicators (actions) they’ll track in the Paygent dashboard. For example, create a chatbot-agent agent and a message-sent indicator.

Common Examples:

  • Agent: customer-support-botIndicator: message-sent
  • Agent: sales-assistantIndicator: meeting-booked
  • Agent: content-generatorIndicator: article-generated

Creating an Agent

Step 1: Go to Paygent dashboard and click on “Create Agent”

Create Agent Button

Step 2: Give agent name and external ID. External ID is important, Select other agent

Agent Details Form

Step 3: Create indicators. Indicators can be activity-based or outcome-based

Create Indicators

Step 4: Define your pricing. For example, in the image it’s $2 per call

Define Pricing

Step 5: Your agent is created successfully!

Agent Created Successfully

Creating a Customer

Step 1: Click on “Create Customer”

Create Customer Button

Step 2: Define customer and external ID. Tip: Always use your database customer ID as external ID

Customer Details Form

Step 3: Customer is created successfully!

Customer Created Successfully


Step 4 — Send Your First Usage Data

The simplest way to track AI usage in Python is by initializing Paygent at the start of your application. This automatically instruments supported LLM clients.

main.py
1import paygent_sdk
2from openai import OpenAI
3
4# 1. Initialize Paygent (Automatic Tracking)
5paygent_sdk.init(api_key="your-paygent-api-key")
6
7# 2. Use your LLM client normally
8client = OpenAI(api_key="your-openai-api-key")
9
10# 3. Add paygent_* kwargs to track usage
11response = client.chat.completions.create(
12 model="gpt-4o",
13 messages=[{"role": "user", "content": "Hello!"}],
14
15 # Paygent tracking parameters
16 paygent_agent_id="chatbot-agent",
17 paygent_customer_id="customer-123",
18 paygent_indicator="message-sent"
19)
20
21print(response.choices[0].message.content)

Step 5 — Monitor & Bill

View real-time usage data in your dashboard, and Paygent will automatically generate invoices based on actual usage. No manual calculations needed.

That’s it! You’ve successfully integrated Paygent and tracked your first AI usage. The data is now visible in your dashboard at withpaygent.com.

Next steps: Explore the SDK documentation for your language to learn about automatic tracking, advanced features, and best practices.