{
  "openapi": "3.1.0",
  "info": {
    "title": "商品图片处理纯 LLM API",
    "version": "1.0.0",
    "description": "Lisa Run API served by an independently deployed Runtime. Authentication, Run state, metering, and billing remain controlled by Lisa Center."
  },
  "servers": [
    {
      "url": "https://ai-img.centrdx.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/agents/{agent_id}/runs": {
      "post": {
        "summary": "Create an Agent Run",
        "operationId": "createAgentRun",
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "agent_product_photo_llm"
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRunRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Run accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/runs/{run_id}": {
      "get": {
        "summary": "Get Run status and result",
        "operationId": "getAgentRun",
        "parameters": [
          {
            "$ref": "#/components/parameters/RunId"
          }
        ],
        "responses": {
          "200": {
            "description": "Current Run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                }
              }
            }
          }
        }
      }
    },
    "/v1/runs/{run_id}/events": {
      "get": {
        "summary": "List Run events",
        "operationId": "listAgentRunEvents",
        "parameters": [
          {
            "$ref": "#/components/parameters/RunId"
          }
        ],
        "responses": {
          "200": {
            "description": "Run event page"
          }
        }
      }
    },
    "/v1/runs/{run_id}/cancel": {
      "post": {
        "summary": "Cancel a Run",
        "operationId": "cancelAgentRun",
        "parameters": [
          {
            "$ref": "#/components/parameters/RunId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancellation state"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Lisa API Token"
      }
    },
    "parameters": {
      "RunId": {
        "name": "run_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "Error": {
        "description": "Lisa API error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "schemas": {
      "CreateRunRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "input"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "async"
            ]
          },
          "external_user_id": {
            "type": "string",
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._~-]{0,127}$",
            "description": "Optional opaque downstream billing-user identifier. It is not model input and is omitted from public Run responses."
          },
          "input": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "Run": {
        "type": "object",
        "required": [
          "object",
          "id",
          "status"
        ],
        "properties": {
          "object": {
            "const": "agent.run"
          },
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "output": {
            "type": [
              "object",
              "null"
            ]
          },
          "error": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      }
    }
  }
}