{"openapi":"3.1.0","info":{"title":"GEDX402 Memory","version":"6","description":"SQL read\/write on shared agent memory \u2014 prepaid sessions or per-query x402.","contact":{"email":"support@macrostrategies.ai","url":"https:\/\/db.gedx402.com"},"x-guidance":"Pay per request with USDC on Base via x402 v2 (Coinbase CDP facilitator). Choose any listed network in the 402 accepts[] response. 3 routes on this shard (competitive heroes default; ?full=1 for all). Full catalog: GET https:\/\/gedx402.com\/v1\/models Start here: POST \/v1\/sql\/query","x-service":{"serviceName":"GEDX402 Memory","tags":["database","memory","sql","agents","usdc"],"iconUrl":"https:\/\/db.gedx402.com\/favicon.svg"},"x-hub":"https:\/\/gedx402.com","x-payments":[{"x402":{"network":"eip155:8453","asset":"USDC","label":"Base"}}],"x-openapi-scope":"competitive","full_catalog":"https:\/\/db.gedx402.com\/openapi.json?full=1"},"servers":[{"url":"https:\/\/db.gedx402.com"}],"paths":{"\/v1\/sql\/query":{"post":{"operationId":"sql_query","summary":"Agent Memory Agent Memory","description":"Read-only SQL on shared agent memory database. POST SELECT with optional params; results capped at 1000 rows. With valid session_token from POST \/v1\/memory\/sessions, no x402 until query credits exhausted. x402 settlement USDC per request (see unpaid 402 or GET \/v1\/models) worst-case per standalone query. Hero: GET \/heroes\/sql-query. Bundle: GET \/v1\/models?bundle=memory. Shard omitted from default OpenAPI discovery.","tags":["Memory"],"security":[{"x402":[]}],"x-payment-info":{"protocols":[{"x402":{"network":"eip155:8453","asset":"USDC","label":"Base"}}],"price":{"mode":"dynamic","currency":"USD","min":"0.002001","max":"0.007000"}},"responses":{"200":{"description":"Inference result","content":{"application\/json":{"schema":{"type":"object"},"example":{"service":"gedx402-memory","results":[{"ok":1}],"meta":{"rows_read":1,"duration_ms":2}}}}},"400":{"description":"Invalid or over-limit payload"},"402":{"description":"Payment required (x402 v2 USDC on Base). Unpaid 402 includes PAYMENT-REQUIRED. After a rejected PAYMENT-SIGNATURE the JSON body is { reason_code, detail, next_step }.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired with accepts[] per network","schema":{"type":"string"}}},"content":{"application\/json":{"schema":{"type":"object","additionalProperties":true},"example":{}}}}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"sql":{"type":"string","description":"Single read-only SELECT (or WITH \u2026 SELECT)."},"params":{"type":"array","description":"Optional bound values for ? placeholders.","items":{}},"session_token":{"type":"string","description":"Optional \u2014 from POST \/v1\/memory\/sessions; skips x402 while credits remain."}},"required":["sql"]},"example":{"sql":"SELECT 1 AS ok"}}}},"servers":[{"url":"https:\/\/db.gedx402.com"}],"x-resource-url":"https:\/\/db.gedx402.com\/v1\/sql\/query"}},"\/v1\/sql\/exec":{"post":{"operationId":"sql_exec","summary":"Agent Memory Agent Memory","description":"Write SQL on shared agent memory database. POST INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, or REPLACE with optional params; UPDATE\/DELETE require WHERE; changes capped at 100 rows. With valid session_token, no x402 until exec credits exhausted. Bundle: GET \/v1\/models?bundle=memory. Shard omitted from default OpenAPI discovery.","tags":["Memory"],"security":[{"x402":[]}],"x-payment-info":{"protocols":[{"x402":{"network":"eip155:8453","asset":"USDC","label":"Base"}}],"price":{"mode":"dynamic","currency":"USD","min":"0.005010","max":"0.017000"}},"responses":{"200":{"description":"Inference result","content":{"application\/json":{"schema":{"type":"object"},"example":{"service":"gedx402-memory","success":true,"meta":{"changes":0,"last_row_id":0,"rows_written":0,"duration_ms":3}}}}},"400":{"description":"Invalid or over-limit payload"},"402":{"description":"Payment required (x402 v2 USDC on Base). Unpaid 402 includes PAYMENT-REQUIRED. After a rejected PAYMENT-SIGNATURE the JSON body is { reason_code, detail, next_step }.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired with accepts[] per network","schema":{"type":"string"}}},"content":{"application\/json":{"schema":{"type":"object","additionalProperties":true},"example":{}}}}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"sql":{"type":"string","description":"Single write statement (INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, REPLACE)."},"params":{"type":"array","description":"Optional bound values for ? placeholders.","items":{}},"session_token":{"type":"string","description":"Optional \u2014 from POST \/v1\/memory\/sessions; skips x402 while credits remain."}},"required":["sql"]},"example":{"sql":"CREATE TABLE IF NOT EXISTS listing_example (id TEXT PRIMARY KEY, body TEXT)"}}}},"servers":[{"url":"https:\/\/db.gedx402.com"}],"x-resource-url":"https:\/\/db.gedx402.com\/v1\/sql\/exec"}},"\/v1\/memory\/sessions":{"post":{"operationId":"memory_sessions","summary":"Gedx402 Memory Session Agent Memory","description":"SQL memory session on db.gedx402.com: one x402 payment prepays sql\/exec write and sql\/query read credits. POST optional budget {max_exec_ops, max_queries}; returns session_id, session_token, routes and credits. USDC per request (see unpaid 402 or GET \/v1\/models) wire settlement (budget caps apply). Send session_token on query\/exec (X-Memory-Session-Token header or body); no 402 until credits run out. Hero: GET \/heroes\/memory-session.","tags":["Memory"],"security":[{"x402":[]}],"x-payment-info":{"protocols":[{"x402":{"network":"eip155:8453","asset":"USDC","label":"Base"}}],"price":{"mode":"dynamic","currency":"USD","min":"0.025035","max":"0.690000"}},"responses":{"200":{"description":"Inference result","content":{"application\/json":{"schema":{"type":"object"},"example":{"session_id":"550e8400-e29b-41d4-a716-446655440000","session_token":"abc123\u2026","credits":{"exec_ops_remaining":3,"queries_remaining":5},"routes":{"query":"\/v1\/sql\/query","exec":"\/v1\/sql\/exec"}}}}},"400":{"description":"Invalid or over-limit payload"},"402":{"description":"Payment required (x402 v2 USDC on Base). Unpaid 402 includes PAYMENT-REQUIRED. After a rejected PAYMENT-SIGNATURE the JSON body is { reason_code, detail, next_step }.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired with accepts[] per network","schema":{"type":"string"}}},"content":{"application\/json":{"schema":{"type":"object","additionalProperties":true},"example":{}}}}},"requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","properties":{"budget":{"type":"object","description":"Prepaid SQL exec\/query credits included in the single x402 payment.","properties":{"max_exec_ops":{"type":"integer","minimum":0,"maximum":64,"description":"Prepaid write credits for POST \/v1\/sql\/exec."},"max_queries":{"type":"integer","minimum":0,"maximum":256,"description":"Prepaid read credits for POST \/v1\/sql\/query."}}}}},"example":{"budget":{"max_exec_ops":3,"max_queries":5}}}}},"servers":[{"url":"https:\/\/db.gedx402.com"}],"x-resource-url":"https:\/\/db.gedx402.com\/v1\/memory\/sessions"}},"\/v1\/models":{"get":{"operationId":"models","summary":"Shard route catalog","description":"Free catalog for this shard with pricing and descriptions.","tags":["Catalog"],"security":[],"responses":{"200":{"description":"Catalog JSON"}}}},"\/v1\/demo":{"get":{"operationId":"demo_index","summary":"Response shape previews","description":"Free cached JSON examples (not charged).","tags":["Catalog"],"security":[],"responses":{"200":{"description":"Demo index"}}}},"\/v1\/health":{"get":{"operationId":"health","summary":"Service health","tags":["Catalog"],"security":[],"responses":{"200":{"description":"Health JSON"}}}}},"x-agentcash-guidance":{"llmsTxtUrl":"https:\/\/db.gedx402.com\/llms.txt"},"x-agentcash-provenance":{"ownershipProofs":["0xb3C2776cE3F99cb3366520c27b4aC5D436942Ab6"]},"x-discovery":{"ownershipProofs":["0xb3C2776cE3F99cb3366520c27b4aC5D436942Ab6"]},"components":{"securitySchemes":{"x402":{"type":"apiKey","in":"header","name":"PAYMENT-SIGNATURE","description":"x402 v2. First POST without this header returns 402 + PAYMENT-REQUIRED. Sign the Base accept (eip155:8453) with @x402\/fetch and retry once. After a rejected signature the 402 body is { reason_code, detail, next_step }."}}}}