{"openapi":"3.1.0","info":{"title":"DurableFile","version":"0.1.0-beta.1","description":"Public artifact storage for agents. $1 buys 1 GiB and purchases never expire. Any file type is accepted up to the size cap, and every file expires: 14 days by default, 180 days at most, renewable by re-upload or publish. Files are public. Every actionable 4xx has a fix field."},"servers":[{"url":"https://durablefile.com"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"A durable_ API key."}},"schemas":{"Error":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}},"paths":{"/health":{"get":{"summary":"Check service health","responses":{"200":{"description":"Healthy."}}}},"/llms.txt":{"get":{"summary":"Read the agent quickstart","responses":{"200":{"description":"Plain text."}}}},"/evaluate.md":{"get":{"summary":"Evaluate product fit","responses":{"200":{"description":"Markdown."}}}},"/integrate.md":{"get":{"summary":"Read the integration procedure","responses":{"200":{"description":"Markdown."}}}},"/v1/accounts":{"post":{"summary":"Create an account and return its API key once","responses":{"201":{"description":"The account has zero quota."}}}},"/v1/me":{"get":{"summary":"Get quota, use, and remaining bytes","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Account state."},"401":{"description":"Invalid key.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/v1/credit":{"post":{"summary":"Create Stripe and usevig payment options","description":"$1 grants 1 GiB. Purchases stack. usevig fields are absent when usevig is unavailable.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["gb"],"properties":{"gb":{"type":"integer","minimum":1,"maximum":100}}}}}},"responses":{"200":{"description":"Payment options."},"400":{"description":"The gb value is invalid.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}},"401":{"description":"Invalid key.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/v1/redeem":{"post":{"summary":"Redeem a coupon code for storage quota","description":"A code grants its quota at once and works one time for each account. Redemption is rate limited per key.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{2,31}$"}}}}}},"responses":{"200":{"description":"The quota is granted."},"400":{"description":"The code is missing, invalid, spent, or expired.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}},"401":{"description":"Invalid key.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}},"429":{"description":"Too many redemption attempts.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/v1/upload":{"post":{"summary":"Publish one file of any type","description":"Accepts any file type as multipart field file or raw bytes; raw bytes need Content-Type and X-Filename or filename. The maximum size is 26214400 bytes. Every download forces Content-Disposition: attachment. Every file expires: omitting the expiry fields gives 14 days, and the maximum window is 180 days.","security":[{"bearerAuth":[]}],"parameters":[{"name":"filename","in":"query","schema":{"type":"string"}},{"name":"expires_after_hours","in":"query","schema":{"type":"number","exclusiveMinimum":0,"maximum":4320}},{"name":"expires_at","in":"query","schema":{"oneOf":[{"type":"integer"},{"type":"string","format":"date-time"}]}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"expires_after_hours":{"type":"number"},"expires_at":{"type":["integer","string"]}}}},"*/*":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"A duplicate claim is live."},"201":{"description":"The file is live."},"400":{"description":"The request or expiry data is invalid.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}},"402":{"description":"The account needs quota.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}},"413":{"description":"The file is too large.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}},"429":{"description":"The upload rate is too high.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/v1/files":{"get":{"summary":"List account claims","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"A bounded page."},"400":{"description":"Pagination is invalid.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/v1/files/{hash}":{"get":{"summary":"Get one account claim","security":[{"bearerAuth":[]}],"parameters":[{"name":"hash","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}}],"responses":{"200":{"description":"File metadata."},"404":{"description":"The claim does not exist.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}}}},"delete":{"summary":"Delete one claim and free quota","security":[{"bearerAuth":[]}],"parameters":[{"name":"hash","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}}],"responses":{"200":{"description":"The claim is deleted."},"404":{"description":"The claim does not exist.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/v1/files/{hash}/publish":{"post":{"summary":"Republish a claim and start a fresh expiry window","description":"An empty body gives a new default 14-day window. Send expires_after_hours or expires_at for up to 180 days. Renews an expired claim that the purge has not removed yet.","security":[{"bearerAuth":[]}],"parameters":[{"name":"hash","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}}],"responses":{"200":{"description":"The claim is live."},"400":{"description":"The expiry is invalid.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}},"404":{"description":"The claim does not exist.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/v1/files/{hash}/unpublish":{"post":{"summary":"Hide one claim and retain its bytes","security":[{"bearerAuth":[]}],"parameters":[{"name":"hash","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}}],"responses":{"200":{"description":"The claim is hidden."},"404":{"description":"The claim does not exist.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}}}}},"/f/{hash}/{filename}":{"get":{"summary":"Download a public file","servers":[{"url":"https://f.durablefile.com"}],"parameters":[{"name":"hash","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"File bytes with Content-Disposition attachment."},"404":{"description":"No live claim exists.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string"},"fix":{"type":"string"}}}}}}}}}}}