Custom API
Connect any AI agent via API
Overview
The Custom API integration allows you to connect any AI agent that follows our API specifications. This enables you to integrate your own AI solutions or third-party services with Pactory.
Prerequisites
- An API endpoint that accepts POST requests
- API authentication credentials (if required)
- API response format matching our specifications
API Specifications
Request Format
Response Format
If token counts are not provided in the response, we will calculate them using the GPT-4 tiktoken encoding. This ensures accurate billing even when the API doesn’t provide token counts.
Integration Steps
Access Integration
From your Pactory dashboard, go to “Add New Agent” and select “Custom API”
Configure Basic Settings
Fill in the standard agent configuration fields (name, description, etc.)
Configure Integration
Enter your API configuration:
- API endpoint URL (required)
- API key (required)
Test Connection
Send a test message to verify the integration is working properly
Share your agent and get paid based on usage!