Skip to main content

AI Integration Overview

The AI Checkout interface enables you to build AI Agents (Chatbots, Copilots, or Autonomous Agents) that can orchestrate crypto payments.

Architecture & Responsibility​

To integrate AI Checkout, you are building an Agent Runtime that acts as the bridge between the User's Wallet and the GStable API.

Unlike a standard checkout where we host the UI, you are responsible for the "Body" and "Brain" of the Agent, while we provide the "Payment Logic" and "Settlement Rail".

Responsibility Matrix​

FeatureWho Builds It?Description
User InterfaceYou (Developer)The chat window, wallet connection button, and transaction confirmation cards.
Agent RuntimeYou (Developer)The backend or client-side logic that calls our API, parses responses, and constructs EIP-712 messages.
Wallet ConnectionYou (Developer)Integration with libraries like wagmi, ethers.js, or viem to request signatures from the user.
Payment LogicGStable SaaSValidating products, calculating prices, handling cross-chain routing, and generating transaction calldata.
SettlementGStable SaaSMonitoring on-chain events and settling funds to your merchant account.

Interaction Diagram​

The following diagram illustrates how your Agent Runtime coordinates between the User and the GStable API.

Integration Core Concepts​

1. The "AI View"​

Our API returns a special aiView object designed for LLMs. It contains:

  • Semantics: What the product is (without HTML formatting).
  • Workflow: What the Agent should do next (e.g., "ask user for address" or "request signature").
  • AuthorizationSpec: How to construct the EIP-712 message for the user to sign.

2. EIP-712 Signatures​

We use EIP-712 for all state-changing actions. This ensures that the Agent cannot spend user funds or create orders without explicit, human-readable consent from the user's wallet.

You will need to implement a signing handler in your runtime using standard Web3 libraries.

Next Steps​

Ready to build? Go to the Integration Workflow guide for a code-first tutorial.