{
  "openapi": "3.1.0",
  "info": {
    "title": "Xiaoya Open Platform Public API",
    "version": "2026-09-01",
    "description": "Complete external contract for open-agent OAuth, Personal and Team APIs, model and TTS access, runtime assets, execution grants, sandbox runtime, and MCP service callbacks."
  },
  "servers": [
    {
      "url": "https://claw.zhenhuiai.com",
      "description": "Xiaoya Open Platform"
    }
  ],
  "tags": [
    {
      "name": "OAuth"
    },
    {
      "name": "Open context"
    },
    {
      "name": "Personal account"
    },
    {
      "name": "Models"
    },
    {
      "name": "Team"
    },
    {
      "name": "Model gateway"
    },
    {
      "name": "TTS gateway"
    },
    {
      "name": "Sponsored billing"
    },
    {
      "name": "Runtime assets"
    },
    {
      "name": "Execution grants"
    },
    {
      "name": "Sandbox"
    },
    {
      "name": "MCP service callbacks"
    }
  ],
  "paths": {
    "/api/proxy/v1/audio/speech": {
      "post": {
        "tags": [
          "TTS gateway"
        ],
        "summary": "Create Speech",
        "operationId": "create_speech_api_proxy_v1_audio_speech_post",
        "security": [
          {
            "openAgentBearer": [
              "model"
            ]
          }
        ],
        "parameters": [
          {
            "name": "X-Xiaoya-Team-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Id"
            }
          },
          {
            "name": "X-Request-ID",
            "in": "header",
            "required": true,
            "description": "Stable client request ID. Reuse the same value only when retrying the same request in the same billing account context.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TtsSpeechInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated speech audio. The response is never cached.",
            "headers": {
              "X-Xiaoya-Request-Id": {
                "description": "Stable request ID used for billing idempotency.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Xiaoya-Tts-Config-Id": {
                "description": "Xiaoya TTS configuration ID that served the request.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Xiaoya-Voice-Id": {
                "description": "Xiaoya voice ID that served the request.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Xiaoya-Input-Characters": {
                "description": "Number of input characters accepted by the gateway.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Xiaoya-Usage-Characters": {
                "description": "Provider-reported character usage used for settlement.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Xiaoya-Actual-Usage": {
                "description": "Actual billing units after applying the configured pricing rule.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Xiaoya-Audio-Duration-Ms": {
                "description": "Generated audio duration in milliseconds when available.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Xiaoya-Charged-Points": {
                "description": "Points charged for this successful request.",
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "description": "Always `no-store`.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/L16": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/flac": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "model"
        ]
      }
    },
    "/api/proxy/v1/chat/completions": {
      "post": {
        "tags": [
          "Model gateway"
        ],
        "summary": "Call the compatible Chat Completions gateway",
        "description": "Personal open-agent tokens support streaming. A Team-bound token requires every X-Xiaoya workflow header and currently rejects stream=true.",
        "security": [
          {
            "openAgentBearer": [
              "model"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamHeader"
          },
          {
            "$ref": "#/components/parameters/WorkflowVersionHeader"
          },
          {
            "$ref": "#/components/parameters/RunHeader"
          },
          {
            "$ref": "#/components/parameters/NodeHeader"
          },
          {
            "$ref": "#/components/parameters/AttemptHeader"
          },
          {
            "name": "X-Request-ID",
            "in": "header",
            "required": true,
            "description": "Stable client request ID. Reuse the same value only when retrying the same request in the same billing account context.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "A modelCode returned by the current context's model catalog."
                  },
                  "messages": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "$ref": "#/components/schemas/ChatMessage"
                    }
                  },
                  "stream": {
                    "type": "boolean",
                    "default": false
                  },
                  "temperature": {
                    "type": "number"
                  },
                  "max_tokens": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON completion or text/event-stream for a supported Personal streaming request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/OpenApiError"
          }
        },
        "x-xiaoya-required-scopes": [
          "model"
        ]
      }
    },
    "/api/proxy/v1/tts/options": {
      "get": {
        "tags": [
          "TTS gateway"
        ],
        "summary": "List Tts Options",
        "operationId": "list_tts_options_api_proxy_v1_tts_options_get",
        "security": [
          {
            "openAgentBearer": [
              "model"
            ]
          }
        ],
        "parameters": [
          {
            "name": "X-Xiaoya-Team-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "model"
        ]
      }
    },
    "/api/v1/open-agent-tools/call-context/introspect": {
      "post": {
        "tags": [
          "MCP service callbacks"
        ],
        "summary": "Introspect Open Agent Call Context",
        "operationId": "introspect_open_agent_call_context_api_v1_open_agent_tools_call_context_introspect_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAgentCallContextIntrospectionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Introspect Open Agent Call Context Api V1 Open Agent Tools Call Context Introspect Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/api/v1/open-agent-tools/callbacks/{invocation_id}": {
      "post": {
        "tags": [
          "MCP service callbacks"
        ],
        "summary": "Complete Open Agent Async Tool",
        "operationId": "complete_open_agent_async_tool_api_v1_open_agent_tools_callbacks__invocation_id__post",
        "parameters": [
          {
            "name": "invocation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Invocation Id"
            }
          },
          {
            "name": "X-Xiaoya-Call-Context",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "title": "X-Xiaoya-Call-Context"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAgentAsyncResultInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Complete Open Agent Async Tool Api V1 Open Agent Tools Callbacks  Invocation Id  Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/api/v1/open/account/bootstrap": {
      "get": {
        "tags": [
          "Personal account"
        ],
        "summary": "Bootstrap",
        "operationId": "bootstrap_api_v1_open_account_bootstrap_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Bootstrap Api V1 Open Account Bootstrap Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "openAgentBearer": [
              "account"
            ]
          }
        ],
        "x-xiaoya-required-scopes": [
          "account"
        ]
      }
    },
    "/api/v1/open/account/entitlements": {
      "get": {
        "tags": [
          "Personal account"
        ],
        "summary": "Open Personal State",
        "operationId": "open_personal_state_api_v1_open_account_entitlements_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "openAgentBearer": [
              "account"
            ]
          }
        ],
        "x-xiaoya-required-scopes": [
          "account"
        ]
      }
    },
    "/api/v1/open/account/gift-cards/redeem": {
      "post": {
        "tags": [
          "Personal account"
        ],
        "summary": "Redeem Card",
        "operationId": "redeem_card_api_v1_open_account_gift_cards_redeem_post",
        "security": [
          {
            "openAgentBearer": [
              "account"
            ]
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 120,
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GiftCardInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Redeem Card Api V1 Open Account Gift Cards Redeem Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "account"
        ]
      }
    },
    "/api/v1/open/account/orders": {
      "get": {
        "tags": [
          "Personal account"
        ],
        "summary": "Orders",
        "operationId": "orders_api_v1_open_account_orders_get",
        "security": [
          {
            "openAgentBearer": [
              "payment"
            ]
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Pagesize"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Orders Api V1 Open Account Orders Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "payment"
        ]
      }
    },
    "/api/v1/open/account/payments/wechat": {
      "post": {
        "tags": [
          "Personal account"
        ],
        "summary": "Create Wechat Order",
        "operationId": "create_wechat_order_api_v1_open_account_payments_wechat_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RechargeOrderInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Create Wechat Order Api V1 Open Account Payments Wechat Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "openAgentBearer": [
              "payment"
            ]
          }
        ],
        "x-xiaoya-required-scopes": [
          "payment"
        ]
      }
    },
    "/api/v1/open/account/payments/{order_id}": {
      "get": {
        "tags": [
          "Personal account"
        ],
        "summary": "Payment Order",
        "operationId": "payment_order_api_v1_open_account_payments__order_id__get",
        "security": [
          {
            "openAgentBearer": [
              "payment"
            ]
          }
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Order Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Payment Order Api V1 Open Account Payments  Order Id  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "payment"
        ]
      }
    },
    "/api/v1/open/account/performance": {
      "get": {
        "tags": [
          "Personal account"
        ],
        "summary": "Performance",
        "operationId": "performance_api_v1_open_account_performance_get",
        "security": [
          {
            "openAgentBearer": [
              "account"
            ]
          }
        ],
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "today",
                "7d",
                "30d",
                "month"
              ],
              "type": "string",
              "default": "month",
              "title": "Range"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Performance Api V1 Open Account Performance Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "account"
        ]
      }
    },
    "/api/v1/open/account/products": {
      "get": {
        "tags": [
          "Personal account"
        ],
        "summary": "Products",
        "operationId": "products_api_v1_open_account_products_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Products Api V1 Open Account Products Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "openAgentBearer": [
              "payment"
            ]
          }
        ],
        "x-xiaoya-required-scopes": [
          "payment"
        ]
      }
    },
    "/api/v1/open/account/profile": {
      "patch": {
        "tags": [
          "Personal account"
        ],
        "summary": "Update Profile",
        "operationId": "update_profile_api_v1_open_account_profile_patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Update Profile Api V1 Open Account Profile Patch"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "openAgentBearer": [
              "account"
            ]
          }
        ],
        "x-xiaoya-required-scopes": [
          "account"
        ]
      }
    },
    "/api/v1/open/account/profile/avatar": {
      "post": {
        "tags": [
          "Personal account"
        ],
        "summary": "Upload Profile Avatar",
        "operationId": "upload_profile_avatar_api_v1_open_account_profile_avatar_post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_profile_avatar_api_v1_open_account_profile_avatar_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Upload Profile Avatar Api V1 Open Account Profile Avatar Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "openAgentBearer": [
              "account"
            ]
          }
        ],
        "x-xiaoya-required-scopes": [
          "account"
        ]
      }
    },
    "/api/v1/open/account/referral": {
      "get": {
        "tags": [
          "Personal account"
        ],
        "summary": "Referral",
        "operationId": "referral_api_v1_open_account_referral_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Referral Api V1 Open Account Referral Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "openAgentBearer": [
              "account"
            ]
          }
        ],
        "x-xiaoya-required-scopes": [
          "account"
        ]
      }
    },
    "/api/v1/open/account/refunds": {
      "get": {
        "tags": [
          "Personal account"
        ],
        "summary": "Refunds",
        "operationId": "refunds_api_v1_open_account_refunds_get",
        "security": [
          {
            "openAgentBearer": [
              "payment"
            ]
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Pagesize"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Refunds Api V1 Open Account Refunds Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "payment"
        ]
      }
    },
    "/api/v1/open/balance": {
      "get": {
        "tags": [
          "Open context"
        ],
        "summary": "Get the Personal balance",
        "description": "Rejects Team-bound tokens.",
        "security": [
          {
            "openAgentBearer": [
              "balance"
            ]
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "default": {
            "$ref": "#/components/responses/OpenApiError"
          }
        },
        "x-xiaoya-required-scopes": [
          "balance"
        ]
      }
    },
    "/api/v1/open/charge": {
      "post": {
        "tags": [
          "Open context"
        ],
        "summary": "Charge",
        "operationId": "charge_api_v1_open_charge_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAgentChargeInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Charge Api V1 Open Charge Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "openAgentBearer": [
              "charge"
            ]
          }
        ],
        "x-xiaoya-required-scopes": [
          "charge"
        ]
      }
    },
    "/api/v1/open/desktop-execution-grants": {
      "post": {
        "tags": [
          "Open context"
        ],
        "summary": "Create Grant",
        "operationId": "create_grant_api_v1_open_desktop_execution_grants_post",
        "security": [
          {
            "openAgentBearer": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DesktopExecutionGrantInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/api/v1/open/desktop-execution-grants/{grant_id}": {
      "delete": {
        "tags": [
          "Open context"
        ],
        "summary": "Revoke Grant",
        "operationId": "revoke_grant_api_v1_open_desktop_execution_grants__grant_id__delete",
        "security": [
          {
            "openAgentBearer": []
          }
        ],
        "parameters": [
          {
            "name": "grant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Grant Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/api/v1/open/desktop-execution-grants/{grant_id}/runs": {
      "post": {
        "tags": [
          "Open context"
        ],
        "summary": "Admit Run",
        "operationId": "admit_run_api_v1_open_desktop_execution_grants__grant_id__runs_post",
        "security": [
          {
            "openAgentBearer": []
          }
        ],
        "parameters": [
          {
            "name": "grant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Grant Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DesktopExecutionRunInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/api/v1/open/desktop-execution-grants/{grant_id}/runs/{run_id}/model-results/{sequence}": {
      "get": {
        "tags": [
          "Open context"
        ],
        "summary": "Model Result",
        "operationId": "model_result_api_v1_open_desktop_execution_grants__grant_id__runs__run_id__model_results__sequence__get",
        "security": [
          {
            "openAgentBearer": []
          }
        ],
        "parameters": [
          {
            "name": "grant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Grant Id"
            }
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Run Id"
            }
          },
          {
            "name": "sequence",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "maximum": 100000,
              "minimum": 0,
              "title": "Sequence"
            }
          },
          {
            "name": "requestFingerprint",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$",
              "title": "Requestfingerprint"
            }
          },
          {
            "name": "X-Xiaoya-Team-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "Response Model Result Api V1 Open Desktop Execution Grants  Grant Id  Runs  Run Id  Model Results  Sequence  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/api/v1/open/employee-generation-results/{operation_digest}": {
      "get": {
        "tags": [
          "Open context"
        ],
        "summary": "Generation Result",
        "operationId": "generation_result_api_v1_open_employee_generation_results__operation_digest__get",
        "security": [
          {
            "openAgentBearer": []
          }
        ],
        "parameters": [
          {
            "name": "operation_digest",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$",
              "title": "Operation Digest"
            }
          },
          {
            "name": "requestFingerprint",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$",
              "title": "Requestfingerprint"
            }
          },
          {
            "name": "X-Xiaoya-Team-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 36
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Context-Version",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Context-Version"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "Response Generation Result Api V1 Open Employee Generation Results  Operation Digest  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/api/v1/open/employee-instances/{instance_id}": {
      "patch": {
        "tags": [
          "Open context"
        ],
        "summary": "Open Patch Instance",
        "operationId": "open_patch_instance_api_v1_open_employee_instances__instance_id__patch",
        "security": [
          {
            "openAgentBearer": []
          }
        ],
        "parameters": [
          {
            "name": "instance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instance Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 36
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Context-Version",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Context-Version"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeInstancePatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      },
      "delete": {
        "tags": [
          "Open context"
        ],
        "summary": "Open Archive Instance",
        "operationId": "open_archive_instance_api_v1_open_employee_instances__instance_id__delete",
        "security": [
          {
            "openAgentBearer": []
          }
        ],
        "parameters": [
          {
            "name": "instance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instance Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 36
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Context-Version",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Context-Version"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/api/v1/open/employee-instances/{instance_id}/boundary": {
      "post": {
        "tags": [
          "Open context"
        ],
        "summary": "Open Instance Boundary",
        "operationId": "open_instance_boundary_api_v1_open_employee_instances__instance_id__boundary_post",
        "security": [
          {
            "openAgentBearer": []
          }
        ],
        "parameters": [
          {
            "name": "instance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instance Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 36
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Context-Version",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Context-Version"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/api/v1/open/employee-instances/{instance_id}/copy": {
      "post": {
        "tags": [
          "Open context"
        ],
        "summary": "Open Copy Instance",
        "operationId": "open_copy_instance_api_v1_open_employee_instances__instance_id__copy_post",
        "security": [
          {
            "openAgentBearer": []
          }
        ],
        "parameters": [
          {
            "name": "instance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instance Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 36
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Context-Version",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Context-Version"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeCopyInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/api/v1/open/employee-instances/{instance_id}/dependencies/{item_type}/{item_id}/package": {
      "get": {
        "tags": [
          "Open context"
        ],
        "summary": "Open Dependency Package",
        "operationId": "open_dependency_package_api_v1_open_employee_instances__instance_id__dependencies__item_type___item_id__package_get",
        "security": [
          {
            "openAgentBearer": []
          }
        ],
        "parameters": [
          {
            "name": "instance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instance Id"
            }
          },
          {
            "name": "item_type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Item Type"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Item Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 36
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Context-Version",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Context-Version"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/api/v1/open/employee-instances/{instance_id}/studio-link": {
      "patch": {
        "tags": [
          "Open context"
        ],
        "summary": "Open Studio Link",
        "operationId": "open_studio_link_api_v1_open_employee_instances__instance_id__studio_link_patch",
        "security": [
          {
            "openAgentBearer": []
          }
        ],
        "parameters": [
          {
            "name": "instance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instance Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 36
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Context-Version",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Context-Version"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeStudioLinkInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/api/v1/open/employee-instances/{instance_id}/upgrade": {
      "post": {
        "tags": [
          "Open context"
        ],
        "summary": "Open Upgrade Instance",
        "operationId": "open_upgrade_instance_api_v1_open_employee_instances__instance_id__upgrade_post",
        "security": [
          {
            "openAgentBearer": []
          }
        ],
        "parameters": [
          {
            "name": "instance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Instance Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 36
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Context-Version",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Context-Version"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmployeeUpgradeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/api/v1/open/employee-market/{template_id}/cloud-installation": {
      "get": {
        "tags": [
          "Open context"
        ],
        "summary": "Open Cloud Installation",
        "operationId": "open_cloud_installation_api_v1_open_employee_market__template_id__cloud_installation_get",
        "security": [
          {
            "openAgentBearer": []
          }
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Template Id"
            }
          },
          {
            "name": "operationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 120,
              "title": "Operationid"
            }
          },
          {
            "name": "X-Xiaoya-Team-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 36
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Context-Version",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Context-Version"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/api/v1/open/me": {
      "get": {
        "tags": [
          "Open context"
        ],
        "summary": "Get the current agent-scoped user",
        "security": [
          {
            "openAgentBearer": [
              "profile"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Current subject",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/OpenAgentUser"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/OpenApiError"
          }
        },
        "x-xiaoya-required-scopes": [
          "profile"
        ]
      }
    },
    "/api/v1/open/models": {
      "get": {
        "tags": [
          "Models"
        ],
        "summary": "List models available to the Personal context",
        "description": "Requires a Personal-bound token with the model scope.",
        "security": [
          {
            "openAgentBearer": [
              "model"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Personal model catalog",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/ModelCatalogItem"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/OpenApiError"
          }
        },
        "x-xiaoya-required-scopes": [
          "model"
        ]
      }
    },
    "/api/v1/open/public-billing-sessions": {
      "post": {
        "tags": [
          "Sponsored billing"
        ],
        "summary": "Create Public Billing Session",
        "operationId": "create_public_billing_session_api_v1_open_public_billing_sessions_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicBillingSessionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "Response Create Public Billing Session Api V1 Open Public Billing Sessions Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "openAgentBearer": [
              "model"
            ]
          }
        ],
        "x-xiaoya-required-scopes": [
          "model"
        ]
      }
    },
    "/api/v1/open/public-billing-sessions/{session_id}": {
      "delete": {
        "tags": [
          "Sponsored billing"
        ],
        "summary": "Revoke Public Billing Session",
        "operationId": "revoke_public_billing_session_api_v1_open_public_billing_sessions__session_id__delete",
        "security": [
          {
            "openAgentBearer": [
              "model"
            ]
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Session Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "Response Revoke Public Billing Session Api V1 Open Public Billing Sessions  Session Id  Delete"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "model"
        ]
      }
    },
    "/api/v1/open/refund": {
      "post": {
        "tags": [
          "Open context"
        ],
        "summary": "Refund",
        "operationId": "refund_api_v1_open_refund_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAgentRefundInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Refund Api V1 Open Refund Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "openAgentBearer": [
              "charge"
            ]
          }
        ],
        "x-xiaoya-required-scopes": [
          "charge"
        ]
      }
    },
    "/api/v1/open/teams": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "List Team contexts visible to the current subject",
        "security": [
          {
            "openAgentBearer": [
              "profile"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Team contexts",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/TeamContext"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/OpenApiError"
          }
        },
        "x-xiaoya-required-scopes": [
          "profile"
        ]
      },
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Create Open Team",
        "operationId": "create_open_team_api_v1_open_teams_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamCreateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Create Open Team Api V1 Open Teams Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "openAgentBearer": [
              "profile"
            ]
          }
        ],
        "x-xiaoya-required-scopes": [
          "profile"
        ]
      }
    },
    "/api/v1/open/teams/invitations/accept": {
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Accept Open Invitation",
        "operationId": "accept_open_invitation_api_v1_open_teams_invitations_accept_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamInvitationAcceptInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Accept Open Invitation Api V1 Open Teams Invitations Accept Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "openAgentBearer": [
              "profile"
            ]
          }
        ],
        "x-xiaoya-required-scopes": [
          "profile"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/audit": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Audit Log",
        "operationId": "audit_log_api_v1_open_teams__team_id__audit_get",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Pagesize"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Audit Log Api V1 Open Teams  Team Id  Audit Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/balance": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Get the exact Team balance",
        "security": [
          {
            "openAgentBearer": [
              "balance"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "default": {
            "$ref": "#/components/responses/OpenApiError"
          }
        },
        "x-xiaoya-required-scopes": [
          "balance"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/charge": {
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Team Charge",
        "operationId": "team_charge_api_v1_open_teams__team_id__charge_post",
        "security": [
          {
            "openAgentBearer": [
              "charge"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAgentTeamChargeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Team Charge Api V1 Open Teams  Team Id  Charge Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "charge"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/context": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Resolve one Team context",
        "security": [
          {
            "openAgentBearer": [
              "profile"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Team context",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/TeamContext"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/OpenApiError"
          }
        },
        "x-xiaoya-required-scopes": [
          "profile"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/entitlements": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Open Team State",
        "operationId": "open_team_state_api_v1_open_teams__team_id__entitlements_get",
        "security": [
          {
            "openAgentBearer": [
              "team_read",
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_read",
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/invitations": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Invitations",
        "operationId": "invitations_api_v1_open_teams__team_id__invitations_get",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Invitations Api V1 Open Teams  Team Id  Invitations Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      },
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Create Invitation",
        "operationId": "create_invitation_api_v1_open_teams__team_id__invitations_post",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamInvitationInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Create Invitation Api V1 Open Teams  Team Id  Invitations Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/invitations/{invitation_id}": {
      "delete": {
        "tags": [
          "Team"
        ],
        "summary": "Revoke Invitation",
        "operationId": "revoke_invitation_api_v1_open_teams__team_id__invitations__invitation_id__delete",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "invitation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Invitation Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Revoke Invitation Api V1 Open Teams  Team Id  Invitations  Invitation Id  Delete"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/join-links": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Join Links",
        "operationId": "join_links_api_v1_open_teams__team_id__join_links_get",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Join Links Api V1 Open Teams  Team Id  Join Links Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      },
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Create Join Link",
        "operationId": "create_join_link_api_v1_open_teams__team_id__join_links_post",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamJoinLinkCreateInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Create Join Link Api V1 Open Teams  Team Id  Join Links Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/join-links/{link_id}": {
      "delete": {
        "tags": [
          "Team"
        ],
        "summary": "Revoke Join Link",
        "operationId": "revoke_join_link_api_v1_open_teams__team_id__join_links__link_id__delete",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "link_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Link Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Revoke Join Link Api V1 Open Teams  Team Id  Join Links  Link Id  Delete"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/knowledge/search": {
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Open Agent Search",
        "operationId": "open_agent_search_api_v1_open_teams__team_id__knowledge_search_post",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KnowledgeAgentSearchInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "Response Open Agent Search Api V1 Open Teams  Team Id  Knowledge Search Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/member-credits": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Member Credits",
        "operationId": "member_credits_api_v1_open_teams__team_id__member_credits_get",
        "security": [
          {
            "openAgentBearer": [
              "team_read",
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Member Credits Api V1 Open Teams  Team Id  Member Credits Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_read",
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/member-credits/allocate": {
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Allocate Credits",
        "operationId": "allocate_credits_api_v1_open_teams__team_id__member_credits_allocate_post",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamCreditChangeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Allocate Credits Api V1 Open Teams  Team Id  Member Credits Allocate Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/member-credits/reclaim": {
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Reclaim Credits",
        "operationId": "reclaim_credits_api_v1_open_teams__team_id__member_credits_reclaim_post",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamCreditChangeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Reclaim Credits Api V1 Open Teams  Team Id  Member Credits Reclaim Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/member-credits/{member_id}/quota": {
      "put": {
        "tags": [
          "Team"
        ],
        "summary": "Update Member Credit Quota",
        "operationId": "update_member_credit_quota_api_v1_open_teams__team_id__member_credits__member_id__quota_put",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Member Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamMemberQuotaInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Update Member Credit Quota Api V1 Open Teams  Team Id  Member Credits  Member Id  Quota Put"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/members": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Members",
        "operationId": "members_api_v1_open_teams__team_id__members_get",
        "security": [
          {
            "openAgentBearer": [
              "team_read",
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Members Api V1 Open Teams  Team Id  Members Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_read",
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/members/{member_id}/organization": {
      "put": {
        "tags": [
          "Team"
        ],
        "summary": "Update Member Org",
        "operationId": "update_member_org_api_v1_open_teams__team_id__members__member_id__organization_put",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Member Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamMemberOrganizationInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Update Member Org Api V1 Open Teams  Team Id  Members  Member Id  Organization Put"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/members/{member_id}/role": {
      "patch": {
        "tags": [
          "Team"
        ],
        "summary": "Update Role",
        "operationId": "update_role_api_v1_open_teams__team_id__members__member_id__role_patch",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Member Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamMemberRoleInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Update Role Api V1 Open Teams  Team Id  Members  Member Id  Role Patch"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/members/{member_id}/status": {
      "patch": {
        "tags": [
          "Team"
        ],
        "summary": "Update Status",
        "operationId": "update_status_api_v1_open_teams__team_id__members__member_id__status_patch",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "member_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Member Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamMemberStatusInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Update Status Api V1 Open Teams  Team Id  Members  Member Id  Status Patch"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/membership": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Open Team Current Membership",
        "operationId": "open_team_current_membership_api_v1_open_teams__team_id__membership_get",
        "security": [
          {
            "openAgentBearer": [
              "team_read",
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Open Team Current Membership Api V1 Open Teams  Team Id  Membership Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_read",
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/membership/orders": {
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Create Open Team Membership Order",
        "operationId": "create_open_team_membership_order_api_v1_open_teams__team_id__membership_orders_post",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamMembershipOrderInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Create Open Team Membership Order Api V1 Open Teams  Team Id  Membership Orders Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      },
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "List Open Team Membership Orders",
        "operationId": "list_open_team_membership_orders_api_v1_open_teams__team_id__membership_orders_get",
        "security": [
          {
            "openAgentBearer": [
              "team_read",
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000000,
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Pagesize"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response List Open Team Membership Orders Api V1 Open Teams  Team Id  Membership Orders Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_read",
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/membership/orders/{order_id}": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Get Open Team Membership Order",
        "operationId": "get_open_team_membership_order_api_v1_open_teams__team_id__membership_orders__order_id__get",
        "security": [
          {
            "openAgentBearer": [
              "team_read",
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Order Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Open Team Membership Order Api V1 Open Teams  Team Id  Membership Orders  Order Id  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_read",
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/membership/orders/{order_id}/refunds": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "List Open Team Membership Refunds",
        "operationId": "list_open_team_membership_refunds_api_v1_open_teams__team_id__membership_orders__order_id__refunds_get",
        "security": [
          {
            "openAgentBearer": [
              "team_read",
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Order Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response List Open Team Membership Refunds Api V1 Open Teams  Team Id  Membership Orders  Order Id  Refunds Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_read",
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/membership/plans": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Open Team Membership Plans",
        "operationId": "open_team_membership_plans_api_v1_open_teams__team_id__membership_plans_get",
        "security": [
          {
            "openAgentBearer": [
              "team_read",
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Open Team Membership Plans Api V1 Open Teams  Team Id  Membership Plans Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_read",
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/models": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "List models available to the exact Team context",
        "security": [
          {
            "openAgentBearer": [
              "model"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/TeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Versioned Team model catalog",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/TeamModelCatalog"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/OpenApiError"
          }
        },
        "x-xiaoya-required-scopes": [
          "model"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/organization": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Get Organization",
        "operationId": "get_organization_api_v1_open_teams__team_id__organization_get",
        "security": [
          {
            "openAgentBearer": [
              "team_read",
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Organization Api V1 Open Teams  Team Id  Organization Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_read",
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/organization/{kind}": {
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Create Org Item",
        "operationId": "create_org_item_api_v1_open_teams__team_id__organization__kind__post",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Kind"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamOrganizationItemInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Create Org Item Api V1 Open Teams  Team Id  Organization  Kind  Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/overview": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Open Team Overview",
        "operationId": "open_team_overview_api_v1_open_teams__team_id__overview_get",
        "security": [
          {
            "openAgentBearer": [
              "team_read",
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Open Team Overview Api V1 Open Teams  Team Id  Overview Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_read",
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/profile": {
      "get": {
        "tags": [
          "Team"
        ],
        "summary": "Team Profile",
        "operationId": "team_profile_api_v1_open_teams__team_id__profile_get",
        "security": [
          {
            "openAgentBearer": [
              "team_read",
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Team Profile Api V1 Open Teams  Team Id  Profile Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_read",
          "team_manage"
        ]
      },
      "patch": {
        "tags": [
          "Team"
        ],
        "summary": "Update Team Profile",
        "operationId": "update_team_profile_api_v1_open_teams__team_id__profile_patch",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamProfileInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Update Team Profile Api V1 Open Teams  Team Id  Profile Patch"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/refund": {
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Team Refund",
        "operationId": "team_refund_api_v1_open_teams__team_id__refund_post",
        "security": [
          {
            "openAgentBearer": [
              "charge"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenAgentTeamRefundInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Team Refund Api V1 Open Teams  Team Id  Refund Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "charge"
        ]
      }
    },
    "/api/v1/open/teams/{team_id}/wallet/fund": {
      "post": {
        "tags": [
          "Team"
        ],
        "summary": "Fund Wallet",
        "operationId": "fund_wallet_api_v1_open_teams__team_id__wallet_fund_post",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamWalletFundingInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Fund Wallet Api V1 Open Teams  Team Id  Wallet Fund Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/open/usage": {
      "get": {
        "tags": [
          "Open context"
        ],
        "summary": "Get Personal usage attributed to the current agent",
        "description": "Rejects Team-bound tokens. Team overview is not equivalent to this detail contract.",
        "security": [
          {
            "openAgentBearer": [
              "usage"
            ]
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/Success"
          },
          "default": {
            "$ref": "#/components/responses/OpenApiError"
          }
        },
        "x-xiaoya-required-scopes": [
          "usage"
        ]
      }
    },
    "/api/v1/runtime-assets/{item_type}": {
      "get": {
        "tags": [
          "Runtime assets"
        ],
        "summary": "List Runtime Assets",
        "operationId": "list_runtime_assets_api_v1_runtime_assets__item_type__get",
        "security": [
          {
            "openAgentBearer": [
              "skill"
            ]
          }
        ],
        "parameters": [
          {
            "name": "item_type",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MarketItemType"
            }
          },
          {
            "name": "X-Xiaoya-Team-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 36
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Id"
            }
          },
          {
            "name": "X-Xiaoya-Team-Context-Version",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Xiaoya-Team-Context-Version"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response List Runtime Assets Api V1 Runtime Assets  Item Type  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "skill"
        ]
      }
    },
    "/api/v1/runtime-assets/{item_type}/{item_id}/package": {
      "get": {
        "tags": [
          "Runtime assets"
        ],
        "summary": "Download Runtime Asset Package",
        "operationId": "download_runtime_asset_package_api_v1_runtime_assets__item_type___item_id__package_get",
        "security": [
          {
            "openAgentBearer": [
              "skill"
            ]
          }
        ],
        "parameters": [
          {
            "name": "item_type",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/MarketItemType"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Item Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "skill"
        ]
      }
    },
    "/api/v1/sandbox-runtime/computer/capabilities": {
      "get": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Configured Capabilities",
        "operationId": "configured_capabilities_api_v1_sandbox_runtime_computer_capabilities_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Create Sandbox Workspace",
        "operationId": "create_sandbox_workspace_api_v1_sandbox_runtime_workspaces_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxWorkspaceCreateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Create Sandbox Workspace Api V1 Sandbox Runtime Workspaces Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces/{sandbox_id}": {
      "get": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Sandbox Workspace Status",
        "operationId": "sandbox_workspace_status_api_v1_sandbox_runtime_workspaces__sandbox_id__get",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Sandbox Workspace Status Api V1 Sandbox Runtime Workspaces  Sandbox Id  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      },
      "delete": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Destroy Sandbox Workspace",
        "operationId": "destroy_sandbox_workspace_api_v1_sandbox_runtime_workspaces__sandbox_id__delete",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Destroy Sandbox Workspace Api V1 Sandbox Runtime Workspaces  Sandbox Id  Delete"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces/{sandbox_id}/commands": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Execute Sandbox Command",
        "operationId": "execute_sandbox_command_api_v1_sandbox_runtime_workspaces__sandbox_id__commands_post",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxCommandInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Execute Sandbox Command Api V1 Sandbox Runtime Workspaces  Sandbox Id  Commands Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces/{sandbox_id}/computer": {
      "get": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Status",
        "operationId": "status_api_v1_sandbox_runtime_workspaces__sandbox_id__computer_get",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces/{sandbox_id}/computer/control": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Acquire",
        "operationId": "acquire_api_v1_sandbox_runtime_workspaces__sandbox_id__computer_control_post",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlAcquireInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces/{sandbox_id}/computer/control/heartbeat": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Heartbeat",
        "operationId": "heartbeat_api_v1_sandbox_runtime_workspaces__sandbox_id__computer_control_heartbeat_post",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlLeaseInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces/{sandbox_id}/computer/control/release": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Release",
        "operationId": "release_api_v1_sandbox_runtime_workspaces__sandbox_id__computer_control_release_post",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ControlLeaseInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces/{sandbox_id}/computer/key": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Key",
        "operationId": "key_api_v1_sandbox_runtime_workspaces__sandbox_id__computer_key_post",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeyInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces/{sandbox_id}/computer/mouse": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Mouse",
        "operationId": "mouse_api_v1_sandbox_runtime_workspaces__sandbox_id__computer_mouse_post",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MouseInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces/{sandbox_id}/computer/screenshot": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Screenshot",
        "operationId": "screenshot_api_v1_sandbox_runtime_workspaces__sandbox_id__computer_screenshot_post",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces/{sandbox_id}/computer/status": {
      "get": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Status",
        "operationId": "status_api_v1_sandbox_runtime_workspaces__sandbox_id__computer_status_get",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces/{sandbox_id}/files": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Upload Sandbox File",
        "operationId": "upload_sandbox_file_api_v1_sandbox_runtime_workspaces__sandbox_id__files_post",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxFileUploadInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Upload Sandbox File Api V1 Sandbox Runtime Workspaces  Sandbox Id  Files Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces/{sandbox_id}/files/download": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Download Sandbox File",
        "operationId": "download_sandbox_file_api_v1_sandbox_runtime_workspaces__sandbox_id__files_download_post",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxFileDownloadInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "Response Download Sandbox File Api V1 Sandbox Runtime Workspaces  Sandbox Id  Files Download Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces/{sandbox_id}/pause": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Pause Sandbox Workspace",
        "operationId": "pause_sandbox_workspace_api_v1_sandbox_runtime_workspaces__sandbox_id__pause_post",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Pause Sandbox Workspace Api V1 Sandbox Runtime Workspaces  Sandbox Id  Pause Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/sandbox-runtime/workspaces/{sandbox_id}/resume": {
      "post": {
        "tags": [
          "Sandbox"
        ],
        "summary": "Resume Sandbox Workspace",
        "operationId": "resume_sandbox_workspace_api_v1_sandbox_runtime_workspaces__sandbox_id__resume_post",
        "security": [
          {
            "openAgentBearer": [
              "sandbox"
            ]
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Sandbox Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxResumeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Resume Sandbox Workspace Api V1 Sandbox Runtime Workspaces  Sandbox Id  Resume Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "sandbox"
        ]
      }
    },
    "/api/v1/teams/{team_id}/execution-grants": {
      "post": {
        "tags": [
          "Execution grants"
        ],
        "summary": "Create Execution Grant",
        "operationId": "create_execution_grant_api_v1_teams__team_id__execution_grants_post",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamExecutionGrantInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Create Execution Grant Api V1 Teams  Team Id  Execution Grants Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      },
      "get": {
        "tags": [
          "Execution grants"
        ],
        "summary": "Execution Grants",
        "operationId": "execution_grants_api_v1_teams__team_id__execution_grants_get",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Execution Grants Api V1 Teams  Team Id  Execution Grants Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/api/v1/teams/{team_id}/execution-grants/{grant_id}": {
      "delete": {
        "tags": [
          "Execution grants"
        ],
        "summary": "Revoke Execution Grant",
        "operationId": "revoke_execution_grant_api_v1_teams__team_id__execution_grants__grant_id__delete",
        "security": [
          {
            "openAgentBearer": [
              "team_manage"
            ]
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Team Id"
            }
          },
          {
            "name": "grant_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Grant Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Revoke Execution Grant Api V1 Teams  Team Id  Execution Grants  Grant Id  Delete"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": [
          "team_manage"
        ]
      }
    },
    "/oauth/authorize": {
      "get": {
        "tags": [
          "OAuth"
        ],
        "summary": "Authorize an open agent",
        "description": "Starts the authorization-code flow. Team authorization should include an exact team_id. Public clients use PKCE S256.",
        "parameters": [
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "const": "code"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri",
              "maxLength": 2000
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 500
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 500
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 43,
              "maxLength": 128
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "const": "S256"
            }
          },
          {
            "name": "team_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 36
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirects to login, consent, Team selection, or the registered callback."
          },
          "400": {
            "description": "Invalid client, redirect URI, scope, Team context, or PKCE input."
          }
        },
        "x-xiaoya-required-scopes": []
      },
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "Authorize Submit",
        "operationId": "authorize_submit_oauth_authorize_post",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Body_authorize_submit_oauth_authorize_post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/oauth/revoke": {
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "Revoke an open-agent token",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "client_id",
                  "client_secret",
                  "token"
                ],
                "properties": {
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string",
                    "writeOnly": true
                  },
                  "token": {
                    "type": "string",
                    "writeOnly": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revocation is idempotent."
          },
          "400": {
            "description": "Invalid client credentials."
          }
        },
        "x-xiaoya-required-scopes": []
      }
    },
    "/oauth/token": {
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "Exchange an authorization code",
        "description": "Consumes a five-minute single-use authorization code. New exchanges return a 7-day access token and no refresh token.",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type",
                  "client_id",
                  "client_secret",
                  "code",
                  "redirect_uri"
                ],
                "properties": {
                  "grant_type": {
                    "type": "string",
                    "const": "authorization_code"
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string",
                    "writeOnly": true
                  },
                  "code": {
                    "type": "string",
                    "writeOnly": true
                  },
                  "redirect_uri": {
                    "type": "string",
                    "format": "uri"
                  },
                  "code_verifier": {
                    "type": "string",
                    "minLength": 43,
                    "maxLength": 128,
                    "writeOnly": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access token response. Team exchanges also include team_id and team_authorization_id.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Pragma": {
                "schema": {
                  "type": "string",
                  "const": "no-cache"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "OAuth error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          }
        },
        "x-xiaoya-required-scopes": []
      }
    }
  },
  "components": {
    "securitySchemes": {
      "openAgentBearer": {
        "type": "oauth2",
        "description": "Server-side open-agent access token. Never expose it to browser code, AI input, logs, or URLs.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://claw.zhenhuiai.com/oauth/authorize",
            "tokenUrl": "https://claw.zhenhuiai.com/oauth/token",
            "scopes": {
              "profile": "Read the agent-scoped subject and Team contexts.",
              "balance": "Read Personal or exact Team balances.",
              "charge": "Perform direct charge and refund operations.",
              "usage": "Read Personal usage attributed to this agent.",
              "model": "List available models and call the model gateway.",
              "account": "Read and update the Personal account surface.",
              "payment": "Use Personal payment and order endpoints.",
              "team_read": "Read Team resources.",
              "team_manage": "Manage a Team as Owner or Admin.",
              "skill": "Read licensed runtime Skill and MCP assets.",
              "sandbox": "Use the cloud sandbox runtime."
            }
          }
        }
      }
    },
    "parameters": {
      "TeamId": {
        "name": "team_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "maxLength": 36
        }
      },
      "TeamHeader": {
        "name": "X-Xiaoya-Team-Id",
        "in": "header",
        "required": false,
        "description": "Required for a Team-bound model call.",
        "schema": {
          "type": "string",
          "maxLength": 36
        }
      },
      "WorkflowVersionHeader": {
        "name": "X-Xiaoya-Workflow-Version-Id",
        "in": "header",
        "required": false,
        "description": "Required for a Team-bound model call.",
        "schema": {
          "type": "string",
          "maxLength": 36
        }
      },
      "RunHeader": {
        "name": "X-Xiaoya-Run-Id",
        "in": "header",
        "required": false,
        "description": "Required for a Team-bound model call.",
        "schema": {
          "type": "string",
          "maxLength": 36
        }
      },
      "NodeHeader": {
        "name": "X-Xiaoya-Node-Id",
        "in": "header",
        "required": false,
        "description": "Required for a Team-bound model call.",
        "schema": {
          "type": "string",
          "maxLength": 128
        }
      },
      "AttemptHeader": {
        "name": "X-Xiaoya-Attempt",
        "in": "header",
        "required": false,
        "description": "Required for a Team-bound model call.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 6
        }
      }
    },
    "responses": {
      "Success": {
        "description": "Successful open API response",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/SuccessEnvelope"
            }
          }
        }
      },
      "OpenApiError": {
        "description": "Structured open API or model-gateway error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      }
    },
    "schemas": {
      "OAuthTokenResponse": {
        "type": "object",
        "required": [
          "access_token",
          "token_type",
          "expires_in",
          "scope"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "writeOnly": true
          },
          "token_type": {
            "type": "string",
            "const": "Bearer"
          },
          "expires_in": {
            "type": "integer",
            "const": 604800
          },
          "scope": {
            "type": "string"
          },
          "team_id": {
            "type": "string"
          },
          "team_authorization_id": {
            "type": "string"
          }
        }
      },
      "OAuthError": {
        "type": "object",
        "required": [
          "error",
          "error_description"
        ],
        "properties": {
          "error": {
            "type": "string",
            "enum": [
              "invalid_client",
              "invalid_grant",
              "unsupported_grant_type"
            ]
          },
          "error_description": {
            "type": "string"
          }
        }
      },
      "SuccessEnvelope": {
        "type": "object",
        "required": [
          "success",
          "data",
          "request_id"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "data": {},
          "request_id": {
            "type": "string"
          }
        }
      },
      "ErrorEnvelope": {
        "type": "object",
        "required": [
          "success",
          "code",
          "message",
          "request_id"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "code": {
            "type": "string",
            "examples": [
              "TEAM_CONTEXT_MISMATCH",
              "TEAM_USAGE_STREAMING_UNSUPPORTED",
              "OPEN_AGENT_SCOPE_REQUIRED"
            ]
          },
          "message": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          }
        }
      },
      "OpenAgentUser": {
        "type": "object",
        "required": [
          "userId",
          "displayName"
        ],
        "properties": {
          "userId": {
            "type": "string",
            "description": "Stable subject isolated to the current open agent."
          },
          "displayName": {
            "type": "string"
          },
          "avatarUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          }
        }
      },
      "TeamContext": {
        "type": "object",
        "required": [
          "teamId",
          "name",
          "status",
          "memberId",
          "memberStatus",
          "role"
        ],
        "properties": {
          "teamId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "memberId": {
            "type": "string"
          },
          "memberStatus": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        }
      },
      "ModelCatalogItem": {
        "type": "object",
        "required": [
          "modelCode",
          "displayName",
          "modelType",
          "parameterSchemaVersion",
          "parameterSpec"
        ],
        "properties": {
          "modelCode": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "modelType": {
            "type": "string",
            "enum": [
              "llm",
              "image",
              "video"
            ]
          },
          "acceptsText": {
            "type": "boolean"
          },
          "acceptsImage": {
            "type": "boolean"
          },
          "acceptsFile": {
            "type": "boolean"
          },
          "outputsText": {
            "type": "boolean"
          },
          "outputsImage": {
            "type": "boolean"
          },
          "outputsAudio": {
            "type": "boolean"
          },
          "outputsVideo": {
            "type": "boolean"
          },
          "parameterSchemaVersion": {
            "type": "integer",
            "minimum": 1
          },
          "parameterSpec": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "structuredOutputMode": {
            "type": "string",
            "enum": [
              "prompt",
              "json_object",
              "json_schema"
            ],
            "default": "prompt",
            "description": "Explicit structured-output mode declared by the model catalog. Use prompt when this field is absent. The legacy supportsJson flag alone does not declare native json_object or json_schema support."
          }
        }
      },
      "TeamModelCatalog": {
        "type": "object",
        "required": [
          "teamId",
          "teamContextVersion",
          "planVersionId",
          "catalogVersion",
          "items"
        ],
        "properties": {
          "teamId": {
            "type": "string"
          },
          "teamContextVersion": {
            "type": "integer"
          },
          "planVersionId": {
            "type": "string"
          },
          "catalogVersion": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelCatalogItem"
            }
          }
        }
      },
      "ChatMessage": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "system",
              "user",
              "assistant",
              "tool"
            ]
          },
          "content": {}
        },
        "additionalProperties": true
      },
      "OpenAgentTeamRefundInput": {
        "properties": {
          "points": {
            "type": "integer",
            "maximum": 1000000000000,
            "minimum": 1,
            "title": "Points"
          },
          "idempotencyKey": {
            "type": "string",
            "maxLength": 64,
            "minLength": 8,
            "title": "Idempotencykey"
          },
          "chargeIdempotencyKey": {
            "type": "string",
            "maxLength": 64,
            "minLength": 8,
            "title": "Chargeidempotencykey"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "points",
          "idempotencyKey",
          "chargeIdempotencyKey"
        ],
        "title": "OpenAgentTeamRefundInput"
      },
      "TeamMemberStatusInput": {
        "properties": {
          "status": {
            "type": "string",
            "maxLength": 24,
            "minLength": 1,
            "title": "Status"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "status"
        ],
        "title": "TeamMemberStatusInput"
      },
      "TeamWalletFundingInput": {
        "properties": {
          "points": {
            "type": "integer",
            "maximum": 1000000000000,
            "minimum": 1,
            "title": "Points"
          },
          "idempotencyKey": {
            "type": "string",
            "maxLength": 160,
            "minLength": 8,
            "title": "Idempotencykey"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "points",
          "idempotencyKey"
        ],
        "title": "TeamWalletFundingInput"
      },
      "TeamInvitationAcceptInput": {
        "properties": {
          "token": {
            "type": "string",
            "maxLength": 200,
            "minLength": 20,
            "title": "Token"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "token"
        ],
        "title": "TeamInvitationAcceptInput"
      },
      "TeamOrganizationItemInput": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Name"
          },
          "parentId": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 36
              },
              {
                "type": "null"
              }
            ],
            "title": "Parentid"
          },
          "description": {
            "type": "string",
            "maxLength": 500,
            "title": "Description",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name"
        ],
        "title": "TeamOrganizationItemInput"
      },
      "ProfileInput": {
        "properties": {
          "displayName": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Displayname"
          },
          "avatarUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatarurl"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "ProfileInput"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "OpenAgentCallContextIntrospectionInput": {
        "properties": {
          "clientId": {
            "type": "string",
            "maxLength": 32,
            "minLength": 3,
            "title": "Clientid"
          },
          "clientSecret": {
            "type": "string",
            "maxLength": 512,
            "minLength": 1,
            "title": "Clientsecret"
          },
          "token": {
            "type": "string",
            "maxLength": 8192,
            "minLength": 1,
            "title": "Token"
          }
        },
        "type": "object",
        "required": [
          "clientId",
          "clientSecret",
          "token"
        ],
        "title": "OpenAgentCallContextIntrospectionInput"
      },
      "OpenAgentChargeInput": {
        "properties": {
          "points": {
            "type": "integer",
            "maximum": 1000000000000,
            "minimum": 1,
            "title": "Points"
          },
          "reason": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Reason"
          },
          "idempotencyKey": {
            "type": "string",
            "maxLength": 64,
            "minLength": 8,
            "title": "Idempotencykey"
          }
        },
        "type": "object",
        "required": [
          "points",
          "reason",
          "idempotencyKey"
        ],
        "title": "OpenAgentChargeInput"
      },
      "Body_upload_profile_avatar_api_v1_open_account_profile_avatar_post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_profile_avatar_api_v1_open_account_profile_avatar_post"
      },
      "TeamProfileInput": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Name"
          },
          "avatarUrl": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatarurl"
          },
          "description": {
            "type": "string",
            "maxLength": 500,
            "title": "Description",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name"
        ],
        "title": "TeamProfileInput"
      },
      "TeamMemberOrganizationInput": {
        "properties": {
          "departmentId": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 36
              },
              {
                "type": "null"
              }
            ],
            "title": "Departmentid"
          },
          "positionId": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 36
              },
              {
                "type": "null"
              }
            ],
            "title": "Positionid"
          },
          "managerMemberId": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 36
              },
              {
                "type": "null"
              }
            ],
            "title": "Managermemberid"
          },
          "roleIds": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 50,
            "title": "Roleids"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "TeamMemberOrganizationInput"
      },
      "TeamCreateInput": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Name"
          },
          "idempotencyKey": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 160,
                "minLength": 8
              },
              {
                "type": "null"
              }
            ],
            "title": "Idempotencykey"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name"
        ],
        "title": "TeamCreateInput"
      },
      "TeamJoinLinkCreateInput": {
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/TeamJoinLinkKind",
            "default": "code"
          },
          "role": {
            "type": "string",
            "maxLength": 32,
            "minLength": 1,
            "title": "Role",
            "default": "member"
          },
          "maxUses": {
            "type": "integer",
            "maximum": 10000,
            "minimum": 1,
            "title": "Maxuses",
            "default": 100
          },
          "expiresInHours": {
            "type": "integer",
            "maximum": 720,
            "minimum": 1,
            "title": "Expiresinhours",
            "default": 720
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "TeamJoinLinkCreateInput"
      },
      "TeamJoinLinkKind": {
        "type": "string",
        "enum": [
          "code",
          "link"
        ],
        "title": "TeamJoinLinkKind"
      },
      "SandboxCommandInput": {
        "properties": {
          "command": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 64,
            "minItems": 1,
            "title": "Command"
          },
          "workingDirectory": {
            "type": "string",
            "maxLength": 1000,
            "minLength": 1,
            "title": "Workingdirectory",
            "default": "/home/agent/workspace"
          },
          "environment": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "maxProperties": 100,
            "title": "Environment"
          },
          "timeoutSeconds": {
            "type": "integer",
            "maximum": 900,
            "minimum": 1,
            "title": "Timeoutseconds",
            "default": 60
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "command"
        ],
        "title": "SandboxCommandInput"
      },
      "GiftCardInput": {
        "properties": {
          "code": {
            "type": "string",
            "maxLength": 64,
            "minLength": 12,
            "title": "Code"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "code"
        ],
        "title": "GiftCardInput"
      },
      "TeamMemberRoleInput": {
        "properties": {
          "role": {
            "type": "string",
            "maxLength": 32,
            "minLength": 1,
            "title": "Role"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "role"
        ],
        "title": "TeamMemberRoleInput"
      },
      "OpenAgentTeamChargeInput": {
        "properties": {
          "points": {
            "type": "integer",
            "maximum": 1000000000000,
            "minimum": 1,
            "title": "Points"
          },
          "idempotencyKey": {
            "type": "string",
            "maxLength": 64,
            "minLength": 8,
            "title": "Idempotencykey"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "points",
          "idempotencyKey"
        ],
        "title": "OpenAgentTeamChargeInput"
      },
      "SandboxResumeInput": {
        "properties": {
          "snapshotId": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Snapshotid"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "SandboxResumeInput"
      },
      "TeamMemberQuotaInput": {
        "properties": {
          "quotaLimit": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1000000000000,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Quotalimit"
          },
          "expectedVersion": {
            "type": "integer",
            "minimum": 0,
            "title": "Expectedversion"
          },
          "idempotencyKey": {
            "type": "string",
            "maxLength": 160,
            "minLength": 8,
            "title": "Idempotencykey"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "expectedVersion",
          "idempotencyKey"
        ],
        "title": "TeamMemberQuotaInput"
      },
      "SandboxFileUploadInput": {
        "properties": {
          "destinationPath": {
            "type": "string",
            "maxLength": 1000,
            "minLength": 1,
            "title": "Destinationpath"
          },
          "contentBase64": {
            "type": "string",
            "maxLength": 45000000,
            "minLength": 1,
            "title": "Contentbase64"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "destinationPath",
          "contentBase64"
        ],
        "title": "SandboxFileUploadInput"
      },
      "OpenAgentRefundInput": {
        "properties": {
          "points": {
            "type": "integer",
            "maximum": 1000000000000,
            "minimum": 1,
            "title": "Points"
          },
          "reason": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Reason"
          },
          "idempotencyKey": {
            "type": "string",
            "maxLength": 64,
            "minLength": 8,
            "title": "Idempotencykey"
          },
          "chargeIdempotencyKey": {
            "type": "string",
            "maxLength": 64,
            "minLength": 8,
            "title": "Chargeidempotencykey"
          }
        },
        "type": "object",
        "required": [
          "points",
          "reason",
          "idempotencyKey",
          "chargeIdempotencyKey"
        ],
        "title": "OpenAgentRefundInput"
      },
      "SandboxWorkspaceCreateInput": {
        "properties": {
          "employeeId": {
            "type": "string",
            "format": "uuid",
            "title": "Employeeid"
          },
          "logicalWorkspaceId": {
            "type": "string",
            "format": "uuid",
            "title": "Logicalworkspaceid"
          },
          "idempotencyKey": {
            "type": "string",
            "maxLength": 160,
            "minLength": 8,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$",
            "title": "Idempotencykey"
          },
          "cpuMilli": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 16000,
                "minimum": 250
              },
              {
                "type": "null"
              }
            ],
            "title": "Cpumilli"
          },
          "memoryMb": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 131072,
                "minimum": 512
              },
              {
                "type": "null"
              }
            ],
            "title": "Memorymb"
          },
          "maxRunMinutes": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1440,
                "minimum": 3
              },
              {
                "type": "null"
              }
            ],
            "title": "Maxrunminutes"
          },
          "idlePauseSeconds": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 86400,
                "minimum": 60
              },
              {
                "type": "null"
              }
            ],
            "title": "Idlepauseseconds"
          },
          "environment": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "maxProperties": 100,
            "title": "Environment"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "employeeId",
          "logicalWorkspaceId",
          "idempotencyKey"
        ],
        "title": "SandboxWorkspaceCreateInput"
      },
      "OpenAgentAsyncResultInput": {
        "properties": {
          "result": {
            "additionalProperties": true,
            "type": "object",
            "title": "Result"
          }
        },
        "type": "object",
        "required": [
          "result"
        ],
        "title": "OpenAgentAsyncResultInput"
      },
      "MarketItemType": {
        "type": "string",
        "enum": [
          "skill",
          "mcp"
        ],
        "title": "MarketItemType"
      },
      "TeamExecutionGrantInput": {
        "properties": {
          "subjectType": {
            "$ref": "#/components/schemas/TeamExecutionSubjectType"
          },
          "subjectId": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Subjectid"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 3,
            "minItems": 1,
            "title": "Scopes"
          },
          "expiresInSeconds": {
            "type": "integer",
            "maximum": 31536000,
            "minimum": 3600,
            "title": "Expiresinseconds",
            "default": 2592000
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "subjectType",
          "subjectId",
          "scopes"
        ],
        "title": "TeamExecutionGrantInput"
      },
      "TeamExecutionSubjectType": {
        "type": "string",
        "enum": [
          "automation",
          "workspace"
        ],
        "title": "TeamExecutionSubjectType"
      },
      "TeamCreditChangeInput": {
        "properties": {
          "memberId": {
            "type": "string",
            "maxLength": 36,
            "minLength": 1,
            "title": "Memberid"
          },
          "points": {
            "type": "integer",
            "maximum": 1000000000000,
            "minimum": 1,
            "title": "Points"
          },
          "idempotencyKey": {
            "type": "string",
            "maxLength": 160,
            "minLength": 8,
            "title": "Idempotencykey"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "memberId",
          "points",
          "idempotencyKey"
        ],
        "title": "TeamCreditChangeInput"
      },
      "TeamInvitationInput": {
        "properties": {
          "invitee": {
            "type": "string",
            "maxLength": 320,
            "minLength": 3,
            "title": "Invitee"
          },
          "role": {
            "type": "string",
            "maxLength": 32,
            "minLength": 1,
            "title": "Role"
          },
          "expiresInHours": {
            "type": "integer",
            "maximum": 168,
            "minimum": 1,
            "title": "Expiresinhours",
            "default": 72
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "invitee",
          "role"
        ],
        "title": "TeamInvitationInput"
      },
      "TeamMembershipOrderInput": {
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/PaymentProvider"
          },
          "planVersionId": {
            "type": "string",
            "maxLength": 36,
            "minLength": 1,
            "title": "Planversionid"
          },
          "action": {
            "$ref": "#/components/schemas/TeamMembershipOrderAction"
          },
          "idempotencyKey": {
            "type": "string",
            "maxLength": 120,
            "minLength": 8,
            "title": "Idempotencykey"
          },
          "expectedSubscriptionVersion": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Expectedsubscriptionversion"
          },
          "seatCount": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Seatcount"
          },
          "billingPeriod": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MembershipBillingPeriod"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "provider",
          "planVersionId",
          "action",
          "idempotencyKey"
        ],
        "title": "TeamMembershipOrderInput"
      },
      "PaymentProvider": {
        "type": "string",
        "enum": [
          "wechat",
          "alipay"
        ],
        "title": "PaymentProvider"
      },
      "TeamMembershipOrderAction": {
        "type": "string",
        "enum": [
          "new",
          "renew",
          "upgrade",
          "downgrade_schedule"
        ],
        "title": "TeamMembershipOrderAction"
      },
      "MembershipBillingPeriod": {
        "type": "string",
        "enum": [
          "monthly",
          "yearly"
        ],
        "title": "MembershipBillingPeriod"
      },
      "RechargeOrderInput": {
        "properties": {
          "amount_cents": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 5000000,
                "minimum": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "Amount Cents"
          },
          "order_type": {
            "$ref": "#/components/schemas/PaymentOrderType",
            "default": "recharge"
          },
          "product_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Product Code"
          },
          "idempotency_key": {
            "type": "string",
            "maxLength": 120,
            "minLength": 8,
            "title": "Idempotency Key"
          },
          "catalog_version": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Catalog Version"
          },
          "billing_period": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MembershipBillingPeriod"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "idempotency_key"
        ],
        "title": "RechargeOrderInput"
      },
      "PaymentOrderType": {
        "type": "string",
        "enum": [
          "recharge",
          "membership",
          "team_membership"
        ],
        "title": "PaymentOrderType"
      },
      "Body_authorize_submit_oauth_authorize_post": {
        "properties": {
          "client_id": {
            "type": "string",
            "maxLength": 32,
            "title": "Client Id"
          },
          "redirect_uri": {
            "type": "string",
            "maxLength": 2000,
            "title": "Redirect Uri"
          },
          "scope": {
            "type": "string",
            "maxLength": 500,
            "title": "Scope",
            "default": ""
          },
          "state_value": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "State Value"
          },
          "code_challenge": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ],
            "title": "Code Challenge"
          },
          "code_challenge_method": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Code Challenge Method"
          },
          "csrf_token": {
            "type": "string",
            "maxLength": 200,
            "title": "Csrf Token"
          },
          "decision": {
            "type": "string",
            "maxLength": 10,
            "title": "Decision"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 36,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Id"
          },
          "team_consent_proof": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "title": "Team Consent Proof"
          }
        },
        "type": "object",
        "required": [
          "client_id",
          "redirect_uri",
          "csrf_token",
          "decision"
        ],
        "title": "Body_authorize_submit_oauth_authorize_post"
      },
      "PublicBillingSessionInput": {
        "properties": {
          "expires_in_seconds": {
            "type": "integer",
            "maximum": 3600,
            "minimum": 60,
            "title": "Expires In Seconds",
            "default": 900
          },
          "max_points": {
            "type": "integer",
            "maximum": 1000000000,
            "minimum": 1,
            "title": "Max Points",
            "default": 1000
          },
          "max_calls": {
            "type": "integer",
            "maximum": 10000,
            "minimum": 1,
            "title": "Max Calls",
            "default": 100
          }
        },
        "type": "object",
        "title": "PublicBillingSessionInput"
      },
      "TtsSpeechInput": {
        "properties": {
          "tts_config_id": {
            "type": "string",
            "maxLength": 100,
            "minLength": 3,
            "title": "Tts Config Id"
          },
          "voice": {
            "type": "string",
            "maxLength": 256,
            "minLength": 1,
            "title": "Voice"
          },
          "input": {
            "type": "string",
            "maxLength": 9999,
            "minLength": 1,
            "title": "Input"
          },
          "response_format": {
            "type": "string",
            "maxLength": 20,
            "minLength": 2,
            "title": "Response Format",
            "default": "mp3"
          },
          "speed": {
            "type": "number",
            "maximum": 2,
            "minimum": 0.5,
            "title": "Speed",
            "default": 1
          },
          "volume": {
            "type": "number",
            "maximum": 10,
            "exclusiveMinimum": 0,
            "title": "Volume",
            "default": 1
          },
          "pitch": {
            "type": "integer",
            "maximum": 12,
            "minimum": -12,
            "title": "Pitch",
            "default": 0
          },
          "emotion": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "happy",
                  "sad",
                  "angry",
                  "fearful",
                  "disgusted",
                  "surprised",
                  "calm",
                  "fluent",
                  "whisper"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Emotion"
          },
          "sample_rate": {
            "type": "integer",
            "enum": [
              8000,
              16000,
              22050,
              24000,
              32000,
              44100
            ],
            "title": "Sample Rate",
            "default": 32000
          },
          "bitrate": {
            "type": "integer",
            "enum": [
              32000,
              64000,
              128000,
              256000
            ],
            "title": "Bitrate",
            "default": 128000
          },
          "audio_channel": {
            "type": "integer",
            "enum": [
              1,
              2
            ],
            "title": "Audio Channel",
            "default": 1
          },
          "language_boost": {
            "type": "string",
            "enum": [
              "Chinese",
              "Chinese,Yue",
              "English",
              "Arabic",
              "Russian",
              "Spanish",
              "French",
              "Portuguese",
              "German",
              "Turkish",
              "Dutch",
              "Ukrainian",
              "Vietnamese",
              "Indonesian",
              "Japanese",
              "Italian",
              "Korean",
              "Thai",
              "Polish",
              "Romanian",
              "Greek",
              "Czech",
              "Finnish",
              "Hindi",
              "Bulgarian",
              "Danish",
              "Hebrew",
              "Malay",
              "Persian",
              "Slovak",
              "Swedish",
              "Croatian",
              "Filipino",
              "Hungarian",
              "Norwegian",
              "Slovenian",
              "Catalan",
              "Nynorsk",
              "Tamil",
              "Afrikaans",
              "auto"
            ],
            "title": "Language Boost",
            "default": "auto"
          },
          "text_normalization": {
            "type": "boolean",
            "title": "Text Normalization",
            "default": false
          },
          "latex_read": {
            "type": "boolean",
            "title": "Latex Read",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "tts_config_id",
          "voice",
          "input"
        ],
        "title": "TtsSpeechInput"
      },
      "DesktopExecutionRunInput": {
        "properties": {
          "runId": {
            "type": "string",
            "maxLength": 36,
            "minLength": 36,
            "title": "Runid"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "runId"
        ],
        "title": "DesktopExecutionRunInput"
      },
      "ControlLeaseInput": {
        "properties": {
          "conversationId": {
            "type": "string",
            "format": "uuid",
            "title": "Conversationid"
          },
          "fence": {
            "type": "integer",
            "minimum": 1,
            "title": "Fence"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "conversationId",
          "fence"
        ],
        "title": "ControlLeaseInput"
      },
      "SandboxFileDownloadInput": {
        "properties": {
          "sourcePath": {
            "type": "string",
            "maxLength": 1000,
            "minLength": 1,
            "title": "Sourcepath"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "sourcePath"
        ],
        "title": "SandboxFileDownloadInput"
      },
      "EmployeeCopyInput": {
        "properties": {
          "operationId": {
            "type": "string",
            "maxLength": 120,
            "minLength": 8,
            "title": "Operationid"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "operationId"
        ],
        "title": "EmployeeCopyInput"
      },
      "EmployeeInstancePatch": {
        "properties": {
          "expectedConfigVersion": {
            "type": "integer",
            "minimum": 1,
            "title": "Expectedconfigversion"
          },
          "changes": {
            "type": "object",
            "maxProperties": 20,
            "title": "Changes"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "expectedConfigVersion",
          "changes"
        ],
        "title": "EmployeeInstancePatch"
      },
      "MouseInput": {
        "properties": {
          "x": {
            "type": "integer",
            "exclusiveMaximum": 1280,
            "minimum": 0,
            "title": "X"
          },
          "y": {
            "type": "integer",
            "exclusiveMaximum": 800,
            "minimum": 0,
            "title": "Y"
          },
          "action": {
            "type": "string",
            "enum": [
              "move",
              "click",
              "down",
              "up"
            ],
            "title": "Action",
            "default": "click"
          },
          "button": {
            "type": "string",
            "enum": [
              "left",
              "middle",
              "right"
            ],
            "title": "Button",
            "default": "left"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "x",
          "y"
        ],
        "title": "MouseInput"
      },
      "DesktopExecutionGrantInput": {
        "properties": {
          "purpose": {
            "$ref": "#/components/schemas/ExecutionGrantPurpose",
            "default": "desktop"
          },
          "workspaceId": {
            "type": "string",
            "maxLength": 36,
            "minLength": 1,
            "title": "Workspaceid"
          },
          "employeeId": {
            "type": "string",
            "maxLength": 36,
            "minLength": 1,
            "title": "Employeeid"
          },
          "desktopSessionId": {
            "type": "string",
            "maxLength": 36,
            "minLength": 1,
            "title": "Desktopsessionid"
          },
          "deviceId": {
            "type": "string",
            "maxLength": 128,
            "minLength": 1,
            "title": "Deviceid"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 3,
            "minItems": 1,
            "title": "Scopes"
          },
          "expiresInSeconds": {
            "type": "integer",
            "maximum": 31536000,
            "minimum": 3600,
            "title": "Expiresinseconds",
            "default": 2592000
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "workspaceId",
          "employeeId",
          "desktopSessionId",
          "deviceId",
          "scopes"
        ],
        "title": "DesktopExecutionGrantInput"
      },
      "ExecutionGrantPurpose": {
        "type": "string",
        "enum": [
          "automation",
          "channel",
          "desktop"
        ],
        "title": "ExecutionGrantPurpose"
      },
      "EmployeeStudioLinkInput": {
        "properties": {
          "operationId": {
            "type": "string",
            "maxLength": 120,
            "minLength": 8,
            "title": "Operationid"
          },
          "studioEmployeeId": {
            "type": "string",
            "maxLength": 36,
            "minLength": 1,
            "title": "Studioemployeeid"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "operationId",
          "studioEmployeeId"
        ],
        "title": "EmployeeStudioLinkInput"
      },
      "EmployeeUpgradeInput": {
        "properties": {
          "expectedConfigVersion": {
            "type": "integer",
            "minimum": 1,
            "title": "Expectedconfigversion"
          },
          "operationId": {
            "type": "string",
            "maxLength": 120,
            "minLength": 8,
            "title": "Operationid"
          },
          "version": {
            "type": "string",
            "maxLength": 32,
            "minLength": 1,
            "title": "Version"
          },
          "resolutions": {
            "additionalProperties": {
              "type": "string",
              "enum": [
                "personal",
                "template"
              ]
            },
            "type": "object",
            "title": "Resolutions"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "expectedConfigVersion",
          "operationId",
          "version"
        ],
        "title": "EmployeeUpgradeInput"
      },
      "KnowledgeAgentSearchInput": {
        "properties": {
          "query": {
            "type": "string",
            "maxLength": 4000,
            "minLength": 1,
            "title": "Query"
          },
          "knowledgeBaseIds": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 100,
            "title": "Knowledgebaseids"
          },
          "limit": {
            "type": "integer",
            "maximum": 20,
            "minimum": 1,
            "title": "Limit",
            "default": 8
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "query"
        ],
        "title": "KnowledgeAgentSearchInput"
      },
      "KeyInput": {
        "properties": {
          "keys": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 8,
            "minItems": 1,
            "title": "Keys"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "keys"
        ],
        "title": "KeyInput"
      },
      "ControlAcquireInput": {
        "properties": {
          "conversationId": {
            "type": "string",
            "format": "uuid",
            "title": "Conversationid"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "conversationId"
        ],
        "title": "ControlAcquireInput"
      }
    }
  }
}
