Skip to main content

PaymentConfig

The full configuration interface:

Required Options

apiKey

Type: string Required: Yes Your Payo provider API key. Get this from your Payo dashboard.
Never hardcode your API key. Use environment variables.

pricing

Type: Record<string, number> Required: Yes Maps tool names to USD prices:
Tools not in this object default to free (price = 0).

Platform Options

platformUrl

Type: string Default: "https://payo.dev" The Payo platform URL. Only change this for testing.

Behavior Options

failOpen

Type: boolean Default: false What happens when Payo is unreachable:
failOpen: true means free service during Payo outages. Use only if availability > revenue.

requireAuthForAllTools

Type: boolean Default: false Whether free tools also require an agent token:
Use this to track usage of free tools or enforce authentication.

Logging Options

logLevel

Type: LogLevel Default: LogLevel.INFO Controls logging verbosity:

logger

Type: PaymentLogger Default: Built-in stderr logger Custom logger implementation:
Example with Winston:

Error Message Options

providerName

Type: string Default: undefined Your service name, shown in error messages:
Error message:
Without providerName:

errorVerbosity

Type: 'detailed' | 'concise' Default: 'detailed' How much detail in error messages:
Detailed (default):
Concise:

Complete Example


Environment-Based Configuration