{"openapi":"3.1.1","info":{"title":"Mycelia public reader API","version":"0.6.0","description":"Local Phase 6. Anonymous public reads; preconfigured scoped agent bearer keys. Register/revoke in the signed-in workspace. No private records or OAuth flow. Read calls with a key log observed reuse; daily repeats are zero-weight."},"servers":[{"url":"/functions/v1/public-api"}],"security":[{},{"AgentKey":[]}],"paths":{"/openapi.json":{"get":{"operationId":"openapi","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/search":{"get":{"operationId":"search","parameters":[{"name":"q","in":"query","schema":{"type":"string"},"description":""},{"name":"kind","in":"query","schema":{"type":"string"},"description":""},{"name":"licences","in":"query","schema":{"type":"string"},"description":"Comma-separated SPDX allowlist; no inferred legal compatibility"},{"name":"min_rung","in":"query","schema":{"type":"integer"},"description":"1–6, current assessed rung"},{"name":"offset","in":"query","schema":{"type":"integer"},"description":"0–10000"},{"name":"limit","in":"query","schema":{"type":"integer"},"description":"1–20, default 20"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResult"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"406":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/parts/{shortId}/versions/{version}":{"get":{"operationId":"readVersion","parameters":[{"name":"shortId","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{5,31}$"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"format","in":"query","schema":{"type":"string","enum":["json","jsonld","mira","nanopub","rocrate","zip","jats"]}},{"name":"Idempotency-Key","in":"header","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Exact version; current assessment accompanies JSON. MIRA is JSON-LD with Mycelia signature sidecar; RO-Crate is detached JSON or a ZIP with payloads.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Version"}},"application/ld+json":{"schema":{"type":"object"}},"application/vnd.mycel.mira+json":{"schema":{"type":"object"}},"application/trig":{"schema":{"type":"string"}},"application/vnd.ro-crate+json":{"schema":{"type":"object"}},"application/zip":{"schema":{"type":"string","format":"binary"}},"application/jats+xml":{"schema":{"type":"object"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"406":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/parts/{shortId}/versions/{version}/links":{"get":{"operationId":"links","parameters":[{"name":"shortId","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{5,31}$"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"links":{"type":"array","items":{"type":"object"}}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"406":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/parts/{shortId}/versions/{version}/citation":{"get":{"operationId":"citation","parameters":[{"name":"shortId","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{5,31}$"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["citation"],"properties":{"citation":{"type":"string"},"text":{"type":"string"}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"406":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/parts/{shortId}/versions/{version}/files/{index}":{"get":{"operationId":"file","parameters":[{"name":"shortId","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{5,31}$"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"index","in":"path","required":true,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Verified public file bytes","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"406":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/reuse":{"post":{"operationId":"logReuse","security":[{"AgentKey":[]}],"description":"Requires reuse:write. High-value events without actor-authored exact public relation evidence receive zero credit; execute remains unverified until Phase 4.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReuseRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"406":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/contributors/{id}/reuse":{"get":{"operationId":"contributorReuse","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReuseSummary"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"406":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp":{"post":{"operationId":"mcp","security":[{"AgentKey":[]}],"description":"MCP Streamable HTTP, pinned protocol 2025-11-25 (2025-06-18 and 2025-03-26 also accepted), stateless JSON response mode. Accept application/json and text/event-stream. No GET SSE stream.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Notification accepted"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"406":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"AgentKey":{"type":"http","scheme":"bearer","bearerFormat":"mycel_agent_<random secret>"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"Version":{"type":"object","required":["document","current_trust","citation","retraction_reason"],"properties":{"document":{"$ref":"/functions/v1/public-api/schemas/part.json"},"current_trust":{"type":"object"},"citation":{"type":"string"},"retraction_reason":{"type":["string","null"]},"canonical_text":{"type":"string"}}},"SearchResult":{"type":"object","required":["items","offset","limit","next_offset"],"properties":{"items":{"type":"array","items":{"type":"object","properties":{"document":{"$ref":"/functions/v1/public-api/schemas/part.json"},"current_trust":{"type":"object"},"retraction_reason":{"type":["string","null"]}}}},"offset":{"type":"integer"},"limit":{"type":"integer"},"next_offset":{"type":["integer","null"]}}},"ReuseRequest":{"$ref":"/functions/v1/public-api/schemas/reuse.json"},"ReuseSummary":{"type":"object","properties":{"weighted_reuse":{"type":"number"},"events":{"type":"integer"},"by_kind":{"type":"object","additionalProperties":{"type":"number"}},"recent":{"type":"array","items":{"type":"object"}}}}}}}