Stickermaker.io

Stickermaker.io · Actions GPT

Image Generation API

  • POST /Generate an image based on the provided prompt
  • OPTIONS /Handle CORS preflight requests
Schéma original API
{
  "openapi": "3.0.0",
  "info": {
    "title": "Image Generation API",
    "version": "1.0.0"
  },
  "paths": {
    "/": {
      "post": {
        "summary": "Generate an image based on the provided prompt",
        "operationId": "generateImageUsingPOST",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "The text prompt for the image generation."
                  },
                  "negative_prompt": {
                    "type": "string",
                    "description": "The text prompt indicating what not to include in the image generation."
                  },
                  "width": {
                    "type": "integer",
                    "description": "The width of the generated image.",
                    "default": 1024
                  },
                  "height": {
                    "type": "integer",
                    "description": "The height of the generated image.",
                    "default": 1024
                  },
                  "upscale": {
                    "type": "boolean",
                    "description": "Whether to enable upscale for the generated image.",
                    "default": true
                  }
                },
                "required": [
                  "prompt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image generation succeeded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "output_urls": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "description": "URL of the generated image."
                      }
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "Image generation is still processing or failed to complete in time.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message providing information about the status of the image generation."
                    },
                    "status": {
                      "type": "string",
                      "description": "The current status of the image generation."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "An error message indicating what went wrong with the request."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "An error message indicating what went wrong with the server."
                    },
                    "details": {
                      "type": "string",
                      "description": "Additional details about the server error."
                    }
                  }
                }
              }
            }
          }
        }
      },
      "options": {
        "summary": "Handle CORS preflight requests",
        "operationId": "handleCORSUsingOPTIONS",
        "responses": {
          "200": {
            "description": "CORS preflight request handled",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string",
                  "description": "The domain allowed to access the resource."
                },
                "example": "https://www.stickermaker.io"
              },
              "Access-Control-Allow-Methods": {
                "schema": {
                  "type": "string",
                  "description": "The allowed HTTP methods for the resource."
                },
                "example": "POST, OPTIONS"
              },
              "Access-Control-Allow-Headers": {
                "schema": {
                  "type": "string",
                  "description": "The allowed HTTP headers for the resource."
                },
                "example": "Content-Type"
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://plugin.stickermaker.io"
    }
  ]
}