The GitHub repository google-agentic-commerce/AP2 introduces the Agent Payments Protocol (AP2), an initiative aimed at establishing a secure and interoperable framework for AI-driven payment systems. The project's core mission is to enable a future in which artificial intelligence can handle payment transactions smoothly and safely across diverse platforms and agents.
Practical resources and flexibility
The repository serves as a practical resource, offering a collection of code samples and demos illustrating AP2's key components and features. While the provided samples rely on specific technologies such as the Agent Development Kit (ADK) and Gemini 2.5 Flash, the documentation explicitly states that the Agent Payments Protocol itself is not tied to these tools. This flexibility allows developers to integrate AP2 with their preferred agent development kits and AI models, fostering broad adoption and customization.
Architecture and selected scenarios
The repository is structured to guide users through various selected scenarios, designed to demonstrate different aspects of the protocol in action. These scenarios are organized under samples/android/scenarios for Android applications and samples/python/scenarios for Python implementations. Each scenario is self-contained, with a README.md file providing a detailed description along with clear installation and local execution instructions. A run.sh script is included to simplify execution.
Authentication and configuration
Running the scenarios requires Python 3.10 or higher. The repository describes two main authentication methods: the Google API key, recommended for development environments for its simplicity, or Vertex AI configuration, advised for production deployments as it is more robust and scalable. Instructions are provided for setting environment variables or using a .env file for credentials.
Core objects and future plans
AP2's core objects and definitions reside in the src/ap2/types directory, with a planned dedicated PyPI package release to simplify installation and dependency management. The demos involve multiple agents and servers, with most of the source code residing in samples/python/src. Scenarios that include an Android application (shopping assistant) have their dedicated source code in samples/android.
Open and collaborative approach
The project is licensed under Apache-2.0, reflecting an open and collaborative approach. This initiative represents Google's commitment to building the infrastructure enabling safe and efficient AI-driven commercial transactions. The distributed multi-agent/server architecture illustrates scalability considerations and the protocol's real-world applicability. The repository positions AP2 as a foundational technology for the emerging agentic commerce ecosystem, where AI agents autonomously manage financial transactions with appropriate security safeguards and interoperability standards.