{"openapi":"3.1.0","info":{"title":"Glyphae Asset API","version":"0.2.0","description":"Manage the Glyphae 3D asset catalog. Reads are public; writes need a session cookie or an API key (x-api-key header), creatable at /account."},"servers":[{"url":"https://glyphae.com"}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"Asset":{"type":"object","required":["id","name","pack","category","license","description","preview","formats"],"properties":{"id":{"type":"string","description":"Stable slug."},"name":{"type":"string"},"pack":{"type":"string"},"category":{"type":"string","enum":["material","hardware","decal","scene","shader","sound"]},"scaleM":{"type":["number","null"],"description":"Longest dimension in meters; null = tileable."},"license":{"type":"string"},"description":{"type":"string"},"preview":{"type":"string","description":"Pack-relative R2 path to the preview image."},"pbr":{"type":["object","null"],"description":"Real-time PBR maps + constants (materials)."},"ai":{"type":["object","null"],"description":"{ whenToUse, params?, gotchas? }"},"formats":{"type":"array","items":{"type":"object"}},"status":{"type":"string","enum":["DRAFT","PUBLISHED"]},"source":{"type":"string","enum":["CURATED","CONTRIBUTED"]}}}}},"paths":{"/data/manifest.json":{"get":{"summary":"Published catalog as a JSON array (the AI index).","responses":{"200":{"description":"Array of published assets."}}}},"/api/assets":{"get":{"summary":"Search the published catalog.","parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"category","in":"query","schema":{"type":"string","enum":["material","hardware","decal","scene","shader","sound"]}},{"name":"pack","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":200,"maximum":500}}],"responses":{"200":{"description":"{ assets, total }"}}},"post":{"summary":"Create an asset (your own contribution; ADMIN may set source=CURATED).","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"responses":{"201":{"description":"Created."},"401":{"description":"No auth."},"409":{"description":"id already exists."},"422":{"description":"Validation error."}}}},"/api/assets/{id}":{"get":{"summary":"Fetch one asset (drafts visible only to owner/admin).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ asset }"},"404":{"description":"Not found."}}},"patch":{"summary":"Update fields or status (owner or ADMIN).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"responses":{"200":{"description":"{ asset }"},"403":{"description":"Forbidden."}}},"delete":{"summary":"Delete an asset (owner or ADMIN).","security":[{"apiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ ok: true }"},"403":{"description":"Forbidden."}}}},"/api/uploads":{"post":{"summary":"Get a presigned R2 PUT URL. Contributor keys are namespaced to u/<userId>; pack is honored only for ADMIN.","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["path"],"properties":{"path":{"type":"string","description":"Pack-relative path (no '..')."},"pack":{"type":"string","description":"ADMIN only; ignored for contributors."},"contentType":{"type":"string","description":"Allowlisted: image/png|jpeg|webp|avif, model/gltf-binary|gltf+json, application/octet-stream|zip."}}}}}},"responses":{"200":{"description":"{ key, uploadUrl, publicUrl }"}}}}}}