Selects median tolerance mode. Omit it for exact mode. It is part of the source ID; "mode":"exact" is rejected.
Hide child attributes
apiConfig.aggregation.mode
enum<string>
Available options:
tolerance
Example:
"tolerance"
apiConfig.aggregation.rule
enum<string>
Available options:
median
Example:
"median"
apiConfig.aggregation.maxDeviationBps
integer
Largest allowed deviation from the lower median, in basis points.
Example:
50
apiConfig.aggregation.maxAgeMs
integer
Largest allowed age of an observation, in milliseconds. Must be greater than 0.
Required range: x >= 1
Example:
2000
apiConfig.aggregation.numeric
object
How observed decimals become the signed integer.
Hide child attributes
apiConfig.aggregation.numeric.type
enum<string>
Available options:
int256
Example:
"int256"
apiConfig.aggregation.numeric.decimals
integer
The signed value is scaled by 10^decimals.
Example:
8
encKeyBundle
object
End-to-end encryption envelope for private API configs. Omit for plaintext configs.
Hide child attributes
encKeyBundle.ephemeralPub
string
Ephemeral public key used to encrypt the config (hex).
encKeyBundle.nonceSym
string
Symmetric encryption nonce (12 bytes, hex).
encKeyBundle.ciphertext
string
Encrypted API configuration payload (hex).
encKeyBundle.envelopes
object
Per-node encrypted key envelopes. Keys are decimal node indices as strings; values are hex. Send one for every node in the registry; the gateway forwards each selected node only its own.
Hide child attributes
encKeyBundle.envelopes.{key}
string
sourcePayments
string[]
Base64 x402 payloads for a paywalled API source, one per node in the round's eligible set. They pay the source, never Molpha.
x402Source
boolean
Declare a paywalled API source to be quoted in extensions.upstream before running the round.
Response
Signed aggregate; the payment is confirmed
Successful round response, shared by POST /v1/round/execute and POST /v1/x402/execute. The attestation payload and Schnorr signature are what verifiers consume.
status
string
Example:
"completed"
data
object
Hide child attributes
data.attestation
object
Hide child attributes
data.attestation.payload
object
Hide child attributes
data.attestation.payload.value
string
Fixed 32-byte packed value (hex). Unsigned in exact mode, signed int256 in tolerance mode.
data.attestation.payload.sourceId
string
32-byte source ID (hex), the canonical API-config hash.
data.attestation.payload.registryVersion
integer
Example:
42
data.attestation.payload.signaturesRequired
integer
Example:
3
data.attestation.payload.timestamp
integer
Gateway-assigned round time in unix milliseconds.
Example:
1700100000000
data.attestation.signature
object
Hide child attributes
data.attestation.signature.signature
string
32-byte aggregate Schnorr scalar (hex).
data.attestation.signature.commitment
string
20-byte commitment address (hex).
data.attestation.signature.signersBitmap
string
32-byte big-endian bitmap of participating signers (hex).
data.value
string
Decimal rendering of payload.value (trailing zeros trimmed).
Example:
"42150125000000"
data.fresh
boolean
Example:
true
data.configHash
string
API-config commitment echoed from the node round (currently equal to sourceId).
data.aggregation
object
Echo of the request's median-tolerance policy; present only in tolerance mode.
Hide child attributes
data.aggregation.mode
enum<string>
Available options:
tolerance
Example:
"tolerance"
data.aggregation.rule
enum<string>
Available options:
median
Example:
"median"
data.aggregation.maxDeviationBps
integer
Largest allowed deviation from the lower median, in basis points.
Example:
50
data.aggregation.maxAgeMs
integer
Largest allowed age of an observation, in milliseconds. Must be greater than 0.
Required range: x >= 1
Example:
2000
data.aggregation.numeric
object
How observed decimals become the signed integer.
Hide child attributes
data.aggregation.numeric.type
enum<string>
Available options:
int256
Example:
"int256"
data.aggregation.numeric.decimals
integer
The signed value is scaled by 10^decimals.
Example:
8
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Molpha","description":"Any API. One threshold signature. Every chain. Threshold-signed data for smart contracts, backends and AI agents, verifiable on Solana, EVM and Starknet.","colors":{"primary":"#9a641f","light":"#cb852a","dark":"#8f5c1c"},"logo":{"light":"https://mintcdn.com/molpha/JodtmQOniERYvMcY/logo/logo.svg?fit=max\u0026auto=format\u0026n=JodtmQOniERYvMcY\u0026q=85\u0026s=0602b5fe95eb3b1557d5dc52b1cd31e7","dark":"https://mintcdn.com/molpha/JodtmQOniERYvMcY/logo/logo.svg?fit=max\u0026auto=format\u0026n=JodtmQOniERYvMcY\u0026q=85\u0026s=0602b5fe95eb3b1557d5dc52b1cd31e7","href":"https://molpha.io"},"favicon":"https://mintcdn.com/molpha/JodtmQOniERYvMcY/logo/favicon.svg?fit=max\u0026auto=format\u0026n=JodtmQOniERYvMcY\u0026q=85\u0026s=fdd89da20736ef39a7efc3cc50d39125","api":{"openapi":"gateway-openapi.yaml","params":{"expanded":"all"},"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["curl","javascript","python","go"],"prefill":true,"autogenerate":true}},"navbar":{"links":[{"href":"mailto:contact@molpha.io","label":"Support"},{"icon":"github","href":"https://github.com/molpha","label":"GitHub"},{"icon":"discord","href":"https://discord.molpha.io","label":"Discord"}],"primary":{"type":"button","label":"npm","href":"https://www.npmjs.com/package/@molpha/sdk"}},"footer":{"socials":{"x":"https://x.com/molpha_oracle","discord":"https://discord.molpha.io","github":"https://github.com/molpha","linkedin":"https://www.linkedin.com/company/molpha-oracle"}},"seo":{"metatags":{"og:site_name":"Molpha Docs","twitter:card":"summary_large_image","twitter:site":"@molpha_oracle","canonical":"https://docs.molpha.io"},"organization":{"id":"https://molpha.io/#organization","name":"Molpha","url":"https://molpha.io","logo":"https://docs.molpha.io/logo/logo.svg","sameAs":["https://x.com/molpha_oracle","https://discord.molpha.io","https://github.com/molpha","https://www.linkedin.com/company/molpha-oracle"]},"indexing":"navigable"},"contextual":{"options":["copy","download-spec","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"molpha","hasAudioNarration":false,"actualSubdomain":"molpha","customDomains":["docs.molpha.io"],"gitSource":{"type":"github","owner":"molpha","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"issues":false,"agentFeedback":true},"entitlements":{},"buildId":"6acbe469884174bcc7e40b91","clientVersion":"0.0.4330","searchFilterCounts":[{"language":"default","tag":"Documentation","count":28},{"language":"default","tag":"API reference","count":12},{"language":"default","tag":"Verify and publish","count":6},{"language":"default","tag":"Network","count":5},{"language":"default","tag":"Access and payments","count":4},{"language":"default","tag":"Get started","count":4},{"language":"default","tag":"MCP server","count":4},{"language":"default","tag":"Protocol","count":4},{"language":"default","tag":"Concepts","count":3},{"language":"default","tag":"Rounds","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"starterQuestions":[],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"gateways/api/x402-execute","slug":"/gateways/api/x402-execute","pageMetadata":{"title":"Execute an x402 pay-per-request round","sidebarTitle":"x402 execute","openapi":"gateway-openapi.yaml POST /v1/x402/execute","description":"x402 v2 exact Solana payment to the protocol treasury; no subscription required.","href":"/gateways/api/x402-execute"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"x402 v2 exact Solana payment to the protocol treasury; no subscription required.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Execute an x402 pay-per-request round","sidebarTitle":"x402 execute","openapi":"gateway-openapi.yaml POST /v1/x402/execute","description":"x402 v2 exact Solana payment to the protocol treasury; no subscription required.","href":"/gateways/api/x402-execute"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Execute an x402 pay-per-request round","description":"x402 v2 exact Solana payment to the protocol treasury; no subscription required.","x-mint":{"metadata":{"sidebarTitle":"x402 execute"},"content":"Runs a round paid by one x402 v2 `exact` USDC payment on Solana, for a caller without a subscription. The payment goes to the protocol treasury, never to the gateway. The full flow, price formula and memo are in [x402 pay-per-request](/access-models/x402).\n\n1. Send the request without `PAYMENT-SIGNATURE`. The gateway answers `402` with a base64 `PAYMENT-REQUIRED` header and the same x402 v2 object in the body.\n2. Sign a payment matching the `accepts` entry, including its `extra.feePayer` and exact `extra.memo`.\n3. Retry the same body with `PAYMENT-SIGNATURE: \u003cbase64 payment payload>`.\n4. The gateway verifies the payment, stamps and dispatches the round, settles the payment and returns `200` with the attestation and a base64 `PAYMENT-RESPONSE` receipt.\n\n- **Payment is the authorization.** No `RequestAuth`; the payer comes from the verified payment, not the body.\n- **One payment, one round.** A used payment is refused for another round (`409`).\n- **Duplicates.** A second request from the same payer for the same source and quorum inside one 100 ms tick returns `409` with nothing reserved; the unused payment stays valid. Retry after one tick.\n- **Failures.** If the round reaches the nodes and fails, the payment is not settled but cannot be reused: sign a new one. An ambiguous settlement returns `503`; do not pay again automatically.\n- **Capacity.** At capacity the gateway answers `503` with `Retry-After` before reading the body, so the payment is neither verified nor reserved.\n\n`apiConfig.aggregation` (tolerance mode), paywalled sources (`x402Source`, `sourcePayments`) and integrated providers work as on [`POST /v1/round/execute`](/gateways/api/round-execute). When a provider's call budget is spent the answer is `503`, the payment is not settled, and the same authorization can be reused.\n"},"tags":["x402"],"parameters":["367d5ca5-fb8e-4a54-a2d6-af95852319af"],"requestBody":"6c6c556d-10cc-4c07-bd39-f375f348ef1b","responses":{"200":"cd5787ee-158e-44ab-821e-39ee0779e868","400":"b5ac3b99-27df-4312-95d6-2b96e16c59a6","402":"4ce3e5ce-a847-4710-b2ab-89524a0d4b00","409":"de871c0e-2308-4fb2-bb61-d209796bb2bc","500":"7afb716a-24bb-4aa0-bb10-70a4c5184c9c","503":"6ec73659-e824-414b-9bba-4ecc6c008ec3"},"method":"post","type":"path","servers":["769641aa-5b99-4072-b9e9-117773357097"],"security":[],"path":"/v1/x402/execute","baseUrlOptions":["https://gateway.molpha.io"],"title":"Execute an x402 pay-per-request round","codeSamples":[],"requestExampleLanguages":["bash","javascript","python","go"],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.signatures_required":3,"body.registry_version":42,"body.apiConfig.url":"https://api.example.com/v1/price","body.apiConfig.method":"GET","body.apiConfig.responseParser":"$.data.price","body.apiConfig.valueTransform":"multiply:1e6"}]},"dependencies":{"parameters":{"367d5ca5-fb8e-4a54-a2d6-af95852319af":{"name":"PAYMENT-SIGNATURE","in":"header","required":false,"description":"Base64 x402 v2 payment payload. Omit on the first request to receive the `402` requirements.","schema":{"type":"string","isRequired":false,"description":"Base64 x402 v2 payment payload. Omit on the first request to receive the `402` requirements.","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"required":true,"description":"x402 execute request","content":{"application/json":{"schema":{"type":"object","description":"Request body for `POST /v1/x402/execute`. It carries no timestamp and no payer, amount, signature or payment reference; payment is in `PAYMENT-SIGNATURE`.","required":["signatures_required","registry_version","apiConfig"],"properties":{"signatures_required":{"type":"integer","description":"Requested quorum for this round. Must be at least protocol `min_signers` and at most the current node count.","example":3,"isRequired":true,"uniqueKey":"signatures_required","typeLabel":"integer"},"registry_version":{"type":"integer","description":"Active on-chain registry version. Must match the current version.","example":42,"isRequired":true,"uniqueKey":"registry_version","typeLabel":"integer"},"apiConfig":{"type":"object","description":"Off-chain HTTP API configuration. Its canonical hash is the source ID.","required":["url","method"],"properties":{"url":{"type":"string","description":"Target API URL. Must use `http` or `https`.","example":"https://api.example.com/v1/price","isRequired":true,"uniqueKey":"apiConfig.url","typeLabel":"string"},"method":{"type":"string","description":"HTTP method. Required: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD` or `OPTIONS`. It is hashed into the source ID as sent.","example":"GET","isRequired":true,"uniqueKey":"apiConfig.method","typeLabel":"string"},"headers":{"type":"object","description":"Request headers. Use `{{secret.name}}` placeholders with `encKeyBundle` for private APIs.","additionalProperties":{"type":"string","uniqueKey":"apiConfig.headers.additionalProperties","typeLabel":"string"},"example":{},"uniqueKey":"apiConfig.headers","typeLabel":"object"},"responseParser":{"type":"string","description":"JSONPath expression to extract the value from the API response.","example":"$.data.price","uniqueKey":"apiConfig.responseParser","typeLabel":"string"},"valueTransform":{"type":"string","description":"Optional post-parse transform (e.g. `multiply:1e6`).","example":"multiply:1e6","uniqueKey":"apiConfig.valueTransform","typeLabel":"string"},"aggregation":{"type":"object","description":"Selects median tolerance mode. Omit it for exact mode. It is part of the source ID; `\"mode\":\"exact\"` is rejected.","properties":{"mode":{"type":"string","enum":["tolerance"],"example":"tolerance","uniqueKey":"apiConfig.aggregation.mode","typeLabel":"enum\u003cstring>"},"rule":{"type":"string","enum":["median"],"example":"median","uniqueKey":"apiConfig.aggregation.rule","typeLabel":"enum\u003cstring>"},"maxDeviationBps":{"type":"integer","description":"Largest allowed deviation from the lower median, in basis points.","example":50,"uniqueKey":"apiConfig.aggregation.maxDeviationBps","typeLabel":"integer"},"maxAgeMs":{"type":"integer","minimum":1,"description":"Largest allowed age of an observation, in milliseconds. Must be greater than 0.","example":2000,"uniqueKey":"apiConfig.aggregation.maxAgeMs","typeLabel":"integer"},"numeric":{"type":"object","description":"How observed decimals become the signed integer.","properties":{"type":{"type":"string","enum":["int256"],"example":"int256","uniqueKey":"apiConfig.aggregation.numeric.type","typeLabel":"enum\u003cstring>"},"decimals":{"type":"integer","description":"The signed value is scaled by `10^decimals`.","example":8,"uniqueKey":"apiConfig.aggregation.numeric.decimals","typeLabel":"integer"}},"uniqueKey":"apiConfig.aggregation.numeric","typeLabel":"object"}},"uniqueKey":"apiConfig.aggregation","typeLabel":"object"}},"isRequired":true,"uniqueKey":"apiConfig","typeLabel":"object"},"encKeyBundle":{"type":"object","description":"End-to-end encryption envelope for private API configs. Omit for plaintext configs.","properties":{"ephemeralPub":{"type":"string","description":"Ephemeral public key used to encrypt the config (hex).","uniqueKey":"encKeyBundle.ephemeralPub","typeLabel":"string"},"nonceSym":{"type":"string","description":"Symmetric encryption nonce (12 bytes, hex).","uniqueKey":"encKeyBundle.nonceSym","typeLabel":"string"},"ciphertext":{"type":"string","description":"Encrypted API configuration payload (hex).","uniqueKey":"encKeyBundle.ciphertext","typeLabel":"string"},"envelopes":{"type":"object","description":"Per-node encrypted key envelopes. Keys are decimal node indices as strings; values are hex. Send one for every node in the registry; the gateway forwards each selected node only its own.","additionalProperties":{"type":"string","uniqueKey":"encKeyBundle.envelopes.additionalProperties","typeLabel":"string"},"uniqueKey":"encKeyBundle.envelopes","typeLabel":"object"}},"uniqueKey":"encKeyBundle","typeLabel":"object"},"sourcePayments":{"type":"array","description":"Base64 x402 payloads for a paywalled API source, one per node in the round's eligible set. They pay the source, never Molpha.","items":{"type":"string","uniqueKey":"sourcePayments.items.[INDEX]","typeLabel":"string"},"uniqueKey":"sourcePayments","typeLabel":"string[]"},"x402Source":{"type":"boolean","description":"Declare a paywalled API source to be quoted in `extensions.upstream` before running the round.","uniqueKey":"x402Source","typeLabel":"boolean"}},"uniqueKey":"","typeLabel":"object"},"example":{"signatures_required":3,"registry_version":42,"apiConfig":{"url":"https://api.example.com/v1/price","method":"GET","headers":{},"responseParser":"$.data.price","valueTransform":"multiply:1e6"}},"examples":{"Example":{"title":"Example","value":{"signatures_required":3,"registry_version":42,"apiConfig":{"url":"https://api.example.com/v1/price","method":"GET","headers":{},"responseParser":"$.data.price","valueTransform":"multiply:1e6"}}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"cd5787ee-158e-44ab-821e-39ee0779e868":{"description":"Signed aggregate; the payment is confirmed","headers":{"PAYMENT-RESPONSE":{"description":"Base64 x402 v2 settlement receipt","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","description":"Successful round response, shared by `POST /v1/round/execute` and `POST /v1/x402/execute`. The attestation payload and Schnorr signature are what verifiers consume.","properties":{"status":{"type":"string","example":"completed","uniqueKey":"status","typeLabel":"string"},"data":{"type":"object","properties":{"attestation":{"type":"object","properties":{"payload":{"type":"object","properties":{"value":{"type":"string","description":"Fixed 32-byte packed value (hex). Unsigned in exact mode, signed int256 in tolerance mode.","uniqueKey":"data.attestation.payload.value","typeLabel":"string"},"sourceId":{"type":"string","description":"32-byte source ID (hex), the canonical API-config hash.","uniqueKey":"data.attestation.payload.sourceId","typeLabel":"string"},"registryVersion":{"type":"integer","example":42,"uniqueKey":"data.attestation.payload.registryVersion","typeLabel":"integer"},"signaturesRequired":{"type":"integer","example":3,"uniqueKey":"data.attestation.payload.signaturesRequired","typeLabel":"integer"},"timestamp":{"type":"integer","description":"Gateway-assigned round time in unix milliseconds.","example":1700100000000,"uniqueKey":"data.attestation.payload.timestamp","typeLabel":"integer"}},"uniqueKey":"data.attestation.payload","typeLabel":"object"},"signature":{"type":"object","properties":{"signature":{"type":"string","description":"32-byte aggregate Schnorr scalar (hex).","uniqueKey":"data.attestation.signature.signature","typeLabel":"string"},"commitment":{"type":"string","description":"20-byte commitment address (hex).","uniqueKey":"data.attestation.signature.commitment","typeLabel":"string"},"signersBitmap":{"type":"string","description":"32-byte big-endian bitmap of participating signers (hex).","uniqueKey":"data.attestation.signature.signersBitmap","typeLabel":"string"}},"uniqueKey":"data.attestation.signature","typeLabel":"object"}},"uniqueKey":"data.attestation","typeLabel":"object"},"value":{"type":"string","description":"Decimal rendering of `payload.value` (trailing zeros trimmed).","example":"42150125000000","uniqueKey":"data.value","typeLabel":"string"},"fresh":{"type":"boolean","example":true,"uniqueKey":"data.fresh","typeLabel":"boolean"},"configHash":{"type":"string","description":"API-config commitment echoed from the node round (currently equal to `sourceId`).","uniqueKey":"data.configHash","typeLabel":"string"},"aggregation":{"type":"object","description":"Echo of the request's median-tolerance policy; present only in tolerance mode.","properties":{"mode":{"type":"string","enum":["tolerance"],"example":"tolerance","uniqueKey":"data.aggregation.mode","typeLabel":"enum\u003cstring>"},"rule":{"type":"string","enum":["median"],"example":"median","uniqueKey":"data.aggregation.rule","typeLabel":"enum\u003cstring>"},"maxDeviationBps":{"type":"integer","description":"Largest allowed deviation from the lower median, in basis points.","example":50,"uniqueKey":"data.aggregation.maxDeviationBps","typeLabel":"integer"},"maxAgeMs":{"type":"integer","minimum":1,"description":"Largest allowed age of an observation, in milliseconds. Must be greater than 0.","example":2000,"uniqueKey":"data.aggregation.maxAgeMs","typeLabel":"integer"},"numeric":{"type":"object","description":"How observed decimals become the signed integer.","properties":{"type":{"type":"string","enum":["int256"],"example":"int256","uniqueKey":"data.aggregation.numeric.type","typeLabel":"enum\u003cstring>"},"decimals":{"type":"integer","description":"The signed value is scaled by `10^decimals`.","example":8,"uniqueKey":"data.aggregation.numeric.decimals","typeLabel":"integer"}},"uniqueKey":"data.aggregation.numeric","typeLabel":"object"}},"uniqueKey":"data.aggregation","typeLabel":"object"}},"uniqueKey":"data","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":"completed","data":{"attestation":{"payload":{"value":"\u003cstring>","sourceId":"\u003cstring>","registryVersion":42,"signaturesRequired":3,"timestamp":1700100000000},"signature":{"signature":"\u003cstring>","commitment":"\u003cstring>","signersBitmap":"\u003cstring>"}},"value":"42150125000000","fresh":true,"configHash":"\u003cstring>","aggregation":{"mode":"tolerance","rule":"median","maxDeviationBps":50,"maxAgeMs":2000,"numeric":{"type":"int256","decimals":8}}}}}},"exampleType":"generated"}},"exampleType":"generated"},"b5ac3b99-27df-4312-95d6-2b96e16c59a6":{"description":"Validation failure or stale `registry_version`","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human-readable error message.","example":"validation failed","uniqueKey":"error","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"validation failed"}}},"exampleType":"generated"}},"exampleType":"generated"},"4ce3e5ce-a847-4710-b2ab-89524a0d4b00":{"description":"Payment missing or rejected, or the API source is paywalled (`extensions.upstream` carries the quote)","headers":{"PAYMENT-REQUIRED":{"description":"Base64 x402 v2 payment requirements","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","description":"x402 v2 payment requirements, returned with `402` and base64-encoded in the `PAYMENT-REQUIRED` header.","properties":{"x402Version":{"type":"integer","description":"x402 protocol version.","example":2,"uniqueKey":"x402Version","typeLabel":"integer"},"error":{"type":"string","description":"Why payment is required or was rejected.","uniqueKey":"error","typeLabel":"string"},"resource":{"type":"object","properties":{"url":{"type":"string","description":"Absolute URL of the request.","example":"https://gateway.molpha.io/v1/x402/execute","uniqueKey":"resource.url","typeLabel":"string"},"description":{"type":"string","example":"Molpha oracle round","uniqueKey":"resource.description","typeLabel":"string"},"mimeType":{"type":"string","example":"application/json","uniqueKey":"resource.mimeType","typeLabel":"string"}},"uniqueKey":"resource","typeLabel":"object"},"accepts":{"type":"array","description":"Accepted Molpha payment options. Empty on `POST /v1/round/execute`, where only the API source requires payment.","items":{"type":"object","description":"One accepted x402 v2 payment option. The payment must match it exactly.","properties":{"scheme":{"type":"string","description":"Payment scheme.","example":"exact","uniqueKey":"accepts.items.[INDEX].scheme","typeLabel":"string"},"network":{"type":"string","description":"Solana CAIP-2 network identifier.","example":"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1","uniqueKey":"accepts.items.[INDEX].network","typeLabel":"string"},"amount":{"type":"string","description":"Round price in USDC atomic units (decimal string): `x402_round_base + (signatures_required + registry.redundancy_buffer) * reward_per_signature`.","example":"1030","uniqueKey":"accepts.items.[INDEX].amount","typeLabel":"string"},"asset":{"type":"string","description":"USDC mint address from the on-chain `ProtocolConfig`.","uniqueKey":"accepts.items.[INDEX].asset","typeLabel":"string"},"payTo":{"type":"string","description":"Protocol treasury owner, the `ProtocolConfig` PDA. Never the gateway.","uniqueKey":"accepts.items.[INDEX].payTo","typeLabel":"string"},"maxTimeoutSeconds":{"type":"integer","description":"Suggested timeout for completing the payment.","example":60,"uniqueKey":"accepts.items.[INDEX].maxTimeoutSeconds","typeLabel":"integer"},"extra":{"type":"object","description":"Facilitator and request binding fields: `feePayer` (the facilitator's fee payer) and `memo` (hex `MOLPHA_X402_REQUEST_V1` commitment to program, gateway, source, quorum and registry version).","additionalProperties":{"type":"string","uniqueKey":"accepts.items.[INDEX].extra.additionalProperties","typeLabel":"string"},"uniqueKey":"accepts.items.[INDEX].extra","typeLabel":"object"}},"uniqueKey":"accepts.items.[INDEX]","typeLabel":"object"},"uniqueKey":"accepts","typeLabel":"object[]"},"extensions":{"type":"object","description":"Non-Molpha payment terms carried beside `accepts`.","properties":{"upstream":{"type":"object","description":"Quote for a paywalled API source. The caller pays the source directly, one authorization per eligible node.","properties":{"provider":{"type":"string","description":"ID of the integrated provider whose x402 host the source is on. Present only for such a source.","uniqueKey":"extensions.upstream.provider","typeLabel":"string"},"resource":{"type":"string","description":"The source URL.","uniqueKey":"extensions.upstream.resource","typeLabel":"string"},"signaturesRequired":{"type":"integer","uniqueKey":"extensions.upstream.signaturesRequired","typeLabel":"integer"},"redundancyBuffer":{"type":"integer","uniqueKey":"extensions.upstream.redundancyBuffer","typeLabel":"integer"},"nodeCount":{"type":"integer","uniqueKey":"extensions.upstream.nodeCount","typeLabel":"integer"},"eligibleSetSize":{"type":"integer","description":"Number of source authorizations to sign.","uniqueKey":"extensions.upstream.eligibleSetSize","typeLabel":"integer"},"supportedX402Versions":{"type":"array","items":{"type":"integer","uniqueKey":"extensions.upstream.supportedX402Versions.items.[INDEX]","typeLabel":"integer"},"uniqueKey":"extensions.upstream.supportedX402Versions","typeLabel":"integer[]"},"error":{"type":"string","description":"The source's own response when it was paywalled without being declared.","uniqueKey":"extensions.upstream.error","typeLabel":"string"}},"uniqueKey":"extensions.upstream","typeLabel":"object"}},"uniqueKey":"extensions","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"x402Version":2,"error":"\u003cstring>","resource":{"url":"https://gateway.molpha.io/v1/x402/execute","description":"Molpha oracle round","mimeType":"application/json"},"accepts":[{"scheme":"exact","network":"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1","amount":"1030","asset":"\u003cstring>","payTo":"\u003cstring>","maxTimeoutSeconds":60,"extra":{}}],"extensions":{"upstream":{"provider":"\u003cstring>","resource":"\u003cstring>","signaturesRequired":123,"redundancyBuffer":123,"nodeCount":123,"eligibleSetSize":123,"supportedX402Versions":[123],"error":"\u003cstring>"}}}}},"exampleType":"generated"}},"exampleType":"generated"},"de871c0e-2308-4fb2-bb61-d209796bb2bc":{"description":"Duplicate round identity (this payer already has a round for this source and quorum in the same 100 ms tick; nothing was reserved and an unused authorization stays usable; retry after one tick) or the payment authorization was already used for a round. No `Retry-After` header.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human-readable error message.","example":"validation failed","uniqueKey":"error","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"validation failed"}}},"exampleType":"generated"}},"exampleType":"generated"},"7afb716a-24bb-4aa0-bb10-70a4c5184c9c":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human-readable error message.","example":"validation failed","uniqueKey":"error","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"validation failed"}}},"exampleType":"generated"}},"exampleType":"generated"},"6ec73659-e824-414b-9bba-4ecc6c008ec3":{"description":"x402 or facilitator unavailable, uncertain payment outcome, gateway at its concurrency limit (with `Retry-After`; payment not reserved), too few nodes accepting the round, node round timeout or upstream failure (the authorization is spent unsettled; retry with a new payment), or the gateway's sponsored provider access at its call limit (the payment is not settled and can be reused)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human-readable error message.","example":"validation failed","uniqueKey":"error","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"validation failed"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{},"servers":{"769641aa-5b99-4072-b9e9-117773357097":{"url":"https://gateway.molpha.io","description":"Devnet (SDK default)"}}},"originalFileLocation":"gateway-openapi.yaml"},"subdomain":"molpha","siteName":"Molpha","title":"Execute an x402 pay-per-request round - Molpha","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-11T19:02:10.633Z","originalFileLocation":"gateways/api/x402-execute.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"x402 v2 exact Solana payment to the protocol treasury; no subscription required.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Molpha\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Execute an x402 pay-per-request round - Molpha\">\u003cmeta data-mint-head property=\"og:description\" content=\"x402 v2 exact Solana payment to the protocol treasury; no subscription required.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Molpha Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.molpha.io/gateways/api/x402-execute\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://molpha.mintlify.site/_mintlify/api/og/v2?division=Rounds\u0026amp;title=Execute+an+x402+pay-per-request+round\u0026amp;description=x402+v2+exact+Solana+payment+to+the+protocol+treasury%3B+no+subscription+required.\u0026amp;theme=31c325c332ddb0c6aed47a08\u0026amp;signature=e7973e27e4a0d4972a2c0b4365713e80dcc8fe4bec56f1c48ca6b1903e92fdaf\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Execute an x402 pay-per-request round - Molpha\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"x402 v2 exact Solana payment to the protocol treasury; no subscription required.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://molpha.mintlify.site/_mintlify/api/og/v2?division=Rounds\u0026amp;title=Execute+an+x402+pay-per-request+round\u0026amp;description=x402+v2+exact+Solana+payment+to+the+protocol+treasury%3B+no+subscription+required.\u0026amp;theme=31c325c332ddb0c6aed47a08\u0026amp;signature=e7973e27e4a0d4972a2c0b4365713e80dcc8fe4bec56f1c48ca6b1903e92fdaf\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/molpha/zla0u27HDk3WRPXS/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Molpha\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#9a641f\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.molpha.io/gateways/api/x402-execute\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/gateways/api/x402-execute.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://molpha.io/#organization\",\"name\":\"Molpha\",\"url\":\"https://molpha.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://docs.molpha.io/logo/logo.svg\"},\"sameAs\":[\"https://x.com/molpha_oracle\",\"https://discord.molpha.io\",\"https://github.com/molpha\",\"https://www.linkedin.com/company/molpha-oracle\"]},{\"@type\":\"WebSite\",\"@id\":\"https://docs.molpha.io#website\",\"name\":\"Molpha\",\"url\":\"https://docs.molpha.io\",\"publisher\":{\"@id\":\"https://molpha.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.molpha.io/gateways/api/x402-execute#webpage\",\"url\":\"https://docs.molpha.io/gateways/api/x402-execute\",\"name\":\"Execute an x402 pay-per-request round\",\"description\":\"x402 v2 exact Solana payment to the protocol treasury; no subscription required.\",\"dateModified\":\"2026-10-11T19:02:10.633Z\",\"isPartOf\":{\"@id\":\"https://docs.molpha.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.molpha.io/gateways/api/x402-execute#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.molpha.io/gateways/api/x402-execute#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Rounds\",\"item\":\"https://docs.molpha.io/gateways/api/round-execute\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Execute an x402 pay-per-request round\",\"item\":\"https://docs.molpha.io/gateways/api/x402-execute\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.molpha.io/gateways/api/x402-execute#apireference\",\"headline\":\"Execute an x402 pay-per-request round\",\"name\":\"Execute an x402 pay-per-request round\",\"description\":\"x402 v2 exact Solana payment to the protocol treasury; no subscription required.\",\"url\":\"https://docs.molpha.io/gateways/api/x402-execute\",\"mainEntityOfPage\":{\"@id\":\"https://docs.molpha.io/gateways/api/x402-execute#webpage\"},\"dateModified\":\"2026-10-11T19:02:10.633Z\",\"publisher\":{\"@id\":\"https://molpha.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.molpha.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Molpha\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Molpha\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/gateways/api/x402-execute.md","siteName":"Molpha","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"API reference","groups":[{"group":"Gateway API","pages":[{"title":"Gateway API","sidebarTitle":"Overview","href":"/gateways/overview"}]},{"group":"Rounds","pages":[{"title":"Execute a subscription round","sidebarTitle":"Round execute","openapi":"gateway-openapi.yaml POST /v1/round/execute","description":"Subscription-backed signing round for feed owners and delegates.","href":"/gateways/api/round-execute"},{"title":"Execute an x402 pay-per-request round","sidebarTitle":"x402 execute","openapi":"gateway-openapi.yaml POST /v1/x402/execute","href":"/gateways/api/x402-execute"},{"title":"x402 payment destination and quote","sidebarTitle":"x402 status","openapi":"gateway-openapi.yaml GET /v1/x402/status","description":"The protocol treasury every x402 payment pays, the next round price, and the gateway's pending tickets.","href":"/gateways/api/x402-status"}]},{"group":"Sign-in sessions","pages":[{"title":"Get a sign-in challenge","sidebarTitle":"Session challenge","openapi":"gateway-openapi.yaml GET /v1/session/challenge","href":"/gateways/api/session-challenge"},{"title":"Sign in","sidebarTitle":"Session sign-in","openapi":"gateway-openapi.yaml POST /v1/session","href":"/gateways/api/session-create"},{"title":"Sign out","sidebarTitle":"Session sign-out","openapi":"gateway-openapi.yaml DELETE /v1/session","href":"/gateways/api/session-delete"}]},{"group":"Network","pages":[{"title":"Get gateway identity","sidebarTitle":"Info","openapi":"gateway-openapi.yaml GET /v1/info","href":"/gateways/api/info"},{"title":"Get on-chain nodes","sidebarTitle":"Nodes","openapi":"gateway-openapi.yaml GET /v1/nodes","href":"/gateways/api/nodes"},{"title":"List integrated providers","sidebarTitle":"Providers","openapi":"gateway-openapi.yaml GET /v1/providers","href":"/gateways/api/providers-list"},{"title":"Get an integrated provider","sidebarTitle":"Provider","openapi":"gateway-openapi.yaml GET /v1/providers/{providerId}","href":"/gateways/api/providers-get"},{"title":"Health check","sidebarTitle":"Health","openapi":"gateway-openapi.yaml GET /health","href":"/gateways/api/health"}]}]},{"tab":"SDK","pages":[{"title":"SDK","href":"/sdk/overview"}]}]},"basePath":"","title":"Execute an x402 pay-per-request round - Molpha","deploymentId":"dpl_GvkCDNzSMF8rzjWibcqz4RHGyof6","buildId":"dpl_GvkCDNzSMF8rzjWibcqz4RHGyof6","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-BT-gNXsx.js","snippetPresets-t1GE-A0I.js","utils-BnfovG5Y.js","style-to-object-BY3JEAdk.js","utils-DeG_ta4n.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-8QcGBhjX.js","conditional-requirements-CFM0id0Q.js","cloneDeep-BWwar1pQ.js","_Uint8Array-DHKset-L.js","isObject-FP1Yky1u.js","ApiExamples-qCJrPSqY.js","usePlaygroundInputsStore-B4wrGqjo.js","shallow-CAGbQGUn.js","isEqual-C7guYU2p.js","CodeSnippets-C5CCkdNg.js","CodeSnippet-Cp7y2ScP.js","use-playground-group-access-DOWzVKl_.js","Page-dKKTKkJo.js","api-description-markdown-BlWHp84w.js","DynamicMarkdown-ddEWq4Sb.js","SectionHeading-B2XCIQxM.js","MethodPill-91jw8MWv.js","getPastedJson-DjcD0eRU.js","Check2Icon-CEEZHK-k.js","axios-CsQoIw0U.js","Markdown-C6U0vKIZ.js","AssistantPageLink-dws35x9H.js","dist-DNuvr41g.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}