curl --request POST \
--url https://dev-gateway.molpha.io/v1/agent/execute \
--header 'Content-Type: application/json' \
--data '
{
"payer": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"canonical_timestamp": 1700100000,
"signatures_required": 3,
"amount": 1030,
"registry_version": 42,
"apiConfig": {
"url": "https://api.example.com/v1/price",
"method": "GET",
"headers": {},
"responseParser": "$.data.price",
"valueTransform": "multiply:1e6"
}
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
payer: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',
canonical_timestamp: 1700100000,
signatures_required: 3,
amount: 1030,
registry_version: 42,
apiConfig: {
url: 'https://api.example.com/v1/price',
method: 'GET',
headers: {},
responseParser: '$.data.price',
valueTransform: 'multiply:1e6'
}
})
};
fetch('https://dev-gateway.molpha.io/v1/agent/execute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dev-gateway.molpha.io/v1/agent/execute"
payload = {
"payer": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"canonical_timestamp": 1700100000,
"signatures_required": 3,
"amount": 1030,
"registry_version": 42,
"apiConfig": {
"url": "https://api.example.com/v1/price",
"method": "GET",
"headers": {},
"responseParser": "$.data.price",
"valueTransform": "multiply:1e6"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev-gateway.molpha.io/v1/agent/execute"
payload := strings.NewReader("{\n \"payer\": \"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU\",\n \"canonical_timestamp\": 1700100000,\n \"signatures_required\": 3,\n \"amount\": 1030,\n \"registry_version\": 42,\n \"apiConfig\": {\n \"url\": \"https://api.example.com/v1/price\",\n \"method\": \"GET\",\n \"headers\": {},\n \"responseParser\": \"$.data.price\",\n \"valueTransform\": \"multiply:1e6\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "completed",
"data": {
"feedId": "0xabc123...",
"value": "42150125000000",
"valuePacked": "<string>",
"timestamp": 1700100000,
"registryVersion": 42,
"signaturesRequired": 3,
"configHash": "<string>",
"signersBitmap": "<string>",
"s": "<string>",
"rx": "<string>",
"ryParity": 123,
"commitmentAddr": "<string>",
"fresh": true
}
}{
"error": "validation failed"
}{
"error": "validation failed"
}{
"x402Version": 1,
"error": "payment required: escrow ATA underfunded",
"accepts": [
{
"scheme": "exact",
"network": "solana-devnet",
"maxAmountRequired": "1030",
"payTo": "<string>",
"asset": "<string>",
"resource": "/v1/agent/execute",
"description": "<string>",
"maxTimeoutSeconds": 60,
"extra": {
"payer": "<string>",
"agent": "<string>",
"gateway": "<string>",
"feedId": "<string>",
"canonicalTimestamp": 123,
"amount": "<string>",
"currentAtaBalance": "<string>",
"committedAmount": "<string>",
"note": "<string>"
}
}
]
}{
"error": "validation failed"
}{
"error": "validation failed"
}{
"error": "validation failed"
}{
"error": "validation failed"
}Execute an x402 agent round
Self-funded pay-per-request round via agent escrow.
curl --request POST \
--url https://dev-gateway.molpha.io/v1/agent/execute \
--header 'Content-Type: application/json' \
--data '
{
"payer": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"canonical_timestamp": 1700100000,
"signatures_required": 3,
"amount": 1030,
"registry_version": 42,
"apiConfig": {
"url": "https://api.example.com/v1/price",
"method": "GET",
"headers": {},
"responseParser": "$.data.price",
"valueTransform": "multiply:1e6"
}
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
payer: '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU',
canonical_timestamp: 1700100000,
signatures_required: 3,
amount: 1030,
registry_version: 42,
apiConfig: {
url: 'https://api.example.com/v1/price',
method: 'GET',
headers: {},
responseParser: '$.data.price',
valueTransform: 'multiply:1e6'
}
})
};
fetch('https://dev-gateway.molpha.io/v1/agent/execute', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://dev-gateway.molpha.io/v1/agent/execute"
payload = {
"payer": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"canonical_timestamp": 1700100000,
"signatures_required": 3,
"amount": 1030,
"registry_version": 42,
"apiConfig": {
"url": "https://api.example.com/v1/price",
"method": "GET",
"headers": {},
"responseParser": "$.data.price",
"valueTransform": "multiply:1e6"
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev-gateway.molpha.io/v1/agent/execute"
payload := strings.NewReader("{\n \"payer\": \"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU\",\n \"canonical_timestamp\": 1700100000,\n \"signatures_required\": 3,\n \"amount\": 1030,\n \"registry_version\": 42,\n \"apiConfig\": {\n \"url\": \"https://api.example.com/v1/price\",\n \"method\": \"GET\",\n \"headers\": {},\n \"responseParser\": \"$.data.price\",\n \"valueTransform\": \"multiply:1e6\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": "completed",
"data": {
"feedId": "0xabc123...",
"value": "42150125000000",
"valuePacked": "<string>",
"timestamp": 1700100000,
"registryVersion": 42,
"signaturesRequired": 3,
"configHash": "<string>",
"signersBitmap": "<string>",
"s": "<string>",
"rx": "<string>",
"ryParity": 123,
"commitmentAddr": "<string>",
"fresh": true
}
}{
"error": "validation failed"
}{
"error": "validation failed"
}{
"x402Version": 1,
"error": "payment required: escrow ATA underfunded",
"accepts": [
{
"scheme": "exact",
"network": "solana-devnet",
"maxAmountRequired": "1030",
"payTo": "<string>",
"asset": "<string>",
"resource": "/v1/agent/execute",
"description": "<string>",
"maxTimeoutSeconds": 60,
"extra": {
"payer": "<string>",
"agent": "<string>",
"gateway": "<string>",
"feedId": "<string>",
"canonicalTimestamp": 123,
"amount": "<string>",
"currentAtaBalance": "<string>",
"committedAmount": "<string>",
"note": "<string>"
}
}
]
}{
"error": "validation failed"
}{
"error": "validation failed"
}{
"error": "validation failed"
}{
"error": "validation failed"
}Body
Agent round execution request
Request body for POST /v1/agent/execute. Agent-specific fields use snake_case.
Payer Ed25519 identity and on-chain escrow authority (base58 pubkey).
"7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
Node round timestamp and on-chain replay key. Must be within gateway clock skew.
1700100000
Requested quorum for this round.
3
Locked round price in USDC atomic units. Must equal the computed price exactly.
1030
Active on-chain registry version. Must match the current version.
42
Off-chain HTTP API configuration hashed into the feed identity.
Hide child attributes
Hide child attributes
Target API URL. Must use http or https.
"https://api.example.com/v1/price"
JSONPath expression to extract the value from the API response.
"$.data.price"
HTTP method.
"GET"
Optional post-parse transform (e.g. multiply:1e6).
"multiply:1e6"
Payer Ed25519 signature over H(AgentRequestAuth) (base58 or 0x hex).
Omit only on the unfunded first request of the 402 discovery flow.
End-to-end encryption envelope for private API configs. Omit for plaintext configs.
Hide child attributes
Hide child attributes
Ephemeral X25519 public key used to encrypt the config.
Symmetric encryption nonce.
Encrypted API configuration payload.
Response
Signed payload ready for submission or verification
Successful round response envelope shared by subscription and agent execute paths.
Round completion status.
"completed"
Threshold-signed oracle result included in successful round responses.
Hide child attributes
Hide child attributes
Derived feed identity (hex).
"0xabc123..."
Human-readable decoded value.
"42150125000000"
32-byte packed value (hex).
Canonical round timestamp (seconds).
1700100000
Registry version active when the round was signed.
42
Quorum required for this feed.
3
Hash of the committed API configuration.
32-byte big-endian bitmap of participating signers (hex).
32-byte Schnorr scalar s (hex).
Schnorr commitment x-coordinate (hex).
Schnorr commitment y parity (0 or 1).
20-byte commitment address (hex).
Always true for live gateway rounds.
true