{
  "openapi": "3.0.3",
  "info": {
    "title": "recraft.ai external api",
    "version": "0.0.1",
    "description": "Generated by the Recraft docs from https://external.api.recraft.ai/doc/spec/external-api.yaml and extended with what the docs document (JSON request bodies, V4.1 Flash, style_reference_urls, prompt enhancement, error responses). Human-readable docs: https://www.recraft.ai/docs/api-reference/introduction"
  },
  "servers": [
    {
      "description": "Production",
      "url": "https://external.api.recraft.ai"
    }
  ],
  "security": [
    {
      "auth0": []
    }
  ],
  "paths": {
    "/v1/images/creativeUpscale": {
      "post": {
        "operationId": "CreativeUpscale",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ProcessImageRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image_url": {
                        "type": "string",
                        "description": "URL or data URL of the input image. JSON counterpart of the `image` file."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ProcessImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Creative Upscale",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/images/crispUpscale": {
      "post": {
        "operationId": "CrispUpscale",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ProcessImageRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image_url": {
                        "type": "string",
                        "description": "URL or data URL of the input image. JSON counterpart of the `image` file."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ProcessImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Crisp Upscale",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/images/eraseRegion": {
      "post": {
        "operationId": "EraseRegion",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EraseRegionRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image_url": {
                        "type": "string",
                        "description": "URL or data URL of the input image. JSON counterpart of the `image` file."
                      },
                      "mask_url": {
                        "type": "string",
                        "description": "URL or data URL of the mask image. JSON counterpart of the `mask` file."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/EraseRegionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Erase Region",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/images/generateBackground": {
      "post": {
        "operationId": "GenerateBackground",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/TransformImageRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image_url": {
                        "type": "string",
                        "description": "URL or data URL of the input image. JSON counterpart of the `image` file."
                      },
                      "mask_url": {
                        "type": "string",
                        "description": "URL or data URL of the mask image. JSON counterpart of the `mask` file."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/TransformImageWithMaskRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Generate Background",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/images/generations": {
      "post": {
        "operationId": "GenerateImage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/GenerateImageRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "style_reference_urls": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "URLs or data URLs of 1 to 10 style reference images. JSON counterpart of `style_references`."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/GenerateImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Generate image from prompt",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/images/generations/raster": {
      "post": {
        "operationId": "GenerateImageRaster",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/GenerateImageRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "style_reference_urls": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "URLs or data URLs of 1 to 10 style reference images. JSON counterpart of `style_references`."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/GenerateImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Generate raster image from prompt",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/images/generations/vector": {
      "post": {
        "operationId": "GenerateImageVector",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/GenerateImageRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "style_reference_urls": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "URLs or data URLs of 1 to 10 style reference images. JSON counterpart of `style_references`."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/GenerateImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Generate vector image from prompt",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/images/imageToImage": {
      "post": {
        "operationId": "ImageToImage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/TransformImageRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image_url": {
                        "type": "string",
                        "description": "URL or data URL of the input image. JSON counterpart of the `image` file."
                      },
                      "strength": {
                        "type": "number"
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ImageToImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Generate image from image and prompt",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/images/inpaint": {
      "post": {
        "operationId": "InpaintImage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/TransformImageRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image_url": {
                        "type": "string",
                        "description": "URL or data URL of the input image. JSON counterpart of the `image` file."
                      },
                      "mask_url": {
                        "type": "string",
                        "description": "URL or data URL of the mask image. JSON counterpart of the `mask` file."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/TransformImageWithMaskRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Inpaint Image",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/images/outpaint": {
      "post": {
        "operationId": "OutpaintImage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/TransformImageRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "expand_bottom": {
                        "format": "uint32",
                        "type": "integer"
                      },
                      "expand_left": {
                        "format": "uint32",
                        "type": "integer"
                      },
                      "expand_right": {
                        "format": "uint32",
                        "type": "integer"
                      },
                      "expand_top": {
                        "format": "uint32",
                        "type": "integer"
                      },
                      "size": {
                        "$ref": "#/components/schemas/ImageSize"
                      },
                      "zoom_out_percentage": {
                        "type": "number"
                      },
                      "image_url": {
                        "type": "string",
                        "description": "URL or data URL of the input image. JSON counterpart of the `image` file."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/OutpaintImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Outpaint Image",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/images/refineDetails": {
      "post": {
        "operationId": "RefineDetails",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/RefineDetailsRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image_url": {
                        "type": "string",
                        "description": "URL or data URL of the input image. JSON counterpart of the `image` file."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/RefineDetailsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Refine Details",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/images/removeBackground": {
      "post": {
        "operationId": "RemoveBackground",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ProcessImageRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image_url": {
                        "type": "string",
                        "description": "URL or data URL of the input image. JSON counterpart of the `image` file."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ProcessImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Remove background",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/images/replaceBackground": {
      "post": {
        "operationId": "ReplaceBackground",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/TransformImageRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image_url": {
                        "type": "string",
                        "description": "URL or data URL of the input image. JSON counterpart of the `image` file."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/TransformImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Replace Background",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/images/variateImage": {
      "post": {
        "operationId": "VariateImage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/VariateImageRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image_url": {
                        "type": "string",
                        "description": "URL or data URL of the input image. JSON counterpart of the `image` file."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/VariateImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Variate Image",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/images/vectorize": {
      "post": {
        "operationId": "VectorizeImage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ProcessImageRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "color_reduction": {
                        "$ref": "#/components/schemas/ColorReduction"
                      },
                      "limit_num_shapes": {
                        "$ref": "#/components/schemas/LimitNumShapes"
                      },
                      "max_num_colors": {
                        "format": "uint32",
                        "type": "integer"
                      },
                      "max_num_shapes": {
                        "format": "uint32",
                        "type": "integer"
                      },
                      "return_gradients": {
                        "$ref": "#/components/schemas/ReturnGradients"
                      },
                      "shape_stacking": {
                        "$ref": "#/components/schemas/ShapeStacking"
                      },
                      "small_shape_filter": {
                        "$ref": "#/components/schemas/SmallShapeFilter"
                      },
                      "strict_color_palette": {
                        "items": {
                          "items": {
                            "type": "integer"
                          },
                          "type": "array"
                        },
                        "type": "array"
                      },
                      "svg_compression": {
                        "$ref": "#/components/schemas/SvgCompression"
                      },
                      "image_url": {
                        "type": "string",
                        "description": "URL or data URL of the input image. JSON counterpart of the `image` file."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/VectorizeImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessImageResponse"
                }
              },
              "multipart/form-data": {
                "schema": {
                  "$ref": "#/components/schemas/ProcessImageMultipartResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Vectorize image",
        "tags": [
          "image"
        ]
      }
    },
    "/v1/styles": {
      "get": {
        "operationId": "ListStyles",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListStylesResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "List Styles",
        "tags": [
          "style"
        ]
      },
      "post": {
        "operationId": "CreateStyle",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CreateStyleRequestBase"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "image_urls": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "URLs or data URLs of the reference images. JSON counterpart of the uploaded files."
                      }
                    }
                  }
                ]
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/CreateStyleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateStyleResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Create Style",
        "tags": [
          "style"
        ]
      }
    },
    "/v1/styles/{style_id}": {
      "delete": {
        "operationId": "DeleteStyle",
        "parameters": [
          {
            "in": "path",
            "name": "style_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Delete Style",
        "tags": [
          "style"
        ]
      },
      "get": {
        "operationId": "GetStyle",
        "parameters": [
          {
            "in": "path",
            "name": "style_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Style"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Get Style",
        "tags": [
          "style"
        ]
      }
    },
    "/v1/styles/basic": {
      "get": {
        "operationId": "ListBasicStyles",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListBasicStylesResponse"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "List Basic Styles",
        "tags": [
          "style"
        ]
      }
    },
    "/v1/users/me": {
      "get": {
        "operationId": "GetCurrentUser",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            },
            "description": "OK"
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Get current user info",
        "tags": [
          "user"
        ]
      }
    },
    "/v1/prompts/enhance": {
      "post": {
        "operationId": "EnhancePrompt",
        "summary": "Expand a short prompt into a detailed one",
        "tags": [
          "prompt"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "prompt"
                ],
                "properties": {
                  "prompt": {
                    "type": "string",
                    "maxLength": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "enhanced_prompt"
                  ],
                  "properties": {
                    "enhanced_prompt": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/Error"
          },
          "5XX": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BasicStyle": {
        "properties": {
          "model": {
            "$ref": "#/components/schemas/TransformModel"
          },
          "style": {
            "type": "string"
          },
          "style_id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "style_id",
          "style",
          "model"
        ],
        "type": "object"
      },
      "ColorReduction": {
        "enum": [
          "on",
          "off"
        ],
        "type": "string"
      },
      "CreateStyleRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CreateStyleRequestBase"
          },
          {
            "properties": {
              "images": {
                "items": {
                  "format": "binary",
                  "type": "string"
                },
                "type": "array"
              }
            },
            "required": [
              "images"
            ],
            "type": "object"
          }
        ]
      },
      "CreateStyleRequestBase": {
        "properties": {
          "image_weights": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "match": {
            "$ref": "#/components/schemas/StyleMatch"
          },
          "mix_policy": {
            "$ref": "#/components/schemas/MixPolicy"
          },
          "model": {
            "$ref": "#/components/schemas/TransformModel"
          },
          "palette": {
            "$ref": "#/components/schemas/PaletteSuggest"
          },
          "private": {
            "type": "boolean"
          },
          "prompt": {
            "type": "string"
          },
          "source_style_weights": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "source_styles": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "style": {
            "$ref": "#/components/schemas/ImageStyle"
          }
        },
        "type": "object"
      },
      "CreateStyleResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Style"
          },
          {
            "properties": {
              "credits": {
                "type": "integer"
              }
            },
            "required": [
              "credits"
            ],
            "type": "object"
          }
        ]
      },
      "EraseRegionRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/EraseRegionRequestBase"
          },
          {
            "properties": {
              "image": {
                "format": "binary",
                "type": "string"
              },
              "mask": {
                "format": "binary",
                "type": "string"
              }
            },
            "type": "object"
          }
        ]
      },
      "EraseRegionRequestBase": {
        "properties": {
          "image_format": {
            "$ref": "#/components/schemas/ImageFormat"
          },
          "response_format": {
            "$ref": "#/components/schemas/ResponseFormat"
          },
          "zdr": {
            "description": "Zero data retention: the prompt and the input and output image bytes are neither stored nor logged; only an output requested as a URL is uploaded so it can be served.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "GenerateImageMultipartResponse": {
        "additionalProperties": {
          "format": "binary",
          "type": "string"
        },
        "properties": {
          "response": {
            "$ref": "#/components/schemas/GenerateImageResponse"
          }
        },
        "required": [
          "response"
        ],
        "type": "object"
      },
      "GenerateImageRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GenerateImageRequestBase"
          },
          {
            "properties": {
              "style_references": {
                "description": "Style reference images. When provided, a style is created from these images and applied to the generation.",
                "items": {
                  "format": "binary",
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        ]
      },
      "GenerateImageRequestBase": {
        "properties": {
          "controls": {
            "$ref": "#/components/schemas/UserControls"
          },
          "image_format": {
            "$ref": "#/components/schemas/ImageFormat"
          },
          "model": {
            "$ref": "#/components/schemas/TransformModel"
          },
          "n": {
            "type": "integer"
          },
          "negative_prompt": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "random_seed": {
            "format": "uint32",
            "type": "integer"
          },
          "response_format": {
            "$ref": "#/components/schemas/ResponseFormat"
          },
          "size": {
            "$ref": "#/components/schemas/ImageSize"
          },
          "style": {
            "type": "string"
          },
          "style_id": {
            "format": "uuid",
            "type": "string"
          },
          "style_match": {
            "$ref": "#/components/schemas/StyleMatch"
          },
          "text_layout": {
            "$ref": "#/components/schemas/TextLayout"
          },
          "upscale": {
            "$ref": "#/components/schemas/UpscaleMode"
          },
          "zdr": {
            "description": "Zero data retention: the prompt and the input and output image bytes are neither stored nor logged; only an output requested as a URL is uploaded so it can be served.",
            "type": "boolean"
          }
        },
        "required": [
          "prompt"
        ],
        "type": "object"
      },
      "GenerateImageResponse": {
        "properties": {
          "created": {
            "type": "integer"
          },
          "credits": {
            "type": "integer"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/Image"
            },
            "type": "array"
          },
          "style_id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "created",
          "data",
          "credits"
        ],
        "type": "object"
      },
      "Image": {
        "properties": {
          "b64_json": {
            "type": "string"
          },
          "image_id": {
            "format": "uuid",
            "type": "string"
          },
          "revised_prompt": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "image_id"
        ],
        "type": "object"
      },
      "ImageColor": {
        "properties": {
          "rgb": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "std": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "weight": {
            "type": "number"
          }
        },
        "type": "object"
      },
      "ImageFormat": {
        "enum": [
          "webp",
          "png"
        ],
        "type": "string"
      },
      "ImageSize": {
        "enum": [
          "1024x1024",
          "1365x1024",
          "1024x1365",
          "1536x1024",
          "1024x1536",
          "1820x1024",
          "1024x1820",
          "1024x2048",
          "2048x1024",
          "1434x1024",
          "1024x1434",
          "1024x1280",
          "1280x1024",
          "1024x1707",
          "1707x1024",
          "1216x896",
          "896x1216",
          "1280x832",
          "832x1280",
          "1152x896",
          "896x1152",
          "1280x896",
          "896x1280",
          "832x1344",
          "768x1344",
          "1344x768",
          "768x1536",
          "1536x768",
          "2048x2048",
          "2432x1792",
          "1792x2432",
          "2560x1664",
          "1664x2560",
          "2304x1792",
          "1792x2304",
          "2560x1792",
          "1792x2560",
          "1664x2688",
          "1536x2688",
          "2688x1536",
          "1536x3072",
          "3072x1536",
          "1:1",
          "2:1",
          "1:2",
          "3:2",
          "2:3",
          "4:3",
          "3:4",
          "5:4",
          "4:5",
          "6:10",
          "14:10",
          "10:14",
          "16:9",
          "9:16"
        ],
        "type": "string"
      },
      "ImageStyle": {
        "enum": [
          "any",
          "digital_illustration",
          "icon",
          "realistic_image",
          "vector_illustration",
          "logo_raster"
        ],
        "type": "string"
      },
      "ImageToImageRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TransformImageRequest"
          },
          {
            "properties": {
              "strength": {
                "type": "number"
              }
            },
            "required": [
              "strength"
            ],
            "type": "object"
          }
        ]
      },
      "LimitNumShapes": {
        "enum": [
          "on",
          "off"
        ],
        "type": "string"
      },
      "ListBasicStylesResponse": {
        "properties": {
          "styles": {
            "items": {
              "$ref": "#/components/schemas/BasicStyle"
            },
            "type": "array"
          }
        },
        "required": [
          "styles"
        ],
        "type": "object"
      },
      "ListStylesResponse": {
        "properties": {
          "styles": {
            "items": {
              "$ref": "#/components/schemas/Style"
            },
            "type": "array"
          }
        },
        "required": [
          "styles"
        ],
        "type": "object"
      },
      "MixPolicy": {
        "enum": [
          "PaletteMatch",
          "MaxWeight"
        ],
        "type": "string"
      },
      "OutpaintImageRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OutpaintImageRequestBase"
          },
          {
            "properties": {
              "image": {
                "format": "binary",
                "type": "string"
              }
            },
            "type": "object"
          }
        ]
      },
      "OutpaintImageRequestBase": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TransformImageRequestBase"
          },
          {
            "properties": {
              "expand_bottom": {
                "format": "uint32",
                "type": "integer"
              },
              "expand_left": {
                "format": "uint32",
                "type": "integer"
              },
              "expand_right": {
                "format": "uint32",
                "type": "integer"
              },
              "expand_top": {
                "format": "uint32",
                "type": "integer"
              },
              "size": {
                "$ref": "#/components/schemas/ImageSize"
              },
              "zoom_out_percentage": {
                "type": "number"
              }
            },
            "type": "object"
          }
        ]
      },
      "PaletteSuggest": {
        "properties": {
          "background_color": {
            "$ref": "#/components/schemas/ImageColor"
          },
          "colors": {
            "items": {
              "$ref": "#/components/schemas/ImageColor"
            },
            "type": "array"
          }
        },
        "required": [
          "colors"
        ],
        "type": "object"
      },
      "ProcessImageMultipartResponse": {
        "additionalProperties": {
          "format": "binary",
          "type": "string"
        },
        "properties": {
          "response": {
            "$ref": "#/components/schemas/ProcessImageResponse"
          }
        },
        "required": [
          "response"
        ],
        "type": "object"
      },
      "ProcessImageRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProcessImageRequestBase"
          },
          {
            "properties": {
              "image": {
                "format": "binary",
                "type": "string"
              }
            },
            "type": "object"
          }
        ]
      },
      "ProcessImageRequestBase": {
        "properties": {
          "image_format": {
            "$ref": "#/components/schemas/ImageFormat"
          },
          "response_format": {
            "$ref": "#/components/schemas/ResponseFormat"
          },
          "upscale": {
            "$ref": "#/components/schemas/UpscaleMode"
          },
          "zdr": {
            "description": "Zero data retention: the prompt and the input and output image bytes are neither stored nor logged; only an output requested as a URL is uploaded so it can be served.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ProcessImageResponse": {
        "properties": {
          "created": {
            "type": "integer"
          },
          "credits": {
            "type": "integer"
          },
          "image": {
            "$ref": "#/components/schemas/Image"
          }
        },
        "required": [
          "created",
          "image",
          "credits"
        ],
        "type": "object"
      },
      "RefineDetailsMode": {
        "default": "moderate",
        "enum": [
          "subtle",
          "moderate"
        ],
        "type": "string"
      },
      "RefineDetailsRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/RefineDetailsRequestBase"
          },
          {
            "properties": {
              "image": {
                "format": "binary",
                "type": "string"
              }
            },
            "type": "object"
          }
        ]
      },
      "RefineDetailsRequestBase": {
        "properties": {
          "image_format": {
            "$ref": "#/components/schemas/ImageFormat"
          },
          "refinement": {
            "$ref": "#/components/schemas/RefineDetailsMode"
          },
          "response_format": {
            "$ref": "#/components/schemas/ResponseFormat"
          },
          "zdr": {
            "description": "Zero data retention: the prompt and the input and output image bytes are neither stored nor logged; only an output requested as a URL is uploaded so it can be served.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ResponseFormat": {
        "enum": [
          "url",
          "b64_json",
          "multipart"
        ],
        "type": "string"
      },
      "ReturnGradients": {
        "enum": [
          "on",
          "off"
        ],
        "type": "string"
      },
      "ShapeStacking": {
        "enum": [
          "cut_out",
          "hierarchical"
        ],
        "type": "string"
      },
      "SmallShapeFilter": {
        "enum": [
          "on",
          "off"
        ],
        "type": "string"
      },
      "Style": {
        "properties": {
          "creation_time": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "is_private": {
            "type": "boolean"
          },
          "style": {
            "$ref": "#/components/schemas/ImageStyle"
          }
        },
        "required": [
          "id",
          "style",
          "creation_time",
          "is_private"
        ],
        "type": "object"
      },
      "StyleMatch": {
        "enum": [
          "regular",
          "precise",
          "flexible"
        ],
        "type": "string"
      },
      "SvgCompression": {
        "enum": [
          "on",
          "off"
        ],
        "type": "string"
      },
      "TextLayout": {
        "items": {
          "$ref": "#/components/schemas/TextLayoutItem"
        },
        "type": "array"
      },
      "TextLayoutItem": {
        "properties": {
          "bbox": {
            "items": {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            "type": "array"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "text",
          "bbox"
        ],
        "type": "object"
      },
      "TransformImageRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TransformImageRequestBase"
          },
          {
            "properties": {
              "image": {
                "format": "binary",
                "type": "string"
              }
            },
            "type": "object"
          }
        ]
      },
      "TransformImageRequestBase": {
        "properties": {
          "controls": {
            "$ref": "#/components/schemas/UserControls"
          },
          "image_format": {
            "$ref": "#/components/schemas/ImageFormat"
          },
          "model": {
            "$ref": "#/components/schemas/TransformModel"
          },
          "n": {
            "type": "integer"
          },
          "negative_prompt": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "random_seed": {
            "format": "uint32",
            "type": "integer"
          },
          "response_format": {
            "$ref": "#/components/schemas/ResponseFormat"
          },
          "style": {
            "type": "string"
          },
          "style_id": {
            "format": "uuid",
            "type": "string"
          },
          "style_match": {
            "$ref": "#/components/schemas/StyleMatch"
          },
          "text_layout": {
            "$ref": "#/components/schemas/TextLayout"
          },
          "zdr": {
            "description": "Zero data retention: the prompt and the input and output image bytes are neither stored nor logged; only an output requested as a URL is uploaded so it can be served.",
            "type": "boolean"
          }
        },
        "required": [
          "prompt"
        ],
        "type": "object"
      },
      "TransformImageWithMaskRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TransformImageRequestBase"
          },
          {
            "properties": {
              "image": {
                "format": "binary",
                "type": "string"
              },
              "mask": {
                "format": "binary",
                "type": "string"
              }
            },
            "type": "object"
          }
        ]
      },
      "TransformModel": {
        "enum": [
          "recraftv2",
          "recraftv2_raster",
          "recraftv2_vector",
          "recraftv3",
          "recraftv3_raster",
          "recraftv3_vector",
          "recraftv4",
          "recraftv4_raster",
          "recraftv4_vector",
          "recraftv4_pro",
          "recraftv4_pro_raster",
          "recraftv4_pro_vector",
          "recraftv4_1",
          "recraftv4_1_raster",
          "recraftv4_1_vector",
          "recraftv4_1_pro",
          "recraftv4_1_pro_raster",
          "recraftv4_1_pro_vector",
          "recraftv4_1_utility",
          "recraftv4_1_utility_raster",
          "recraftv4_1_utility_vector",
          "recraftv4_1_utility_pro",
          "recraftv4_1_utility_pro_raster",
          "recraftv4_1_utility_pro_vector",
          "recraftv4_styles",
          "recraftv4_styles_raster",
          "recraftv4_styles_vector",
          "recraftv4_styles_pro",
          "recraftv4_styles_pro_raster",
          "recraftv4_styles_pro_vector",
          "recraftv4_1_flash",
          "recraftv4_1_flash_raster"
        ],
        "type": "string"
      },
      "UpscaleMode": {
        "enum": [
          "upscale4mp",
          "upscale16mp"
        ],
        "type": "string"
      },
      "User": {
        "properties": {
          "credits": {
            "type": "integer"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "credits"
        ],
        "type": "object"
      },
      "UserControls": {
        "properties": {
          "artistic_level": {
            "type": "integer"
          },
          "background_color": {
            "$ref": "#/components/schemas/ImageColor"
          },
          "colors": {
            "items": {
              "$ref": "#/components/schemas/ImageColor"
            },
            "type": "array"
          },
          "no_text": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "VariateImageRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/VariateImageRequestBase"
          },
          {
            "properties": {
              "image": {
                "format": "binary",
                "type": "string"
              }
            },
            "type": "object"
          }
        ]
      },
      "VariateImageRequestBase": {
        "properties": {
          "image_format": {
            "$ref": "#/components/schemas/ImageFormat"
          },
          "model": {
            "$ref": "#/components/schemas/TransformModel"
          },
          "n": {
            "type": "integer"
          },
          "random_seed": {
            "format": "uint32",
            "type": "integer"
          },
          "response_format": {
            "$ref": "#/components/schemas/ResponseFormat"
          },
          "size": {
            "$ref": "#/components/schemas/ImageSize"
          },
          "zdr": {
            "description": "Zero data retention: the prompt and the input and output image bytes are neither stored nor logged; only an output requested as a URL is uploaded so it can be served.",
            "type": "boolean"
          }
        },
        "required": [
          "size"
        ],
        "type": "object"
      },
      "VectorizeImageRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/VectorizeImageRequestBase"
          },
          {
            "properties": {
              "image": {
                "format": "binary",
                "type": "string"
              }
            },
            "type": "object"
          }
        ]
      },
      "VectorizeImageRequestBase": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProcessImageRequestBase"
          },
          {
            "properties": {
              "color_reduction": {
                "$ref": "#/components/schemas/ColorReduction"
              },
              "limit_num_shapes": {
                "$ref": "#/components/schemas/LimitNumShapes"
              },
              "max_num_colors": {
                "format": "uint32",
                "type": "integer"
              },
              "max_num_shapes": {
                "format": "uint32",
                "type": "integer"
              },
              "return_gradients": {
                "$ref": "#/components/schemas/ReturnGradients"
              },
              "shape_stacking": {
                "$ref": "#/components/schemas/ShapeStacking"
              },
              "small_shape_filter": {
                "$ref": "#/components/schemas/SmallShapeFilter"
              },
              "strict_color_palette": {
                "items": {
                  "items": {
                    "type": "integer"
                  },
                  "type": "array"
                },
                "type": "array"
              },
              "svg_compression": {
                "$ref": "#/components/schemas/SvgCompression"
              }
            },
            "type": "object"
          }
        ]
      }
    },
    "securitySchemes": {
      "auth0": {
        "scheme": "bearer",
        "type": "http"
      }
    },
    "responses": {
      "Error": {
        "description": "Request failed. The body is plain text (for example 401 `request unauthorized`) or JSON, so read it as text before parsing.",
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            }
          },
          "application/json": {
            "schema": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}
