{
  "openapi": "3.1.0",
  "info": {
    "title": "Toolzipp Media Processing API",
    "version": "1.0.0",
    "description": "Process images and videos with simple multipart requests. Authenticate with an API key from your Toolzipp dashboard. Rate limits: 30 requests/minute per key, 60/minute per IP. Last updated 2026-11-19.",
    "contact": {
      "name": "Toolzipp",
      "email": "hello@toolzipp.com",
      "url": "https://www.toolzipp.com/contact"
    },
    "termsOfService": "https://www.toolzipp.com/terms"
  },
  "externalDocs": {
    "description": "API documentation",
    "url": "https://www.toolzipp.com/docs/api"
  },
  "servers": [
    {
      "url": "https://www.toolzipp.com/api/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/images/process": {
      "post": {
        "operationId": "processImage",
        "summary": "Process an image",
        "description": "Resize, compress, or convert one image per request. The request is processed synchronously and the response body is the processed image itself.",
        "externalDocs": {
          "url": "https://www.toolzipp.com/docs/api#process-image"
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "operation"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The image to process (JPEG, PNG, WebP, AVIF, GIF, TIFF, or SVG)."
                  },
                  "operation": {
                    "type": "string",
                    "description": "What to do with the image.",
                    "enum": [
                      "resize",
                      "compress",
                      "convert"
                    ]
                  },
                  "width": {
                    "type": "integer",
                    "description": "Target width in pixels. Required when operation is \"resize\".",
                    "minimum": 1
                  },
                  "quality": {
                    "type": "integer",
                    "description": "JPEG quality for compress.",
                    "default": 80,
                    "minimum": 1,
                    "maximum": 100
                  },
                  "format": {
                    "type": "string",
                    "description": "Output format. Required when operation is \"convert\".",
                    "enum": [
                      "jpeg",
                      "png",
                      "webp",
                      "avif"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The processed image. Content-Type matches the returned format: resize keeps the input format, compress returns JPEG, convert returns the requested format. The X-Toolzipp-Job-Id header identifies the job in your dashboard.",
            "headers": {
              "X-Toolzipp-Job-Id": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "image/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. A required field is missing or invalid — the error message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. The Authorization header is missing, or the API key is invalid or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Processing failed. The file could not be processed, e.g. it is corrupt or not a supported format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit hit (wait for the Retry-After header, in seconds), or the monthly plan quota is used up (wait for the reset on the 1st, or upgrade your plan).",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait (rate limits only)."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable. Temporary server-side problem. Retry with exponential backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/videos/process": {
      "post": {
        "operationId": "processVideo",
        "summary": "Process a video",
        "description": "Trim, resize, compress, or convert a video, or extract a thumbnail frame. Processed synchronously (up to 120 seconds); the response body is the resulting file. Maximum upload size is 200 MB.",
        "externalDocs": {
          "url": "https://www.toolzipp.com/docs/api#process-video"
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "operation"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The video to process, up to 200 MB."
                  },
                  "operation": {
                    "type": "string",
                    "description": "What to do with the video.",
                    "enum": [
                      "trim",
                      "resize",
                      "compress",
                      "convert",
                      "thumbnail"
                    ]
                  },
                  "start": {
                    "type": "number",
                    "description": "Clip start, in seconds. Required when operation is \"trim\".",
                    "minimum": 0
                  },
                  "duration": {
                    "type": "number",
                    "description": "Clip length, in seconds. Required when operation is \"trim\"."
                  },
                  "width": {
                    "type": "integer",
                    "description": "Target width in pixels. Required when operation is \"resize\".",
                    "minimum": 1
                  },
                  "quality": {
                    "type": "integer",
                    "description": "Quality for compress (higher = better quality, larger file).",
                    "default": 70,
                    "minimum": 1,
                    "maximum": 100
                  },
                  "format": {
                    "type": "string",
                    "description": "Output container. Required when operation is \"convert\".",
                    "enum": [
                      "mp4",
                      "webm"
                    ]
                  },
                  "time": {
                    "type": "number",
                    "description": "Timestamp for thumbnail, in seconds.",
                    "default": 0,
                    "minimum": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The processed video — in the same container as the input, except for convert — or a JPEG frame for thumbnail. Content-Type matches the returned file. The X-Toolzipp-Job-Id header identifies the job.",
            "headers": {
              "X-Toolzipp-Job-Id": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "video/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. A required field is missing or invalid — the error message names it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. The Authorization header is missing, or the API key is invalid or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Payload too large. The video exceeds 200 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Processing failed. The file could not be processed, e.g. it is corrupt or not a supported format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit hit (wait for the Retry-After header, in seconds), or the monthly plan quota is used up (wait for the reset on the 1st, or upgrade your plan).",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait (rate limits only)."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable. Temporary server-side problem. Retry with exponential backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Get plan and usage",
        "description": "Returns the plan, this month's usage, plan limits, and when usage resets, for the account that owns the API key. Useful for checking remaining quota before a batch job. A null limit means unlimited.",
        "externalDocs": {
          "url": "https://www.toolzipp.com/docs/api#get-me"
        },
        "responses": {
          "200": {
            "description": "Plan, usage, and limits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. The Authorization header is missing, or the API key is invalid or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Rate limit hit (wait for the Retry-After header, in seconds), or the monthly plan quota is used up (wait for the reset on the 1st, or upgrade your plan).",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait (rate limits only)."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable. Temporary server-side problem. Retry with exponential backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key (starts with tz_live_) from https://www.toolzipp.com/dashboard/api"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "Me": {
        "type": "object",
        "properties": {
          "plan": {
            "type": "string",
            "enum": [
              "Free",
              "Pro",
              "Enterprise"
            ]
          },
          "period": {
            "type": "string",
            "description": "Current usage period, YYYY-MM (UTC).",
            "examples": [
              "2026-11"
            ]
          },
          "resetsAt": {
            "type": "string",
            "format": "date-time",
            "description": "When monthly usage resets (1st of next month, 00:00 UTC)."
          },
          "usage": {
            "type": "object",
            "description": "Operations this month; storage is the current total.",
            "properties": {
              "storageUsed": {
                "type": "number",
                "description": "GB"
              },
              "imagesProcessed": {
                "type": "integer"
              },
              "videosProcessed": {
                "type": "integer"
              }
            }
          },
          "limits": {
            "type": "object",
            "description": "null means unlimited.",
            "properties": {
              "storage": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "GB"
              },
              "images": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "videos": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          }
        }
      }
    }
  }
}