{"openapi":"3.1.0","info":{"title":"TIG Agent API","version":"1.1.0","description":"Run Transparent Image Generator (TIG) tools over JSON. Free utilities are instant and keyless; AI tools return a job_id to poll."},"servers":[{"url":"https://gifupscaler.com/functions"}],"components":{"schemas":{"Envelope":{"type":"object","required":["success","data","error","credits","timing_ms"],"properties":{"success":{"type":"boolean"},"data":{"type":["object","null"]},"error":{"type":["object","null"],"properties":{"code":{"type":"string","enum":["INVALID_PARAMS","AUTH_REQUIRED","INSUFFICIENT_CREDITS","TOOL_NOT_FOUND","JOB_NOT_FOUND","TOO_LARGE","UNSUPPORTED_FORMAT","RATE_LIMITED","PROCESSING_FAILED","BROWSER_ONLY"]},"message":{"type":"string"},"docs_url":{"type":"string"}}},"credits":{"type":"object","properties":{"charged":{"type":"number"},"remaining":{"type":["number","null"]}}},"timing_ms":{"type":"number"}}},"tool_gif_fixer":{"type":"object","description":"GIF Fixer — browser-only (returns BROWSER_ONLY with action_url)","required":["tool"],"properties":{"tool":{"type":"string","const":"gif-fixer"},"source_url":{"type":"string","format":"uri","description":"Public http(s) URL of the input file (max 15 MB)"}},"x-tig-capabilities":["repair","clean"],"x-tig-credit-cost":0,"x-tig-output-formats":["gif"]},"tool_gif_interpolator":{"type":"object","description":"GIF Interpolator — browser-only (returns BROWSER_ONLY with action_url)","required":["tool"],"properties":{"tool":{"type":"string","const":"gif-interpolator"},"source_url":{"type":"string","format":"uri","description":"Public http(s) URL of the input file (max 15 MB)"}},"x-tig-capabilities":["animate"],"x-tig-credit-cost":1,"x-tig-output-formats":["gif"]},"tool_gif_motion_optimizer":{"type":"object","description":"GIF Motion Optimizer — browser-only (returns BROWSER_ONLY with action_url)","required":["tool"],"properties":{"tool":{"type":"string","const":"gif-motion-optimizer"},"source_url":{"type":"string","format":"uri","description":"Public http(s) URL of the input file (max 15 MB)"}},"x-tig-capabilities":["repair"],"x-tig-credit-cost":null,"x-tig-output-formats":["gif"]},"tool_gif_upscaler":{"type":"object","description":"GIF Upscaler — browser-only (returns BROWSER_ONLY with action_url)","required":["tool"],"properties":{"tool":{"type":"string","const":"gif-upscaler"},"source_url":{"type":"string","format":"uri","description":"Public http(s) URL of the input file (max 15 MB)"}},"x-tig-capabilities":["upscale"],"x-tig-credit-cost":6,"x-tig-output-formats":["gif"]},"tool_nano_interpolator":{"type":"object","description":"Nano Interpolator — browser-only (returns BROWSER_ONLY with action_url)","required":["tool"],"properties":{"tool":{"type":"string","const":"nano-interpolator"},"source_url":{"type":"string","format":"uri","description":"Public http(s) URL of the input file (max 15 MB)"}},"x-tig-capabilities":["animate"],"x-tig-credit-cost":null,"x-tig-output-formats":["gif"]}},"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"X-Api-Key"},"Session":{"type":"http","scheme":"bearer"}}},"paths":{"/agentApi":{"post":{"operationId":"runTool","summary":"Run a tool","description":"Send the tool slug as ?tool=<slug> or as \"tool\" in the body. Sync tools return output URLs; job tools return 202 with data.job_id.","parameters":[{"name":"tool","in":"query","required":false,"schema":{"type":"string","enum":["gif-fixer","gif-interpolator","gif-motion-optimizer","gif-upscaler","nano-interpolator"]}}],"security":[{},{"ApiKey":[]},{"Session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/tool_gif_fixer"},{"$ref":"#/components/schemas/tool_gif_interpolator"},{"$ref":"#/components/schemas/tool_gif_motion_optimizer"},{"$ref":"#/components/schemas/tool_gif_upscaler"},{"$ref":"#/components/schemas/tool_nano_interpolator"}],"discriminator":{"propertyName":"tool","mapping":{"gif-fixer":"#/components/schemas/tool_gif_fixer","gif-interpolator":"#/components/schemas/tool_gif_interpolator","gif-motion-optimizer":"#/components/schemas/tool_gif_motion_optimizer","gif-upscaler":"#/components/schemas/tool_gif_upscaler","nano-interpolator":"#/components/schemas/tool_nano_interpolator"}}}}}},"responses":{"200":{"description":"Completed (sync tools)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"202":{"description":"Job queued (AI tools) — poll GET /agentApi?job=<id>","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"INVALID_PARAMS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"AUTH_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"402":{"description":"INSUFFICIENT_CREDITS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"404":{"description":"TOOL_NOT_FOUND / JOB_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"413":{"description":"TOO_LARGE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"415":{"description":"UNSUPPORTED_FORMAT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"description":"RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"500":{"description":"PROCESSING_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"501":{"description":"BROWSER_ONLY","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}}},"get":{"operationId":"getJobOrFile","summary":"Poll a job (?job=<id>) or fetch a discovery file (?file=…)","parameters":[{"name":"job","in":"query","required":false,"schema":{"type":"string"},"description":"Job id → data: { job_id, status, progress_pct, result }"},{"name":"file","in":"query","required":false,"schema":{"type":"string","enum":["llms.txt","llms-full.txt","tools.json","openapi.json"]}}],"security":[{"ApiKey":[]},{"Session":[]},{}],"responses":{"200":{"description":"Job status envelope or discovery file","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"404":{"description":"JOB_NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}}}}}}}