{"openapi":"3.1.0","info":{"title":"gimgs API","version":"1.0.0","summary":"AI image tools of gimgs.net (remove background, upscale) over HTTP","description":"Create an API key at https://gimgs.net/profile#api and send it as `Authorization: Bearer gk_…`. Pricing (Point per image, from the account's balance): remove-bg 0.1, upscale 2x 0.1, upscale 4x 0.15 (the Photosoft editor's free daily quota does not apply to the API). Full guide: https://gimgs.net/developers","termsOfService":"https://gimgs.net/terms"},"servers":[{"url":"https://gimgs.net/api/v1"}],"security":[{"bearerAuth":[]},{"apiKeyHeader":[]}],"tags":[{"name":"Account"},{"name":"Images"},{"name":"Jobs"},{"name":"Public"}],"paths":{"/me":{"get":{"tags":["Account"],"summary":"Account, Point balance and price per image","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/remove-bg":{"post":{"tags":["Images"],"summary":"Remove the background (transparent PNG)","requestBody":{"required":true,"description":"The image: JPG, PNG or WebP, up to 20 MB. Send it as a multipart file, a JSON `image_url` / `image_base64`, or as the raw request body with an `image/*` Content-Type.","content":{"multipart/form-data":{"schema":{"type":"object","required":["image"],"properties":{"image":{"type":"string","format":"binary"},"wait":{"$ref":"#/components/schemas/Wait"}}}},"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","format":"uri","description":"Absolute http(s) URL the server downloads (15 s timeout)"},"image_base64":{"type":"string","description":"Base64 (data URL accepted)"},"wait":{"$ref":"#/components/schemas/Wait"}}}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"parameters":[{"$ref":"#/components/parameters/WaitQuery"}],"responses":{"200":{"description":"Job finished (only when `wait` was given, or the job failed immediately)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobWithBilling"}}}},"202":{"description":"Job accepted and queued — poll `GET /jobs/{id}`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobWithBilling"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"Not enough Point for this image","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Image larger than 20 MB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unsupported / missing image, bad `scale`, 4× image over 4096 px","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many jobs running for this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Could not queue the job (nothing charged)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Billing or account service busy — retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/upscale":{"post":{"tags":["Images"],"summary":"Upscale 2× or 4×","requestBody":{"required":true,"description":"The image: JPG, PNG or WebP, up to 20 MB. Send it as a multipart file, a JSON `image_url` / `image_base64`, or as the raw request body with an `image/*` Content-Type. 4× requires the longest side ≤ 4096 px.","content":{"multipart/form-data":{"schema":{"type":"object","required":["image"],"properties":{"image":{"type":"string","format":"binary"},"wait":{"$ref":"#/components/schemas/Wait"},"scale":{"type":"integer","enum":[2,4],"default":2}}}},"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","format":"uri","description":"Absolute http(s) URL the server downloads (15 s timeout)"},"image_base64":{"type":"string","description":"Base64 (data URL accepted)"},"wait":{"$ref":"#/components/schemas/Wait"},"scale":{"type":"integer","enum":[2,4],"default":2}}}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"parameters":[{"$ref":"#/components/parameters/WaitQuery"},{"name":"scale","in":"query","schema":{"type":"integer","enum":[2,4]}}],"responses":{"200":{"description":"Job finished (only when `wait` was given, or the job failed immediately)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobWithBilling"}}}},"202":{"description":"Job accepted and queued — poll `GET /jobs/{id}`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobWithBilling"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"Not enough Point for this image","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Image larger than 20 MB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Unsupported / missing image, bad `scale`, 4× image over 4096 px","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many jobs running for this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Could not queue the job (nothing charged)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Billing or account service busy — retry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{id}":{"get":{"tags":["Jobs"],"summary":"Job status","parameters":[{"$ref":"#/components/parameters/JobId"},{"$ref":"#/components/parameters/WaitQuery"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Unknown job or not yours","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{id}/result":{"get":{"tags":["Jobs"],"summary":"Result image","parameters":[{"$ref":"#/components/parameters/JobId"},{"name":"download","in":"query","schema":{"type":"boolean"},"description":"1 → Content-Disposition: attachment"}],"responses":{"200":{"description":"The image","content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Unknown job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Job not finished yet (`job_not_ready`) or failed (`job_failed`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tasks":{"get":{"tags":["Public"],"summary":"Pricing and limits","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/openapi.json":{"get":{"tags":["Public"],"summary":"This document","security":[],"responses":{"200":{"description":"OK"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key from /profile#api (starts with gk_)"},"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-Api-Key"}},"parameters":{"JobId":{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"WaitQuery":{"name":"wait","in":"query","schema":{"$ref":"#/components/schemas/Wait"},"description":"Keep the connection open up to N seconds until the job finishes (long-poll)"}},"responses":{"Unauthorized":{"description":"Missing or invalid API key","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Wait":{"type":"integer","minimum":0,"maximum":60,"description":"Seconds to wait for completion before responding (0 = return immediately with status queued)"},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"required":{"type":"number"},"balance":{"type":"number"},"retryable":{"type":"boolean"}}}}},"Me":{"type":"object","properties":{"uname":{"type":"string"},"is_vip":{"type":"boolean"},"balance":{"type":"number","description":"Point"},"currency":{"type":"string","const":"Point"},"cost_per_image":{"type":"number","description":"lowest per-image price"},"cost_per_task":{"type":"object","additionalProperties":{"type":"number"},"description":"Point per image for each task id"},"images_affordable":{"type":"integer","description":"floor(balance / cost_per_image)"}}},"Job":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"task":{"type":"string","enum":["remove-bg","upscale-2x","upscale-4x"]},"status":{"type":"string","enum":["queued","processing","completed","failed"]},"progress":{"type":"integer","minimum":0,"maximum":100},"message":{"type":"string","description":"Human readable progress / error message from the worker"},"result_url":{"type":["string","null"],"format":"uri","description":"Public URL of the result image (CORS *). null until completed"},"download_url":{"type":["string","null"],"format":"uri","description":"Same image served by the API (needs the API key); add ?download=1 for Content-Disposition: attachment"},"cost":{"type":"number","description":"Point charged for this job"},"refunded":{"type":"boolean","description":"true when a failed job's Point was given back"},"created_at":{"type":["string","null"],"description":"YYYY-MM-DD HH:MM:SS, Asia/Ho_Chi_Minh"},"updated_at":{"type":["string","null"]}}},"JobWithBilling":{"allOf":[{"$ref":"#/components/schemas/Job"},{"type":"object","properties":{"billing":{"type":"object","properties":{"cost":{"type":"number"},"balance":{"type":"number","description":"Balance after this charge"},"currency":{"type":"string"}}}}}]}}}}