A package to interact with the Paid API.
Project description
AgentPaid Python SDK
Official Python SDK for the AgentPaid API.
Installation
pip install Paid.ai-Client
Usage
from paid_client import PaidClient
# Initialize the client
client = PaidClient(
api_key='YOUR_API_KEY',
api_url='YOUR_API_URL' # Optional, defaults to production URL
)
# Example: Record usage
client.record_usage(
'agent_id',
'customer_id',
'event_name',
{'key': 'value'}
)
# Signals are automatically flushed:
# - Every 30 seconds
# - When the buffer reaches 100 events
# To manually flush:
client.flush()
API Documentation
Usage Recording
record_usage(agent_id: str, external_user_id: str, signal_name: str, data: Any) -> Noneflush() -> None
Accounts
create_account(data: CreateAccountRequest) -> Accountget_account(account_id: str) -> Accountget_account_by_external_id(external_id: str) -> Accountlist_accounts() -> List[Account]update_account(account_id: str, data: UpdateAccountRequest) -> Accountupdate_account_by_external_id(external_id: str, data: UpdateAccountRequest) -> Accountdelete_account(account_id: str) -> Nonedelete_account_by_external_id(external_id: str) -> None
Orders
create_order(data: CreateOrderRequest) -> Orderget_order(order_id: str) -> Orderlist_orders() -> List[Order]add_order_lines(order_id: str, lines: List[Dict[str, Any]]) -> List[OrderLine]activate_order(order_id: str) -> strdelete_order(order_id: str) -> None
Agents
create_agent(agent: CreateAgentRequest) -> Agentget_agent(agent_id: str) -> Agentlist_agents() -> List[Agent]update_agent(agent_id: str, data: UpdateAgentRequest) -> Agentdelete_agent(agent_id: str) -> None
Contacts
create_contact(data: CreateContactRequest) -> Contactget_contact(contact_id: str) -> Contactlist_contacts(account_id: Optional[str] = None) -> List[Contact]delete_contact(contact_id: str) -> str
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
paid_ai_client-0.4.4.tar.gz
(8.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paid_ai_client-0.4.4.tar.gz.
File metadata
- Download URL: paid_ai_client-0.4.4.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ff9005fd41766f7b8f67215ca9d1d4f9bc09dcb5aa321f5be83ae9fc855dd61
|
|
| MD5 |
4223fde1deda0fd5e5ab96509dd0c22c
|
|
| BLAKE2b-256 |
0c6d2a40716bc8dbce2bf464a48267f0bce7a880d46e5677d47cc1cec1703b0b
|
File details
Details for the file paid_ai_client-0.4.4-py3-none-any.whl.
File metadata
- Download URL: paid_ai_client-0.4.4-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7228c7702caeb4954c6db5878f04c0af8065c3f993529038d8ccac73bcfeaaeb
|
|
| MD5 |
67511b8573bc7d393dcc301b15092b50
|
|
| BLAKE2b-256 |
d22d109f7aa83713085595f7ff9d0cc0e0fe23f5f63609abc1d57bf3f35277d0
|