Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 97 additions & 50 deletions .cspell/custom-words.txt
Original file line number Diff line number Diff line change
@@ -1,112 +1,159 @@
ACMRTUXB
ASGI
Adyen
Agentic
BVNK
Blackhawk
CLASSPATH
CYGPATTERN
Crossmint
DCQL
DID
DIDs
DPAN
Dafiti
Dcql
Dfile
Dorg
Drawables
Ebanx
Fiuu
Forter
Fudd's
Garena
Gravitee
Imtp
JAVACMD
Jetpack
KXMYBJWNQ
Kotlinx
Ktor
Lazada
Lightspark
MSYS
Mispick
Monee
Mysten
OURCYGPATTERN
Otherville
PYUSD
Payoneer
Proguard
ROOTDIRS
ROOTDIRSRAW
Revolut
Rulebook
Shopcider
Shopee
USDC
Wallex
Worldline
Worldpay
XVCJ
Xdock
Zalora
aapt
absl
achatassistant
ACMRTUXB
Adyen
agentic
Agentic
agenticpayments
androidx
appname
ASGI
Blackhawk
BVNK
attestation
autopayments
blacklist
blockchain
classpath
CLASSPATH
cmwallet
contentnegotiation
credman
Crossmint
cryptographic
cryptographical
CYGPATTERN
Dafiti
dcql
Dcql
DCQL
decentralized
deviceauth
Dfile
Dorg
DPAN
Drawables
Ebanx
emvco
endlocal
ephemeral
esac
Fiuu
ethereum
ethr
fontawesome
Forter
fqcn
Fudd's
Garena
fromisoformat
gemini
genai
generativeai
gradlew
Gravitee
gson
gte
icns
imei
Imtp
inlinehilite
inmemory
interoperability
isoformat
issuerauth
JAVACMD
jetbrains
Jetpack
jvmargs
keepattributes
keepclassmembers
kotlin
kotlinx
Kotlinx
ktor
Ktor
KXMYBJWNQ
Lazada
Lightspark
linenums
lte
mastercard
mbps
micropayment
micropayments
Mispick
Monee
millisecond
milliseconds
msys
MSYS
multi
multicurrency
multistep
Mysten
nanosecond
nanoseconds
ne
nonce
nonces
octicons
okhttp
Otherville
OURCYGPATTERN
passcodes
Payoneer
payee
payer
paypal
pids
polygon
prepayments
programmable
proguard
Proguard
pymdownx
reemademo
refundability
regex
renamesourcefileattribute
representment
repudiable
Revolut
ROOTDIRS
ROOTDIRSRAW
Rulebook
repudiation
revocable
screenreaders
setlocal
sharedpref
Shopcider
Shopee
sideloaded
skus
solana
stablecoin
stablecoins
streamable
subagent
subagents
superfences
timestamped
verifiable
viewmodel
voucher
vouchers
vulnz
Wallex
Worldline
Worldpay
Xdock
XVCJ
Zalora
whitelist
120 changes: 118 additions & 2 deletions docs/a2a-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ schema:
"description": "The roles that this agent performs in the AP2 model.",
"minItems": 1,
"items": {
"enum": ["merchant", "shopper", "credentials-provider", "payment-processor"]
"enum": ["merchant", "shopper", "credentials-provider", "payment-processor", "micropayment-provider", "streaming-payment-consumer"]
}
}
},
Expand All @@ -51,7 +51,7 @@ schema:
This schema is also expressed by the following Pydantic type definition:

```py
AP2Role = "merchant" | "shopper" | "credentials-provider" | "payment-processor"
AP2Role = "merchant" | "shopper" | "credentials-provider" | "payment-processor" | "micropayment-provider" | "streaming-payment-consumer"

class AP2ExtensionParameters(BaseModel):
# The roles this agent performs in the AP2 model. At least one value is required.
Expand Down Expand Up @@ -97,6 +97,122 @@ The following listing shows an AgentCard declaring AP2 extension support.
}
```

## Micropayment Channel Capabilities

Agents that support micropayment channels can advertise their capabilities through additional parameters in the AgentCard extension. This enables high-frequency, sub-cent transactions for AI inference, data streaming, and other pay-per-use services.

### Micropayment Provider Example

```json
{
"name": "AI Inference Service",
"description": "High-performance AI model with pay-per-token pricing",
"capabilities": {
"extensions": [
{
"uri": "https://github.com/google-agentic-commerce/ap2/tree/v0.1",
"description": "Micropayment channels for AI inference",
"params": {
"roles": ["merchant", "micropayment-provider"],
"payment_channels": {
"supported": true,
"min_deposit": "1.0",
"rate_per_call": "0.001",
"rate_per_token": "0.0001",
"supported_currencies": ["USDC", "PYUSD", "ETH"],
"blockchain_networks": ["ethereum", "polygon", "kite"],
"max_channel_duration": "86400",
"checkpoint_frequency": "30",
"streaming_payments": true
}
}
}
]
}
}
```

### Streaming Payment Consumer Example

```json
{
"name": "Data Analytics Agent",
"description": "Consumes real-time data feeds with streaming payments",
"capabilities": {
"extensions": [
{
"uri": "https://github.com/google-agentic-commerce/ap2/tree/v0.1",
"description": "Streaming payments for data consumption",
"params": {
"roles": ["shopper", "streaming-payment-consumer"],
"payment_streams": {
"max_concurrent_streams": 5,
"supported_rate_types": ["per_second", "per_byte", "per_request"],
"auto_pause_threshold": "10.0",
"preferred_currencies": ["USDC", "DAI"],
"quality_requirements": {
"max_latency_ms": 100,
"min_throughput_mbps": 10
}
}
}
}
]
}
}
```

### Payment Channel Parameters Schema

The `payment_channels` object in the extension params supports the following schema:

```json
{
"type": "object",
"name": "PaymentChannelCapabilities",
"properties": {
"supported": {
"type": "boolean",
"description": "Whether payment channels are supported"
},
"min_deposit": {
"type": "string",
"description": "Minimum deposit required to open a channel"
},
"rate_per_call": {
"type": "string",
"description": "Cost per API call or request"
},
"rate_per_token": {
"type": "string",
"description": "Cost per AI token for inference services"
},
"supported_currencies": {
"type": "array",
"items": {"type": "string"},
"description": "List of supported payment currencies"
},
"blockchain_networks": {
"type": "array",
"items": {"type": "string"},
"description": "Supported blockchain networks"
},
"max_channel_duration": {
"type": "string",
"description": "Maximum channel duration in seconds"
},
"checkpoint_frequency": {
"type": "string",
"description": "How often to create payment checkpoints (seconds)"
},
"streaming_payments": {
"type": "boolean",
"description": "Whether streaming payments are supported"
}
}
}
```

## AP2 Data Type Containers

The following sections describe how AP2 data types are encapsulated into A2A
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""AI inference service with micropayment channels."""
Loading