{"components":{"schemas":{"Capability":{"additionalProperties":false,"properties":{"capability":{"type":"string"},"url":{"format":"uri","type":"string"}},"required":["capability","url"],"type":"object"},"CreateBox":{"additionalProperties":false,"properties":{"ciphertextSha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"ciphertextSize":{"maximum":10485760,"minimum":1,"type":"integer"}},"required":["ciphertextSha256","ciphertextSize"],"type":"object"},"CreateResponse":{"additionalProperties":false,"properties":{"boxId":{"format":"uuid","type":"string"},"createdAt":{"format":"date-time","type":"string"},"delete":{"$ref":"#/components/schemas/Capability"},"download":{"$ref":"#/components/schemas/Capability"},"expiresAt":{"format":"date-time","type":"string"},"upload":{"$ref":"#/components/schemas/Capability"}},"required":["boxId","createdAt","delete","download","expiresAt","upload"],"type":"object"},"Error":{"additionalProperties":false,"properties":{"error":{"additionalProperties":false,"properties":{"code":{"enum":["blob_too_large","box_not_writable","capacity_exhausted","capacity_reclaiming","deleted","expired","creation_disabled","idempotency_conflict","integrity_mismatch","invalid_capability","invalid_request","facilitator_unavailable","not_found","payment_invalid","payment_pending","payment_replay","payment_required","payment_unavailable","rate_limited","replay_credential_required","storage_unavailable"],"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","requestId","retryable"],"type":"object"}},"required":["error"],"type":"object"}},"securitySchemes":{"BearerCapability":{"scheme":"bearer","type":"http"}}},"externalDocs":{"url":"https://agtbox.dev/docs"},"info":{"contact":{"email":"support@agtbox.dev"},"termsOfService":"https://agtbox.dev/legal/terms","title":"agtbox API","version":"0.1.0","x-agtbox-availability":"public-beta","x-agtbox-capabilities":["upload","download","delete"],"x-agtbox-cli":"@agtbox/cli@0.1.5","x-agtbox-limits":{"ciphertextBytes":10485760,"lifetimeSeconds":86400,"liveBoxes":500},"x-agtbox-payment":{"amount":"10000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","network":"eip155:8453","payTo":"0xb5363EDDE479640886cf708BC596F2aED09806A8","scheme":"exact"},"x-agtbox-retry":"Retry paid creation only with the identical request and saved authorization.","x-agtbox-runtime":"vps-sqlite-authority"},"openapi":"3.1.0","paths":{"/v1/boxes":{"post":{"parameters":[{"in":"header","name":"idempotency-key","required":true,"schema":{"maxLength":256,"minLength":1,"type":"string"}},{"in":"header","name":"payment-signature","schema":{"minLength":1,"type":"string"}},{"description":"EIP-191 signature from the x402 payer over the canonical paid create request; required with a payment credential.","in":"header","name":"x-agtbox-request-commitment","schema":{"pattern":"^0x[0-9a-f]{130}$","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBox"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResponse"}}},"description":"Box created after exactly one $0.01 USDC settlement","headers":{"payment-response":{"schema":{"type":"string"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request"},"402":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"x402 v2 payment required","headers":{"payment-required":{"schema":{"type":"string"}}}},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Idempotency or payment conflict"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Expired or deleted box"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Create rate limit or capacity exhausted"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Creation, payment, or storage infrastructure unavailable"}}}},"/v1/boxes/{boxId}":{"delete":{"parameters":[{"in":"path","name":"boxId","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"authorization","schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid capability"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Box not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Expired or deleted box"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"120 capability requests per minute per client IP"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Storage unavailable"}},"security":[{"BearerCapability":[]}]},"get":{"parameters":[{"in":"path","name":"boxId","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"authorization","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/octet-stream":{"schema":{"type":"string"}}},"description":"Ciphertext","headers":{"content-length":{"schema":{"type":"string"}},"content-type":{"schema":{"enum":["application/octet-stream"],"type":"string"}},"x-agtbox-created-at":{"schema":{"format":"date-time","type":"string"}},"x-agtbox-expires-at":{"schema":{"format":"date-time","type":"string"}},"x-agtbox-sha256":{"schema":{"pattern":"^[a-f0-9]{64}$","type":"string"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid capability"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Box not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Expired or deleted box"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"120 capability requests per minute per client IP"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Storage unavailable"}},"security":[{"BearerCapability":[]}]},"head":{"parameters":[{"in":"path","name":"boxId","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"authorization","schema":{"type":"string"}}],"responses":{"200":{"description":"Ciphertext metadata","headers":{"content-length":{"schema":{"type":"string"}},"content-type":{"schema":{"enum":["application/octet-stream"],"type":"string"}},"x-agtbox-created-at":{"schema":{"format":"date-time","type":"string"}},"x-agtbox-expires-at":{"schema":{"format":"date-time","type":"string"}},"x-agtbox-sha256":{"schema":{"pattern":"^[a-f0-9]{64}$","type":"string"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid capability"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Box not found"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Expired or deleted box"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"120 capability requests per minute per client IP"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Storage unavailable"}},"security":[{"BearerCapability":[]}]},"put":{"parameters":[{"in":"path","name":"boxId","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"header","name":"authorization","schema":{"type":"string"}},{"description":"Exact ciphertext size in bytes; maximum 10485760.","in":"header","name":"content-length","required":true,"schema":{"pattern":"^[0-9]+$","type":"string"}},{"in":"header","name":"content-type","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Ciphertext uploaded"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid capability"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Box not found"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Box is not writable"},"410":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Expired or deleted box"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too large"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Integrity mismatch"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"120 capability requests per minute per client IP"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Storage unavailable"}},"security":[{"BearerCapability":[]}]}}},"servers":[{"url":"https://agtbox.dev"}]}
