{
  "openapi": "3.1.0",
  "info": {
    "title": "YunQi AI HTTP API",
    "version": "1.1.0",
    "description": "Customer-selected exact model IDs. Model-specific constraints are documented in /llms-full.txt. Realtime is a separate WebSocket protocol, not an HTTP generation operation."
  },
  "servers": [
    {
      "url": "https://www.yunqiai.chat"
    }
  ],
  "paths": {
    "/v1/models": {
      "get": {
        "operationId": "listModels",
        "summary": "List models visible to this API Key",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelList"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/responses": {
      "post": {
        "operationId": "createResponse",
        "summary": "Responses text, files and function tools",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponsesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponsesResult"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "SSE frames, including protocol error and terminal events"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/completions": {
      "post": {
        "operationId": "createChatCompletion",
        "summary": "Chat compatibility; model-specific fields",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatResult"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "SSE frames, including protocol error and terminal events"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/messages": {
      "post": {
        "operationId": "createMessage",
        "summary": "Anthropic native Messages",
        "security": [
          {
            "anthropicKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessagesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagesResult"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "SSE frames, including protocol error and terminal events"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "anthropic-version",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "2023-06-01"
            }
          }
        ]
      }
    },
    "/v1beta/models/{model}:generateContent": {
      "parameters": [
        {
          "name": "model",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "enum": [
              "gemini-3.5-flash",
              "gemini-3.1-pro-preview",
              "gemini-3.7-flash",
              "gemini-3.8-flash",
              "gemini-3.1-flash-image",
              "gemini-3-pro-image-preview",
              "gemini-nano-banana-2.1"
            ]
          }
        }
      ],
      "post": {
        "operationId": "generateContent",
        "summary": "Gemini native generation and inline media",
        "security": [
          {
            "geminiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeminiRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeminiResult"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1beta/models/{model}:streamGenerateContent": {
      "parameters": [
        {
          "name": "model",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "enum": [
              "gemini-3.5-flash",
              "gemini-3.1-pro-preview",
              "gemini-3.7-flash",
              "gemini-3.8-flash",
              "gemini-3.1-flash-image",
              "gemini-3-pro-image-preview",
              "gemini-nano-banana-2.1"
            ]
          }
        },
        {
          "name": "alt",
          "in": "query",
          "required": true,
          "schema": {
            "const": "sse",
            "type": "string"
          }
        }
      ],
      "post": {
        "operationId": "streamGenerateContent",
        "summary": "Gemini SSE generation",
        "security": [
          {
            "geminiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeminiRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeminiResult"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "SSE frames, including protocol error and terminal events"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/images/generations": {
      "post": {
        "operationId": "generateImages",
        "summary": "Images JSON generation",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImagesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImagesResult"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/images/edits": {
      "post": {
        "operationId": "editImages",
        "summary": "Native multipart reference images and mask",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ImagesEditRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImagesResult"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "api-version",
            "in": "query",
            "description": "Required for gpt-image-2.5-flare and gpt-image-2.5-sunburst edits.",
            "schema": {
              "type": "string",
              "const": "2025-04-01-preview"
            }
          }
        ]
      }
    },
    "/v1/tob/diffusion": {
      "post": {
        "operationId": "mjGenerate",
        "summary": "MJ image job submission",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MjGenerate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MjJob"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tob/job/{jobId}": {
      "get": {
        "operationId": "mjGetJob",
        "summary": "Query existing MJ image job",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MjJob"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/tob/variation": {
      "post": {
        "operationId": "mj_variation",
        "summary": "MJ variation image job",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jobId": {
                    "type": "string"
                  },
                  "imageNo": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "type": {
                    "type": "integer",
                    "enum": [
                      0,
                      1
                    ]
                  },
                  "remixPrompt": {
                    "type": "string"
                  }
                },
                "required": [
                  "jobId",
                  "imageNo",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MjJob"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tob/upscale": {
      "post": {
        "operationId": "mj_upscale",
        "summary": "MJ upscale image job",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jobId": {
                    "type": "string"
                  },
                  "imageNo": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "type": {
                    "type": "integer",
                    "enum": [
                      0,
                      1,
                      2,
                      3
                    ],
                    "description": "Must match source version"
                  }
                },
                "required": [
                  "jobId",
                  "imageNo",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MjJob"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tob/reroll": {
      "post": {
        "operationId": "mj_reroll",
        "summary": "MJ reroll image job",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jobId": {
                    "type": "string"
                  }
                },
                "required": [
                  "jobId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MjJob"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tob/pan": {
      "post": {
        "operationId": "mj_pan",
        "summary": "MJ pan image job",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jobId": {
                    "type": "string"
                  },
                  "imageNo": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "direction": {
                    "type": "integer",
                    "enum": [
                      0,
                      1,
                      2,
                      3
                    ]
                  },
                  "scale": {
                    "type": "number",
                    "minimum": 1.1,
                    "maximum": 3
                  },
                  "remixPrompt": {
                    "type": "string"
                  }
                },
                "required": [
                  "jobId",
                  "imageNo",
                  "direction",
                  "scale"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MjJob"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tob/outpaint": {
      "post": {
        "operationId": "mj_outpaint",
        "summary": "MJ outpaint image job",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jobId": {
                    "type": "string"
                  },
                  "imageNo": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "scale": {
                    "type": "number",
                    "minimum": 1.1,
                    "maximum": 2
                  },
                  "remixPrompt": {
                    "type": "string"
                  }
                },
                "required": [
                  "jobId",
                  "imageNo",
                  "scale"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MjJob"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tob/inpaint": {
      "post": {
        "operationId": "mj_inpaint",
        "summary": "MJ inpaint image job",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jobId": {
                    "type": "string"
                  },
                  "imageNo": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "mask": {
                    "$ref": "#/components/schemas/MjMask"
                  },
                  "remixPrompt": {
                    "type": "string"
                  }
                },
                "required": [
                  "jobId",
                  "imageNo",
                  "mask"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MjJob"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tob/remix": {
      "post": {
        "operationId": "mj_remix",
        "summary": "MJ remix image job",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jobId": {
                    "type": "string"
                  },
                  "imageNo": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "remixPrompt": {
                    "type": "string"
                  },
                  "mode": {
                    "type": "integer",
                    "enum": [
                      0,
                      1
                    ]
                  }
                },
                "required": [
                  "jobId",
                  "imageNo",
                  "remixPrompt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MjJob"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tob/edit": {
      "post": {
        "operationId": "mj_edit",
        "summary": "MJ edit image job",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jobId": {
                    "type": "string"
                  },
                  "imageNo": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "canvas": {
                    "$ref": "#/components/schemas/MjCanvas"
                  },
                  "imgPos": {
                    "$ref": "#/components/schemas/MjPosition"
                  },
                  "remixPrompt": {
                    "type": "string"
                  },
                  "mask": {
                    "$ref": "#/components/schemas/MjMask"
                  }
                },
                "required": [
                  "jobId",
                  "imageNo",
                  "canvas",
                  "imgPos",
                  "remixPrompt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MjJob"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tob/upload-paint": {
      "post": {
        "operationId": "mj_upload_paint",
        "summary": "MJ upload-paint image job",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "imgUrl": {
                    "type": "string"
                  },
                  "canvas": {
                    "$ref": "#/components/schemas/MjCanvas"
                  },
                  "imgPos": {
                    "$ref": "#/components/schemas/MjPosition"
                  },
                  "remixPrompt": {
                    "type": "string"
                  },
                  "mask": {
                    "$ref": "#/components/schemas/MjMask"
                  }
                },
                "required": [
                  "imgUrl",
                  "canvas",
                  "imgPos",
                  "remixPrompt",
                  "mask"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MjJob"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tob/retexture": {
      "post": {
        "operationId": "mj_retexture",
        "summary": "MJ retexture image job",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "imgUrl": {
                    "type": "string"
                  },
                  "remixPrompt": {
                    "type": "string"
                  }
                },
                "required": [
                  "imgUrl",
                  "remixPrompt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MjJob"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tob/remove-background": {
      "post": {
        "operationId": "mj_remove_background",
        "summary": "MJ remove-background image job",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "imgUrl": {
                    "type": "string"
                  }
                },
                "required": [
                  "imgUrl"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MjJob"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tob/enhance": {
      "post": {
        "operationId": "mj_enhance",
        "summary": "MJ enhance image job",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jobId": {
                    "type": "string"
                  },
                  "imageNo": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "jobId",
                  "imageNo"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspect protocol terminal state and actual content; HTTP success alone is insufficient.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MjJob"
                }
              }
            }
          },
          "default": {
            "description": "API or gateway error. Preserve HTTP status even if the body is not JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      },
      "anthropicKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      },
      "geminiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-goog-api-key"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  },
                  "code": {
                    "type": [
                      "string",
                      "integer",
                      "null"
                    ]
                  }
                }
              }
            ]
          },
          "message": {
            "type": "string"
          },
          "code": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          }
        }
      },
      "ModelList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "object": {
                  "type": "string"
                },
                "owned_by": {
                  "type": "string"
                }
              },
              "required": [
                "id"
              ]
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "ResponsesInputContent": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "input_text"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "text"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "input_image"
              },
              "image_url": {
                "type": "string",
                "description": "Public URL or image data URI"
              },
              "detail": {
                "type": "string",
                "enum": [
                  "auto",
                  "low",
                  "high"
                ]
              }
            },
            "required": [
              "type",
              "image_url"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "input_file"
              },
              "filename": {
                "type": "string"
              },
              "file_data": {
                "type": "string",
                "description": "Data URI with actual MIME: PDF, DOCX, XLSX, TXT, CSV or JSON. Not audio/video."
              }
            },
            "required": [
              "type",
              "filename",
              "file_data"
            ]
          }
        ]
      },
      "ResponsesInputItem": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "role": {
                "type": "string",
                "enum": [
                  "user",
                  "assistant",
                  "system",
                  "developer"
                ]
              },
              "content": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ResponsesInputContent"
                    }
                  }
                ]
              }
            },
            "required": [
              "role",
              "content"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "function_call_output"
              },
              "call_id": {
                "type": "string"
              },
              "output": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "call_id",
              "output"
            ]
          },
          {
            "type": "object",
            "description": "Original output item carried forward unchanged, including reasoning and function_call items."
          }
        ]
      },
      "ResponsesRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "gpt-5.6-sol",
              "gpt-5.6-terra",
              "gpt-5.6-luna",
              "gpt-6-astra",
              "gpt-6-sol",
              "gpt-6-luna"
            ]
          },
          "input": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ResponsesInputItem"
                }
              }
            ]
          },
          "instructions": {
            "type": "string"
          },
          "max_output_tokens": {
            "type": "integer",
            "minimum": 1
          },
          "stream": {
            "type": "boolean",
            "default": false
          },
          "reasoning": {
            "type": "object",
            "properties": {
              "effort": {
                "type": "string",
                "description": "Model-specific. gpt-6-astra: low, medium, high, xhigh, max; no none/minimal."
              }
            }
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "const": "function"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "parameters": {
                  "type": "object"
                },
                "strict": {
                  "type": "boolean"
                }
              },
              "required": [
                "type",
                "name",
                "parameters"
              ]
            }
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "auto",
                  "none",
                  "required"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "const": "function"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "name"
                ]
              }
            ]
          },
          "text": {
            "type": "object",
            "properties": {
              "format": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "text",
                      "json_object",
                      "json_schema"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "schema": {
                    "type": "object"
                  },
                  "strict": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "type"
                ]
              }
            }
          }
        },
        "required": [
          "model",
          "input"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "model": {
                  "const": "gpt-5.6-sol"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "reasoning": {
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "none",
                        "low",
                        "medium",
                        "high",
                        "xhigh",
                        "max"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "model": {
                  "const": "gpt-5.6-terra"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "reasoning": {
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "none",
                        "low",
                        "medium",
                        "high",
                        "xhigh",
                        "max"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "model": {
                  "const": "gpt-5.6-luna"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "reasoning": {
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "none",
                        "low",
                        "medium",
                        "high",
                        "xhigh",
                        "max"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "model": {
                  "const": "gpt-6-astra"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "reasoning": {
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        "xhigh",
                        "max"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "model": {
                  "const": "gpt-6-sol"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "reasoning": {
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "none",
                        "low",
                        "medium",
                        "high",
                        "xhigh",
                        "max"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "model": {
                  "const": "gpt-6-luna"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "reasoning": {
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "none",
                        "low",
                        "medium",
                        "high",
                        "xhigh",
                        "max"
                      ]
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "ResponsesResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "incomplete",
              "failed",
              "in_progress",
              "queued",
              "cancelled"
            ]
          },
          "output": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "error": {
            "type": [
              "object",
              "null"
            ]
          },
          "incomplete_details": {
            "type": [
              "object",
              "null"
            ]
          },
          "usage": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "ChatMessage": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "system",
              "developer",
              "user",
              "assistant",
              "tool"
            ]
          },
          "content": {
            "type": [
              "string",
              "array",
              "null"
            ]
          },
          "tool_calls": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "tool_call_id": {
            "type": "string"
          }
        },
        "required": [
          "role"
        ]
      },
      "ChatRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "gpt-5.6-sol",
              "gpt-5.6-terra",
              "gpt-5.6-luna",
              "gpt-6-astra",
              "gpt-6-sol",
              "gpt-6-luna",
              "kimi-k3",
              "DeepSeek-V4.1-Flash"
            ]
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatMessage"
            }
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1
          },
          "max_completion_tokens": {
            "type": "integer",
            "minimum": 1
          },
          "stream": {
            "type": "boolean"
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "const": "function"
                },
                "function": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "parameters": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "name",
                    "parameters"
                  ]
                }
              },
              "required": [
                "type",
                "function"
              ]
            }
          },
          "tool_choice": {
            "type": [
              "string",
              "object"
            ]
          },
          "response_format": {
            "type": "object"
          }
        },
        "required": [
          "model",
          "messages"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "model": {
                  "type": "string",
                  "enum": [
                    "gpt-5.6-sol",
                    "gpt-5.6-terra",
                    "gpt-5.6-luna",
                    "gpt-6-astra",
                    "gpt-6-sol",
                    "gpt-6-luna"
                  ]
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "tools"
                    ]
                  },
                  {
                    "required": [
                      "tool_choice"
                    ]
                  },
                  {
                    "required": [
                      "response_format"
                    ]
                  }
                ]
              }
            },
            "description": "GPT Chat compatibility is text-only in this integration contract. Use the selected model's Responses contract for tools and JSON Schema."
          }
        ]
      },
      "ChatResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "minimum": 0
                },
                "message": {
                  "$ref": "#/components/schemas/ChatMessage"
                },
                "finish_reason": {
                  "type": "string"
                }
              }
            }
          },
          "usage": {
            "type": "object"
          }
        }
      },
      "ClaudeSource": {
        "type": "object",
        "properties": {
          "type": {
            "const": "base64"
          },
          "media_type": {
            "type": "string",
            "enum": [
              "image/png",
              "image/jpeg",
              "image/webp",
              "image/gif",
              "application/pdf"
            ]
          },
          "data": {
            "type": "string",
            "contentEncoding": "base64"
          }
        },
        "required": [
          "type",
          "media_type",
          "data"
        ]
      },
      "ClaudeBlock": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "text"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "text"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "image",
                  "document"
                ]
              },
              "source": {
                "$ref": "#/components/schemas/ClaudeSource"
              }
            },
            "required": [
              "type",
              "source"
            ]
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "tool_result"
              },
              "tool_use_id": {
                "type": "string"
              },
              "content": {
                "type": [
                  "string",
                  "array"
                ]
              },
              "is_error": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "tool_use_id",
              "content"
            ]
          },
          {
            "type": "object",
            "description": "Preserve original assistant content blocks including thinking, signature and tool_use."
          }
        ]
      },
      "MessagesRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "claude-sonnet-4-6",
              "claude-opus-4-6",
              "claude-opus-4-7",
              "claude-opus-4-8",
              "claude-sonnet-5",
              "claude-fable-5",
              "claude-opus-5",
              "claude-opus-5-5"
            ]
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "enum": [
                    "user",
                    "assistant"
                  ]
                },
                "content": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ClaudeBlock"
                      }
                    }
                  ]
                }
              },
              "required": [
                "role",
                "content"
              ]
            }
          },
          "system": {
            "type": [
              "string",
              "array"
            ]
          },
          "stream": {
            "type": "boolean"
          },
          "thinking": {
            "type": "object",
            "description": "Model-specific. Do not send disabled or legacy enabled/budget_tokens to Opus 5.5."
          },
          "output_config": {
            "type": "object",
            "properties": {
              "effort": {
                "type": "string",
                "description": "Use only model-supported effort values."
              },
              "format": {
                "type": "object",
                "properties": {
                  "type": {
                    "const": "json_schema"
                  },
                  "schema": {
                    "type": "object"
                  }
                },
                "required": [
                  "type",
                  "schema"
                ],
                "description": "Not available for claude-opus-5-5 in the current integration contract."
              }
            }
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "input_schema": {
                  "type": "object"
                }
              },
              "required": [
                "name",
                "input_schema"
              ]
            }
          },
          "tool_choice": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "description": "Model-specific: Opus 5.5 does not accept any or forced named tool."
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ]
          }
        },
        "required": [
          "model",
          "max_tokens",
          "messages"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "model": {
                  "const": "claude-opus-5-5"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "output_config": {
                  "not": {
                    "required": [
                      "format"
                    ]
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "model": {
                  "const": "claude-sonnet-4-6"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "output_config": {
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        "max"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "model": {
                  "const": "claude-opus-4-6"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "output_config": {
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        "max"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "model": {
                  "const": "claude-opus-4-7"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "output_config": {
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        "xhigh",
                        "max"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "model": {
                  "const": "claude-opus-4-8"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "output_config": {
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        "xhigh",
                        "max"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "model": {
                  "const": "claude-sonnet-5"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "output_config": {
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        "xhigh",
                        "max"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "model": {
                  "const": "claude-fable-5"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "output_config": {
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        "xhigh",
                        "max"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "model": {
                  "const": "claude-opus-5"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "output_config": {
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        "xhigh",
                        "max"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "model": {
                  "const": "claude-opus-5-5"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "output_config": {
                  "properties": {
                    "effort": {
                      "type": "string",
                      "enum": [
                        "low",
                        "medium",
                        "high",
                        "xhigh",
                        "max"
                      ]
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "MessagesResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "content": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "stop_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "usage": {
            "type": "object"
          }
        }
      },
      "GeminiPart": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "inlineData": {
            "type": "object",
            "properties": {
              "mimeType": {
                "type": "string"
              },
              "data": {
                "type": "string",
                "contentEncoding": "base64"
              }
            },
            "required": [
              "mimeType",
              "data"
            ]
          },
          "thoughtSignature": {
            "type": "string"
          }
        }
      },
      "GeminiRequest": {
        "type": "object",
        "properties": {
          "contents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "enum": [
                    "user",
                    "model"
                  ]
                },
                "parts": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GeminiPart"
                  }
                }
              },
              "required": [
                "parts"
              ]
            }
          },
          "systemInstruction": {
            "type": "object",
            "properties": {
              "parts": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GeminiPart"
                }
              }
            }
          },
          "generationConfig": {
            "type": "object",
            "properties": {
              "maxOutputTokens": {
                "type": "integer",
                "minimum": 1
              },
              "temperature": {
                "type": "number"
              },
              "thinkingConfig": {
                "type": "object",
                "description": "Model-specific; 3.7/3.8 Flash do not accept minimal thinkingLevel."
              },
              "responseModalities": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "TEXT",
                    "IMAGE"
                  ]
                }
              },
              "imageConfig": {
                "type": "object",
                "properties": {
                  "aspectRatio": {
                    "type": "string"
                  },
                  "imageSize": {
                    "type": "string",
                    "enum": [
                      "1K",
                      "2K",
                      "4K"
                    ]
                  }
                }
              }
            }
          }
        },
        "required": [
          "contents"
        ],
        "not": {
          "anyOf": [
            {
              "required": [
                "tools"
              ]
            },
            {
              "required": [
                "toolConfig"
              ]
            },
            {
              "properties": {
                "generationConfig": {
                  "anyOf": [
                    {
                      "required": [
                        "responseMimeType"
                      ]
                    },
                    {
                      "required": [
                        "responseJsonSchema"
                      ]
                    }
                  ]
                }
              },
              "required": [
                "generationConfig"
              ]
            }
          ]
        }
      },
      "GeminiResult": {
        "type": "object",
        "properties": {
          "candidates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "content": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string"
                    },
                    "parts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GeminiPart"
                      }
                    }
                  }
                },
                "finishReason": {
                  "type": "string"
                },
                "safetyRatings": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "promptFeedback": {
            "type": "object"
          },
          "usageMetadata": {
            "type": "object"
          }
        }
      },
      "ImagesRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "gpt-image-2",
              "gpt-image-2.5-flare",
              "gpt-image-2.5-sunburst"
            ]
          },
          "prompt": {
            "type": "string"
          },
          "size": {
            "type": "string",
            "description": "auto or model-valid WIDTHxHEIGHT"
          },
          "quality": {
            "type": "string",
            "enum": [
              "auto",
              "low",
              "medium",
              "high",
              "xhigh",
              "max"
            ]
          },
          "n": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png",
              "jpeg"
            ]
          },
          "output_compression": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "background": {
            "type": "string",
            "enum": [
              "auto",
              "opaque",
              "transparent"
            ]
          },
          "moderation": {
            "type": "string",
            "enum": [
              "auto",
              "low"
            ]
          }
        },
        "required": [
          "model",
          "prompt"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "model": {
                  "const": "gpt-image-2"
                }
              },
              "required": [
                "model"
              ]
            },
            "then": {
              "properties": {
                "quality": {
                  "type": "string",
                  "enum": [
                    "auto",
                    "low",
                    "medium",
                    "high"
                  ]
                },
                "background": {
                  "type": "string",
                  "enum": [
                    "auto",
                    "opaque"
                  ]
                }
              }
            }
          }
        ]
      },
      "ImagesEditRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ImagesRequest"
          },
          {
            "type": "object",
            "properties": {
              "image": {
                "type": "string",
                "format": "binary"
              },
              "image[]": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "mask": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        ],
        "anyOf": [
          {
            "required": [
              "image"
            ]
          },
          {
            "required": [
              "image[]"
            ]
          }
        ]
      },
      "ImagesResult": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer",
            "minimum": 0
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "b64_json": {
                  "type": "string",
                  "contentEncoding": "base64"
                },
                "url": {
                  "type": "string"
                }
              }
            }
          },
          "size": {
            "type": "string"
          },
          "quality": {
            "type": "string"
          },
          "output_format": {
            "type": "string"
          },
          "usage": {
            "type": "object"
          }
        },
        "required": [
          "data"
        ]
      },
      "MjGenerate": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "mj_imagine",
              "youchuan-image"
            ]
          },
          "text": {
            "type": "string",
            "description": "Prompt and all MJ generation flags; not prompt/size/quality fields."
          }
        },
        "required": [
          "model",
          "text"
        ]
      },
      "MjMask": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              }
            },
            "required": [
              "url"
            ]
          },
          {
            "type": "object",
            "properties": {
              "areas": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "width": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "height": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "points": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    }
                  },
                  "required": [
                    "width",
                    "height",
                    "points"
                  ]
                }
              }
            },
            "required": [
              "areas"
            ]
          }
        ]
      },
      "MjCanvas": {
        "type": "object",
        "properties": {
          "width": {
            "type": "integer",
            "minimum": 1
          },
          "height": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "width",
          "height"
        ]
      },
      "MjPosition": {
        "type": "object",
        "properties": {
          "width": {
            "type": "integer",
            "minimum": 1
          },
          "height": {
            "type": "integer",
            "minimum": 1
          },
          "x": {
            "type": "integer"
          },
          "y": {
            "type": "integer"
          }
        },
        "required": [
          "width",
          "height",
          "x",
          "y"
        ]
      },
      "MjJob": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "enum": [
              1,
              2,
              3
            ]
          },
          "comment": {
            "type": "string"
          },
          "urls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cost": {
            "type": "object"
          }
        },
        "required": [
          "id",
          "status"
        ]
      }
    }
  },
  "x-realtime-reference": "/docs/cn/api-reference/realtime"
}
