{"openapi":"3.1.0","info":{"title":"upres.ai API","version":"1.0.0","description":"Programmatic access to upres.ai image upscaling.\nBusiness-tier API keys are required for all /v1/* endpoints.\n\n**Authentication**: Include your API key in the `Authorization` header:\n```\nAuthorization: Bearer upres_<your-key>\n```\n\nKeys are generated from your account settings at `/app/settings/api`.\nEach key is shown once on creation and cannot be retrieved again.\n","contact":{"email":"support@upres.ai"},"license":{"name":"Proprietary"}},"servers":[{"url":"https://api.upres.ai/v1","description":"Production API"},{"url":"http://localhost:3001/v1","description":"Local development"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key in format: upres_<key>"}},"schemas":{"Job":{"type":"object","required":["id","status","model","scale","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"},"status":{"type":"string","enum":["pending","processing","completed","failed"],"example":"completed"},"model":{"type":"string","example":"wavespeed-ai/real-esrgan"},"scale":{"type":"integer","minimum":2,"maximum":8,"example":4},"result_url":{"type":"string","format":"uri","nullable":true,"description":"Presigned S3 URL to the upscaled image. Valid for 1 hour.","example":"https://cdn.upres.ai/results/abc123.png"},"error":{"type":"string","nullable":true,"description":"Error message if status is 'failed'."},"original_filename":{"type":"string","example":"photo.jpg"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"JobCreateRequest":{"type":"object","description":"Submit a job via URL (JSON). For file upload, use multipart/form-data with an 'image' field.","properties":{"image_url":{"type":"string","format":"uri","description":"Publicly accessible URL of the image to upscale.","example":"https://example.com/photo.jpg"},"model":{"type":"string","description":"Upscaling model to use.","default":"wavespeed-ai/real-esrgan","enum":["wavespeed-ai/real-esrgan","wavespeed-ai/image-upscaler"]},"scale":{"type":"integer","description":"Upscaling factor.","default":4,"minimum":2,"maximum":8}}},"JobListResponse":{"type":"object","required":["data","has_more"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"has_more":{"type":"boolean","description":"Whether there are more results to fetch."},"next_cursor":{"type":"string","nullable":true,"description":"Pass as 'cursor' query param to get next page."}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Invalid or revoked API key."}}}}},"paths":{"/jobs":{"post":{"operationId":"createJob","summary":"Create an upscale job","description":"Submit an image for upscaling. Accepts either:\n- **JSON** body with `image_url` (publicly accessible URL)\n- **multipart/form-data** with an `image` file field\n\nOne credit is deducted from your monthly quota.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreateRequest"},"example":{"image_url":"https://example.com/photo.jpg","model":"wavespeed-ai/real-esrgan","scale":4}},"multipart/form-data":{"schema":{"type":"object","required":["image"],"properties":{"image":{"type":"string","format":"binary","description":"Image file to upscale (JPEG, PNG, WebP, TIFF)"},"model":{"type":"string","default":"wavespeed-ai/real-esrgan"},"scale":{"type":"integer","default":4}}}}}},"responses":{"201":{"description":"Job created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","example":"pending"},"model":{"type":"string"},"scale":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}}}}},"400":{"description":"Bad request (missing image).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid or missing API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Monthly quota exceeded.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"quota":{"type":"integer"},"used":{"type":"integer"}}}]}}}},"429":{"description":"Rate limit exceeded (60 req/min per key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listJobs","summary":"List jobs","description":"Returns a paginated list of your upscaling jobs, newest first.","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["pending","processing","completed","failed"]},"description":"Filter by job status."},{"name":"model","in":"query","schema":{"type":"string"},"description":"Filter by model name."},{"name":"before","in":"query","schema":{"type":"string","format":"date-time"},"description":"Return jobs created before this timestamp (ISO 8601)."},{"name":"after","in":"query","schema":{"type":"string","format":"date-time"},"description":"Return jobs created after this timestamp (ISO 8601)."},{"name":"limit","in":"query","schema":{"type":"integer","default":20,"minimum":1,"maximum":100},"description":"Number of jobs to return."},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Pagination cursor from next_cursor of previous response."}],"responses":{"200":{"description":"List of jobs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobListResponse"}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/jobs/{id}":{"get":{"operationId":"getJob","summary":"Get a job","description":"Retrieve status, progress, and result URL for a single job.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Job ID returned by POST /v1/jobs."}],"responses":{"200":{"description":"Job details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Job not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}