{
  "swagger": "2.0",
  "host": "api.removal.ai",
  "basePath": "/",
  "tags": [
    {
      "name": "Background removal",
      "description": "Remove background via API call."
    },
    {
      "name": "Fetching account information",
      "description": "Check account information."
    },
    {
      "name": "User",
      "description": "Operations about user and API Key."
    }
  ],
  "paths": {
    "/3.0/remove": {
      "post": {
        "tags": [
          "Background removal"
        ],
        "summary": "Remove background of an image",
        "description": "Removes background of an image. Supports JPG/PNG files.\n- File size: up to 12 MB\n - Image source: File upload in form of binary stream or base64 or URL reference.\n - Image content: Photo with clear distinction between foreground and background.\n - Output resolutions available: Preview (up to 0.25 megapixels), Full resolution (up to 25 megapixels).",
        "consumes": [
          "multipart/form-data"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "header",
            "type": "string",
            "name": "Rm-Token",
            "description": "Your secret API Key.",
            "required": true
          },
          {
            "in": "formData",
            "name": "image_file",
            "type": "file",
            "description": "Your image file in form-data, can be PNG/JPEG in form of binary stream. When passing image to via parameter, the Image_url parameter will be neglected."
          },
          {
            "in": "formData",
            "name": "image_url",
            "type": "string",
            "description": "URL reference to your image. This parameter also support base64 format. Blank the image_file parameter before use."
          },
          {
            "in": "formData",
            "name": "crop",
            "type": "integer",
            "description": "Automatically crop off surrounding empty regions (0 by default). Note that cropping has no effect on the amount of charged credits.",
            "enum": [
              0,
              1
            ]
          },
          {
            "in": "formData",
            "name": "ecom",
            "type": "integer",
            "description": "Getting the smoothest edge for the foreground (0 bydefault). Best suitable for ecommerce product images. Use this parameter with caution of failing fur edges.",
            "enum": [
              0,
              1
            ]
          },
          {
            "in": "formData",
            "name": "get_base64",
            "type": "integer",
            "description": "Get the result back encoded by base64.",
            "enum": [
              0,
              1
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Image background removed successfully."
          },
          "401": {
            "description": "Unauthorized API Key. This error code will be spawned in case your input API Key is wrong."
          },
          "1001": {
            "description": "Cannot get image from URL. This error code will be spawned in case your input on param Image_file is an URL reference and our API cannot get the image from that URL."
          },
          "1002": {
            "description": "File corrupted. This error code will be spawned in case your input image is corrupted."
          },
          "1003": {
            "description": "Invalid base-64. This error code will be spawned in case our server cannot decode your encoded base64 input image."
          },
          "400 & 500": {
            "description": "Undefined error. In this case, please feel free to [contact us](https://removal.ai/contact/). We will be more than happy to support you."
          }
        }
      }
    },
    "/2.0/account": {
      "get": {
        "tags": [
          "Fetching account information"
        ],
        "summary": "Get general information about your account.",
        "description": "This section decribes how you can get as well as change general information regarding your account.",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "header",
            "type": "string",
            "name": "Rm-Token",
            "description": "Your secret API Key.",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Succesfully retrieved account data."
          },
          "401": {
            "description": "Unauthorized API Key. This error code will be spawned in case your input API Key is wrong."
          },
          "400 & 500": {
            "description": "Undefined error. In this case, please feel free to [contact us](https://removal.ai/contact/). We will be more than happy to support you."
          }
        }
      }
    },
    "/2.0/account/refesh-token/": {
      "put": {
        "tags": [
          "User"
        ],
        "summary": "Generate new secret API Key.",
        "description": "This section decribes how you can generate a new API Key. This is strong advised when you accidently published your API Key.",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "header",
            "type": "string",
            "name": "Rm-Token",
            "description": "Your secret API Key.",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Succesfully renew API Key."
          },
          "401": {
            "description": "Unauthorized API Key. This error code will be spawned in case your input API Key is wrong."
          },
          "400 & 500": {
            "description": "Undefined error. In this case, please feel free to [contact us](https://removal.ai/contact/). We will be more than happy to support you."
          }
        }
      }
    }
  },
  "externalDocs": {
    "description": "Find out more about Removal.AI",
    "url": "https://removal.ai/about-us/"
  }
}