{"openapi":"3.1.0","info":{"title":"AI Blocks public API","version":"1.0.0","description":"Stateless catalogue retrieval and workflow validation. All inference and execution happen in the client."},"servers":[{"url":"https://useaiblocks.com"}],"paths":{"/api/v1/search":{"get":{"operationId":"search_library","parameters":[{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":300}},{"name":"type","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":40}},{"name":"category","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":40}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":25}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100000}}],"responses":{"200":{"description":"Structured result with explicit revision hashes and execution limitations."}}}},"/api/v1/skills/{slug}":{"get":{"operationId":"get_skill","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9][a-z0-9-]{0,119}$"}},{"name":"revision_sha256","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Exact lowercase catalogue SHA-256 revision returned by discovery or retrieval."}}],"responses":{"200":{"description":"Structured result with explicit revision hashes and execution limitations."}}}},"/api/v1/workflows/{slug}":{"get":{"operationId":"get_workflow","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9][a-z0-9-]{0,119}$"}},{"name":"revision_sha256","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Exact lowercase catalogue SHA-256 revision returned by discovery or retrieval."}}],"responses":{"200":{"description":"Structured result with explicit revision hashes and execution limitations."}}}},"/api/v1/resources/{slug}":{"get":{"operationId":"get_resource","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9][a-z0-9-]{0,119}$"}},{"name":"path","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":511}},{"name":"revision_sha256","in":"query","required":true,"schema":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Exact lowercase catalogue SHA-256 revision returned by discovery or retrieval."}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":20000000,"description":"Offset in Unicode code points, as returned by next_offset."}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":48000}}],"responses":{"200":{"description":"Structured result with explicit revision hashes and execution limitations."}}}},"/api/v1/workflow-preparations":{"post":{"operationId":"prepare_workflow","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"goal":{"type":"string","minLength":1,"maxLength":4000},"notes":{"type":"string","minLength":1,"maxLength":8000},"steps":{"type":"array","minItems":1,"maxItems":40,"items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_-]{0,79}$"},"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9][a-z0-9-]{0,119}$"},"revision_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Exact lowercase catalogue SHA-256 revision returned by discovery or retrieval."},"notes":{"type":"string","minLength":1,"maxLength":4000},"depends_on":{"type":"array","maxItems":40,"items":{"type":"string","minLength":1,"maxLength":80}}},"required":["id","slug"],"additionalProperties":false}},"governing_skills":{"type":"array","maxItems":20,"items":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9][a-z0-9-]{0,119}$"},"revision_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Exact lowercase catalogue SHA-256 revision returned by discovery or retrieval."}},"required":["slug","revision_sha256"],"additionalProperties":false}},"custom_skills":{"type":"array","maxItems":10,"items":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^custom-[a-z0-9-]+$"},"name":{"type":"string","minLength":1,"maxLength":120},"instructions":{"type":"string","minLength":1,"maxLength":30000},"inputs":{"type":"array","maxItems":40,"items":{"type":"object","properties":{"type":{"type":"string","minLength":1,"maxLength":100},"required":{"type":"boolean"}},"required":["type"],"additionalProperties":false}},"outputs":{"type":"array","maxItems":40,"items":{"type":"object","properties":{"type":{"type":"string","minLength":1,"maxLength":100},"required":{"type":"boolean"}},"required":["type"],"additionalProperties":false}}},"required":["slug","name","instructions"],"additionalProperties":false}},"approved_draft_hash":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Optional host-reported hash of the exact previously reviewed draft. This field cannot establish consent or execution authorization."}},"required":["name","goal","steps"],"additionalProperties":false}}}},"responses":{"200":{"description":"Structured result with explicit revision hashes and execution limitations."}}}}}}