{"openapi":"3.0.3","info":{"title":"Moresq Corpus API","description":"Proof-backed implementation memory for coding agents. See https://corpus.moresq.com/mcp-corpus for the MCP adapter.","version":"1.0.0"},"servers":[{"url":"https://data.moresq.com"}],"paths":{"/data/v1/functions/corpus.retrieve":{"post":{"operationId":"corpus.retrieve","summary":"Récupère un snippet vérifié (payant) : débite le wallet, reverse au déposant, prend la commission, sert le code + tampon de garantie.","description":"X-API-Key required. Debits the wallet by the snippet's listed fee.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["snippet_id"],"properties":{"snippet_id":{"type":"string","description":"The _id from a corpus.search result"},"max_price_credits":{"type":"integer","description":"Abort instead of charging above this many credits"},"max_input_tokens":{"type":"integer","description":"Abort instead of retrieving above this estimated token size"}}}}}},"responses":{"200":{"description":"Success or a function-level error in the `error` field."}}}},"/data/v1/functions/corpus.deposit":{"post":{"operationId":"corpus.deposit","summary":"Dépose un snippet : débite le deposit fee (paie le scan), passe le portier (déterministe + consensus Satcove), crée le snippet si admis.","description":"X-API-Key required. Debits a scan fee whether admitted or rejected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","language"],"properties":{"code":{"type":"string"},"language":{"type":"string"},"title":{"type":"string"},"license":{"type":"string"},"attested":{"type":"boolean","description":"You attest you have the right to share this code"}}}}}},"responses":{"200":{"description":"Success or a function-level error in the `error` field."}}}},"/data/v1/functions/corpus.trial":{"post":{"operationId":"corpus.trial","summary":"Octroie un petit crédit d’essai (une seule fois par compte) pour tester la récupération.","description":"X-API-Key required. One-time 20 free credits per account.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Success or a function-level error in the `error` field."}}}},"/data/v1/functions/corpus.balance":{"post":{"operationId":"corpus.balance","summary":"Renvoie le solde de credits du wallet du caller (total + retirable).","description":"X-API-Key required.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Success or a function-level error in the `error` field."}}}},"/data/v1/functions/corpus.usage_by_key":{"post":{"operationId":"corpus.usage_by_key","summary":"Répartition des retrievals/credits par clé API pour le compte du caller — pour un wallet partagé entre plusieurs agents.","description":"X-API-Key required.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Success or a function-level error in the `error` field."}}}},"/data/v1/functions/corpus.search":{"post":{"operationId":"corpus.search","summary":"Recherche dans le catalogue Moresq Corpus (metadata uniquement ; le code s’obtient via corpus.retrieve, payant).","description":"None required (public, metadata only).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"q":{"type":"string","description":"Search text, space-separated tokens all required (title/language/summary match)"},"language":{"type":"string","description":"Filter by language, e.g. typescript"},"limit":{"type":"integer","minimum":1,"maximum":500,"default":20}}}}}},"responses":{"200":{"description":"Success or a function-level error in the `error` field."}}}},"/data/v1/functions/corpus.report_issue":{"post":{"operationId":"corpus.report_issue","summary":"Alias API public de corpus.report : signale un problème sur une primitive récupérée.","description":"Bearer session token required (signed-in user, not an API key).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"snippet_id":{"type":"string"},"message":{"type":"string"}}}}}},"responses":{"200":{"description":"Success or a function-level error in the `error` field."}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}}}}