{
  "openapi": "3.0.3",
  "info": {
    "title": "Image Studio API",
    "version": "1.0.0",
    "description": "Currently free, with unlimited cumulative generations and no balance requirement. API key authentication is still required. Optional prompt; asynchronous generation."
  },
  "servers": [
    {
      "url": "https://image-remix.run.place"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "Task": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "preparing",
              "generating",
              "finishing",
              "completed",
              "failed"
            ]
          },
          "message": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "nullable": true
          },
          "reference_strength": {
            "type": "number"
          },
          "generation": {
            "type": "object",
            "nullable": true
          }
        }
      }
    }
  },
  "paths": {
    "/v1/tasks": {
      "post": {
        "summary": "Submit image task",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "image"
                ],
                "properties": {
                  "image": {
                    "type": "string",
                    "format": "binary"
                  },
                  "prompt": {
                    "type": "string",
                    "maxLength": 6000,
                    "default": ""
                  },
                  "reference_strength": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0.72
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict"
          },
          "413": {
            "description": "Too large"
          },
          "429": {
            "description": "Queue full"
          }
        }
      },
      "get": {
        "summary": "List own tasks",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20,
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task list"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict"
          },
          "413": {
            "description": "Too large"
          },
          "429": {
            "description": "Queue full"
          }
        }
      }
    },
    "/v1/tasks/{task_id}": {
      "get": {
        "summary": "Get task",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Task status"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict"
          },
          "413": {
            "description": "Too large"
          },
          "429": {
            "description": "Queue full"
          }
        }
      }
    },
    "/v1/tasks/{task_id}/result": {
      "get": {
        "summary": "Download result",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JPEG result"
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Invalid key"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Conflict"
          },
          "413": {
            "description": "Too large"
          },
          "429": {
            "description": "Queue full"
          }
        }
      }
    }
  }
}