{
  "openapi": "3.1.0",
  "info": {
    "title": "AIM Platform Open API",
    "version": "1.0.0",
    "description": "Current working-tree contract for Owner resources, Agent instances, collaboration, runs, requirements, webhooks, and triggers. Implementation refactoring and remote acceptance are in progress; see OPEN_PLATFORM_API_GUIDE.md."
  },
  "servers": [
    {
      "url": "https://a-im.cn"
    }
  ],
  "security": [
    {
      "oauth2": []
    }
  ],
  "paths": {
    "/v2/agents": {
      "post": {
        "operationId": "createAgentInstance",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentInstanceRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Agent instance",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentInstanceMutation"
                }
              }
            }
          },
          "202": {
            "description": "Configuration preparation accepted",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentInstanceMutation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "get": {
        "operationId": "listAgentInstances",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized Agent instances",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentInstancePage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "parameters": [
          {
            "name": "view",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "owned",
                "usable"
              ],
              "default": "owned"
            }
          },
          {
            "name": "execution_mode",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "studio_managed",
                "harness_self_hosted",
                "external_provider"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "starting",
                "online",
                "offline",
                "error",
                "disabled",
                "archived"
              ]
            }
          },
          {
            "name": "query",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ]
      }
    },
    "/v2/agents/{agent_id}": {
      "parameters": [
        {
          "name": "agent_id",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/Uuid"
          }
        }
      ],
      "get": {
        "operationId": "getAgentInstance",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Agent instance",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentInstance"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateAgentInstance",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            },
            "description": "One strong resource ETag; absent 428, stale 412. Successful idempotent replay precedes CAS."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchAgentInstanceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Agent instance",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentInstanceMutation"
                }
              }
            }
          },
          "202": {
            "description": "Configuration preparation accepted",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentInstanceMutation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "archiveAgentInstance",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            },
            "description": "One strong resource ETag; absent 428, stale 412. Successful idempotent replay precedes CAS."
          }
        ],
        "responses": {
          "200": {
            "description": "Agent instance",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentInstanceMutation"
                }
              }
            }
          },
          "202": {
            "description": "Configuration preparation accepted",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentInstanceMutation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/agents/{agent_id}:restart": {
      "parameters": [
        {
          "name": "agent_id",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/Uuid"
          }
        }
      ],
      "post": {
        "operationId": "restartAgentInstance",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            },
            "description": "One strong resource ETag; absent 428, stale 412. Successful idempotent replay precedes CAS."
          }
        ],
        "responses": {
          "200": {
            "description": "Agent instance",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentInstanceMutation"
                }
              }
            }
          },
          "202": {
            "description": "Configuration preparation accepted",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentInstanceMutation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/agents/{agent_id}/credential:rotate": {
      "parameters": [
        {
          "name": "agent_id",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/Uuid"
          }
        }
      ],
      "post": {
        "operationId": "rotateAgentInstanceCredential",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            },
            "description": "One strong resource ETag; absent 428, stale 412. Successful idempotent replay precedes CAS."
          }
        ],
        "responses": {
          "200": {
            "description": "Agent instance",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentInstanceMutation"
                }
              }
            }
          },
          "202": {
            "description": "Configuration preparation accepted",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentInstanceMutation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/agents/{agent_id}/friends": {
      "parameters": [
        {
          "name": "agent_id",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/Uuid"
          }
        }
      ],
      "get": {
        "operationId": "listOwnedAgentFriends",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "responses": {
          "200": {
            "description": "Friends of the directly owned Agent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentFriendOverview"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/agents/{agent_id}/friends/{friend_id}": {
      "parameters": [
        {
          "name": "agent_id",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/Uuid"
          }
        },
        {
          "name": "friend_id",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/Uuid"
          }
        }
      ],
      "delete": {
        "operationId": "removeOwnedAgentFriend",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "clear_history_for_agent",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Agent friend removed"
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/agents/{agent_id}/credential": {
      "parameters": [
        {
          "name": "agent_id",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/Uuid"
          }
        }
      ],
      "delete": {
        "operationId": "revokeAgentInstanceCredential",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            },
            "description": "One strong resource ETag; absent 428, stale 412. Successful idempotent replay precedes CAS."
          }
        ],
        "responses": {
          "200": {
            "description": "Agent instance",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentInstanceMutation"
                }
              }
            }
          },
          "202": {
            "description": "Configuration preparation accepted",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentInstanceMutation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/.well-known/aim-open-platform": {
      "get": {
        "operationId": "getOpenPlatformDiscovery",
        "security": [],
        "responses": {
          "200": {
            "description": "AIM Open Platform discovery",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenPlatformDiscovery"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApiContract",
        "security": [],
        "responses": {
          "200": {
            "description": "This OpenAPI 3.1 contract",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/openapi/realtime-v1.json": {
      "get": {
        "operationId": "getRealtimeOpenApiContract",
        "security": [],
        "responses": {
          "200": {
            "description": "AIM realtime media OpenAPI 3.1 contract",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/asyncapi.json": {
      "get": {
        "operationId": "getAsyncApiContract",
        "security": [],
        "responses": {
          "200": {
            "description": "AIM AsyncAPI 3.0 contract",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/schemas/a2a-v1.json": {
      "get": {
        "operationId": "getA2aJsonSchema",
        "security": [],
        "responses": {
          "200": {
            "description": "A2A v1 JSON Schema",
            "content": {
              "application/schema+json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/friends": {
      "get": {
        "operationId": "listOAuthContacts",
        "security": [
          {
            "oauth2": [
              "contacts.read"
            ]
          }
        ],
        "x-aim-scopes": [
          "contacts.read"
        ],
        "parameters": [
          {
            "name": "incoming_cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "outgoing_cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "request_limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Caller-minimized contacts and pending friend-request pages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FriendOverview"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/conversations": {
      "get": {
        "operationId": "listOAuthConversations",
        "security": [
          {
            "oauth2": [
              "conversations.read"
            ]
          }
        ],
        "x-aim-scopes": [
          "conversations.read"
        ],
        "responses": {
          "200": {
            "description": "Authorized conversations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConversationSummary"
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createGroup",
        "deprecated": true,
        "security": [
          {
            "humanJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Legacy IM creation response for a canonical Group and dedicated Team",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationSummary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/conversations/{conversation_id}": {
      "get": {
        "operationId": "getOAuthConversation",
        "security": [
          {
            "oauth2": [
              "conversations.read"
            ]
          }
        ],
        "x-aim-scopes": [
          "conversations.read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConversationId"
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized conversation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationSummary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/agents/{agent_id}/grants": {
      "$ref": "#/components/pathItems/OwnedAgentGrants"
    },
    "/v1/agents/{agent_id}/grants/{grant_id}": {
      "$ref": "#/components/pathItems/OwnedAgentGrant"
    },
    "/v1/groups/{group_id}/assistant": {
      "$ref": "#/components/pathItems/GroupAssistant"
    },
    "/v1/conversations/{conversation_id}/messages": {
      "get": {
        "operationId": "listOAuthMessages",
        "security": [
          {
            "oauth2": [
              "messages.read"
            ]
          }
        ],
        "x-aim-scopes": [
          "messages.read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConversationId"
          },
          {
            "name": "after_seq",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "before_seq",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "latest",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          },
          {
            "name": "device_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized message page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagePage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/messages": {
      "post": {
        "operationId": "sendOAuthMessage",
        "security": [
          {
            "oauth2": [
              "messages.write"
            ]
          }
        ],
        "x-aim-scopes": [
          "messages.write"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMessageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message committed idempotently by client_msg_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/managed-files": {
      "get": {
        "operationId": "listManagedFiles",
        "description": "Lists the current Owner's explicit Agent inputs and Managed Agent run artifacts. Chat attachments are excluded.",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized Agent file library",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedFilePage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "uploadManagedFile",
        "description": "Uploads an Owner-owned input and registers it in the independent Agent file library.",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "file_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "width",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "height",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "duration_ms",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/*": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "audio/*": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "video/*": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Managed input registered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedFileEntry"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/managed-files/{asset_id}": {
      "delete": {
        "operationId": "archiveManagedFile",
        "description": "Archives an explicit input registration. Existing session references remain immutable.",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "asset_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Input registration archived"
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/assets": {
      "post": {
        "operationId": "uploadOAuthAsset",
        "security": [
          {
            "oauth2": [
              "assets.write"
            ]
          }
        ],
        "x-aim-scopes": [
          "assets.write"
        ],
        "parameters": [
          {
            "name": "file_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          },
          {
            "name": "width",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "height",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "duration_ms",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/*": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "audio/*": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "video/*": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Asset committed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Asset"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/assets/{asset_id}/content": {
      "get": {
        "operationId": "downloadOAuthAsset",
        "security": [
          {
            "oauth2": [
              "assets.read"
            ]
          }
        ],
        "x-aim-scopes": [
          "assets.read"
        ],
        "parameters": [
          {
            "name": "asset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Range",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized asset bytes",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "Authorized byte range",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/a2a/agents/{agent_id}": {
      "post": {
        "operationId": "invokeAgentA2a",
        "security": [
          {
            "humanJwt": []
          },
          {
            "oauth2": [
              "a2a.invoke"
            ]
          },
          {
            "oauth2": [
              "a2a.tasks.read"
            ]
          },
          {
            "oauth2": [
              "a2a.tasks.cancel"
            ]
          }
        ],
        "x-aim-method-scopes": {
          "SendMessage": "a2a.invoke",
          "SendStreamingMessage": "a2a.invoke",
          "ContinueTask": "a2a.invoke",
          "GetTask": "a2a.tasks.read",
          "ListTasks": "a2a.tasks.read",
          "SubscribeToTask": "a2a.tasks.read",
          "CancelTask": "a2a.tasks.cancel",
          "aim.realtime.GetSession": "a2a.tasks.read",
          "aim.realtime.RegisterEndpoint": "a2a.invoke",
          "aim.realtime.JoinSession": "a2a.invoke",
          "aim.realtime.EndSession": "a2a.invoke",
          "aim.realtime.SendInteraction": "a2a.invoke",
          "aim.realtime.GetCommand": "a2a.tasks.read",
          "aim.realtime.GetOperation": "a2a.tasks.read"
        },
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "A2A-Version",
            "in": "header",
            "required": true,
            "schema": {
              "const": "1.0"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "https://a-im.cn/schemas/a2a-v1.json"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A2A JSON-RPC result or resumable event stream"
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/a2a/agents/{agent_id}/agent-card.json": {
      "get": {
        "operationId": "getRuntimeAgentCard",
        "security": [
          {
            "humanJwt": []
          },
          {
            "oauth2": [
              "agents.read"
            ]
          }
        ],
        "x-aim-scopes": [
          "agents.read"
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized runtime Agent Card; pushNotifications is false",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeAgentCard"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/a2a/groups/{conversation_id}/coordinator": {
      "post": {
        "operationId": "invokeGroupCoordinatorA2a",
        "security": [
          {
            "humanJwt": []
          },
          {
            "oauth2": [
              "a2a.invoke"
            ]
          },
          {
            "oauth2": [
              "a2a.tasks.read"
            ]
          },
          {
            "oauth2": [
              "a2a.tasks.cancel"
            ]
          }
        ],
        "x-aim-method-scopes": {
          "SendMessage": "a2a.invoke",
          "SendStreamingMessage": "a2a.invoke",
          "GetTask": "a2a.tasks.read",
          "ListTasks": "a2a.tasks.read",
          "SubscribeToTask": "a2a.tasks.read",
          "CancelTask": "a2a.tasks.cancel"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/ConversationId"
          },
          {
            "name": "A2A-Version",
            "in": "header",
            "required": true,
            "schema": {
              "const": "1.0"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "https://a-im.cn/schemas/a2a-v1.json"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A2A JSON-RPC result or resumable event stream"
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/a2a/groups/{conversation_id}/coordinator/agent-card.json": {
      "get": {
        "operationId": "getGroupCoordinatorAgentCard",
        "security": [
          {
            "humanJwt": []
          },
          {
            "oauth2": [
              "agents.read"
            ]
          }
        ],
        "x-aim-scopes": [
          "agents.read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ConversationId"
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized group coordinator Agent Card; pushNotifications is false",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuntimeAgentCard"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/runs": {
      "get": {
        "operationId": "listRuns",
        "security": [
          {
            "humanJwt": []
          },
          {
            "oauth2": [
              "runs.read"
            ]
          }
        ],
        "x-aim-scopes": [
          "runs.read"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/RunStatus"
            }
          },
          {
            "name": "group_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "agent_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "origin",
            "in": "query",
            "schema": {
              "enum": [
                "im"
              ]
            }
          },
          {
            "name": "created_from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "created_to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "description": "OAuth Application-owned or Human Owner-wide run page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformRunPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/runs/{run_id}": {
      "get": {
        "operationId": "getRun",
        "security": [
          {
            "humanJwt": []
          },
          {
            "oauth2": [
              "runs.read"
            ]
          }
        ],
        "x-aim-scopes": [
          "runs.read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/RunId"
          }
        ],
        "responses": {
          "200": {
            "description": "Run projection within the authenticated Owner",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformRun"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/runs/{run_id}/events": {
      "get": {
        "operationId": "streamRunEvents",
        "security": [
          {
            "humanJwt": []
          },
          {
            "oauth2": [
              "runs.read"
            ]
          }
        ],
        "x-aim-scopes": [
          "runs.read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/RunId"
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Resumable SSE stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/runs/{run_id}/event-log": {
      "get": {
        "operationId": "listRunEvents",
        "security": [
          {
            "humanJwt": []
          },
          {
            "oauth2": [
              "runs.read"
            ]
          }
        ],
        "x-aim-scopes": [
          "runs.read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/RunId"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "description": "Finite resumable Run event page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformRunEventPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/runs/{run_id}/trace": {
      "get": {
        "operationId": "getRunTrace",
        "security": [
          {
            "humanJwt": []
          },
          {
            "oauth2": [
              "runs.read"
            ]
          }
        ],
        "x-aim-scopes": [
          "runs.read"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/RunId"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "description": "Redacted cross-component trace spans",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunTracePage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/agent-provider/model-grants": {
      "post": {
        "operationId": "createPlatformModelGrant",
        "security": [
          {
            "providerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "AIM-Provider-Version",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformModelGrantRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Short-lived least-privilege model proxy grant; no upstream secret is exposed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformModelGrantResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/model-proxy/chat/completions": {
      "post": {
        "operationId": "proxyPlatformChatCompletion",
        "security": [
          {
            "modelGrantBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upstream-compatible chat completion response or stream",
            "content": {
              "application/json": {
                "schema": {}
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "parameters": [
          {
            "name": "X-AIM-Model-Call-ID",
            "in": "header",
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            },
            "description": "Required for task/RTC managed grants; one UUID per logical request, kept stable across HTTP retry. Repeated dispatched IDs never reissue upstream calls."
          }
        ]
      }
    },
    "/v2/agents/{agent_id}/draft": {
      "get": {
        "operationId": "getManagedAgentDraft",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentDraft"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateManagedAgentDraft",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentDraft"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateManagedAgentDraftRequest"
              }
            }
          }
        }
      }
    },
    "/v2/agents/{agent_id}/draft:validate": {
      "post": {
        "operationId": "validateManagedAgentDraft",
        "description": "Validates an unsaved complete configuration; this does not save or publish it.",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedValidationResult"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateManagedAgentDraftRequest"
              }
            }
          }
        }
      }
    },
    "/v2/agents/{agent_id}/versions": {
      "get": {
        "operationId": "listManagedAgentVersions",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentVersionPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/agents/{agent_id}/versions/{version_id}": {
      "get": {
        "operationId": "getManagedAgentVersion",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentVersion"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/agents/{agent_id}/releases": {
      "get": {
        "operationId": "listManagedAgentReleases",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentReleasePage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createManagedAgentRelease",
        "description": "Freeze current draft or reference immutable version_id for rollback. Preparing/failed never replaces healthy old versions or pinned sessions.",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentRelease"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateManagedAgentReleaseRequest"
              }
            }
          }
        }
      }
    },
    "/v2/agents/{agent_id}/releases/{release_id}": {
      "get": {
        "operationId": "getManagedAgentRelease",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "release_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentRelease"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/agents/{agent_id}/sessions": {
      "get": {
        "operationId": "listManagedAgentSessions",
        "description": "",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentSessionPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createManagedAgentSession",
        "description": "Only current actor sessions are accessible. Preview requires Owner management. active and ready are distinct.",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentSession"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateManagedAgentSessionRequest"
              }
            }
          }
        }
      }
    },
    "/v2/agent-sessions/{session_id}": {
      "get": {
        "operationId": "getManagedAgentSession",
        "description": "",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentSession"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "archiveManagedAgentSession",
        "description": "Durably archive and purge only this actor/session derived content. Immediate fencing and a persistent cleanup job are atomic with CAS/idempotency. Returns archived with reason_code session_purge_pending; GET later reports session_purged only after proven cleanup. External IM originals, other actors/sessions, shared Memory and externally referenced Assets remain. Unknown PUT/multipart outcomes retain precise tombstones and cannot report completion.",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAgentSession"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/agent-sessions/{session_id}/messages": {
      "get": {
        "operationId": "listManagedSessionMessages",
        "description": "Newest first by (created_at,id). IM-origin messages reference canonical IM facts and current visibility.",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSessionMessagePage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "submitManagedSessionMessage",
        "description": "Commits a real canonical message, Provider task and Run in one admission transaction; replay never creates another Run.",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSessionMessageReceipt"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateManagedSessionMessageRequest"
              }
            }
          }
        }
      }
    },
    "/v2/agent-sessions/{session_id}/commands": {
      "post": {
        "operationId": "submitManagedSessionCommand",
        "description": "Only supported when Session.execution_capabilities.commands=true. Bootstrap v1 rejects new controls with 409 runtime_commands_unavailable; cancel can still fence a task but cannot fabricate a legacy host ACK.",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedControlReceipt"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedSessionCommandRequest"
              }
            }
          }
        }
      }
    },
    "/v2/agent-sessions/{session_id}/event-log": {
      "get": {
        "operationId": "listManagedSessionEvents",
        "description": "",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSessionEventPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/agent-sessions/{session_id}/events": {
      "get": {
        "operationId": "streamManagedSessionEvents",
        "description": "SSE data is ManagedSessionEvent JSON. id is opaque actor/session-bound cursor. Last-Event-ID resumes persisted events; stream.closed revokes the connection.",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "x-aim-event-schema": {
                    "$ref": "#/components/schemas/ManagedSessionEvent"
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/agent-sessions/{session_id}/assets": {
      "post": {
        "operationId": "uploadManagedSessionAsset",
        "description": "Raw binary body; asset belongs to current caller actor. This upload is single-send and has no idempotency receipt. Unknown HTTP outcome must not be automatically retried.",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "file_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "width",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "height",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "duration_ms",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Asset"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        }
      }
    },
    "/v2/agents/{agent_id}/im-context": {
      "get": {
        "operationId": "getManagedImContext",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "conversation_id",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedImContext"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/agents/{agent_id}/im-context:reset": {
      "post": {
        "operationId": "resetManagedImContext",
        "description": "CAS starts the default version in the same IM conversation and inherits visible completed history references; old in-flight Runs remain fixed.",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedImContext"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetManagedImContextRequest"
              }
            }
          }
        }
      }
    },
    "/v2/runs/{run_id}": {
      "get": {
        "operationId": "getManagedRun",
        "description": "Actor/session/source-message visibility required; owning the Agent does not grant access to another actor history.",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedRun"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/runs/{run_id}:cancel": {
      "post": {
        "operationId": "cancelManagedRun",
        "description": "Empty body or {}. Durable cancellation intent is distinct from confirmed host termination; bounded timeout can report cancel_termination_unconfirmed.",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedControlReceipt"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/runs/{run_id}/events": {
      "get": {
        "operationId": "listManagedRunEvents",
        "description": "JSON historical page in increasing Run sequence; cursor is actor and Run scoped. This endpoint is not SSE.",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSessionEventPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/runs/{run_id}/interactions": {
      "get": {
        "operationId": "listManagedRunApprovals",
        "description": "",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedToolApprovalPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "respondManagedRunApproval",
        "description": "",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedToolApproval"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RespondManagedToolApprovalRequest"
              }
            }
          }
        }
      }
    },
    "/v2/runs/{run_id}/artifacts/{asset_id}/content": {
      "get": {
        "operationId": "downloadManagedRunArtifact",
        "description": "Rechecks actor Run visibility and exact output asset reference before streaming canonical Asset bytes.",
        "security": [
          {
            "humanJwt": []
          },
          {
            "managedCallerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "asset_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/{resource_kind}": {
      "get": {
        "operationId": "listManagedResources",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "resource_kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "skills",
                "mcp-connections",
                "knowledge-bindings",
                "environment-profiles",
                "memory-stores",
                "secret-vaults",
                "scheduled-tasks",
                "webhook-subscriptions"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedResourcePage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createManagedResources",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "resource_kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "skills",
                "mcp-connections",
                "knowledge-bindings",
                "environment-profiles",
                "memory-stores",
                "secret-vaults",
                "scheduled-tasks",
                "webhook-subscriptions"
              ]
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedResource"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WriteManagedResourceRequest"
              }
            }
          }
        }
      }
    },
    "/v2/{resource_kind}/{resource_id}": {
      "get": {
        "operationId": "getManagedResource",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "resource_kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "skills",
                "mcp-connections",
                "knowledge-bindings",
                "environment-profiles",
                "memory-stores",
                "secret-vaults",
                "scheduled-tasks",
                "webhook-subscriptions"
              ]
            }
          },
          {
            "name": "resource_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedResource"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateManagedResource",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "resource_kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "skills",
                "mcp-connections",
                "knowledge-bindings",
                "environment-profiles",
                "memory-stores",
                "secret-vaults",
                "scheduled-tasks",
                "webhook-subscriptions"
              ]
            }
          },
          {
            "name": "resource_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedResource"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WriteManagedResourceRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "archiveManagedResource",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "resource_kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "skills",
                "mcp-connections",
                "knowledge-bindings",
                "environment-profiles",
                "memory-stores",
                "secret-vaults",
                "scheduled-tasks",
                "webhook-subscriptions"
              ]
            }
          },
          {
            "name": "resource_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedResource"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/mcp-connections/{resource_id}/discovery": {
      "post": {
        "operationId": "discoverManagedMcpTools",
        "description": "Empty body. Current owner/revision tool discovery is persisted; release rejects undiscovered MCP tool bindings.",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMcpDiscovery"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/access-tokens": {
      "get": {
        "operationId": "listManagedAccessTokens",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAccessTokenPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "post": {
        "operationId": "createManagedAccessToken",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAccessTokenMutation"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateManagedAccessTokenRequest"
              }
            }
          }
        }
      }
    },
    "/v2/access-tokens/{token_id}": {
      "get": {
        "operationId": "getManagedAccessToken",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "token_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAccessToken"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "delete": {
        "operationId": "revokeManagedAccessToken",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "token_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedAccessToken"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/budgets": {
      "get": {
        "operationId": "getManagedBudget",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedBudget"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      },
      "patch": {
        "operationId": "updateManagedBudget",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedBudget"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateManagedBudgetRequest"
              }
            }
          }
        }
      }
    },
    "/v2/usage": {
      "get": {
        "operationId": "listManagedUsage",
        "description": "Authoritative platform gateway usage only. RTC has execution_id=root Task and nullable run_id/session_id. Unknown or legacy-unmetered consumption retains reservation as reconciliation_required.",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "agent_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "run_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedUsagePage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/scheduled-tasks/{id}/runs": {
      "post": {
        "operationId": "triggerManagedSchedule",
        "description": "Empty body or {}. Fixed version occurrence; paused only disables automatic cron. Queued/dispatching has nullable Run/Session; submitted returns real Provider identities.",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedScheduledRun"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          },
          "201": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedScheduledRun"
                }
              }
            }
          }
        }
      }
    },
    "/v2/scheduled-tasks/{id}/runs/{occurrence_id}": {
      "get": {
        "operationId": "getManagedScheduledOccurrence",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "occurrence_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedScheduledRun"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/webhook-subscriptions/{id}/deliveries": {
      "get": {
        "operationId": "listManagedWebhookDeliveries",
        "description": "",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedWebhookDeliveryPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/webhook-subscriptions/{id}/deliveries/{delivery_id}/retry": {
      "post": {
        "operationId": "retryManagedWebhookDelivery",
        "description": "Empty body or {}. Only failed events may be retried. Original event ID, endpoint, secret revision and raw body stay fixed. Receiver must deduplicate event IDs.",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedWebhookDelivery"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/agent-provider/tasks/{task_id}/tools/execute": {
      "post": {
        "operationId": "executeManagedTool",
        "description": "",
        "security": [
          {
            "providerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "AIM-Provider-Version",
            "in": "header",
            "required": true,
            "schema": {
              "const": "1.0"
            }
          },
          {
            "name": "AIM-Provider-Instance",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AIM-Lease-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedToolResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedToolRequest"
              }
            }
          }
        }
      }
    },
    "/v1/agent-provider/tasks/{task_id}/commands": {
      "get": {
        "operationId": "pollManagedRunControls",
        "description": "",
        "security": [
          {
            "providerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "AIM-Provider-Version",
            "in": "header",
            "required": true,
            "schema": {
              "const": "1.0"
            }
          },
          {
            "name": "AIM-Provider-Instance",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AIM-Lease-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(0|[1-9][0-9]*)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedRunControlPage"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/agent-provider/tasks/{task_id}/commands/{control_id}/ack": {
      "post": {
        "operationId": "acknowledgeManagedRunControl",
        "description": "Acknowledges durable input enqueue or confirmed cancellation. Success completion additionally uses consumed control_cursor; enqueue ack alone cannot satisfy the completion barrier.",
        "security": [
          {
            "providerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "control_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "AIM-Provider-Version",
            "in": "header",
            "required": true,
            "schema": {
              "const": "1.0"
            }
          },
          {
            "name": "AIM-Provider-Instance",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AIM-Lease-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedControlReceipt"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/agent-provider/tasks/{task_id}/resources/{resource_id}": {
      "get": {
        "operationId": "getManagedBoundResource",
        "description": "",
        "security": [
          {
            "providerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "resource_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "AIM-Provider-Version",
            "in": "header",
            "required": true,
            "schema": {
              "const": "1.0"
            }
          },
          {
            "name": "AIM-Provider-Instance",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AIM-Lease-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedResource"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v1/agent-provider/tasks/{task_id}/resources/{resource_id}/mcp": {
      "post": {
        "operationId": "proxyManagedMcpMetadata",
        "description": "Initialize/list only. tools/call must use durable tools/execute name=mcp and exact resource_id,tool_name,arguments.",
        "security": [
          {
            "providerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "resource_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "AIM-Provider-Version",
            "in": "header",
            "required": true,
            "schema": {
              "const": "1.0"
            }
          },
          {
            "name": "AIM-Provider-Instance",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AIM-Lease-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedMcpProxyResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagedMcpProxyRequest"
              }
            }
          }
        }
      }
    },
    "/v1/agent-provider/tasks/{task_id}/events": {
      "post": {
        "operationId": "reportManagedRuntimeEvents",
        "description": "Only bounded public output/tool/artifact/observational usage events. No chain-of-thought or arbitrary logs. Host usage never overwrites authoritative billing.",
        "security": [
          {
            "providerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "AIM-Provider-Version",
            "in": "header",
            "required": true,
            "schema": {
              "const": "1.0"
            }
          },
          {
            "name": "AIM-Provider-Instance",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-AIM-Lease-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderEventReceipt"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderEventBatch"
              }
            }
          }
        }
      }
    },
    "/v1/agent-provider/tasks/{task_id}/model-grant": {
      "post": {
        "operationId": "createManagedTaskModelGrant",
        "description": "",
        "security": [
          {
            "providerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "AIM-Provider-Version",
            "in": "header",
            "required": true,
            "schema": {
              "const": "1.0"
            }
          },
          {
            "name": "X-AIM-Lease-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformModelGrantResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlatformModelGrantRequest"
              }
            }
          }
        }
      }
    },
    "/v1/realtime/provider/sessions/{session_id}/model-grant": {
      "post": {
        "operationId": "createManagedRealtimeModelGrant",
        "description": "",
        "security": [
          {
            "providerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "AIM-Provider-Version",
            "in": "header",
            "required": true,
            "schema": {
              "const": "1.0"
            }
          },
          {
            "name": "AIM-Realtime-Lease",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlatformModelGrantResponse"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RealtimeProviderModelGrantRequest"
              }
            }
          }
        }
      }
    },
    "/v1/agent-provider/tasks/{task_id}/complete": {
      "post": {
        "operationId": "completeManagedProviderTask",
        "description": "Existing completion pipeline with atomic consumed-control barrier for managed success. Returns stable 409 pending_controls before reserving finalization when accepted input remains; SDK must resume the same Agent instance and consume it. Trusted completed tool assets are merged into the canonical message by the server.",
        "security": [
          {
            "providerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "AIM-Provider-Version",
            "in": "header",
            "required": true,
            "schema": {
              "const": "1.0"
            }
          },
          {
            "name": "AIM-Provider-Instance",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentProviderCompleteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current task summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentTaskSummary"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/environment-templates/default": {
      "get": {
        "operationId": "getManagedEnvironmentTemplate",
        "description": "Fixed approved base image and immutable resource revision. Python packages resolve in an independent gVisor build; ready freezes resolved versions and private artifact digest. No user image or arbitrary build command. Empty body or {} for create.",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Authorized fixed environment template/build",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedEnvironmentTemplate"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    },
    "/v2/environment-profiles/{resource_id}/builds": {
      "post": {
        "operationId": "createManagedEnvironmentBuild",
        "description": "Fixed approved base image and immutable resource revision. Python packages resolve in an independent gVisor build; ready freezes resolved versions and private artifact digest. No user image or arbitrary build command. Empty body or {} for create.",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Authorized fixed environment template/build",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedEnvironmentBuild"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          },
          "200": {
            "description": "Authorized fixed environment template/build",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedEnvironmentBuild"
                }
              }
            }
          }
        }
      }
    },
    "/v2/environment-profiles/{resource_id}/builds/{build_id}": {
      "get": {
        "operationId": "getManagedEnvironmentBuild",
        "description": "Fixed approved base image and immutable resource revision. Python packages resolve in an independent gVisor build; ready freezes resolved versions and private artifact digest. No user image or arbitrary build command. Empty body or {} for create.",
        "security": [
          {
            "humanJwt": []
          }
        ],
        "parameters": [
          {
            "name": "resource_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "build_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized fixed environment template/build",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedEnvironmentBuild"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ApiError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://a-im.cn/oauth/authorize",
            "tokenUrl": "https://a-im.cn/oauth/token",
            "scopes": {
              "a2a.invoke": "Invoke A2A targets",
              "a2a.tasks.cancel": "Cancel owned A2A tasks",
              "a2a.tasks.read": "Read owned A2A tasks",
              "agents.read": "Read published agents",
              "agents.write": "Manage agent definitions",
              "applications.read": "Read application operations",
              "applications.write": "Manage application operations",
              "assets.read": "Read owned or visible assets",
              "assets.write": "Create application-owned assets",
              "capabilities.read": "Read capability registry",
              "capabilities.write": "Manage capability snapshots",
              "contacts.read": "Read authorized contacts",
              "conversations.read": "Read authorized conversations",
              "groups.read": "Read Groups and People governance",
              "groups.write": "Manage Groups and People governance",
              "knowledge.read": "Read Knowledge sources",
              "knowledge.write": "Manage Knowledge sources",
              "mcp.read": "Read MCP connections",
              "mcp.write": "Manage MCP connections",
              "messages.read": "Read authorized messages",
              "messages.write": "Create authorized messages",
              "openid": "Identify the delegated human",
              "profile": "Read the delegated human profile",
              "requirements.read": "Read requirements",
              "requirements.write": "Respond to requirements",
              "runs.read": "Read runs",
              "runs.write": "Create and control runs",
              "runtime.read": "Read Runtime identities",
              "runtime.write": "Manage Runtime identities",
              "skills.read": "Read Skill packages",
              "skills.write": "Manage Skill packages",
              "teams.read": "Read runnable Teams",
              "teams.write": "Manage runnable Teams",
              "triggers.read": "Read triggers",
              "triggers.write": "Manage triggers",
              "webhooks.read": "Read webhook subscriptions",
              "webhooks.write": "Manage webhook subscriptions",
              "workflows.read": "Read workflow definitions",
              "workflows.write": "Manage workflow definitions"
            }
          },
          "clientCredentials": {
            "tokenUrl": "https://a-im.cn/oauth/token",
            "scopes": {
              "a2a.invoke": "Invoke A2A targets",
              "a2a.tasks.cancel": "Cancel owned A2A tasks",
              "a2a.tasks.read": "Read owned A2A tasks",
              "agents.read": "Read published agents",
              "agents.write": "Manage agent definitions",
              "applications.read": "Read application operations",
              "applications.write": "Manage application operations",
              "assets.read": "Read application-owned assets",
              "assets.write": "Create application-owned assets",
              "capabilities.read": "Read capability registry",
              "capabilities.write": "Manage capability snapshots",
              "groups.read": "Read Groups and People governance",
              "groups.write": "Manage Groups and People governance",
              "knowledge.read": "Read Knowledge sources",
              "knowledge.write": "Manage Knowledge sources",
              "mcp.read": "Read MCP connections",
              "mcp.write": "Manage MCP connections",
              "requirements.read": "Read application requirements",
              "requirements.write": "Manage application requirements",
              "runs.read": "Read application runs",
              "runs.write": "Create and control application runs",
              "runtime.read": "Read Runtime identities",
              "runtime.write": "Manage Runtime identities",
              "skills.read": "Read Skill packages",
              "skills.write": "Manage Skill packages",
              "teams.read": "Read runnable Teams",
              "teams.write": "Manage runnable Teams",
              "triggers.read": "Read application triggers",
              "triggers.write": "Manage application triggers",
              "webhooks.read": "Read application webhooks",
              "webhooks.write": "Manage application webhooks",
              "workflows.read": "Read workflow definitions",
              "workflows.write": "Manage workflow definitions"
            }
          }
        }
      },
      "humanJwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "AIM human JWT"
      },
      "providerBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "AIM Agent Secret"
      },
      "modelGrantBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "AIM ModelGrant JWT"
      },
      "managedCallerBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "aimc_v1",
        "description": "Scoped agent.invoke credential; isolated Service actor, never Human Owner management. Current expiry and revocation checked per request."
      }
    },
    "parameters": {
      "ConversationId": {
        "name": "conversation_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "RunId": {
        "name": "run_id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "description": "Opaque, signed and filter-bound continuation cursor. Clients must not parse or modify it.",
        "schema": {
          "type": "string",
          "maxLength": 2048
        }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 50
        }
      },
      "IfMatch": {
        "name": "If-Match",
        "in": "header",
        "required": true,
        "description": "Strong ETag containing the decimal resource version, for example \"3\".",
        "schema": {
          "type": "string",
          "pattern": "^\\\"[0-9]+\\\"$"
        }
      }
    },
    "requestBodies": {},
    "responses": {
      "ApiError": {
        "description": "Stable API error",
        "headers": {
          "X-Request-Id": {
            "description": "Request/trace correlation UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          "WWW-Authenticate": {
            "description": "RFC 6750/RFC 9728 Bearer challenge when applicable",
            "schema": {
              "type": "string"
            }
          },
          "Retry-After": {
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          "RateLimit-Limit": {
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          "RateLimit-Remaining": {
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          "RateLimit-Reset": {
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ApiError"
            }
          }
        }
      }
    },
    "schemas": {
      "RuntimeCapabilities": {
        "type": "object",
        "additionalProperties": false,
        "description": "Managed SDK skills and workflows. Bounded to 256 KiB encoded; workflow depth <=8 and <=64 steps per workflow. Updating replaces the runtime revision.",
        "properties": {
          "skills": {
            "type": "array",
            "maxItems": 32,
            "items": {
              "$ref": "#/components/schemas/RuntimeSkill"
            }
          },
          "workflows": {
            "type": "array",
            "maxItems": 16,
            "items": {
              "$ref": "#/components/schemas/RuntimeWorkflow"
            }
          }
        }
      },
      "RuntimeSkill": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "description",
          "instructions"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "instructions": {
            "type": "string",
            "maxLength": 65536
          },
          "references": {
            "type": "object",
            "maxProperties": 32,
            "propertyNames": {
              "pattern": "^[A-Za-z0-9_-][A-Za-z0-9_.-]{0,127}$"
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 65536
            }
          }
        }
      },
      "RuntimeWorkflow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "description",
          "steps"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "steps": {
            "type": "array",
            "minItems": 1,
            "maxItems": 64,
            "items": {
              "$ref": "#/components/schemas/RuntimeWorkflowStep"
            }
          }
        }
      },
      "RuntimeWorkflowStep": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "name",
              "instructions"
            ],
            "properties": {
              "type": {
                "const": "agent"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              "instructions": {
                "type": "string",
                "maxLength": 65536
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "name",
              "steps"
            ],
            "properties": {
              "type": {
                "const": "parallel"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              "steps": {
                "type": "array",
                "minItems": 1,
                "maxItems": 64,
                "items": {
                  "$ref": "#/components/schemas/RuntimeWorkflowStep"
                }
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "name",
              "steps"
            ],
            "properties": {
              "type": {
                "const": "sequence"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              "steps": {
                "type": "array",
                "minItems": 1,
                "maxItems": 64,
                "items": {
                  "$ref": "#/components/schemas/RuntimeWorkflowStep"
                }
              }
            }
          }
        ]
      },
      "CreateAgentInstanceRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "instructions": {
            "type": "string",
            "maxLength": 32768
          },
          "description": {
            "type": "string",
            "maxLength": 1000
          },
          "avatar_asset_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "execution_mode": {
            "type": "string",
            "enum": [
              "studio_managed",
              "harness_self_hosted",
              "external_provider"
            ],
            "default": "studio_managed"
          },
          "runtime": {
            "$ref": "#/components/schemas/RuntimeCapabilities"
          },
          "managed_creation": {
            "type": "string",
            "enum": [
              "auto_publish",
              "draft"
            ],
            "default": "auto_publish",
            "description": "draft is M1 Developer entry and remains disabled until explicit release; ordinary create defaults to auto_publish."
          },
          "managed_configuration": {
            "$ref": "#/components/schemas/ManagedAgentConfiguration",
            "description": "Complete initial draft saved atomically with a Developer Web managed Agent."
          }
        },
        "allOf": [
          {
            "if": {
              "required": [
                "execution_mode"
              ],
              "properties": {
                "execution_mode": {
                  "enum": [
                    "harness_self_hosted",
                    "external_provider"
                  ]
                }
              }
            },
            "then": {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "instructions"
                    ]
                  },
                  {
                    "required": [
                      "runtime"
                    ]
                  },
                  {
                    "required": [
                      "managed_configuration"
                    ]
                  }
                ]
              }
            }
          },
          {
            "if": {
              "required": [
                "managed_configuration"
              ]
            },
            "then": {
              "required": [
                "managed_creation"
              ],
              "properties": {
                "managed_creation": {
                  "const": "draft"
                },
                "execution_mode": {
                  "const": "studio_managed"
                }
              },
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "instructions"
                    ]
                  },
                  {
                    "required": [
                      "runtime"
                    ]
                  }
                ]
              }
            }
          }
        ]
      },
      "PatchAgentInstanceRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "instructions": {
            "type": "string",
            "maxLength": 32768
          },
          "description": {
            "type": "string",
            "maxLength": 1000
          },
          "avatar_asset_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "enabled": {
            "type": "boolean"
          },
          "runtime": {
            "$ref": "#/components/schemas/RuntimeCapabilities"
          }
        }
      },
      "AgentInstance": {
        "type": "object",
        "required": [
          "agent_id",
          "principal_id",
          "owner_id",
          "name",
          "description",
          "avatar_asset_id",
          "execution_mode",
          "role",
          "status",
          "reason_code",
          "enabled",
          "can_chat",
          "can_manage",
          "version",
          "generation",
          "last_seen_at",
          "coordinator_team_id",
          "available_actions",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "agent_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "principal_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "owner_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "description": {
            "type": "string",
            "maxLength": 1000
          },
          "avatar_asset_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "execution_mode": {
            "type": "string",
            "enum": [
              "studio_managed",
              "harness_self_hosted",
              "external_provider"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "worker",
              "coordinator"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "starting",
              "online",
              "offline",
              "error",
              "disabled",
              "archived"
            ]
          },
          "reason_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "can_chat": {
            "type": "boolean"
          },
          "can_manage": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "generation": {
            "type": "integer",
            "minimum": 1
          },
          "last_seen_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "coordinator_team_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "configuration": {
            "type": "object",
            "required": [
              "instructions",
              "model",
              "desired_revision",
              "effective_revision",
              "config_status",
              "max_output_tokens",
              "max_turns"
            ],
            "properties": {
              "instructions": {
                "type": "string",
                "maxLength": 32768
              },
              "model": {
                "type": "string"
              },
              "desired_revision": {
                "type": "integer",
                "minimum": 1
              },
              "effective_revision": {
                "type": "integer",
                "minimum": 0
              },
              "config_status": {
                "type": "string",
                "enum": [
                  "applying",
                  "applied",
                  "failed"
                ]
              },
              "config_reason_code": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "max_output_tokens": {
                "type": "integer"
              },
              "max_turns": {
                "type": "integer"
              },
              "runtime": {
                "$ref": "#/components/schemas/RuntimeCapabilities"
              }
            }
          },
          "credential": {
            "type": "object",
            "required": [
              "status",
              "generation"
            ],
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "revoked"
                ]
              },
              "generation": {
                "type": "integer",
                "minimum": 1
              }
            }
          },
          "available_actions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AgentInstanceMutation": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AgentInstance"
          },
          {
            "type": "object",
            "properties": {
              "secret": {
                "type": "string",
                "description": "Returned once; never stored or replayed in plaintext."
              },
              "secret_delivery": {
                "type": "string",
                "enum": [
                  "issued",
                  "already_issued"
                ]
              }
            }
          }
        ]
      },
      "AgentInstancePage": {
        "type": "object",
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentInstance"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "GroupCoordinator": {
        "type": "object",
        "required": [
          "group_id",
          "team_id",
          "can_manage",
          "agent"
        ],
        "properties": {
          "group_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "team_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "can_manage": {
            "type": "boolean"
          },
          "agent": {
            "$ref": "#/components/schemas/AgentInstance"
          }
        }
      },
      "UpdateGroupCoordinatorRequest": {
        "type": "object",
        "required": [
          "enabled"
        ],
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "ApiError": {
        "type": "object",
        "required": [
          "code",
          "message",
          "trace_id"
        ],
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[a-z0-9_]+$"
          },
          "message": {
            "type": "string"
          },
          "trace_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "Uuid": {
        "type": "string",
        "format": "uuid"
      },
      "PrincipalType": {
        "type": "string",
        "enum": [
          "human",
          "agent",
          "service"
        ]
      },
      "PrincipalSummary": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "handle",
          "display_name",
          "avatar_url"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "kind": {
            "$ref": "#/components/schemas/PrincipalType"
          },
          "handle": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "avatar_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          }
        },
        "additionalProperties": false
      },
      "FriendRelationship": {
        "type": "object",
        "required": [
          "origin",
          "can_remove"
        ],
        "properties": {
          "origin": {
            "type": "string"
          },
          "can_remove": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "FriendContact": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "handle",
          "display_name",
          "avatar_url",
          "relationship"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "kind": {
            "$ref": "#/components/schemas/PrincipalType"
          },
          "handle": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "avatar_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "relationship": {
            "$ref": "#/components/schemas/FriendRelationship"
          }
        },
        "additionalProperties": false
      },
      "FriendRequest": {
        "type": "object",
        "required": [
          "id",
          "requester",
          "addressee",
          "message",
          "status",
          "created_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "requester": {
            "$ref": "#/components/schemas/PrincipalSummary"
          },
          "addressee": {
            "$ref": "#/components/schemas/PrincipalSummary"
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AgentFriendOverview": {
        "type": "object",
        "required": [
          "agent_id",
          "friends"
        ],
        "properties": {
          "agent_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "friends": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FriendContact"
            }
          }
        },
        "additionalProperties": false
      },
      "FriendOverview": {
        "type": "object",
        "required": [
          "friends",
          "incoming_requests",
          "outgoing_requests",
          "incoming_pending_count",
          "outgoing_pending_count"
        ],
        "properties": {
          "friends": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FriendContact"
            }
          },
          "incoming_requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FriendRequest"
            }
          },
          "outgoing_requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FriendRequest"
            }
          },
          "incoming_pending_count": {
            "type": "integer",
            "minimum": 0
          },
          "outgoing_pending_count": {
            "type": "integer",
            "minimum": 0
          },
          "incoming_next_cursor": {
            "type": "string"
          },
          "outgoing_next_cursor": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ConversationMemberDetail": {
        "type": "object",
        "required": [
          "principal_id",
          "role",
          "alias"
        ],
        "properties": {
          "principal_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "role": {
            "type": "string"
          },
          "alias": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ConversationSummary": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "title",
          "canonical_title",
          "avatar_url",
          "announcement",
          "invite_approval_required",
          "latest_seq",
          "last_message_preview",
          "unread_count",
          "unread_mention_count",
          "unread_watched_count",
          "is_pinned",
          "is_muted",
          "saved_to_contacts",
          "watched_member_ids",
          "draft_text",
          "viewer_role",
          "my_alias",
          "my_remark",
          "member_details",
          "members",
          "inactive_member_ids",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "direct",
              "group",
              "system"
            ]
          },
          "title": {
            "type": "string"
          },
          "canonical_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "avatar_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "announcement": {
            "type": "string"
          },
          "invite_approval_required": {
            "type": "boolean"
          },
          "latest_seq": {
            "type": "integer",
            "minimum": 0
          },
          "last_message_preview": {
            "type": [
              "string",
              "null"
            ]
          },
          "unread_count": {
            "type": "integer",
            "minimum": 0
          },
          "unread_mention_count": {
            "type": "integer",
            "minimum": 0
          },
          "unread_watched_count": {
            "type": "integer",
            "minimum": 0
          },
          "is_pinned": {
            "type": "boolean"
          },
          "is_muted": {
            "type": "boolean"
          },
          "saved_to_contacts": {
            "type": "boolean"
          },
          "watched_member_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          "draft_text": {
            "type": "string"
          },
          "viewer_role": {
            "type": "string"
          },
          "my_alias": {
            "type": "string"
          },
          "my_remark": {
            "type": "string"
          },
          "member_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversationMemberDetail"
            }
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrincipalSummary"
            }
          },
          "inactive_member_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "GroupGatewayDisclosure": {
        "type": "object",
        "required": [
          "revision",
          "orchestration_enabled"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "orchestration_enabled": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "SendMessageRequest": {
        "type": "object",
        "required": [
          "client_msg_id",
          "conversation_id",
          "kind",
          "content"
        ],
        "properties": {
          "client_msg_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "conversation_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "kind": {
            "type": "string"
          },
          "content": {},
          "mentions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            },
            "default": []
          },
          "mention_all": {
            "type": "boolean",
            "default": false
          },
          "reply_to": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "reply_quote": {
            "type": [
              "string",
              "null"
            ]
          },
          "group_gateway_disclosure": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GroupGatewayDisclosure"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Message": {
        "type": "object",
        "required": [
          "id",
          "client_msg_id",
          "conversation_id",
          "seq",
          "sender",
          "kind",
          "content",
          "mentions",
          "mention_all",
          "reply_to",
          "reply_quote",
          "reply_source_state",
          "task_id",
          "created_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "client_msg_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "conversation_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "seq": {
            "type": "integer",
            "minimum": 1
          },
          "sender": {
            "$ref": "#/components/schemas/PrincipalSummary"
          },
          "kind": {
            "type": "string"
          },
          "content": {},
          "mentions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          "mention_all": {
            "type": "boolean"
          },
          "reply_to": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "reply_quote": {
            "type": [
              "string",
              "null"
            ]
          },
          "reply_source_state": {
            "type": "string",
            "enum": [
              "intact",
              "recalled",
              "unknown"
            ]
          },
          "task_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "target_device_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "target_device_name_snapshot": {
            "type": "string"
          },
          "origin_device_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "origin_device_name_snapshot": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "MessagePage": {
        "type": "object",
        "required": [
          "messages",
          "latest_seq",
          "has_older",
          "has_newer"
        ],
        "properties": {
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            }
          },
          "latest_seq": {
            "type": "integer",
            "minimum": 0
          },
          "has_older": {
            "type": "boolean"
          },
          "has_newer": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "Asset": {
        "type": "object",
        "required": [
          "asset_id",
          "file_name",
          "mime_type",
          "size_bytes",
          "sha256",
          "width",
          "height",
          "duration_ms"
        ],
        "properties": {
          "asset_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "file_name": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "width": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "height": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          }
        },
        "additionalProperties": false
      },
      "RunAssetReference": {
        "type": "object",
        "required": [
          "asset_id",
          "role",
          "name",
          "media_type",
          "size_bytes",
          "content_digest",
          "downloadable"
        ],
        "properties": {
          "asset_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "role": {
            "type": "string",
            "pattern": "^[a-z0-9._-]{1,64}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "media_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 127
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "content_digest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "downloadable": {
            "type": "boolean"
          },
          "download_path": {
            "type": "string",
            "pattern": "^/v1/(assets/[0-9a-f-]{36}|agent-provider/run-items/[0-9a-f-]{36}/assets/[0-9a-f-]{36})/content$"
          }
        },
        "additionalProperties": false
      },
      "RuntimeAgentCard": {
        "type": "object",
        "required": [
          "name",
          "description",
          "version",
          "supportedInterfaces",
          "capabilities",
          "securitySchemes",
          "securityRequirements",
          "defaultInputModes",
          "defaultOutputModes",
          "skills"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "supportedInterfaces": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": [
                "url",
                "protocolBinding",
                "protocolVersion"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "protocolBinding": {
                  "const": "JSONRPC"
                },
                "protocolVersion": {
                  "const": "1.0"
                }
              },
              "additionalProperties": false
            }
          },
          "capabilities": {
            "type": "object",
            "required": [
              "streaming",
              "pushNotifications",
              "extendedAgentCard",
              "extensions"
            ],
            "properties": {
              "streaming": {
                "const": true
              },
              "pushNotifications": {
                "const": false
              },
              "extendedAgentCard": {
                "const": false
              },
              "extensions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "uri",
                    "description",
                    "required"
                  ],
                  "properties": {
                    "uri": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "required": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            },
            "additionalProperties": false
          },
          "securitySchemes": {
            "type": "object",
            "required": [
              "aimBearer"
            ],
            "properties": {
              "aimBearer": {
                "type": "object",
                "required": [
                  "httpAuthSecurityScheme"
                ],
                "properties": {
                  "httpAuthSecurityScheme": {
                    "type": "object",
                    "required": [
                      "scheme",
                      "bearerFormat"
                    ],
                    "properties": {
                      "scheme": {
                        "const": "Bearer"
                      },
                      "bearerFormat": {
                        "const": "JWT"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "securityRequirements": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "defaultInputModes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "defaultOutputModes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "skills": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "description",
                "tags"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "tags": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      },
      "OpenPlatformLimits": {
        "type": "object",
        "required": [
          "max_page_size"
        ],
        "properties": {
          "max_page_size": {
            "type": "integer",
            "const": 100
          }
        },
        "additionalProperties": false
      },
      "OpenPlatformDiscovery": {
        "type": "object",
        "required": [
          "api_version",
          "resource",
          "openapi_url",
          "asyncapi_url",
          "a2a_schema_url",
          "limits",
          "authentication"
        ],
        "properties": {
          "api_version": {
            "const": "1.0.0"
          },
          "resource": {
            "type": "string",
            "format": "uri"
          },
          "openapi_url": {
            "type": "string",
            "format": "uri"
          },
          "asyncapi_url": {
            "type": "string",
            "format": "uri"
          },
          "a2a_schema_url": {
            "type": "string",
            "format": "uri"
          },
          "limits": {
            "$ref": "#/components/schemas/OpenPlatformLimits"
          },
          "authentication": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "human_jwt",
                "agent_secret",
                "managed_caller_token"
              ]
            },
            "uniqueItems": true,
            "minItems": 2,
            "maxItems": 2
          }
        },
        "additionalProperties": false
      },
      "RunTraceSpan": {
        "type": "object",
        "required": [
          "id",
          "run_id",
          "name",
          "status",
          "sequence",
          "attributes",
          "started_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "run_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "parent_span_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1
          },
          "attributes": {
            "type": "object"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "RunTracePage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunTraceSpan"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "CreateResourceGrantRequest": {
        "type": "object",
        "required": [
          "grantee_principal_id",
          "capability"
        ],
        "properties": {
          "grantee_principal_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "capability": {
            "const": "agent.use"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "ResourceGrant": {
        "type": "object",
        "required": [
          "id",
          "owner_id",
          "grantee_principal_id",
          "resource_kind",
          "resource_id",
          "capability",
          "status",
          "version",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "owner_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "grantee_principal_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "resource_kind": {
            "const": "agent"
          },
          "resource_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "capability": {
            "const": "agent.use"
          },
          "status": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "ResourceGrantPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResourceGrant"
            },
            "maxItems": 100
          },
          "next_cursor": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "CreateGroupTeamRequest": {
        "type": "object",
        "properties": {
          "agent_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            },
            "uniqueItems": true
          },
          "strategy": {
            "enum": [
              "coordinator",
              "sequential",
              "parallel",
              "route"
            ],
            "default": "coordinator"
          },
          "skill_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            },
            "uniqueItems": true
          },
          "knowledge_source_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            },
            "uniqueItems": true
          }
        },
        "additionalProperties": false
      },
      "CreateGroupRequest": {
        "type": "object",
        "anyOf": [
          {
            "required": [
              "name"
            ]
          },
          {
            "required": [
              "title"
            ]
          }
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "deprecated": true
          },
          "avatar_asset_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "member_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            },
            "uniqueItems": true,
            "default": []
          },
          "team": {
            "$ref": "#/components/schemas/CreateGroupTeamRequest"
          },
          "source_conversation_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "shared_message_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            },
            "default": []
          }
        },
        "additionalProperties": false
      },
      "AgentExecutionMode": {
        "type": "string",
        "enum": [
          "studio_managed",
          "harness_self_hosted",
          "external_provider"
        ]
      },
      "PlatformModelGrantRequest": {
        "type": "object",
        "required": [
          "instance_id",
          "capabilities"
        ],
        "properties": {
          "instance_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "model_hint": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 128
          },
          "capabilities": {
            "type": "array",
            "prefixItems": [
              {
                "const": "chat_completions"
              }
            ],
            "minItems": 1,
            "maxItems": 1
          }
        },
        "additionalProperties": false
      },
      "PlatformModelGrantResponse": {
        "type": "object",
        "required": [
          "api_key",
          "base_url",
          "model",
          "expires_at"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "writeOnly": true
          },
          "base_url": {
            "type": "string",
            "format": "uri"
          },
          "model": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "image_input": {
            "type": "boolean"
          },
          "max_output_tokens": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65536
          }
        },
        "additionalProperties": false
      },
      "RunStatus": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "waiting",
          "finalizing",
          "succeeded",
          "failed",
          "cancelled"
        ]
      },
      "PlatformRun": {
        "type": "object",
        "required": [
          "id",
          "owner_id",
          "caller_principal_id",
          "target_kind",
          "origin_kind",
          "purpose",
          "idempotency_key",
          "input",
          "input_assets",
          "budget",
          "status",
          "output_assets",
          "attempt",
          "version",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "request_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "invocation_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "task_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "owner_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "team_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "agent_id": {
            "$ref": "#/components/schemas/Uuid",
            "description": "Agent instance executing this Run."
          },
          "caller_principal_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "definition_version_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "target_kind": {
            "type": "string",
            "enum": [
              "agent",
              "workflow",
              "team",
              "legacy_team"
            ]
          },
          "origin_kind": {
            "type": "string",
            "enum": [
              "im",
              "api",
              "trigger",
              "evaluation",
              "group_coordinator",
              "a2a_group"
            ]
          },
          "group_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "root_message_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "team_revision": {
            "type": "integer",
            "minimum": 1
          },
          "roster_snapshot_digest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "capability_snapshot_digest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "execution_mode": {
            "$ref": "#/components/schemas/AgentExecutionMode"
          },
          "definition_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "deployment_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "purpose": {
            "enum": [
              "standard",
              "deployment_evaluation"
            ]
          },
          "idempotency_key": {
            "$ref": "#/components/schemas/Uuid"
          },
          "input": {},
          "input_assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunAssetReference"
            },
            "maxItems": 32
          },
          "budget": {},
          "deadline": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/RunStatus"
          },
          "output": {},
          "output_assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunAssetReference"
            }
          },
          "actual_usage": {},
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "attempt": {
            "type": "integer",
            "minimum": 0
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "PlatformRunPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlatformRun"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "PlatformRunEvent": {
        "type": "object",
        "required": [
          "id",
          "run_id",
          "sequence",
          "event_type",
          "payload",
          "created_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "run_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1
          },
          "event_type": {
            "type": "string"
          },
          "payload": {},
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "PlatformRunEventPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlatformRunEvent"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ManagedModelBinding": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "platform",
              "byok"
            ]
          },
          "model": {
            "type": "string"
          },
          "secret_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "kind": {
                  "const": "byok"
                }
              },
              "required": [
                "kind"
              ]
            },
            "then": {
              "properties": {
                "model": {
                  "type": "string",
                  "minLength": 1
                },
                "secret_id": {
                  "$ref": "#/components/schemas/Uuid"
                }
              },
              "required": [
                "model",
                "secret_id"
              ]
            }
          }
        ]
      },
      "ManagedToolBinding": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "policy": {
            "type": "string",
            "enum": [
              "disabled",
              "allow",
              "ask"
            ]
          },
          "resource_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "name",
          "policy"
        ],
        "additionalProperties": false
      },
      "ManagedResourceBinding": {
        "type": "object",
        "properties": {
          "resource_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "kind": {
            "type": "string",
            "enum": [
              "skill",
              "mcp",
              "knowledge",
              "memory",
              "agent",
              "environment"
            ]
          },
          "revision": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "access": {
            "type": "string",
            "enum": [
              "read",
              "read_write"
            ]
          }
        },
        "required": [
          "resource_id",
          "kind",
          "revision",
          "access"
        ],
        "additionalProperties": false
      },
      "ManagedExecutionLimits": {
        "type": "object",
        "properties": {
          "max_output_tokens": {
            "type": "integer",
            "minimum": 1,
            "maximum": 65536,
            "default": 4096
          },
          "max_turns": {
            "type": "integer",
            "minimum": 1,
            "maximum": 128,
            "default": 16
          },
          "timeout_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3600,
            "default": 600
          },
          "session_ttl_seconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 2592000,
            "default": 604800
          }
        },
        "required": [
          "max_output_tokens",
          "max_turns",
          "timeout_seconds",
          "session_ttl_seconds"
        ],
        "additionalProperties": false
      },
      "ManagedAgentConfiguration": {
        "type": "object",
        "properties": {
          "instructions": {
            "type": "string",
            "maxLength": 32768
          },
          "model_binding": {
            "$ref": "#/components/schemas/ManagedModelBinding"
          },
          "runtime": {
            "$ref": "#/components/schemas/RuntimeCapabilities"
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedToolBinding"
            },
            "maxItems": 64
          },
          "resource_bindings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedResourceBinding"
            },
            "maxItems": 64
          },
          "environment_profile_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "limits": {
            "$ref": "#/components/schemas/ManagedExecutionLimits"
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "UpdateManagedAgentDraftRequest": {
        "type": "object",
        "properties": {
          "configuration": {
            "$ref": "#/components/schemas/ManagedAgentConfiguration"
          }
        },
        "required": [
          "configuration"
        ],
        "additionalProperties": false
      },
      "ManagedAgentDraft": {
        "type": "object",
        "properties": {
          "agent_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "configuration": {
            "$ref": "#/components/schemas/ManagedAgentConfiguration"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "agent_id",
          "version",
          "configuration",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ManagedValidationIssue": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "code"
        ],
        "additionalProperties": false
      },
      "ManagedValidationResult": {
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedValidationIssue"
            }
          }
        },
        "required": [
          "valid",
          "issues"
        ],
        "additionalProperties": false
      },
      "ManagedRuntimeArtifact": {
        "type": "object",
        "properties": {
          "image": {
            "type": "string"
          },
          "sandbox_image": {
            "type": "string"
          },
          "assembler_version": {
            "type": "string"
          },
          "tool_adapter_version": {
            "type": "string"
          }
        },
        "required": [
          "image",
          "assembler_version",
          "tool_adapter_version"
        ],
        "additionalProperties": false
      },
      "ManagedAgentVersion": {
        "type": "object",
        "properties": {
          "runtime_artifact": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ManagedRuntimeArtifact"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "agent_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "number": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "configuration": {
            "$ref": "#/components/schemas/ManagedAgentConfiguration"
          },
          "configuration_digest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "resolved_model_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Resolved exactly once from first trusted bootstrap, unchanged by operator default changes."
          },
          "resolved_model_image_input": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Actual trusted bootstrap model capability. Unknown legacy snapshots stay null until proven."
          }
        },
        "required": [
          "runtime_artifact",
          "id",
          "agent_id",
          "number",
          "configuration",
          "configuration_digest",
          "created_at",
          "resolved_model_name",
          "resolved_model_image_input"
        ],
        "additionalProperties": false
      },
      "CreateManagedAgentReleaseRequest": {
        "type": "object",
        "properties": {
          "version_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "ManagedAgentRelease": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "agent_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "version_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "version_number": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "status": {
            "type": "string",
            "enum": [
              "preparing",
              "active",
              "failed",
              "superseded"
            ]
          },
          "reason_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "activated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "agent_id",
          "version_id",
          "version_number",
          "status",
          "reason_code",
          "created_at",
          "activated_at"
        ],
        "additionalProperties": false
      },
      "CreateManagedAgentSessionRequest": {
        "type": "object",
        "properties": {
          "version_id": {
            "description": "Owner may select a known historical or preview version. Other actors may omit this field or explicitly select only the current default; other version IDs return 404. Existing session receipts replay before this check and remain pinned after publishing.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "preview": {
            "type": "boolean",
            "default": false
          },
          "title": {
            "type": "string",
            "maxLength": 128
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "ManagedAgentSession": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "agent_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "version_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "version_number": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "title": {
            "type": "string"
          },
          "preview": {
            "type": "boolean"
          },
          "ready": {
            "type": "boolean"
          },
          "reason_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived",
              "expired"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "limits": {
            "$ref": "#/components/schemas/ManagedSessionLimits"
          },
          "execution_capabilities": {
            "$ref": "#/components/schemas/ManagedSessionExecutionCapabilities"
          }
        },
        "required": [
          "id",
          "agent_id",
          "version_id",
          "version_number",
          "version",
          "title",
          "preview",
          "ready",
          "reason_code",
          "status",
          "created_at",
          "expires_at",
          "limits",
          "execution_capabilities"
        ],
        "additionalProperties": false
      },
      "CreateManagedSessionMessageRequest": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 12000
          },
          "asset_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            },
            "maxItems": 16,
            "uniqueItems": true
          }
        },
        "required": [
          "text"
        ],
        "additionalProperties": false
      },
      "ManagedSessionMessage": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "session_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ]
          },
          "text": {
            "type": "string"
          },
          "asset_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            },
            "maxItems": 16
          },
          "run_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "session_id",
          "role",
          "text",
          "asset_ids",
          "run_id",
          "created_at"
        ],
        "additionalProperties": false
      },
      "ManagedSessionMessageReceipt": {
        "type": "object",
        "properties": {
          "message": {
            "$ref": "#/components/schemas/ManagedSessionMessage"
          },
          "run_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "task_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "version_id": {
            "$ref": "#/components/schemas/Uuid"
          }
        },
        "required": [
          "message",
          "run_id",
          "task_id",
          "version_id"
        ],
        "additionalProperties": false
      },
      "ManagedProviderContext": {
        "type": "object",
        "properties": {
          "session_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "version_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "version_number": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "security_epoch": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "configuration": {
            "$ref": "#/components/schemas/ManagedAgentConfiguration"
          }
        },
        "required": [
          "session_id",
          "version_id",
          "version_number",
          "security_epoch",
          "configuration"
        ],
        "additionalProperties": false
      },
      "ManagedImContext": {
        "type": "object",
        "properties": {
          "agent_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "conversation_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "context_generation": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "session": {
            "$ref": "#/components/schemas/ManagedAgentSession"
          }
        },
        "required": [
          "agent_id",
          "conversation_id",
          "context_generation",
          "session"
        ],
        "additionalProperties": false
      },
      "ResetManagedImContextRequest": {
        "type": "object",
        "properties": {
          "conversation_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "expected_generation": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          }
        },
        "required": [
          "conversation_id",
          "expected_generation"
        ],
        "additionalProperties": false
      },
      "ManagedSessionEvent": {
        "type": "object",
        "properties": {
          "schema_version": {
            "type": "integer",
            "const": 1
          },
          "event_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "session_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "run_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "sequence": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "type": {
            "type": "string"
          },
          "payload": {
            "description": "Canonical serde_json::Value for caller business payload; grants and routing are never inferred from these keys.",
            "type": [
              "object",
              "array",
              "string",
              "integer",
              "number",
              "boolean",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "schema_version",
          "event_id",
          "session_id",
          "run_id",
          "sequence",
          "type",
          "payload",
          "created_at"
        ],
        "additionalProperties": false
      },
      "ManagedToolRequest": {
        "type": "object",
        "properties": {
          "command_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "call_id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "builtin: bash/read/write/edit/glob/grep/mark_artifacts/web_fetch/web_search/knowledge_search/memory_read/memory_write; mcp requires exact resource_id,tool_name,arguments."
          },
          "arguments": {
            "description": "Canonical serde_json::Value for caller business payload; grants and routing are never inferred from these keys.",
            "type": [
              "object",
              "array",
              "string",
              "integer",
              "number",
              "boolean",
              "null"
            ]
          }
        },
        "required": [
          "command_id",
          "call_id",
          "name",
          "arguments"
        ],
        "additionalProperties": false
      },
      "ManagedToolResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "waiting_approval",
              "running",
              "reconciliation_required"
            ]
          },
          "operation_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "call_id": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "is_error": {
            "type": "boolean"
          },
          "asset_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Uuid"
            },
            "maxItems": 16
          },
          "requirement_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "action_digest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "status",
          "operation_id",
          "call_id",
          "content",
          "is_error",
          "asset_ids"
        ],
        "additionalProperties": false
      },
      "ManagedToolApproval": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "kind": {
            "const": "approval"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected",
              "expired"
            ]
          },
          "version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "action_digest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "tool_name": {
            "type": "string"
          },
          "arguments": {
            "description": "Canonical serde_json::Value for caller business payload; grants and routing are never inferred from these keys.",
            "type": [
              "object",
              "array",
              "string",
              "integer",
              "number",
              "boolean",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "status",
          "version",
          "action_digest",
          "tool_name",
          "arguments"
        ],
        "additionalProperties": false
      },
      "RespondManagedToolApprovalRequest": {
        "type": "object",
        "properties": {
          "requirement_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "expected_version": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "action_digest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "decision": {
            "type": "string",
            "enum": [
              "approve",
              "reject"
            ]
          }
        },
        "required": [
          "requirement_id",
          "expected_version",
          "action_digest",
          "decision"
        ],
        "additionalProperties": false
      },
      "ManagedToolApprovalPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedToolApproval"
            },
            "maxItems": 64
          },
          "next_cursor": {
            "type": "null"
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ManagedRun": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "agent_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "session_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "version_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "task_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "caller_principal_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "waiting",
              "waiting_approval",
              "waiting_input",
              "finalizing",
              "cancelling",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "attempt": {
            "type": "integer",
            "minimum": 0
          },
          "input": {
            "description": "Canonical serde_json::Value for caller business payload; grants and routing are never inferred from these keys.",
            "type": [
              "object",
              "array",
              "string",
              "integer",
              "number",
              "boolean",
              "null"
            ]
          },
          "output": {
            "anyOf": [
              {
                "description": "Canonical serde_json::Value for caller business payload; grants and routing are never inferred from these keys.",
                "type": [
                  "object",
                  "array",
                  "string",
                  "integer",
                  "number",
                  "boolean",
                  "null"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "output_assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunAssetReference"
            },
            "maxItems": 16
          },
          "actual_usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ManagedRunActualUsage"
              },
              {
                "type": "null"
              }
            ]
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "agent_id",
          "session_id",
          "version_id",
          "task_id",
          "caller_principal_id",
          "status",
          "version",
          "attempt",
          "input",
          "output",
          "output_assets",
          "actual_usage",
          "error_code",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ManagedSessionCommandRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "steer",
              "follow_up",
              "interrupt"
            ]
          },
          "target_run_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "text": {
            "type": "string",
            "maxLength": 12000
          }
        },
        "required": [
          "kind",
          "target_run_id"
        ],
        "additionalProperties": false
      },
      "ManagedControlReceipt": {
        "type": "object",
        "properties": {
          "run_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "status": {
            "type": "string",
            "enum": [
              "accepted",
              "applied",
              "cancelling",
              "cancelled"
            ]
          },
          "control_id": {
            "$ref": "#/components/schemas/Uuid"
          }
        },
        "required": [
          "run_id",
          "status",
          "control_id"
        ],
        "additionalProperties": false
      },
      "ManagedRunControl": {
        "type": "object",
        "properties": {
          "control_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "sequence": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "steer",
              "follow_up",
              "interrupt",
              "cancel"
            ]
          },
          "target_run_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "text": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "control_id",
          "sequence",
          "kind",
          "target_run_id",
          "text",
          "created_at"
        ],
        "additionalProperties": false
      },
      "ManagedRunControlPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedRunControl"
            },
            "maxItems": 128
          },
          "next_cursor": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ManagedExecutionMetadata": {
        "type": "object",
        "properties": {
          "run_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "session_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "version_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "version_number": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RunAssetReference"
            },
            "maxItems": 16
          },
          "interactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedToolApproval"
            },
            "maxItems": 64
          },
          "resource_usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ManagedResourceUsage"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "run_id",
          "session_id",
          "version_id",
          "version_number",
          "assets",
          "interactions"
        ],
        "additionalProperties": false
      },
      "ManagedSkillConfiguration": {
        "type": "object",
        "properties": {
          "type": {
            "const": "skill"
          },
          "instructions": {
            "type": "string"
          },
          "references": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "scripts": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "type",
          "instructions"
        ],
        "additionalProperties": false
      },
      "ManagedMcpConfiguration": {
        "type": "object",
        "properties": {
          "type": {
            "const": "mcp"
          },
          "endpoint": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048
          },
          "secret_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "allowed_tools": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 128
          }
        },
        "required": [
          "type",
          "endpoint"
        ],
        "additionalProperties": false
      },
      "ManagedKnowledgeConfiguration": {
        "type": "object",
        "properties": {
          "type": {
            "const": "knowledge"
          },
          "endpoint": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048
          },
          "collection": {
            "type": "string"
          },
          "secret_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "type",
          "endpoint",
          "collection"
        ],
        "additionalProperties": false
      },
      "ManagedEnvironmentConfiguration": {
        "type": "object",
        "properties": {
          "type": {
            "const": "environment"
          },
          "template": {
            "const": "default"
          },
          "packages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 64
          },
          "cpu_millis": {
            "type": "integer",
            "minimum": 100,
            "maximum": 2000,
            "default": 500
          },
          "memory_mib": {
            "type": "integer",
            "minimum": 128,
            "maximum": 2048,
            "default": 512
          }
        },
        "required": [
          "type",
          "template"
        ],
        "additionalProperties": false
      },
      "ManagedMemoryConfiguration": {
        "type": "object",
        "properties": {
          "type": {
            "const": "memory"
          },
          "entries": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "type"
        ],
        "additionalProperties": false,
        "description": "Dynamic writes are isolated by the currently authorized Run caller principal; delegation uses the calling business Agent identity, not automatic end-user propagation. Immutable configured entries seed each actor independently."
      },
      "ManagedSecretVaultConfiguration": {
        "type": "object",
        "properties": {
          "type": {
            "const": "secret_vault"
          },
          "endpoint": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048
          },
          "allowed_hosts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 32
          },
          "header_name": {
            "type": "string",
            "default": "Authorization"
          }
        },
        "required": [
          "type",
          "endpoint"
        ],
        "additionalProperties": false
      },
      "ManagedScheduledTaskConfiguration": {
        "type": "object",
        "properties": {
          "type": {
            "const": "scheduled_task"
          },
          "agent_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "version_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "message": {
            "type": "string",
            "maxLength": 12000
          },
          "cron": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 128,
                "description": "POSIX five numeric fields with *, ranges, lists, nonzero steps. DOM/DOW restricted fields use OR."
              },
              {
                "type": "null"
              }
            ]
          },
          "timezone": {
            "type": "string",
            "default": "UTC"
          },
          "paused": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "type",
          "agent_id",
          "version_id",
          "message"
        ],
        "additionalProperties": false
      },
      "ManagedWebhookConfiguration": {
        "type": "object",
        "properties": {
          "type": {
            "const": "webhook"
          },
          "endpoint": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "run.queued",
                "run.started",
                "run.succeeded",
                "run.failed",
                "run.cancelled",
                "release.active",
                "release.failed"
              ]
            },
            "maxItems": 32
          },
          "secret_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "paused": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "type",
          "endpoint",
          "events",
          "secret_id"
        ],
        "additionalProperties": false
      },
      "ManagedResourceConfiguration": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ManagedSkillConfiguration"
          },
          {
            "$ref": "#/components/schemas/ManagedMcpConfiguration"
          },
          {
            "$ref": "#/components/schemas/ManagedKnowledgeConfiguration"
          },
          {
            "$ref": "#/components/schemas/ManagedEnvironmentConfiguration"
          },
          {
            "$ref": "#/components/schemas/ManagedMemoryConfiguration"
          },
          {
            "$ref": "#/components/schemas/ManagedSecretVaultConfiguration"
          },
          {
            "$ref": "#/components/schemas/ManagedScheduledTaskConfiguration"
          },
          {
            "$ref": "#/components/schemas/ManagedWebhookConfiguration"
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "WriteManagedResourceRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "configuration": {
            "$ref": "#/components/schemas/ManagedResourceConfiguration"
          },
          "secret_value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16384,
            "writeOnly": true
          }
        },
        "required": [
          "name",
          "configuration"
        ],
        "additionalProperties": false
      },
      "ManagedResource": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "skills",
              "mcp-connections",
              "knowledge-bindings",
              "environment-profiles",
              "memory-stores",
              "secret-vaults",
              "scheduled-tasks",
              "webhook-subscriptions"
            ]
          },
          "version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "configuration": {
            "$ref": "#/components/schemas/ManagedResourceConfiguration"
          },
          "configuration_digest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "has_secret": {
            "type": "boolean"
          },
          "archived": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "kind",
          "version",
          "configuration",
          "configuration_digest",
          "has_secret",
          "archived",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ManagedMcpDiscovery": {
        "type": "object",
        "properties": {
          "resource_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "revision": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "schema_digest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "inputSchema": {
                  "type": "object",
                  "description": "MCP tool JSON Schema supplied by the authorized upstream."
                }
              },
              "required": [
                "name",
                "inputSchema"
              ],
              "additionalProperties": true
            },
            "maxItems": 128
          }
        },
        "required": [
          "resource_id",
          "revision",
          "schema_digest",
          "tools"
        ],
        "additionalProperties": false
      },
      "CreateManagedAccessTokenRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "agent_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "expires_in_seconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 2592000,
            "default": 86400
          },
          "max_runs_per_day": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 100
          }
        },
        "required": [
          "name",
          "agent_id"
        ],
        "additionalProperties": false
      },
      "ManagedAccessToken": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "actor_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "agent_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "const": "agent.invoke"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "max_runs_per_day": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "actor_id",
          "agent_id",
          "name",
          "scopes",
          "status",
          "max_runs_per_day",
          "created_at",
          "expires_at"
        ],
        "additionalProperties": false
      },
      "ManagedAccessTokenMutation": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "actor_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "agent_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "name": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "const": "agent.invoke"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "max_runs_per_day": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "access_token": {
            "type": "string",
            "writeOnly": true,
            "description": "Only the first creation response. Replay omits it."
          },
          "secret_delivery": {
            "type": "string",
            "enum": [
              "issued",
              "already_issued"
            ]
          }
        },
        "required": [
          "id",
          "actor_id",
          "agent_id",
          "name",
          "scopes",
          "status",
          "max_runs_per_day",
          "created_at",
          "expires_at",
          "secret_delivery"
        ],
        "additionalProperties": false
      },
      "UpdateManagedBudgetRequest": {
        "type": "object",
        "properties": {
          "max_active_runs": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          },
          "max_daily_runs": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "max_daily_tokens": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "max_run_tokens": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          }
        },
        "required": [
          "max_active_runs",
          "max_daily_runs",
          "max_daily_tokens",
          "max_run_tokens"
        ],
        "additionalProperties": false
      },
      "ManagedBudget": {
        "type": "object",
        "properties": {
          "agent_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "max_active_runs": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          },
          "max_daily_runs": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "max_daily_tokens": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "max_run_tokens": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          }
        },
        "required": [
          "agent_id",
          "version",
          "max_active_runs",
          "max_daily_runs",
          "max_daily_tokens",
          "max_run_tokens"
        ],
        "additionalProperties": false
      },
      "ManagedRunUsage": {
        "type": "object",
        "properties": {
          "execution_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "run_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "agent_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "session_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "realtime_session_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "input_tokens": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "output_tokens": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "tool_calls": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "reserved_tokens": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "reservation_status": {
            "type": "string",
            "enum": [
              "active",
              "settled",
              "reconciliation_required"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "resource_usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ManagedResourceUsage"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "execution_id",
          "run_id",
          "agent_id",
          "session_id",
          "realtime_session_id",
          "input_tokens",
          "output_tokens",
          "tool_calls",
          "reserved_tokens",
          "reservation_status",
          "created_at"
        ],
        "additionalProperties": false
      },
      "ManagedScheduledRun": {
        "type": "object",
        "properties": {
          "occurrence_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "scheduled_task_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "session_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "run_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "scheduled_for": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "dispatching",
              "submitted",
              "failed"
            ]
          }
        },
        "required": [
          "occurrence_id",
          "scheduled_task_id",
          "session_id",
          "run_id",
          "reason_code",
          "scheduled_for",
          "status"
        ],
        "additionalProperties": false
      },
      "ManagedWebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "subscription_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "event_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "event_type": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "delivering",
              "delivered",
              "failed"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "last_status_code": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 100,
                "maximum": 599
              },
              {
                "type": "null"
              }
            ]
          },
          "reason_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "next_attempt_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "subscription_id",
          "event_id",
          "event_type",
          "status",
          "attempts",
          "last_status_code",
          "reason_code",
          "created_at",
          "next_attempt_at"
        ],
        "additionalProperties": false
      },
      "ManagedAgentVersionPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedAgentVersion"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ManagedAgentReleasePage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedAgentRelease"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ManagedAgentSessionPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedAgentSession"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ManagedSessionMessagePage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedSessionMessage"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ManagedSessionEventPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedSessionEvent"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ManagedFileSource": {
        "type": "string",
        "enum": [
          "input",
          "artifact"
        ]
      },
      "ManagedFileEntry": {
        "type": "object",
        "required": [
          "asset_id",
          "file_name",
          "mime_type",
          "size_bytes",
          "sha256",
          "width",
          "height",
          "duration_ms",
          "source",
          "run_id",
          "created_at",
          "download_path"
        ],
        "properties": {
          "asset_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "file_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "mime_type": {
            "type": "string",
            "minLength": 1,
            "maxLength": 127
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "width": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "height": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "source": {
            "$ref": "#/components/schemas/ManagedFileSource"
          },
          "run_id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "download_path": {
            "type": "string",
            "pattern": "^/v1/assets/[0-9a-f-]{36}/content$"
          }
        },
        "additionalProperties": false
      },
      "ManagedFilePage": {
        "type": "object",
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedFileEntry"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "ManagedResourcePage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedResource"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ManagedAccessTokenPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedAccessToken"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ManagedUsagePage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedRunUsage"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ManagedWebhookDeliveryPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedWebhookDelivery"
            }
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ProviderRuntimeEvent": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "event_id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "type": {
                "const": "text_delta"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "event_id",
              "type",
              "text"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "event_id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "type": {
                "const": "tool_started"
              },
              "call_id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "event_id",
              "type",
              "call_id",
              "name"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "event_id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "type": {
                "const": "tool_completed"
              },
              "call_id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "is_error": {
                "type": "boolean"
              },
              "summary": {
                "type": "string"
              }
            },
            "required": [
              "event_id",
              "type",
              "call_id",
              "name",
              "is_error",
              "summary"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "event_id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "type": {
                "const": "artifact_created"
              },
              "asset_id": {
                "$ref": "#/components/schemas/Uuid"
              }
            },
            "required": [
              "event_id",
              "type",
              "asset_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "event_id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "type": {
                "const": "usage_recorded"
              },
              "usage_event_id": {
                "$ref": "#/components/schemas/Uuid"
              },
              "input_tokens": {
                "type": "integer",
                "minimum": 0
              },
              "output_tokens": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "event_id",
              "type",
              "usage_event_id",
              "input_tokens",
              "output_tokens"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ProviderEventBatch": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderRuntimeEvent"
            },
            "maxItems": 128
          }
        },
        "required": [
          "events"
        ],
        "additionalProperties": false
      },
      "RuntimeEventReceipt": {
        "type": "object",
        "properties": {
          "event_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "sequence": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          }
        },
        "required": [
          "event_id",
          "sequence"
        ],
        "additionalProperties": false
      },
      "ProviderEventReceipt": {
        "type": "object",
        "properties": {
          "run_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuntimeEventReceipt"
            }
          }
        },
        "required": [
          "run_id",
          "events"
        ],
        "additionalProperties": false
      },
      "RealtimeProviderModelGrantRequest": {
        "type": "object",
        "properties": {
          "instanceId": {
            "type": "string"
          },
          "instanceBootId": {
            "type": "string"
          },
          "sessionEpoch": {
            "type": "integer",
            "minimum": 0
          },
          "leaseEpoch": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "instanceId",
          "instanceBootId",
          "sessionEpoch",
          "leaseEpoch"
        ],
        "additionalProperties": false
      },
      "ManagedMcpProxyRequest": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "integer"
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "initialize",
              "tools/list"
            ]
          },
          "params": {
            "description": "Canonical serde_json::Value for caller business payload; grants and routing are never inferred from these keys.",
            "type": [
              "object",
              "array",
              "string",
              "integer",
              "number",
              "boolean",
              "null"
            ]
          }
        },
        "required": [
          "jsonrpc",
          "id",
          "method"
        ],
        "additionalProperties": false
      },
      "ManagedMcpProxyResponse": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "result": {
            "description": "Canonical serde_json::Value for caller business payload; grants and routing are never inferred from these keys.",
            "type": [
              "object",
              "array",
              "string",
              "integer",
              "number",
              "boolean",
              "null"
            ]
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              },
              "data": {
                "description": "Canonical serde_json::Value for caller business payload; grants and routing are never inferred from these keys.",
                "type": [
                  "object",
                  "array",
                  "string",
                  "integer",
                  "number",
                  "boolean",
                  "null"
                ]
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "jsonrpc",
          "id"
        ],
        "additionalProperties": false
      },
      "AgentTaskToolProgress": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "call_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "state",
          "summary"
        ]
      },
      "AgentTaskProgress": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "task_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "sequence": {
            "type": "integer",
            "minimum": 0
          },
          "phase": {
            "type": "string"
          },
          "percent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "draft_text": {
            "type": "string"
          },
          "tool_summary": {
            "$ref": "#/components/schemas/AgentTaskToolProgress"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "task_id",
          "sequence",
          "phase",
          "updated_at"
        ]
      },
      "AgentTaskSummary": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "conversation_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "trigger_message_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "agent": {
            "$ref": "#/components/schemas/PrincipalSummary"
          },
          "requested_by": {
            "$ref": "#/components/schemas/PrincipalSummary"
          },
          "conversation_title": {
            "type": "string"
          },
          "trigger_preview": {
            "type": "string"
          },
          "context_available": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "retryable": {
            "type": "boolean"
          },
          "progress": {
            "$ref": "#/components/schemas/AgentTaskProgress"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "conversation_id",
          "trigger_message_id",
          "agent",
          "requested_by",
          "conversation_title",
          "trigger_preview",
          "context_available",
          "status",
          "error",
          "retryable",
          "created_at",
          "updated_at"
        ]
      },
      "AgentProviderOutputPart": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "text"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "text"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "asset"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "image",
                  "audio",
                  "file"
                ]
              },
              "asset": {
                "$ref": "#/components/schemas/Asset"
              },
              "caption": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "kind",
              "asset"
            ]
          }
        ]
      },
      "AgentProviderOutput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentProviderOutputPart"
            }
          }
        },
        "required": [
          "parts"
        ]
      },
      "AgentProviderCompleteRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "control_cursor": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$",
            "description": "Actually consumed steer/follow_up watermark, not enqueued ack watermark. Unconsumed accepted input atomically rejects success with pending_controls."
          },
          "extensions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "lease_token": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          },
          "output": {
            "$ref": "#/components/schemas/AgentProviderOutput"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "lease_token",
          "success"
        ]
      },
      "ManagedSessionLimits": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "max_owner_active_sessions": {
            "type": "integer",
            "const": 256
          },
          "max_agent_active_sessions": {
            "type": "integer",
            "const": 64
          },
          "max_retained_versions": {
            "type": "integer",
            "const": 16
          }
        },
        "required": [
          "max_owner_active_sessions",
          "max_agent_active_sessions",
          "max_retained_versions"
        ]
      },
      "ManagedEnvironmentTemplate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "image": {
            "type": "string",
            "pattern": "^.+@sha256:[a-f0-9]{64}$"
          },
          "system_packages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "python_packages": {
            "type": "boolean"
          },
          "workspace_mib": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "name",
          "image",
          "system_packages",
          "python_packages",
          "workspace_mib"
        ]
      },
      "ManagedEnvironmentBuild": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "resource_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "resource_revision": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "building",
              "ready",
              "failed"
            ]
          },
          "base_image": {
            "type": "string",
            "pattern": "^.+@sha256:[a-f0-9]{64}$"
          },
          "packages": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "artifact_digest": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[a-f0-9]{64}$"
          },
          "reason_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "resource_id",
          "resource_revision",
          "status",
          "base_image",
          "packages",
          "artifact_digest",
          "reason_code",
          "created_at",
          "completed_at"
        ]
      },
      "ManagedSessionExecutionCapabilities": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "commands": {
            "type": "boolean"
          },
          "tool_broker": {
            "type": "boolean"
          },
          "authoritative_model_usage": {
            "type": "boolean"
          }
        },
        "required": [
          "commands",
          "tool_broker",
          "authoritative_model_usage"
        ],
        "description": "Derived from immutable bootstrap protocol. Version1 remains false; publishing a new version is explicit and never mutates old artifacts."
      },
      "ManagedResourceUsageStatus": {
        "type": "string",
        "enum": [
          "measured",
          "partial",
          "unknown"
        ],
        "description": "measured is complete within the named scope; partial is a known lower bound; unknown always has a null value."
      },
      "ManagedResourceUsageScope": {
        "type": "string",
        "enum": [
          "sandbox_execute",
          "session_workspace",
          "egress_proxy_tls"
        ]
      },
      "ManagedResourceUsageValue": {
        "type": "object",
        "properties": {
          "value": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ManagedResourceUsageStatus"
          },
          "scope": {
            "$ref": "#/components/schemas/ManagedResourceUsageScope"
          }
        },
        "required": [
          "value",
          "status",
          "scope"
        ],
        "additionalProperties": false,
        "oneOf": [
          {
            "properties": {
              "status": {
                "enum": [
                  "measured",
                  "partial"
                ]
              },
              "value": {
                "type": "string"
              }
            }
          },
          {
            "properties": {
              "status": {
                "const": "unknown"
              },
              "value": {
                "type": "null"
              }
            }
          }
        ]
      },
      "ManagedResourceUsage": {
        "type": "object",
        "properties": {
          "cpu_ms": {
            "description": "Actual sandbox cgroup CPU delta in milliseconds, exact decimal string with at most six fractional digits. Includes trusted sandbox execute service work; never inferred from elapsed time or CPU requests.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedResourceUsageValue"
              },
              {
                "properties": {
                  "scope": {
                    "const": "sandbox_execute"
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            ]
          },
          "wall_time_ms": {
            "description": "Cumulative elapsed milliseconds of serialized sandbox execute windows; not CPU time.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedResourceUsageValue"
              },
              {
                "properties": {
                  "scope": {
                    "const": "sandbox_execute"
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(0|[1-9][0-9]*)$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            ]
          },
          "workspace_bytes": {
            "description": "Last observed logical workspace bytes gauge, chosen by persistent Pod order and workspace generation. Never summed across operations or Runs, and not a bill.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedResourceUsageValue"
              },
              {
                "properties": {
                  "scope": {
                    "const": "session_workspace"
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(0|[1-9][0-9]*)$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            ]
          },
          "egress_sent_bytes": {
            "description": "Union of trusted proxy cumulative TLS socket byte intervals accepted into upstream write buffers. Excludes CONNECT and control HTTP; not whole-platform or billed Internet traffic.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedResourceUsageValue"
              },
              {
                "properties": {
                  "scope": {
                    "const": "egress_proxy_tls"
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(0|[1-9][0-9]*)$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            ]
          },
          "egress_received_bytes": {
            "description": "Union of trusted proxy cumulative TLS socket byte intervals accepted into client write buffers. Missing or broken streams are unknown/partial, not zero.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ManagedResourceUsageValue"
              },
              {
                "properties": {
                  "scope": {
                    "const": "egress_proxy_tls"
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^(0|[1-9][0-9]*)$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            ]
          }
        },
        "required": [
          "cpu_ms",
          "wall_time_ms",
          "workspace_bytes",
          "egress_sent_bytes",
          "egress_received_bytes"
        ],
        "additionalProperties": false,
        "description": "Trusted per-operation resources aggregated by execution. Historical/no-sandbox executions may have null resource_usage. Counters and decimal values are strings to preserve precision; unknown is never a fabricated zero. No monetary charge or complete platform-cost accounting is implied."
      },
      "ManagedRunActualUsage": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "output_tokens": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "meter": {
            "type": "string",
            "enum": [
              "legacy_unmetered",
              "platform_gateway"
            ]
          },
          "reservation_status": {
            "type": "string",
            "enum": [
              "active",
              "settled",
              "reconciliation_required"
            ]
          },
          "resource_usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ManagedResourceUsage"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "resource_usage"
        ],
        "additionalProperties": false,
        "description": "Token settlement fields may be absent until settlement. resource_usage is read from the authoritative resource ledger independently of token settlement."
      }
    },
    "pathItems": {
      "OwnedAgentGrants": {
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "get": {
          "operationId": "listAgentGrants",
          "security": [
            {
              "humanJwt": []
            },
            {
              "oauth2": [
                "agents.read"
              ]
            }
          ],
          "x-aim-scopes": [
            "agents.read"
          ],
          "parameters": [
            {
              "$ref": "#/components/parameters/Cursor"
            },
            {
              "$ref": "#/components/parameters/Limit"
            }
          ],
          "responses": {
            "200": {
              "description": "Agent grants owned by the caller",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ResourceGrantPage"
                  }
                }
              }
            },
            "default": {
              "$ref": "#/components/responses/ApiError"
            }
          }
        },
        "post": {
          "operationId": "grantAgentUse",
          "security": [
            {
              "humanJwt": []
            },
            {
              "oauth2": [
                "agents.write"
              ]
            }
          ],
          "x-aim-scopes": [
            "agents.write"
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResourceGrantRequest"
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Idempotent agent.use grant",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ResourceGrant"
                  }
                }
              }
            },
            "default": {
              "$ref": "#/components/responses/ApiError"
            }
          }
        }
      },
      "OwnedAgentGrant": {
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "grant_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "get": {
          "operationId": "getAgentGrant",
          "security": [
            {
              "humanJwt": []
            },
            {
              "oauth2": [
                "agents.read"
              ]
            }
          ],
          "x-aim-scopes": [
            "agents.read"
          ],
          "responses": {
            "200": {
              "description": "Agent grant",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ResourceGrant"
                  }
                }
              }
            },
            "default": {
              "$ref": "#/components/responses/ApiError"
            }
          }
        },
        "delete": {
          "operationId": "revokeAgentGrant",
          "security": [
            {
              "humanJwt": []
            },
            {
              "oauth2": [
                "agents.write"
              ]
            }
          ],
          "x-aim-scopes": [
            "agents.write"
          ],
          "parameters": [
            {
              "$ref": "#/components/parameters/IfMatch"
            }
          ],
          "responses": {
            "200": {
              "description": "Revoked grant with incremented version",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ResourceGrant"
                  }
                }
              }
            },
            "default": {
              "$ref": "#/components/responses/ApiError"
            }
          }
        }
      },
      "GroupAssistant": {
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "get": {
          "operationId": "getGroupAssistant",
          "security": [
            {
              "humanJwt": []
            }
          ],
          "responses": {
            "200": {
              "description": "Group's unique managed coordinator Agent",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/GroupCoordinator"
                  }
                }
              }
            },
            "default": {
              "$ref": "#/components/responses/ApiError"
            }
          }
        },
        "patch": {
          "operationId": "updateGroupAssistant",
          "security": [
            {
              "humanJwt": []
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateGroupCoordinatorRequest"
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Group's unique managed coordinator Agent",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/GroupCoordinator"
                  }
                }
              }
            },
            "default": {
              "$ref": "#/components/responses/ApiError"
            }
          },
          "parameters": [
            {
              "name": "Idempotency-Key",
              "in": "header",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            },
            {
              "name": "If-Match",
              "in": "header",
              "required": true,
              "schema": {
                "type": "string",
                "pattern": "^\"[1-9][0-9]*\"$"
              },
              "description": "One strong resource ETag; absent 428, stale 412. Successful idempotent replay precedes CAS."
            }
          ]
        }
      }
    }
  }
}
