X402 - Permissions
Create Permission
Creates a delegated permission and generates an x402 access token.
post/x402/permissions
Request
- Base URL: https://api.sandbox.nevermined.app/api/v1
- URL: https://api.sandbox.nevermined.app/api/v1/x402/permissions
- Auth: HTTP bearer
Request body
Example request
{
"resource": {
"url": "https://myagent.ai/api/v1/tasks",
"description": "AI agent task execution",
"mimeType": "application/json"
},
"accepted": {
"scheme": "nvm:erc4337",
"network": "eip155:84532",
"planId": "44742763076047497640080230236781474129970992727896593861997347135613135571071",
"extra": {
"version": "1",
"agentId": "80918427023170428029540261117198154464497879145267720259488529685089104529015",
"httpVerb": "POST"
}
},
"delegationConfig": {
"delegationId": "a1b2c3d4-e5f6-4a90-8bcd-ef1234567890",
"apiKeyId": "sk-abc123",
"providerPaymentMethodId": "pm_1Abc2Def3Ghi4Jkl",
"cardId": "a1b2c3d4-e5f6-4a90-8bcd-ef1234567890",
"spendingLimitCents": 10000,
"durationSecs": 604800,
"currency": "usd",
"maxTransactions": 50
},
"tokenVersion": 3
}Response
Permission created
Example response
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwbGFuSWQiOiI0MzI5ODQzMjk4NDMyOSIsImFnZW50SWQiOiIxMjM0NTY3ODkwMTIzNDU2Nzg5MCJ9.x402_signature_hash"
}Changes
No recorded changes to this operation across all 1 revision of this API.