The Agent Payments Protocol (AP2) repository is a Google-maintained project that provides code samples, demonstrations, and a software development kit for building secure, interoperable AI-driven payment systems. The repository is written primarily in Python and serves as the reference implementation for a protocol designed to enable autonomous agents to conduct transactions safely and reliably. The project's homepage at ap2-protocol.org provides additional context and documentation for the protocol itself.
The repository is organized into three main functional areas. The docs directory contains the protocol specification, architectural flows, frequently asked questions, and MkDocs sources for documentation. The code directory houses all source code split into three subdirectories: the AP2 SDK with Python implementations, reference implementations and scenarios demonstrating the protocol in action, and a web-based demo client built with Vite and React. The samples are particularly comprehensive, with scenario implementations available in Python, Go, and Android, each including a README with setup instructions and a run.sh script for local execution.
The repository shares contributors with related projects including ruvnet/ruflo, ruvnet/ruview, and ruvnet/ruvector, suggesting a broader ecosystem of interconnected tools.
The samples within the repository demonstrate various agent and server configurations, with most Python source code located in code/samples/python/src. Android-based shopping assistant implementations are housed in code/samples/android, while Go-based role implementations are in code/samples/go. Each scenario is self-contained with its own documentation and execution scripts, making it straightforward for developers to understand and run specific use cases.
The project uses Google's Agent Development Kit (ADK) and Gemini 3.1 Flash Lite Preview in its samples, though the protocol itself does not mandate these tools. Developers are free to use alternative frameworks and models when building their own agents. The quickstart documentation specifies Python 3.11 or higher as a requirement and recommends the uv package manager for dependency management. Authentication can be configured through either Google API Keys for development or Vertex AI for production environments, with support for both environment variables and .env file configuration.
The AP2 SDK's core objects are defined through Pydantic models and canonical JSON schemas, with the protocol's types package installable directly from the repository until a PyPI package becomes available. This breadth of classification reflects the protocol's ambition to serve as a foundational standard for AI-driven commerce interactions.