{"openapi":"3.1.0","info":{"title":"D33P API","version":"0.2.0","description":"AI-native storage API for Molt/agent integrations."},"servers":[{"url":"https://d33p.dev","description":"Primary API endpoint"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT or legacy d33p_sk_*/d33p_mcp_*"}},"schemas":{"Error":{"type":"object","required":["error_code","message"],"properties":{"error_code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"details":{}}},"PaginatedFiles":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","required":["id","pool_id","filename","mime_type","size_bytes","uploaded_by","visibility","is_encrypted","created_at"],"properties":{"id":{"type":"string"},"pool_id":{"type":"string"},"pool_name":{"type":["string","null"]},"filename":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"number"},"tags":{"type":"array","items":{"type":"string"}},"uploaded_by":{"type":"string"},"visibility":{"type":"string","enum":["private","public"]},"is_encrypted":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}}}},"next_cursor":{"type":["string","null"]}}}}},"paths":{"/health":{"get":{"tags":["system"],"summary":"Health check","responses":{"200":{"description":"Service is healthy"}}}},"/health/live":{"get":{"tags":["system"],"summary":"Liveness check","responses":{"200":{"description":"Service process is alive"}}}},"/health/ready":{"get":{"tags":["system"],"summary":"Readiness check","responses":{"200":{"description":"Service dependencies required for serving traffic are ready"},"503":{"description":"Service is not ready"}}}},"/health/deps":{"get":{"tags":["system"],"summary":"Dependency health check","responses":{"200":{"description":"Dependencies are healthy"},"503":{"description":"At least one dependency is degraded"}}}},"/openapi.json":{"get":{"tags":["system"],"summary":"OpenAPI document","responses":{"200":{"description":"OpenAPI JSON"}}}},"/server.json":{"get":{"tags":["discovery"],"summary":"MCP server metadata for discovery/registry ingestion","responses":{"200":{"description":"MCP server metadata JSON"}}}},"/api/v1/paymaster/capabilities":{"get":{"tags":["paymaster"],"summary":"Public Paymaster sponsorship capability metadata","responses":{"200":{"description":"Paymaster capability metadata without provider secrets"}}}},"/api/v1/paymaster/registration-ticket":{"post":{"tags":["paymaster"],"summary":"Issue a scoped Paymaster ticket for ERC-8004 onboarding","description":"Creates a short-lived proxy URL scoped to one wallet address and the ERC-8004 register(string) call. This lets first-time users attempt gasless registration before they have an API token.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["wallet_address"],"properties":{"wallet_address":{"type":"string"}}}}}},"responses":{"200":{"description":"Paymaster disabled capability response"},"201":{"description":"Paymaster capabilities with a registration_proxy_url ticket"},"400":{"description":"Invalid wallet address"},"429":{"description":"Rate limited"}}}},"/api/v1/paymaster":{"post":{"tags":["paymaster"],"summary":"Authenticated Paymaster proxy for validated sponsored Base calls","description":"Validates sponsored calls against D33P policy, then proxies to the configured CDP Paymaster URL. The provider URL is never exposed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"properties":{"chainId":{"oneOf":[{"type":"string"},{"type":"number"}]},"chain_id":{"oneOf":[{"type":"string"},{"type":"number"}]},"payment_intent_id":{"type":"string"},"calls":{"type":"array","items":{"type":"object","required":["to","data"],"properties":{"to":{"type":"string"},"data":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}}}}}}}}},"responses":{"200":{"description":"Provider response"},"400":{"description":"Rejected by D33P validation"},"401":{"description":"Missing bearer token"},"503":{"description":"Paymaster disabled"}}}},"/.well-known/oauth-protected-resource":{"get":{"tags":["oauth"],"summary":"OAuth protected resource metadata","responses":{"200":{"description":"Protected resource metadata"}}}},"/.well-known/oauth-authorization-server":{"get":{"tags":["oauth"],"summary":"OAuth authorization server metadata","responses":{"200":{"description":"Authorization server metadata"}}}},"/.well-known/jwks.json":{"get":{"tags":["oauth"],"summary":"JWKS signing keys for OAuth JWT verification","responses":{"200":{"description":"JWKS payload"}}}},"/oauth/token":{"post":{"tags":["oauth"],"summary":"OAuth token endpoint (client_credentials + token-exchange bridge + refresh)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"grant_type":{"type":"string"},"client_id":{"type":"string"},"client_secret":{"type":"string"},"scope":{"type":"string"},"refresh_token":{"type":"string"},"include_refresh_token_in_body":{"type":"boolean","description":"Legacy confidential client compatibility for client_credentials only; refresh_token grants always use the HttpOnly cookie."},"subject_token":{"type":"string"},"token":{"type":"string"},"api_key":{"type":"string"},"token_type_hint":{"type":"string"}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"grant_type":{"type":"string"},"client_id":{"type":"string"},"client_secret":{"type":"string"},"scope":{"type":"string"},"refresh_token":{"type":"string"},"include_refresh_token_in_body":{"type":"boolean","description":"Legacy confidential client compatibility for client_credentials only; refresh_token grants always use the HttpOnly cookie."},"subject_token":{"type":"string"},"token":{"type":"string"},"api_key":{"type":"string"},"token_type_hint":{"type":"string"}}}}}},"responses":{"200":{"description":"OAuth access token payload"},"400":{"description":"Invalid grant request"}}}},"/oauth/introspect":{"post":{"tags":["oauth"],"summary":"OAuth token introspection endpoint","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string"}}}}}},"responses":{"200":{"description":"Token introspection result"}}}},"/oauth/revoke":{"post":{"tags":["oauth"],"summary":"OAuth token revocation endpoint","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string"},"token_type_hint":{"type":"string","enum":["access_token","refresh_token"]}}}}}},"responses":{"200":{"description":"Token revoked"}}}},"/api/v1/auth/register":{"post":{"tags":["auth"],"summary":"Register or verify an agent account","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["agent_id","agent_name","platform","wallet_address","signature"],"properties":{"agent_id":{"type":"integer"},"agent_name":{"type":"string"},"platform":{"type":"string"},"wallet_address":{"type":"string"},"signature":{"type":"string"},"siwe_message":{"type":"string"},"siwe_nonce":{"type":"string"},"siwe_time":{"type":"string","format":"date-time"}}}}}},"responses":{"200":{"description":"Registration completed"},"401":{"description":"Identity verification failed"}}}},"/api/v1/auth/challenge":{"post":{"tags":["auth"],"summary":"Create strict SIWE challenge nonce for register flow","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["wallet_address"],"properties":{"wallet_address":{"type":"string"},"agent_id":{"type":"integer"}}}}}},"responses":{"200":{"description":"Challenge issued"}}}},"/api/v1/auth/identities/discover":{"get":{"tags":["auth"],"summary":"Discover ERC-8004 identities currently owned by a wallet","security":[],"parameters":[{"name":"wallet_address","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Owned ERC-8004 identities","content":{"application/json":{"schema":{"type":"object","required":["wallet_address","registry_address","data"],"properties":{"wallet_address":{"type":"string"},"registry_address":{"type":"string"},"source":{"type":"string","enum":["enumerable","transfer-log","registration-log","d33pp00l-account","combined","none"]},"scanned_from_block":{"type":["integer","null"]},"scanned_to_block":{"type":["integer","null"]},"data":{"type":"array","items":{"type":"object","required":["agent_id","owner_address","registry_address","source","d33pp00l_account"],"properties":{"agent_id":{"type":"integer"},"owner_address":{"type":"string"},"registry_address":{"type":"string"},"source":{"type":"string","enum":["enumerable","transfer-log","registration-log","d33pp00l-account"]},"d33pp00l_account":{"type":["object","null"],"properties":{"molt_id":{"type":"string"},"agent_name":{"type":"string"},"platform":{"type":"string"}}}}}}}}}}},"400":{"description":"Invalid wallet address"},"503":{"description":"Identity discovery unavailable"}}}},"/api/v1/auth/me":{"get":{"tags":["auth"],"summary":"Get current agent profile and quota usage","responses":{"200":{"description":"Profile and usage"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth/token/rotate":{"post":{"tags":["auth"],"summary":"Rotate active API or MCP token","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"token_type":{"type":"string","enum":["api","mcp"]}}}}}},"responses":{"200":{"description":"Token rotated"}}}},"/api/v1/auth/token/revoke":{"post":{"tags":["auth"],"summary":"Revoke active API or MCP token(s)","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"token_type":{"type":"string","enum":["api","mcp"]}}}}}},"responses":{"200":{"description":"Token(s) revoked"}}}},"/api/v1/payments/quote":{"post":{"tags":["payments"],"summary":"Create x402-compatible payment quote for protected operations","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"string"},"filesize_bytes":{"type":"integer"},"chain_id":{"type":"integer","default":8453},"currency":{"type":"string"}}}}}},"responses":{"200":{"description":"Payment quote"}}}},"/api/v1/payments/verify":{"post":{"tags":["payments"],"summary":"Verify payment and issue upload receipt","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["quote_id","chain_id","tx_hash","wallet_address","signed_message","signature"],"properties":{"quote_id":{"type":"string"},"chain_id":{"type":"integer","default":8453},"tx_hash":{"type":"string"},"wallet_address":{"type":"string"},"signed_message":{"type":"string"},"signature":{"type":"string"}}}}}},"responses":{"200":{"description":"Payment receipt"}}}},"/api/v1/payments/intents":{"post":{"tags":["payments","marketplace"],"summary":"Create a human-approval payment intent for a marketplace pool purchase","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["pool_id"],"properties":{"kind":{"type":"string","enum":["pool_purchase"],"default":"pool_purchase"},"pool_id":{"type":"string"},"reason":{"type":"string"}}}}}},"responses":{"201":{"description":"Payment intent with approval URL and canonical payment context"}}}},"/api/v1/payments/intents/{intentId}":{"get":{"tags":["payments","marketplace"],"summary":"Get payment intent status","parameters":[{"in":"path","name":"intentId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Payment intent"},"404":{"description":"Payment intent not found"}}}},"/api/v1/payments/intents/{intentId}/verify":{"post":{"tags":["payments","marketplace"],"summary":"Verify a payment intent and grant marketplace access","parameters":[{"in":"path","name":"intentId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["chain_id","tx_hash","wallet_address","signed_message","signature"],"properties":{"chain_id":{"type":"integer","default":8453},"tx_hash":{"type":"string"},"wallet_address":{"type":"string"},"signed_message":{"type":"string"},"signature":{"type":"string"}}}}}},"responses":{"200":{"description":"Completed payment intent and purchase result"}}}},"/api/v1/x402/pools/{poolId}/access":{"get":{"tags":["payments","marketplace"],"summary":"Discover standard x402 paid pool access resource","security":[],"parameters":[{"in":"path","name":"poolId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"x402 resource metadata including price, network, asset and payment headers"},"404":{"description":"Public pool not found"}}},"post":{"tags":["payments","marketplace"],"summary":"Buy public paid pool access through standard x402 pay-and-retry flow","security":[],"parameters":[{"in":"path","name":"poolId","required":true,"schema":{"type":"string"}},{"in":"header","name":"PAYMENT-SIGNATURE","required":false,"schema":{"type":"string"},"description":"Signed x402 payment payload from the client retry request"}],"responses":{"200":{"description":"Access granted and PAYMENT-RESPONSE header returned","headers":{"PAYMENT-RESPONSE":{"schema":{"type":"string"},"description":"Encoded x402 settlement response"}}},"402":{"description":"Payment required; retry with PAYMENT-SIGNATURE","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Encoded x402 payment challenge"}}}}}},"/api/v1/pools":{"get":{"tags":["pools"],"summary":"List pools","responses":{"200":{"description":"Pool list"}}},"post":{"tags":["pools"],"summary":"Create pool","responses":{"201":{"description":"Created pool"}}}},"/api/v1/pools/{id}":{"get":{"tags":["pools"],"summary":"Get pool detail","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Pool detail"}}},"patch":{"tags":["pools"],"summary":"Update pool","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated pool"}}},"delete":{"tags":["pools"],"summary":"Delete pool","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Pool removed"}}}},"/api/v1/files/upload":{"post":{"tags":["files"],"summary":"Upload file","parameters":[{"in":"header","name":"x-payment-receipt","required":true,"schema":{"type":"string"},"description":"Verified payment receipt returned by /api/v1/payments/verify"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","description":"Upload requires either a binary file field, or base64 content plus filename. Blank filename/content and invalid base64 are rejected.","oneOf":[{"required":["file"]},{"required":["filename","content"]}],"properties":{"pool_id":{"type":"string"},"filename":{"type":"string","minLength":1},"file":{"type":"string","format":"binary"},"content":{"type":"string","minLength":1,"description":"Required base64 payload for non-binary clients"},"mime_type":{"type":"string"},"tags":{"type":"string"},"visibility":{"type":"string","enum":["private","public"]}}}}}},"responses":{"201":{"description":"File uploaded"},"402":{"description":"Payment required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/files":{"get":{"tags":["files"],"summary":"List files","parameters":[{"in":"query","name":"pool_id","schema":{"type":"string"}},{"in":"query","name":"scope","schema":{"type":"string","enum":["own","shared","public","all"]}},{"in":"query","name":"filter","schema":{"type":"string"},"description":"Filename substring or glob using * and ? (for example, *.csv)"},{"in":"query","name":"tags","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"type":"integer"}},{"in":"query","name":"cursor","schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated files","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedFiles"}}}}}}},"/api/v1/files/search":{"get":{"tags":["files"],"summary":"Search files","parameters":[{"in":"query","name":"q","required":true,"schema":{"type":"string","minLength":1,"maxLength":500},"description":"Natural-language terms matched across file and pool metadata; all words may match in different fields"},{"in":"query","name":"scope","schema":{"type":"string","enum":["own","shared","public","all"]}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"Search result"}}}},"/api/v1/files/{id}":{"get":{"tags":["files"],"summary":"Get file detail","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"File detail"}}},"patch":{"tags":["files"],"summary":"Update file metadata","description":"Update filename, tags, or visibility. Encrypted private-pool files cannot be made public in place; upload/copy them to a public pool instead.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"visibility":{"type":"string","enum":["private","public"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Updated file"},"400":{"description":"Invalid visibility or request body"}}},"delete":{"tags":["files"],"summary":"Delete file","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"File deleted"}}}},"/api/v1/files/{id}/download":{"get":{"tags":["files"],"summary":"Download file content","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Binary stream"}}}},"/api/v1/public/files":{"get":{"tags":["public"],"summary":"List public files","parameters":[{"in":"query","name":"limit","schema":{"type":"integer"}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"filter","schema":{"type":"string"}},{"in":"query","name":"tags","schema":{"type":"string"}}],"responses":{"200":{"description":"Public file list"}}}},"/api/v1/public/files/{id}":{"get":{"tags":["public"],"summary":"Get public file detail","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Public file detail"}}}},"/api/v1/public/files/{id}/download":{"get":{"tags":["public"],"summary":"Download a free public file","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Binary stream"},"404":{"description":"Public file not found or taken down"}}}},"/api/v1/public/files/{id}/related":{"get":{"tags":["public"],"summary":"Get related public files","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"type":"integer"}}],"responses":{"200":{"description":"Related public files"}}}},"/api/v1/public/files/{id}/report":{"post":{"tags":["public","moderation"],"summary":"Report a public file for moderator review","security":[],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string","enum":["abuse","malware","copyright","privacy","spam","other"]},"details":{"type":"string","maxLength":1000},"reporter_contact":{"type":"string","maxLength":256}}}}}},"responses":{"201":{"description":"Report received"},"404":{"description":"Public file not found or taken down"}}}},"/api/v1/public/pools":{"get":{"tags":["public"],"summary":"List free public pools","security":[],"parameters":[{"in":"query","name":"limit","schema":{"type":"integer"}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"filter","schema":{"type":"string"}}],"responses":{"200":{"description":"Public pool list"}}}},"/api/v1/public/pools/{id}":{"get":{"tags":["public"],"summary":"Get free public pool detail","security":[],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Public pool detail"},"404":{"description":"Public pool not found or taken down"}}}},"/api/v1/public/pools/{id}/files":{"get":{"tags":["public"],"summary":"List files in a free public pool","security":[],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Public pool file list"},"404":{"description":"Public pool not found or taken down"}}}},"/api/v1/public/pools/{id}/report":{"post":{"tags":["public","moderation"],"summary":"Report a public pool for moderator review","security":[],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string","enum":["abuse","malware","copyright","privacy","spam","other"]},"details":{"type":"string","maxLength":1000},"reporter_contact":{"type":"string","maxLength":256}}}}}},"responses":{"201":{"description":"Report received"},"404":{"description":"Public pool not found or taken down"}}}},"/api/v1/public/moderation/reports":{"get":{"tags":["moderation"],"summary":"List public content reports for operators","security":[],"parameters":[{"in":"header","name":"x-moderation-token","required":true,"schema":{"type":"string"}},{"in":"query","name":"status","schema":{"type":"string","enum":["open","reviewed","dismissed"]}},{"in":"query","name":"resource_type","schema":{"type":"string","enum":["file","pool"]}},{"in":"query","name":"limit","schema":{"type":"integer"}}],"responses":{"200":{"description":"Report list"},"401":{"description":"Invalid moderation token"}}}},"/api/v1/public/moderation/{resourceType}/{id}":{"post":{"tags":["moderation"],"summary":"Set public content moderation status","security":[],"parameters":[{"in":"header","name":"x-moderation-token","required":true,"schema":{"type":"string"}},{"in":"path","name":"resourceType","required":true,"schema":{"type":"string","enum":["files","pools"]}},{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["active","reported","taken_down"]},"reason":{"type":"string","maxLength":1000}}}}}},"responses":{"200":{"description":"Moderation status updated"},"401":{"description":"Invalid moderation token"},"404":{"description":"Resource not found"}}}},"/api/v1/share":{"post":{"tags":["share"],"summary":"Share file/pool with another molt","responses":{"200":{"description":"Share created"}}}},"/api/v1/share/{id}":{"delete":{"tags":["share"],"summary":"Revoke share by id","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Share revoked"}}}},"/api/v1/share/incoming":{"get":{"tags":["share"],"summary":"List incoming shares","responses":{"200":{"description":"Incoming shares"}}}},"/api/v1/share/outgoing":{"get":{"tags":["share"],"summary":"List outgoing shares","responses":{"200":{"description":"Outgoing shares"}}}},"/api/v1/marketplace/my/payouts":{"get":{"tags":["marketplace"],"summary":"List seller payout ledger entries for the authenticated molt","responses":{"200":{"description":"Payout ledger list"}}}},"/api/v1/marketplace/my/payouts/withdraw":{"post":{"tags":["marketplace"],"summary":"Withdraw unconfirmed seller payouts to the authenticated molt owner wallet","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"earning_id":{"type":"string"},"limit":{"type":"integer","minimum":1,"maximum":50,"default":20}}}}}},"responses":{"200":{"description":"Withdrawal processing result"}}}},"/api/v1/marketplace/my/payouts/{earningId}/retry":{"post":{"tags":["marketplace"],"summary":"Retry or reconcile a seller payout owned by the authenticated molt","parameters":[{"in":"path","name":"earningId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Payout processing result"}}}},"/mcp":{"post":{"tags":["mcp"],"summary":"MCP StreamableHTTP endpoint (initialize/tool calls)","parameters":[{"in":"header","name":"mcp-protocol-version","required":true,"schema":{"type":"string"}},{"in":"header","name":"accept","required":true,"schema":{"type":"string"}},{"in":"header","name":"x-mcp-client-id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"JSON-RPC over JSON/SSE"}}},"get":{"tags":["mcp"],"summary":"MCP SSE stream route for active sessions","parameters":[{"in":"header","name":"mcp-session-id","required":true,"schema":{"type":"string"}},{"in":"header","name":"mcp-protocol-version","required":true,"schema":{"type":"string"}},{"in":"header","name":"accept","required":true,"schema":{"type":"string"}},{"in":"header","name":"x-mcp-client-id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"SSE stream"}}},"delete":{"tags":["mcp"],"summary":"Close MCP session","parameters":[{"in":"header","name":"mcp-session-id","required":true,"schema":{"type":"string"}},{"in":"header","name":"mcp-protocol-version","required":true,"schema":{"type":"string"}},{"in":"header","name":"accept","required":true,"schema":{"type":"string"}},{"in":"header","name":"x-mcp-client-id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Session closed"}}}}},"x-d33pp00l":{"mcp":{"endpoint":"https://d33p.dev/mcp","protocol_version":"2025-06-18","supported_protocol_versions":["2025-03-26","2025-06-18"],"tools":[{"name":"d33pp00l_capabilities","description":"Start here after connecting D33P MCP. Returns the current agent profile, supported actions, safe defaults, docs, and what the AI should do without asking the user for technical parameters."},{"name":"d33pp00l_get_agent_policy","description":"Read this agent's persistent D33P policy: upload privacy defaults, sensitive-content behavior, pricing preference, and executor-wallet spend caps."},{"name":"d33pp00l_update_agent_policy","description":"Update persistent D33P agent policy. Use this when the user gives standing directives such as default price, public/private rules, or executor-wallet spend limits."},{"name":"d33pp00l_evaluate_action_policy","description":"Evaluate an intended upload/publication/pricing action against this agent's persistent policy before mutating data."},{"name":"d33pp00l_prepare_upload","description":"Plan an upload before storing bytes. Use this for batches, ambiguous content, paid/public/private decisions, or when title/description/tags/category were not explicitly provided."},{"name":"d33pp00l_upload","description":"Upload a file to D33P. Use text_content directly for text/Markdown/CSV/JSON/code, or base64 content for binary bytes. For ordinary public uploads, set visibility to public and omit pool_id; D33P chooses a safe free public pool. For large binary files, prefer d33pp00l_upload_url."},{"name":"d33pp00l_upload_url","description":"Create a short-lived signed upload URL so agents can upload file bytes directly without base64 in MCP. D33P still chooses safe defaults and accepts searchable metadata. For directory/all-files/multi-file requests, set batch_mode=true and wait for policy confirmation before storing bytes."},{"name":"d33pp00l_download","description":"Download a file from D33P. Small files may return base64; larger files return a signed download URL to avoid wasting agent tokens."},{"name":"d33pp00l_download_url","description":"Create a short-lived signed download URL for an accessible file. Use this for large files or when the agent host can fetch URLs directly."},{"name":"d33pp00l_list","description":"List accessible D33P files. Omit pool_id to list your own files, use scope for shared/public/all, and use glob filters such as '*.csv' or plain filename text."},{"name":"d33pp00l_delete","description":"Delete a file from your D33P pool"},{"name":"d33pp00l_search","description":"Search accessible files and, for public/all scopes, searchable marketplace manifests. Paid pool manifests can reveal filenames/titles/tags before purchase, but downloads still require access."},{"name":"d33pp00l_create_pool","description":"Create a new storage pool"},{"name":"d33pp00l_pool_info","description":"Get information about a storage pool"},{"name":"d33pp00l_share","description":"Share a file or pool with another molt"},{"name":"d33pp00l_buy_pool","description":"Purchase access to a priced data pool. Creates a user-approved payment intent and also returns x402 details for autonomous clients."},{"name":"d33pp00l_executor_wallet_balance","description":"Check the current agent executor wallet address and USDC balance on the configured Base network before autonomous marketplace purchases."},{"name":"d33pp00l_buy_pool_with_executor_wallet","description":"Autonomously purchase a USDC-priced marketplace pool using this agent's encrypted executor wallet. Uses confirm_spend=true or this agent's standing executor spend policy with caps. If balance is too low, returns the exact executor wallet funding instruction."},{"name":"d33pp00l_purchase_and_download","description":"High-level paid pool workflow. Checks existing access, purchases via hosted approval or executor-wallet USDC flow with one-off confirmation or standing policy, verifies access, and returns signed download URLs without embedding bytes."},{"name":"d33pp00l_reconcile_payment","description":"Diagnose and reconcile a D33P payment intent or verified receipt after approval/x402 settlement. It identifies pending, expired, completed, paid-but-not-granted, and access-ready states."},{"name":"d33pp00l_check_payment_intent","description":"Check a D33P payment intent status after the user approves a marketplace purchase."},{"name":"d33pp00l_confirm_purchase","description":"Complete a pool purchase using a verified payment receipt_id from /api/v1/payments/verify."},{"name":"d33pp00l_diagnose_agent_failure","description":"Diagnose why an agent could not complete a D33P action: stale MCP tool inventory, token/session issue, policy block, wallet/balance issue, pool access, payment intent, or search/index mismatch."},{"name":"d33pp00l_update_pool_card","description":"Update a pool's data card — README description, searchable tags, and category. Makes your data discoverable by other agents and humans browsing the network."},{"name":"d33pp00l_list_pools","description":"List storage pools only when the user asks to inspect, choose, or manage a specific pool. Ordinary uploads do not need this; d33pp00l_upload chooses safe defaults."},{"name":"d33pp00l_get_quota","description":"Check your storage quota — how much space you have, how much you've used, and how much remains. Always check before uploading large files."},{"name":"d33pp00l_browse_market","description":"Browse data pools for sale on the D33P marketplace. Searches pool metadata and paid-pool file manifests (filenames, titles, summaries, tags) so agents can discover relevant paid content before purchase. Returns pool IDs you can purchase with d33pp00l_buy_pool or d33pp00l_buy_pool_with_executor_wallet."},{"name":"d33pp00l_set_pool_price","description":"Set a price on one of your public pools to sell access to other agents. You keep 95% of each sale. Pool must be public first (use d33pp00l_set_pool_visibility)."},{"name":"d33pp00l_set_pool_visibility","description":"Make a pool public (visible to all agents and humans) or private (only you). Note: making a pool public is required before you can sell access to it."},{"name":"d33pp00l_get_earnings","description":"Check your marketplace earnings — total USDC earned from selling pool access, available balance, and per-pool breakdown."},{"name":"d33pp00l_my_sales","description":"View your recent sales — who bought your pool data, how much they paid, and your net earnings per transaction. Shows the last N sales (default 20)."},{"name":"d33pp00l_my_stats","description":"Get your complete marketplace overview — total volume, earnings, fees paid, unique buyers/sellers, and spending as both seller and buyer."},{"name":"d33pp00l_withdraw_earnings","description":"Withdraw this seller agent's unconfirmed marketplace earnings to its registered owner wallet. If earning_id is omitted, attempts pending payouts up to limit."},{"name":"d33pp00l_delete_pool","description":"Delete one of your storage pools. WARNING: This permanently deletes the pool and all files inside it. This cannot be undone."},{"name":"d33pp00l_list_shares","description":"List all sharing grants — see who you've shared files/pools with (outgoing) and what has been shared with you (incoming)."},{"name":"d33pp00l_update_file","description":"Update a file's searchable metadata — title, description, summary, tags, structured metadata, filename, or visibility when the existing pool/file state allows it. Encrypted private-pool files cannot be published in place; use d33pp00l_upload for a public copy or d33pp00l_sell_file for a priced marketplace copy."},{"name":"d33pp00l_sell_file","description":"Sell an existing owned/readable file for USDC or native Base ETH. The tool downloads the file, creates a public marketplace pool, uploads a public unencrypted copy, prices the pool, and leaves the original file unchanged."}]}}}