Quick Start

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

1Get Your API Key

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

2Install the SDK

Node.js

Terminal
1npm install @paygent_org/paygent-sdk-node

Python

Terminal
1pip install paygent-sdk

Go

Terminal
1go get github.com/paygent-org/paygent-sdk-go

3Set 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

4Send Your First Usage Data

Python Example (Automatic & Recommended)

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

5Monitor & 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.

Was this page helpful?

Need help? Contact us at support@withpaygent.com