{"openapi":"3.1.0","info":{"title":"Casa API","version":"0.1.0","description":"Casa — a private, permanent Dropbox for AI agents. Files are encrypted client-side before upload (only your wallet can decrypt; Casa is zero-knowledge) and stored permanently — on Arweave by default (pay-once endowment, ~200+ years; the arweave-permanent label), or Swarm for large files. Each upload reports an honest durability label (arweave-permanent, swarm-postage with a guaranteed_until TTL, swarm-managed, or mock-ephemeral). Reads are free; the POST /v1/store write returns HTTP 402 with x402 payment requirements.","contact":{"name":"Casa","url":"https://casa-agents.fly.dev"}},"servers":[{"url":"https://casa-agents.fly.dev"}],"paths":{"/v1/store":{"post":{"operationId":"storeFile","summary":"Store an (encrypted) blob permanently (paid via x402)","description":"Stores the request body permanently (Arweave by default; Swarm for large files) and returns a reference, a public gateway URL, and durability info (durability + guaranteed_until). Casa is zero-knowledge: the Casa client encrypts client-side before upload so only your wallet can decrypt. Requires payment of $0.01 in USDC on Base via x402: an unpaid request returns HTTP 402 with the payment requirements in the body.","requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}},"text/plain":{"schema":{"type":"string"}},"application/json":{"schema":{"type":"object"}},"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"parameters":[{"name":"X-Casa-Name","in":"header","required":false,"schema":{"type":"string"},"description":"Optional filename stored as metadata."}],"responses":{"200":{"description":"Stored","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreResult"}}}},"402":{"description":"Payment Required (x402). Body contains payment requirements."}}}},"/v1/file/{reference}":{"get":{"operationId":"fetchFile","summary":"Fetch a stored file (free)","parameters":[{"name":"reference","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"File bytes (mock mode serves directly)."},"302":{"description":"Redirect to the permanent public gateway URL (Arweave or Swarm)."},"404":{"description":"Not found."}}}},"/v1/info/{reference}":{"get":{"operationId":"fileInfo","summary":"Get file metadata (free)","parameters":[{"name":"reference","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadInfo"}}}},"404":{"description":"Unknown reference."}}}},"/v1/revenue":{"get":{"operationId":"revenue","summary":"On-chain USDC received at the shot.eth deposit address (free)","description":"Returns total USDC detected on-chain (Base + Ethereum) at the shot.eth deposit address, the individual payments, and whether the $1.00 goal has been reached.","responses":{"200":{"description":"Revenue summary (JSON)."}}}},"/health":{"get":{"operationId":"health","summary":"Health check","responses":{"200":{"description":"ok"}}}}},"components":{"schemas":{"StoreResult":{"type":"object","required":["reference","url","gateway_url"],"properties":{"reference":{"type":"string","description":"Storage reference: Arweave txid (43-char base64url) or Swarm reference (64-hex)."},"url":{"type":"string","description":"Casa free-read URL for the (encrypted) blob."},"gateway_url":{"type":"string","description":"Public permanent gateway URL for the blob (Arweave or Swarm)."},"name":{"type":"string"},"size":{"type":"integer"},"content_type":{"type":"string"},"encrypted":{"type":"boolean","description":"True if the stored blob is a client-side encrypted envelope."},"durability":{"type":"string","enum":["arweave-permanent","swarm-postage","swarm-managed","mock-ephemeral"],"description":"Honest durability label. arweave-permanent = permanently stored on Arweave (pay-once endowment, ~200+ years), the default for small files; swarm-postage = our funded batch (has guaranteed_until); swarm-managed = managed Swarm (Swarmy), retained while subscription active, no fixed TTL; mock-ephemeral = local-disk test, not durable."},"guaranteed_until":{"type":["string","null"],"format":"date-time","description":"Guaranteed retrievable until this time (Swarm postage TTL, extendable). null in mock and swarm-managed modes (no fixed expiry to prove)."},"durability_note":{"type":["string","null"],"description":"Honest human-readable retention statement when there is no fixed TTL."}}},"UploadInfo":{"type":"object","properties":{"reference":{"type":"string"},"name":{"type":"string"},"size":{"type":"integer"},"content_type":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"gateway_url":{"type":"string"},"encrypted":{"type":"boolean"},"durability":{"type":"string","enum":["arweave-permanent","swarm-postage","swarm-managed","mock-ephemeral"]},"guaranteed_until":{"type":["string","null"],"format":"date-time"},"durability_note":{"type":["string","null"]}}}}},"x-payment":{"protocol":"x402","asset":"USDC","network":"base","facilitator":"https://x402.org/facilitator","deposit_address":"0x8C28Cf33d9Fd3D0293f963b1cd27e3FF422B425c","deposit_ens":"shot.eth","price":{"/v1/store":"$0.01"}}}