operationId, detailed JSON schemas, and consistent conventions that make it straightforward to use with LLM function calling, autonomous agents, and AI orchestration frameworks.
OpenAPI Specification
The full OpenAPI 3.1 specification is available at:- A unique
operationIdfor every endpoint (e.g.createPaymentLink,listTransactions) - Detailed request and response JSON schemas with descriptions
- Authentication requirements
- Error response schemas
LLM Function Calling
Claude (Anthropic)
Convert OpenAPI operations into Claude tool definitions. Here is an example tool definition for creating a payment link:OpenAI
The equivalent function definition for OpenAI’s function calling:Example: Conversation Flow
Here is how an AI assistant might use the AnySpend tools in a conversation:User asks to create a payment link
User: “Create a payment link for 50 USDC for the Pro plan subscription”The AI decides to call the
create_payment_link tool.AI responds to the user
“I’ve created a payment link for 50 USDC for the Pro Plan Subscription. Here’s the link: https://pay.anyspend.com/pl_abc123”
Building an AI Payment Agent
Below is a complete example of an AI agent that can manage payments using Claude and the AnySpend SDK:MCP Server (Coming Soon)
We are building a Model Context Protocol (MCP) server that will expose the full AnySpend Platform API as MCP tools. This will allow any MCP-compatible AI client (Claude Desktop, Cursor, Windsurf, etc.) to interact with your AnySpend account directly.Join the waitlist to get early access.
- All CRUD operations for payment links, products, customers, and webhooks
- Transaction querying and export
- Analytics and stats
- Checkout session management
Additional Tool Definitions
Here are more tool definitions you can add to your agent for comprehensive coverage:list_payment_links
list_payment_links
get_analytics_overview
get_analytics_overview
create_discount_code
create_discount_code
export_transactions
export_transactions
Best Practices
Use read-only keys for query agents
AI agents that only read data (list transactions, view analytics) should use API keys with read-only permission. This prevents accidental mutations from hallucinated tool calls.
Use write keys for action agents
Agents that need to create payment links or manage resources need read-write API keys. Scope them to the minimum permissions required.
Always validate amounts
LLMs can hallucinate numbers. Before executing a tool call that involves an amount, validate that the amount is reasonable. Consider adding a confirmation step for amounts above a threshold.
Log all tool calls
Log every tool call and its result for auditability. This is especially important for agents that handle real money.
HypeDuel