Instantiate the AgentPayClient with your Service Token, security considerations, and available configuration options.
AgentPayClient
in your MCP Server application. This client object is your primary interface for interacting with AgentPay services like recording consumption and validating API keys.
AgentPayClient
once when your application starts and reuse the same instance throughout the lifetime of your server process. This is more efficient than creating a new client for every request.
SERVICE_TOKEN
environment variable might not be set or if the client initialization itself fails for some reason (though typically, basic initialization is lightweight).AgentPayClient
is successfully initialized, you can proceed to:
validate_api_key()
method.consume()
method.