{"openapi":"3.1.0","info":{"title":"imgd.dev","version":"0.1.0","description":"Image hosting your agent can sign up for. No email, no captcha, no dashboard. $1 buys 1 GB of storage, one-time and stacking. Uploads are content-addressed by sha256 and idempotent. Every 4xx carries a 'fix' field in plain language.","contact":{"email":"abuse@imgd.dev"}},"servers":[{"url":"https://imgd.dev"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your imgd_ API key."}},"schemas":{"Error":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"fix":{"type":"string","description":"Plain-language instruction telling the caller what to do next."}}}}},"paths":{"/health":{"get":{"summary":"Liveness probe","security":[],"responses":{"200":{"description":"Service is healthy."}}}},"/llms.txt":{"get":{"summary":"Agent-oriented quickstart","security":[],"responses":{"200":{"description":"Plain text guide."}}}},"/v1/accounts":{"post":{"summary":"Create an account","description":"No email, no captcha. Returns the API key exactly once plus a Stripe activation link.","security":[],"responses":{"201":{"description":"Account created.","content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string"},"api_key":{"type":"string","description":"Shown once; never recoverable."},"status":{"type":"string","enum":["unpaid"]},"activation_url":{"type":"string","nullable":true},"storage_quota_bytes":{"type":"integer","description":"Zero until a payment grants storage."}}}}}}}}},"/v1/me":{"get":{"summary":"Quota, usage, remaining storage and strikes","description":"Returns storage_bytes, storage_quota_bytes and storage_remaining_bytes so a caller can decide whether a file will fit before uploading it.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Account state.","content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string"},"status":{"type":"string","enum":["unpaid","active","suspended"],"description":"'unpaid' accounts have zero quota and cannot upload."},"storage_bytes":{"type":"integer"},"storage_quota_bytes":{"type":"integer"},"storage_remaining_bytes":{"type":"integer"},"storage_used_pct":{"type":"number"},"topup_url":{"type":"string"}}}}}},"401":{"description":"Missing or invalid key.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"fix":{"type":"string","description":"Plain-language instruction telling the caller what to do next."}}}}}}}}},"/v1/credit":{"post":{"summary":"Buy storage ($1 = 1 GB, stacking)","description":"Returns a Stripe Checkout URL as JSON. Works for already-active accounts, so a paying caller can top up at any time. Purchases stack and never expire.","security":[{"bearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"gb":{"type":"integer","minimum":1,"maximum":100,"default":1,"description":"Gigabytes to buy, priced at $1 each."}}}}}},"responses":{"200":{"description":"Checkout session created.","content":{"application/json":{"schema":{"type":"object","properties":{"checkout_url":{"type":"string"},"gb":{"type":"integer"},"price_usd":{"type":"string"},"grants_bytes":{"type":"integer"}}}}}},"400":{"description":"'gb' outside the accepted range.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"fix":{"type":"string","description":"Plain-language instruction telling the caller what to do next."}}}}}},"401":{"description":"Missing or invalid key.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"fix":{"type":"string","description":"Plain-language instruction telling the caller what to do next."}}}}}}}}},"/v1/upload":{"post":{"summary":"Upload an image","description":"Multipart (field 'file') or raw bytes with an image/* Content-Type. Returns 202 while moderation runs, or 200 when identical bytes already exist.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]}},"image/*":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"Deduplicated; identical bytes already stored."},"202":{"description":"Accepted; moderation pending."},"402":{"description":"Payment required: the account has no storage yet, or this upload exceeds the quota. The body carries topup_url and a checkout URL so the caller can buy space and retry unaided.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"fix":{"type":"string","description":"Plain-language instruction telling the caller what to do next."}}}}}},"403":{"description":"Account suspended, or this content was already blocked.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"fix":{"type":"string","description":"Plain-language instruction telling the caller what to do next."}}}}}},"413":{"description":"File too large.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"fix":{"type":"string","description":"Plain-language instruction telling the caller what to do next."}}}}}},"415":{"description":"Unsupported media type.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"fix":{"type":"string","description":"Plain-language instruction telling the caller what to do next."}}}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"fix":{"type":"string","description":"Plain-language instruction telling the caller what to do next."}}}}}}}}},"/v1/images":{"get":{"summary":"List your images","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":25,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Paginated image list."}}}},"/v1/images/{hash}":{"get":{"summary":"Image metadata including alt_text","security":[{"bearerAuth":[]}],"parameters":[{"name":"hash","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Metadata."},"404":{"description":"Not linked to your account.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"fix":{"type":"string","description":"Plain-language instruction telling the caller what to do next."}}}}}}}},"delete":{"summary":"Unlink an image from your account","security":[{"bearerAuth":[]}],"parameters":[{"name":"hash","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted."},"404":{"description":"Not found.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"fix":{"type":"string","description":"Plain-language instruction telling the caller what to do next."}}}}}}}}},"/i/{hash}":{"get":{"summary":"Serve an image","description":"Immutable cache headers. Optional transforms via ?w= and ?fmt=.","security":[],"parameters":[{"name":"hash","in":"path","required":true,"schema":{"type":"string"}},{"name":"w","in":"query","schema":{"type":"integer","maximum":4096}},{"name":"fmt","in":"query","schema":{"type":"string","enum":["webp","avif","jpeg","png"]}}],"responses":{"200":{"description":"Image bytes."},"404":{"description":"Unknown or unavailable.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"fix":{"type":"string","description":"Plain-language instruction telling the caller what to do next."}}}}}},"409":{"description":"Still clearing moderation; retry shortly.","content":{"application/json":{"schema":{"type":"object","required":["error","fix"],"properties":{"error":{"type":"string","description":"Stable machine-readable error code."},"fix":{"type":"string","description":"Plain-language instruction telling the caller what to do next."}}}}}}}}}}}