{
  "openapi": "3.0.0",
  "info": {
    "title": "SIPPulse AI API",
    "version": "1.25.3",
    "description": "REST API of the SIPPulse AI platform: conversational agents, speech to text and text to\nspeech, text intelligence, knowledge bases and the organization, project and billing\nresources around them.\n\n### Authentication\n\nEvery endpoint accepts either a user JWT (`Authorization: Bearer <token>`) or an organization\nAPI key (`api-key` header); the two are interchangeable alternatives. Each operation declares\nwhich credentials it accepts.\n\n### Errors\n\nFailures share one envelope, `ErrorResponse`, which carries both fields: `message` is always\npresent, and `code` comes with it whenever the failure is in the platform catalog. Branch on\n`code`; `message` is human text and may change. Framework level failures raised before\napplication code runs - malformed JSON, schema validation - have no `code`.",
    "contact": {
      "name": "SIPPulse AI Support",
      "email": "support@sippulse.ai",
      "url": "https://sippulse.ai"
    }
  },
  "paths": {
    "/.well-known/oauth-authorization-server/{issuer_path}": {
      "get": {
        "x-controller-name": "OAuthMetadataController",
        "x-operation-name": "authorizationServerMetadataPathful",
        "tags": [
          "OAuth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "OAuth 2.0 authorization server metadata (RFC 8414).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "issuer",
                    "authorization_endpoint",
                    "token_endpoint",
                    "revocation_endpoint",
                    "device_authorization_endpoint",
                    "response_types_supported",
                    "grant_types_supported",
                    "token_endpoint_auth_methods_supported",
                    "code_challenge_methods_supported",
                    "scopes_supported",
                    "client_id_metadata_document_supported",
                    "authorization_response_iss_parameter_supported"
                  ],
                  "properties": {
                    "issuer": {
                      "type": "string",
                      "format": "uri"
                    },
                    "authorization_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "token_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "revocation_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "device_authorization_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "response_types_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "code"
                      ]
                    },
                    "response_modes_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "query"
                      ]
                    },
                    "grant_types_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "token_endpoint_auth_methods_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "none",
                        "client_secret_basic"
                      ]
                    },
                    "code_challenge_methods_supported": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "S256"
                        ]
                      }
                    },
                    "scopes_supported": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "spai:agents:read",
                          "spai:agents:write",
                          "spai:agents:execute",
                          "spai:models:read",
                          "spai:secrets:read",
                          "spai:secrets:write",
                          "spai:channels:read",
                          "spai:channels:write",
                          "spai:threads:read",
                          "spai:threads:write",
                          "spai:analytics:read",
                          "spai:stt:execute",
                          "spai:llm:execute",
                          "spai:tts:execute",
                          "spai:embeddings:execute",
                          "spai:decisions:execute",
                          "offline_access"
                        ]
                      }
                    },
                    "client_id_metadata_document_supported": {
                      "type": "boolean"
                    },
                    "authorization_response_iss_parameter_supported": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "issuer_path",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Issuer path segment used by the RFC 8414 pathful metadata form.",
            "required": true
          }
        ],
        "operationId": "OAuthMetadataController.authorizationServerMetadataPathful"
      }
    },
    "/.well-known/oauth-authorization-server": {
      "get": {
        "x-controller-name": "OAuthMetadataController",
        "x-operation-name": "authorizationServerMetadata",
        "tags": [
          "OAuth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "OAuth 2.0 authorization server metadata (RFC 8414).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "issuer",
                    "authorization_endpoint",
                    "token_endpoint",
                    "revocation_endpoint",
                    "device_authorization_endpoint",
                    "response_types_supported",
                    "grant_types_supported",
                    "token_endpoint_auth_methods_supported",
                    "code_challenge_methods_supported",
                    "scopes_supported",
                    "client_id_metadata_document_supported",
                    "authorization_response_iss_parameter_supported"
                  ],
                  "properties": {
                    "issuer": {
                      "type": "string",
                      "format": "uri"
                    },
                    "authorization_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "token_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "revocation_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "device_authorization_endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "response_types_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "code"
                      ]
                    },
                    "response_modes_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "query"
                      ]
                    },
                    "grant_types_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "token_endpoint_auth_methods_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "none",
                        "client_secret_basic"
                      ]
                    },
                    "code_challenge_methods_supported": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "S256"
                        ]
                      }
                    },
                    "scopes_supported": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "spai:agents:read",
                          "spai:agents:write",
                          "spai:agents:execute",
                          "spai:models:read",
                          "spai:secrets:read",
                          "spai:secrets:write",
                          "spai:channels:read",
                          "spai:channels:write",
                          "spai:threads:read",
                          "spai:threads:write",
                          "spai:analytics:read",
                          "spai:stt:execute",
                          "spai:llm:execute",
                          "spai:tts:execute",
                          "spai:embeddings:execute",
                          "spai:decisions:execute",
                          "offline_access"
                        ]
                      }
                    },
                    "client_id_metadata_document_supported": {
                      "type": "boolean"
                    },
                    "authorization_response_iss_parameter_supported": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "OAuthMetadataController.authorizationServerMetadata"
      }
    },
    "/.well-known/oauth-protected-resource/{issuer_path}": {
      "get": {
        "x-controller-name": "OAuthMetadataController",
        "x-operation-name": "protectedResourceMetadataPathful",
        "tags": [
          "OAuth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Protected resource metadata (RFC 9728).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "resource",
                    "authorization_servers",
                    "scopes_supported",
                    "bearer_methods_supported"
                  ],
                  "properties": {
                    "resource": {
                      "type": "string",
                      "format": "uri"
                    },
                    "authorization_servers": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uri"
                      }
                    },
                    "scopes_supported": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "spai:agents:read",
                          "spai:agents:write",
                          "spai:agents:execute",
                          "spai:models:read",
                          "spai:secrets:read",
                          "spai:secrets:write",
                          "spai:channels:read",
                          "spai:channels:write",
                          "spai:threads:read",
                          "spai:threads:write",
                          "spai:analytics:read",
                          "spai:stt:execute",
                          "spai:llm:execute",
                          "spai:tts:execute",
                          "spai:embeddings:execute",
                          "spai:decisions:execute"
                        ]
                      }
                    },
                    "bearer_methods_supported": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "header"
                        ]
                      }
                    },
                    "resource_name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "issuer_path",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Issuer path segment used by the RFC 9728 pathful metadata form.",
            "required": true
          }
        ],
        "operationId": "OAuthMetadataController.protectedResourceMetadataPathful"
      }
    },
    "/.well-known/oauth-protected-resource": {
      "get": {
        "x-controller-name": "OAuthMetadataController",
        "x-operation-name": "protectedResourceMetadata",
        "tags": [
          "OAuth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Protected resource metadata (RFC 9728).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "resource",
                    "authorization_servers",
                    "scopes_supported",
                    "bearer_methods_supported"
                  ],
                  "properties": {
                    "resource": {
                      "type": "string",
                      "format": "uri"
                    },
                    "authorization_servers": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uri"
                      }
                    },
                    "scopes_supported": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "spai:agents:read",
                          "spai:agents:write",
                          "spai:agents:execute",
                          "spai:models:read",
                          "spai:secrets:read",
                          "spai:secrets:write",
                          "spai:channels:read",
                          "spai:channels:write",
                          "spai:threads:read",
                          "spai:threads:write",
                          "spai:analytics:read",
                          "spai:stt:execute",
                          "spai:llm:execute",
                          "spai:tts:execute",
                          "spai:embeddings:execute",
                          "spai:decisions:execute"
                        ]
                      }
                    },
                    "bearer_methods_supported": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "header"
                        ]
                      }
                    },
                    "resource_name": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "OAuthMetadataController.protectedResourceMetadata"
      }
    },
    "/agents/internal-tools": {
      "get": {
        "x-controller-name": "AgentsController",
        "x-operation-name": "listInternalTools",
        "tags": [
          "Agents"
        ],
        "summary": "List internal tools",
        "description": "Returns the declarative catalog of internal agent tools (type: \"internal\"). Deprecated entries are aliases kept for agents created before a rename.",
        "responses": {
          "200": {
            "description": "Internal tools catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "name",
                      "description",
                      "alwaysAvailable"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "alwaysAvailable": {
                        "type": "boolean"
                      },
                      "deprecated": {
                        "type": "boolean"
                      },
                      "aliasOf": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "operationId": "AgentsController.listInternalTools"
      }
    },
    "/agents/validate": {
      "post": {
        "x-controller-name": "AgentsController",
        "x-operation-name": "validateModelConfiguration",
        "tags": [
          "Agents"
        ],
        "summary": "Validate Agent model configuration",
        "description": "Validate an agent model and its parameters without persisting changes.",
        "responses": {
          "200": {
            "description": "Validation result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "valid",
                    "errors",
                    "warnings"
                  ],
                  "properties": {
                    "valid": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "path",
                          "code",
                          "message"
                        ],
                        "properties": {
                          "path": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "path",
                          "code",
                          "message"
                        ],
                        "properties": {
                          "path": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "spec"
                ],
                "properties": {
                  "agent_id": {
                    "type": "string"
                  },
                  "spec": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "required": true
        },
        "operationId": "AgentsController.validateModelConfiguration"
      }
    },
    "/agents/{id}/outbound-call": {
      "post": {
        "x-controller-name": "AgentsController",
        "x-operation-name": "makeOutboundCall",
        "tags": [
          "Agents"
        ],
        "summary": "Make outbound call using agent's outbound trunk",
        "description": "Place a call from the agent's outbound trunk to `phone_number`. Send `metadata_overrides` to change the greeting, prompt variables, duration cap or tools for this call alone, without touching the agent configuration. Optionally send `Idempotency-Key` (1-191 characters): the same key within an organization replays the original result for 24 hours, or returns 409 while the call is still being initiated (pending reservation expires after 120 seconds).",
        "responses": {
          "200": {
            "description": "Outbound call initiated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutboundCallResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the agent placing the call.",
            "required": true
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Optional organization-scoped retry key, retained for 24 hours."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OutboundCallRequest"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "AgentsController.makeOutboundCall"
      }
    },
    "/agents/{id}": {
      "patch": {
        "x-controller-name": "AgentsController",
        "x-operation-name": "updateById",
        "tags": [
          "Agents"
        ],
        "summary": "Update Agent by ID",
        "description": "Update an agent by its ID",
        "responses": {
          "204": {
            "description": "Agent PATCH success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentUpdate"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "AgentsController.updateById"
      },
      "get": {
        "x-controller-name": "AgentsController",
        "x-operation-name": "findById",
        "tags": [
          "Agents"
        ],
        "summary": "Find Agent by ID",
        "description": "Find an agent by its ID",
        "security": [
          {
            "jwt": []
          },
          {
            "ApiKeyAuth": []
          },
          {
            "guest-token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Agent model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentWithExtensionWithRelations"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agent.Filter"
                }
              }
            },
            "description": "Query criteria: `where`, `fields`, `order`, `limit`, `skip`, `cursor` and `include`. Send it as a JSON string (`filter={\"where\":{\"name\":\"x\"},\"limit\":10}`) or as nested keys (`filter[limit]=10`)."
          }
        ],
        "operationId": "AgentsController.findById"
      },
      "delete": {
        "x-controller-name": "AgentsController",
        "x-operation-name": "deleteById",
        "tags": [
          "Agents"
        ],
        "summary": "Delete Agent by ID",
        "description": "Delete an agent by its ID",
        "responses": {
          "204": {
            "description": "Agent DELETE success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "AgentsController.deleteById"
      }
    },
    "/agents": {
      "post": {
        "x-controller-name": "AgentsController",
        "x-operation-name": "create",
        "tags": [
          "Agents"
        ],
        "summary": "Create Agent",
        "description": "Create a new agent",
        "responses": {
          "200": {
            "description": "Agent model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentWithExtension"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentBody"
              }
            }
          }
        },
        "operationId": "AgentsController.create"
      },
      "get": {
        "x-controller-name": "AgentsController",
        "x-operation-name": "find",
        "tags": [
          "Agents"
        ],
        "summary": "List Agents",
        "description": "Get the list of Agent models",
        "responses": {
          "200": {
            "description": "Array of Agent model instances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AgentWithExtensionWithRelations"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Agent.Filter1"
                }
              }
            },
            "description": "Query criteria: `where`, `fields`, `order`, `limit`, `skip`, `cursor` and `include`. Send it as a JSON string (`filter={\"where\":{\"name\":\"x\"},\"limit\":10}`) or as nested keys (`filter[limit]=10`)."
          }
        ],
        "operationId": "AgentsController.find"
      }
    },
    "/analytics/catalog": {
      "get": {
        "x-controller-name": "AnalyticsController",
        "x-operation-name": "catalog",
        "tags": [
          "Analytics"
        ],
        "summary": "Analytics catalog",
        "description": "Returns the caller-scoped analytics datasets, selling-price measures, dimensions and limits.",
        "responses": {
          "200": {
            "description": "The analytics catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsCatalogResponse"
                }
              }
            }
          },
          "400": {
            "description": "The requested dataset is invalid."
          },
          "401": {
            "description": "Authentication is required."
          },
          "403": {
            "description": "The caller is not authorized."
          }
        },
        "parameters": [
          {
            "name": "dataset",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Optional dataset name: usage, conversations, or analysis."
          }
        ],
        "operationId": "AnalyticsController.catalog"
      }
    },
    "/analytics/query": {
      "post": {
        "x-controller-name": "AnalyticsController",
        "x-operation-name": "query",
        "tags": [
          "Analytics"
        ],
        "summary": "Run an analytics query",
        "description": "Executes a bounded, caller-scoped query against the analytics read-only datasource.",
        "responses": {
          "200": {
            "description": "The analytics result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsResult"
                }
              }
            }
          },
          "400": {
            "description": "The analytics query is invalid."
          },
          "401": {
            "description": "Authentication is required."
          },
          "403": {
            "description": "The caller cannot read a requested measure or dimension."
          },
          "422": {
            "description": "The analytics query timed out."
          },
          "429": {
            "description": "The organization's analytics concurrency limit was reached."
          },
          "503": {
            "description": "The analytics datasource is unavailable."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyticsQuery"
              }
            }
          },
          "required": true,
          "description": "Strict AnalyticsQuery request. Unknown keys and unsupported selections are rejected."
        },
        "operationId": "AnalyticsController.query"
      }
    },
    "/anonymize/entities/{language}": {
      "get": {
        "x-controller-name": "AnonymizeController",
        "x-operation-name": "entities",
        "tags": [
          "Anonymization"
        ],
        "summary": "Get Entities By Language",
        "responses": {
          "200": {
            "description": "List of entities",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "language",
            "in": "path",
            "schema": {
              "enum": [
                "en",
                "pt"
              ],
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "AnonymizeController.entities"
      }
    },
    "/anonymize": {
      "post": {
        "x-controller-name": "AnonymizeController",
        "x-operation-name": "anonymize",
        "tags": [
          "Anonymization"
        ],
        "summary": "Anonymize Text",
        "responses": {
          "200": {
            "description": "Anonymized text",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnonymizeRequest"
              }
            }
          }
        },
        "operationId": "AnonymizeController.anonymize"
      }
    },
    "/api-keys/count": {
      "get": {
        "x-controller-name": "ApiKeysController",
        "x-operation-name": "count",
        "tags": [
          "API Keys"
        ],
        "summary": "Count Api Keys",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Get the count of ApiKey models",
        "responses": {
          "200": {
            "description": "ApiKey model count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/loopback.Count"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "where",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "ApiKey.WhereFilter",
                  "additionalProperties": true,
                  "x-typescript-type": "@loopback/repository#Where<ApiKey>"
                }
              }
            },
            "description": "Match criteria applied to the collection, using the same operators as `filter.where` (`eq`, `neq`, `gt`, `lt`, `inq`, `between`, `like`, `and`, `or`)."
          }
        ],
        "operationId": "ApiKeysController.count"
      }
    },
    "/api-keys/usage/compare": {
      "get": {
        "x-controller-name": "ApiKeysController",
        "x-operation-name": "compareUsage",
        "tags": [
          "API Keys"
        ],
        "summary": "Compare Usage Across Multiple API Keys",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Compare cost and usage statistics across multiple API keys owned by the user",
        "responses": {
          "200": {
            "description": "Comparison of API keys usage",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiKeyUsageComparison"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "api_key_ids",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Comma separated identifiers of the API keys to compare. At least one is required, and every key must belong to the caller's organization."
          },
          {
            "name": "start_date",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Start of the window, inclusive, as `YYYY-MM-DD`. Defaults to 30 days ago."
          },
          {
            "name": "end_date",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "End of the window, inclusive, as `YYYY-MM-DD`. Defaults to today."
          }
        ],
        "operationId": "ApiKeysController.compareUsage"
      }
    },
    "/api-keys/usage/summary": {
      "get": {
        "x-controller-name": "ApiKeysController",
        "x-operation-name": "getUsageSummary",
        "tags": [
          "API Keys"
        ],
        "summary": "Get API Key Usage Summary",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Get cost summary and usage statistics for all API keys owned by the user",
        "responses": {
          "200": {
            "description": "API key usage summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "total_cost": {
                      "type": "number"
                    },
                    "total_requests": {
                      "type": "number"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "start": {
                          "type": "string"
                        },
                        "end": {
                          "type": "string"
                        }
                      }
                    },
                    "first_usage": {
                      "type": "string",
                      "nullable": true
                    },
                    "last_usage": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "start_date",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Start of the window, inclusive, as `YYYY-MM-DD`. Defaults to 30 days ago."
          },
          {
            "name": "end_date",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "End of the window, inclusive, as `YYYY-MM-DD`. Defaults to today."
          }
        ],
        "operationId": "ApiKeysController.getUsageSummary"
      }
    },
    "/api-keys/{id}/finish-rotation": {
      "post": {
        "x-controller-name": "ApiKeysController",
        "x-operation-name": "finishRotation",
        "tags": [
          "API Keys"
        ],
        "summary": "Finish Api Key Rotation",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "End an active rotation grace period early, invalidating the previous credential immediately.",
        "responses": {
          "200": {
            "description": "ApiKey model instance after the grace period ended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyView"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ApiKeysController.finishRotation"
      }
    },
    "/api-keys/{id}/rotate": {
      "post": {
        "x-controller-name": "ApiKeysController",
        "x-operation-name": "rotate",
        "tags": [
          "API Keys"
        ],
        "summary": "Rotate Api Key",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Rotate an API key in place. The row keeps its id, name, owner, organization, project, created_at and billing linkage while the credential is replaced; the new plaintext is returned exactly once. With a grace period the previous credential keeps authenticating under the same id until the stored deadline.",
        "responses": {
          "200": {
            "description": "ApiKey model instance with the new plaintext key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKey"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "grace_period_hours": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 168,
                    "default": 0,
                    "description": "Hours the previous credential keeps working after the rotation. 0 (default) invalidates it immediately; the maximum is 168. Request input only - the deadline is the stored truth."
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "ApiKeysController.rotate"
      }
    },
    "/api-keys/{id}/usage/aggregated": {
      "get": {
        "x-controller-name": "ApiKeysController",
        "x-operation-name": "getUsageAggregated",
        "tags": [
          "API Keys"
        ],
        "summary": "Get API Key Usage Aggregated",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Get aggregated usage data for a specific API key grouped by time period, type, or identifier",
        "responses": {
          "200": {
            "description": "API key usage aggregated data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiKeyUsageAggregate"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the API key.",
            "required": true
          },
          {
            "name": "start_date",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Start of the window, inclusive, as `YYYY-MM-DD`. Defaults to 30 days ago."
          },
          {
            "name": "end_date",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "End of the window, inclusive, as `YYYY-MM-DD`. Defaults to today."
          },
          {
            "name": "group_by",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma separated dimensions to aggregate by: `period`, `type`, `identifier`. Defaults to `type`."
          },
          {
            "name": "period_unit",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month"
              ],
              "default": "day"
            },
            "description": "Bucket size used when `group_by` includes `period`."
          }
        ],
        "operationId": "ApiKeysController.getUsageAggregated"
      }
    },
    "/api-keys/{id}/usage/details": {
      "get": {
        "x-controller-name": "ApiKeysController",
        "x-operation-name": "getUsageDetails",
        "tags": [
          "API Keys"
        ],
        "summary": "Get API Key Usage Details",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Get detailed usage records for a specific API key with filtering and pagination",
        "responses": {
          "200": {
            "description": "API key usage details with pagination",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/UsageRequestWithRelations"
                      }
                    },
                    "count": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageRequest.Filter"
                }
              }
            },
            "description": "Query criteria: `where`, `fields`, `order`, `limit`, `skip`, `cursor` and `include`. Send it as a JSON string (`filter={\"where\":{\"name\":\"x\"},\"limit\":10}`) or as nested keys (`filter[limit]=10`)."
          }
        ],
        "operationId": "ApiKeysController.getUsageDetails"
      }
    },
    "/api-keys/{id}/usage/summary": {
      "get": {
        "x-controller-name": "ApiKeysController",
        "x-operation-name": "getUsageSummaryById",
        "tags": [
          "API Keys"
        ],
        "summary": "Get API Key Usage Summary by ID",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Get cost summary and usage statistics for a specific API key",
        "responses": {
          "200": {
            "description": "API key usage summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "api_key_id": {
                      "type": "string"
                    },
                    "api_key_name": {
                      "type": "string"
                    },
                    "total_cost": {
                      "type": "number"
                    },
                    "total_requests": {
                      "type": "number"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "start": {
                          "type": "string"
                        },
                        "end": {
                          "type": "string"
                        }
                      }
                    },
                    "first_usage": {
                      "type": "string",
                      "nullable": true
                    },
                    "last_usage": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the API key.",
            "required": true
          },
          {
            "name": "start_date",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Start of the window, inclusive, as `YYYY-MM-DD`. Defaults to 30 days ago."
          },
          {
            "name": "end_date",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "End of the window, inclusive, as `YYYY-MM-DD`. Defaults to today."
          }
        ],
        "operationId": "ApiKeysController.getUsageSummaryById"
      }
    },
    "/api-keys/{id}": {
      "patch": {
        "x-controller-name": "ApiKeysController",
        "x-operation-name": "updateById",
        "tags": [
          "API Keys"
        ],
        "summary": "Update Api Key",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Update an ApiKey model instance",
        "responses": {
          "204": {
            "description": "ApiKey PATCH success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyUpdate"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "ApiKeysController.updateById"
      },
      "get": {
        "x-controller-name": "ApiKeysController",
        "x-operation-name": "findById",
        "tags": [
          "API Keys"
        ],
        "summary": "Get Api Key",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Get an ApiKey model instance by id",
        "responses": {
          "200": {
            "description": "ApiKey model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyView"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKey.Filter"
                }
              }
            },
            "description": "Query criteria: `where`, `fields`, `order`, `limit`, `skip`, `cursor` and `include`. Send it as a JSON string (`filter={\"where\":{\"name\":\"x\"},\"limit\":10}`) or as nested keys (`filter[limit]=10`)."
          }
        ],
        "operationId": "ApiKeysController.findById"
      },
      "delete": {
        "x-controller-name": "ApiKeysController",
        "x-operation-name": "deleteById",
        "tags": [
          "API Keys"
        ],
        "summary": "Delete Api Key",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Delete an ApiKey model instance",
        "responses": {
          "204": {
            "description": "ApiKey DELETE success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ApiKeysController.deleteById"
      }
    },
    "/api-keys": {
      "post": {
        "x-controller-name": "ApiKeysController",
        "x-operation-name": "create",
        "tags": [
          "API Keys"
        ],
        "summary": "Create Api Key",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Create a new API key",
        "responses": {
          "200": {
            "description": "ApiKey model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKey"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "for_user_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Create the key on behalf of another member of the organization. Owners and admins only; defaults to the caller."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewApiKey"
              }
            }
          }
        },
        "operationId": "ApiKeysController.create"
      },
      "get": {
        "x-controller-name": "ApiKeysController",
        "x-operation-name": "find",
        "tags": [
          "API Keys"
        ],
        "summary": "List Api Keys",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Get the list of ApiKey models",
        "responses": {
          "200": {
            "description": "Array of ApiKey model instances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiKeyView"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKey.Filter1"
                }
              }
            },
            "description": "Query criteria: `where`, `fields`, `order`, `limit`, `skip`, `cursor` and `include`. Send it as a JSON string (`filter={\"where\":{\"name\":\"x\"},\"limit\":10}`) or as nested keys (`filter[limit]=10`)."
          },
          {
            "name": "target_user_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "List the keys of another member instead of the caller's. Owners and admins only."
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Set to `organization` to list every key of the organization, subject to permission. Defaults to the caller's own keys."
          }
        ],
        "operationId": "ApiKeysController.find"
      }
    },
    "/asr/batch/{request_id}/status": {
      "get": {
        "x-controller-name": "AsrController",
        "x-operation-name": "batchStatus",
        "tags": [
          "Speech to Text"
        ],
        "summary": "Get Batch Transcription Status",
        "description": "Poll for the result of a batch transcription. Returns in_progress while processing, completed with result when done.",
        "responses": {
          "200": {
            "description": "Batch transcription status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchTranscriptionStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "AsrController.batchStatus"
      }
    },
    "/asr/models": {
      "get": {
        "x-controller-name": "AsrController",
        "x-operation-name": "models",
        "tags": [
          "Speech to Text"
        ],
        "summary": "List ASR Models",
        "description": "List all ASR models",
        "responses": {
          "200": {
            "description": "List of all ASR models",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "inactive"
              ]
            },
            "required": false,
            "default": "active",
            "description": "Model status"
          }
        ],
        "operationId": "AsrController.models"
      }
    },
    "/asr/transcribe/batch": {
      "post": {
        "x-controller-name": "AsrController",
        "x-operation-name": "transcribeBatch",
        "tags": [
          "Speech to Text"
        ],
        "summary": "Submit Batch Transcription",
        "description": "Submit audio for async transcription. Returns a request_id immediately. Poll GET /asr/batch/{request_id}/status for the result. Only supported for RunPod serverless models (pulse-precision, pulse-precision-pro).",
        "responses": {
          "202": {
            "description": "Batch transcription submitted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchTranscriptionSubmission"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "model",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "ASR model to use. Batch is only supported by the RunPod serverless models (`pulse-precision`, `pulse-precision-pro`)."
          },
          {
            "name": "language",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Language of the audio, ISO 639-1. Detected automatically when omitted."
          },
          {
            "name": "prompt",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Text hint that biases the transcription, useful for names, jargon and acronyms."
          },
          {
            "name": "temperature",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Sampling temperature, 0 to 1. Lower is more deterministic."
          },
          {
            "name": "response_format",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Output format. `stereo_diarization` requires a 2-channel (stereo) audio file and labels speakers by physical channel (L/R); a mono file returns 400. For mono audio use `diarization`, which infers speaker labels (00/01/02)."
          },
          {
            "name": "input_sample_rate",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "If the input file is a PCM file, specify the sample rate. Default is 8000"
          },
          {
            "name": "llm_boost",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Post-process the completed transcription with an LLM to fix punctuation, spelling and clearly mistranscribed words. The boost runs once when the job completes; the improved version is attached to the status result as a `llm_boost` field (a plain-text result becomes `{text, llm_boost}`). Fail-open: if the boost fails, the result is returned without the field."
          },
          {
            "name": "preset",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Named bundle of transcription settings saved by the organization. Explicit parameters take precedence over the preset."
          },
          {
            "name": "x-bot-id",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the bot the audio came from. Recorded on the usage entry for attribution."
          },
          {
            "name": "x-room-name",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the realtime room the audio came from. Recorded on the usage entry for attribution."
          },
          {
            "name": "x-request-id",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Optional client-provided request ID (must be a valid UUID). Used to track billing and poll status via GET /asr/batch/{request_id}/status. If not provided, the server generates one."
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "x-parser": "stream",
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Audio file to transcribe."
                  }
                }
              }
            }
          },
          "description": "Audio to transcribe asynchronously. The `file` part is required.",
          "required": true
        },
        "operationId": "AsrController.transcribeBatch"
      }
    },
    "/asr/transcribe": {
      "post": {
        "x-controller-name": "AsrController",
        "x-operation-name": "transcribe",
        "tags": [
          "Speech to Text"
        ],
        "summary": "Transcribe an Audio",
        "description": "Transcribe an audio file to text. The audio goes in the `multipart/form-data` body; everything else is a query parameter. The response always carries `text`, plus one field per optional analysis requested through `insights`, `anonymize` or `llm_boost`.",
        "security": [
          {
            "jwt": []
          },
          {
            "ApiKeyAuth": []
          },
          {
            "guest-token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Transcription of the submitted audio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscriptionResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "model",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "ASR model to use. Defaults to the organization default when omitted."
          },
          {
            "name": "language",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Language of the audio, ISO 639-1. Detected automatically when omitted."
          },
          {
            "name": "prompt",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Text hint that biases the transcription, useful for names, jargon and acronyms."
          },
          {
            "name": "temperature",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Sampling temperature, 0 to 1. Lower is more deterministic."
          },
          {
            "name": "response_format",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Output format. `stereo_diarization` requires a 2-channel (stereo) audio file and labels speakers by physical channel (L/R); a mono file returns 400. For mono audio use `diarization`, which infers speaker labels (00/01/02)."
          },
          {
            "name": "input_sample_rate",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "If the input file is a PCM file, specify the sample rate. Default is 8000"
          },
          {
            "name": "insights",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "$ref": "#/components/schemas/AsrInsightsOptions",
                  "definitions": {
                    "SentimentAnalysisOptions": {
                      "$ref": "#/components/schemas/SentimentAnalysisOptions"
                    },
                    "TopicDetectionOptions": {
                      "$ref": "#/components/schemas/TopicDetectionOptions"
                    },
                    "CustomOption": {
                      "$ref": "#/components/schemas/CustomOption"
                    },
                    "AsrInsightsOptions": {
                      "$ref": "#/components/schemas/AsrInsightsOptions"
                    }
                  }
                }
              }
            },
            "description": "Text intelligence to run on the transcription, as a JSON object. Adds a matching field to the response for each analysis requested. The transcription language is used, so it is not configurable here."
          },
          {
            "name": "anonymize",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "$ref": "#/components/schemas/AsrAnonymizeOptions",
                  "definitions": {
                    "SearchReplace": {
                      "$ref": "#/components/schemas/SearchReplace"
                    },
                    "AsrAnonymizeOptions": {
                      "$ref": "#/components/schemas/AsrAnonymizeOptions"
                    }
                  }
                }
              }
            },
            "description": "Masking to apply to the transcription, as a JSON object. `text` and `segments` are not accepted: the transcription itself is the input."
          },
          {
            "name": "llm_boost",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Post-process the transcription with an LLM to fix punctuation, spelling and clearly mistranscribed words. The improved version is returned in a separate `llm_boost` field; the original transcription is preserved. Fail-open: if the boost fails, the response is returned without the field."
          },
          {
            "name": "preset",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Named bundle of transcription settings saved by the organization. Explicit parameters take precedence over the preset."
          },
          {
            "name": "x-bot-id",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the bot the audio came from. Recorded on the usage entry for attribution."
          },
          {
            "name": "x-room-name",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the realtime room the audio came from. Recorded on the usage entry for attribution."
          },
          {
            "name": "x-request-id",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Optional request ID for sync recovery (must be a valid UUID or 'auto'). If provided, the transcription is tracked and can be retrieved via GET /asr/batch/{request_id}/status in case of timeout. Use 'auto' to let the server generate the ID."
          },
          {
            "name": "x-job-id",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Deprecated: use x-request-id instead. Kept for backward compatibility."
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "x-parser": "stream",
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Audio file. PCM input also needs the `input_sample_rate` query parameter; `stereo_diarization` needs a 2 channel file."
                  }
                }
              }
            }
          },
          "description": "Audio to transcribe. The `file` part is required.",
          "required": true
        },
        "operationId": "AsrController.transcribe"
      }
    },
    "/billing/history": {
      "get": {
        "x-controller-name": "BillingController",
        "x-operation-name": "history",
        "tags": [
          "Billing"
        ],
        "summary": "Billing history",
        "description": "Get billing history",
        "security": [
          {
            "jwt": []
          }
        ],
        "responses": {
          "200": {
            "description": "Billing history",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CreditTransactions"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreditTransactions.Filter"
                }
              }
            },
            "description": "Query criteria: `where`, `fields`, `order`, `limit`, `skip`, `cursor` and `include`. Send it as a JSON string (`filter={\"where\":{\"name\":\"x\"},\"limit\":10}`) or as nested keys (`filter[limit]=10`)."
          }
        ],
        "operationId": "BillingController.history"
      }
    },
    "/email/unsubscribe/{token}": {
      "post": {
        "x-controller-name": "EmailPreferencesController",
        "x-operation-name": "unsubscribe",
        "tags": [
          "Email Preferences"
        ],
        "security": [],
        "description": "One-click unsubscribe (RFC 8058). Accepts the List-Unsubscribe=One-Click body and an empty body.",
        "responses": {
          "200": {
            "description": "HTML page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "HTML page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "EmailPreferencesController.unsubscribe"
      },
      "get": {
        "x-controller-name": "EmailPreferencesController",
        "x-operation-name": "showForm",
        "tags": [
          "Email Preferences"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "HTML page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "HTML page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "EmailPreferencesController.showForm"
      }
    },
    "/forgot-password": {
      "post": {
        "x-controller-name": "AuthenticationController",
        "x-operation-name": "forgotPassword",
        "tags": [
          "Authentication"
        ],
        "summary": "Forgot password",
        "description": "Send a password recovery email. Always answers 200, whether or not the address belongs to an account, so the endpoint cannot be used to probe for registered emails.",
        "security": [],
        "responses": {
          "200": {
            "description": "Recovery email sent, if the address matches an account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationMessage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                }
              }
            }
          }
        },
        "operationId": "AuthenticationController.forgotPassword"
      }
    },
    "/health": {
      "get": {
        "x-controller-name": "PingController",
        "x-operation-name": "health",
        "tags": [
          "Service"
        ],
        "summary": "Health check",
        "description": "Liveness and dependency probe. Public: no credential, so an external monitor can poll it.",
        "security": [],
        "responses": {
          "200": {
            "description": "Health Check Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        },
        "operationId": "PingController.health"
      }
    },
    "/knowledge/{collection_name}/add": {
      "post": {
        "x-controller-name": "KnowledgeBaseController",
        "x-operation-name": "addDocuments",
        "tags": [
          "Knowledge Base"
        ],
        "summary": "Add documents to a knowledge collection",
        "responses": {
          "204": {
            "description": "Add documents to a collection"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "collection_name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "KnowledgeBaseController.addDocuments"
      }
    },
    "/knowledge/{collection_name}/document/{document_id}": {
      "delete": {
        "x-controller-name": "KnowledgeBaseController",
        "x-operation-name": "deleteDocument",
        "tags": [
          "Knowledge Base"
        ],
        "summary": "Delete a document from a knowledge collection",
        "responses": {
          "204": {
            "description": "Document deleted from collection"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "collection_name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "document_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "KnowledgeBaseController.deleteDocument"
      }
    },
    "/knowledge/{collection_name}/file": {
      "post": {
        "x-controller-name": "KnowledgeBaseController",
        "x-operation-name": "addFileToCollection",
        "tags": [
          "Knowledge Base"
        ],
        "summary": "Add a file to a knowledge collection",
        "description": "Upload a document, split it into chunks and index them into the collection. Files larger than 10 MB are rejected.",
        "responses": {
          "204": {
            "description": "File added to collection"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "collection_name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Name of the collection to index the document into.",
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "x-parser": "stream",
              "schema": {
                "type": "object",
                "properties": {
                  "splitPages": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false"
                    ],
                    "description": "Index each page as its own document instead of the whole file. Defaults to false."
                  },
                  "chunkSize": {
                    "type": "string",
                    "description": "Characters per chunk. Capped at 20000, which is also the default."
                  },
                  "chunkOverlap": {
                    "type": "string",
                    "description": "Characters repeated between consecutive chunks. Defaults to 100."
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Document to index. Up to 10 MB."
                  }
                }
              }
            }
          },
          "description": "Document to index, plus the chunking options applied to it. The `file` part is required. Send the text fields BEFORE the file part: the server stops parsing when the file part ends, so anything after it is ignored.",
          "required": true,
          "x-parameter-index": 1
        },
        "operationId": "KnowledgeBaseController.addFileToCollection"
      }
    },
    "/knowledge/{collection_name}/query": {
      "post": {
        "x-controller-name": "KnowledgeBaseController",
        "x-operation-name": "queryCollection",
        "tags": [
          "Knowledge Base"
        ],
        "summary": "Query a knowledge collection",
        "responses": {
          "200": {
            "description": "Query results from a collection",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "collection_name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KnowledgeQueryBody"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "KnowledgeBaseController.queryCollection"
      }
    },
    "/knowledge/{collection_name}/sync": {
      "post": {
        "x-controller-name": "KnowledgeBaseController",
        "x-operation-name": "syncCollection",
        "tags": [
          "Knowledge Base"
        ],
        "summary": "Sync documents to a knowledge collection",
        "responses": {
          "204": {
            "description": "Documents synced to collection"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "collection_name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "KnowledgeBaseController.syncCollection"
      }
    },
    "/knowledge/{collection_name}": {
      "post": {
        "x-controller-name": "KnowledgeBaseController",
        "x-operation-name": "createCollection",
        "tags": [
          "Knowledge Base"
        ],
        "summary": "Create a new knowledge collection",
        "description": "Creates a new knowledge collection. Requires X-Project-ID header with a valid project UUID.",
        "responses": {
          "200": {
            "description": "Create a new collection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeCollectionSummary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - X-Project-ID header is required"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "collection_name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "description"
                ],
                "properties": {
                  "model_name": {
                    "type": "string",
                    "nullable": true
                  },
                  "description": {
                    "type": "string"
                  },
                  "schema": {
                    "type": "object",
                    "nullable": true
                  }
                }
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "KnowledgeBaseController.createCollection"
      },
      "patch": {
        "x-controller-name": "KnowledgeBaseController",
        "x-operation-name": "updateCollection",
        "tags": [
          "Knowledge Base"
        ],
        "summary": "Update an existing knowledge collection",
        "responses": {
          "204": {
            "description": "Update a collection"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "collection_name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model_name": {
                    "type": "string",
                    "nullable": true
                  },
                  "description": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "KnowledgeBaseController.updateCollection"
      },
      "get": {
        "x-controller-name": "KnowledgeBaseController",
        "x-operation-name": "getCollection",
        "tags": [
          "Knowledge Base"
        ],
        "summary": "Get a specific knowledge collection",
        "responses": {
          "200": {
            "description": "Get a specific collection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KnowledgeCollectionSummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "collection_name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "KnowledgeBaseController.getCollection"
      },
      "delete": {
        "x-controller-name": "KnowledgeBaseController",
        "x-operation-name": "deleteCollection",
        "tags": [
          "Knowledge Base"
        ],
        "summary": "Delete a knowledge collection",
        "responses": {
          "204": {
            "description": "Collection deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "collection_name",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "KnowledgeBaseController.deleteCollection"
      }
    },
    "/knowledge": {
      "get": {
        "x-controller-name": "KnowledgeBaseController",
        "x-operation-name": "getKnowledge",
        "tags": [
          "Knowledge Base"
        ],
        "summary": "Get all knowledge collections",
        "responses": {
          "200": {
            "description": "Get all collections",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/KnowledgeCollectionSummary"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "operationId": "KnowledgeBaseController.getKnowledge"
      }
    },
    "/login": {
      "post": {
        "x-controller-name": "AuthenticationController",
        "x-operation-name": "login",
        "tags": [
          "Authentication"
        ],
        "summary": "Login",
        "description": "Sign in with email and password. An account with MFA enabled gets `mfa_required` instead of a token on the first call; repeat the request with the `mfa` field of the body filled in to receive `access_token`.",
        "security": [],
        "responses": {
          "200": {
            "description": "Access token, or the MFA challenge when the account requires a second factor",
            "content": {
              "application/json": {
                "schema": {
                  "title": "LoginResult",
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AuthResponse"
                    },
                    {
                      "$ref": "#/components/schemas/MfaChallenge"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaCredentials"
              }
            }
          }
        },
        "operationId": "AuthenticationController.login"
      }
    },
    "/me": {
      "get": {
        "x-controller-name": "AuthenticationController",
        "x-operation-name": "me",
        "tags": [
          "Authentication"
        ],
        "summary": "User Profile",
        "description": "Get the current user profile",
        "security": [
          {
            "jwt": []
          },
          {
            "ApiKeyAuth": []
          },
          {
            "guest-token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Get current user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessTokenSession"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "operationId": "AuthenticationController.me"
      }
    },
    "/model-catalog/{id}": {
      "get": {
        "x-controller-name": "ModelCatalogController",
        "x-operation-name": "get",
        "tags": [
          "ModelCatalog"
        ],
        "summary": "Get an available LLM model",
        "description": "Get model capabilities and the effective agent parameter contract.",
        "responses": {
          "200": {
            "description": "Model catalog detail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "source",
                    "type",
                    "available",
                    "capabilities",
                    "parameter_schema",
                    "parameters",
                    "architecture"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "platform",
                        "organization"
                      ]
                    },
                    "integration_provider": {
                      "type": "string",
                      "nullable": true
                    },
                    "type": {
                      "type": "string"
                    },
                    "available": {
                      "type": "boolean"
                    },
                    "capabilities": {
                      "type": "object",
                      "nullable": true
                    },
                    "parameter_schema": {
                      "type": "object"
                    },
                    "parameters": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "architecture": {
                      "type": "object",
                      "nullable": true
                    },
                    "unavailable_reason": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ModelCatalogController.get"
      }
    },
    "/model-catalog": {
      "get": {
        "x-controller-name": "ModelCatalogController",
        "x-operation-name": "list",
        "tags": [
          "ModelCatalog"
        ],
        "summary": "List available LLM models",
        "description": "List the organization-visible text-generation model catalog.",
        "responses": {
          "200": {
            "description": "Model catalog page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "total",
                    "has_more"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "source",
                          "type",
                          "available",
                          "capabilities"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "platform",
                              "organization"
                            ]
                          },
                          "integration_provider": {
                            "type": "string",
                            "nullable": true
                          },
                          "type": {
                            "type": "string"
                          },
                          "available": {
                            "type": "boolean"
                          },
                          "capabilities": {
                            "type": "object",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Case-insensitive search over model name, description or provider."
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Restrict results to platform or organization-owned models."
          },
          {
            "name": "capability",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by a supported capability such as tools or reasoning."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Number of models per page (1-100)."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "One-based result page."
          }
        ],
        "operationId": "ModelCatalogController.list"
      }
    },
    "/oauth/authorize": {
      "get": {
        "x-controller-name": "OAuthAuthorizeController",
        "x-operation-name": "authorize",
        "tags": [
          "OAuth"
        ],
        "security": [],
        "parameters": [
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "description": "Registered OAuth client identifier.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "description": "Exact redirect URI registered for the client.",
            "schema": {
              "type": "string",
              "description": "Exact redirect URI registered for the client; it must be an absolute URI."
            }
          },
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "description": "OAuth response type; only `code` is supported.",
            "schema": {
              "type": "string",
              "description": "OAuth response type. The authorization server accepts only `code`."
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "Space-delimited requested OAuth scopes.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resource",
            "in": "query",
            "required": true,
            "description": "Canonical resource URI the resulting token is valid for.",
            "schema": {
              "type": "string",
              "description": "Canonical resource URI the resulting token is valid for."
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": true,
            "description": "RFC 7636 S256 code challenge.",
            "schema": {
              "type": "string",
              "description": "RFC 7636 S256 challenge: 43-character base64url value."
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": true,
            "description": "PKCE challenge method; only S256 is supported.",
            "schema": {
              "type": "string",
              "description": "PKCE challenge method. The authorization server accepts only `S256`."
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Opaque client state returned unchanged with the authorization result.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the web consent screen.",
            "headers": {
              "Location": {
                "description": "Consent URL containing the opaque request_id.",
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "Cache-Control": {
                "description": "Always `no-store` for an authorization response.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive; always `no-cache`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The OAuth request is malformed or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "The OAuth endpoint rate limit was exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "The OAuth state store is temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          }
        },
        "operationId": "OAuthAuthorizeController.authorize"
      }
    },
    "/oauth/device/code": {
      "post": {
        "x-controller-name": "OAuthDeviceCodeController",
        "x-operation-name": "issue",
        "tags": [
          "OAuth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "RFC 8628 device authorization response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "device_code",
                    "user_code",
                    "verification_uri",
                    "verification_uri_complete",
                    "expires_in",
                    "interval"
                  ],
                  "properties": {
                    "device_code": {
                      "type": "string"
                    },
                    "user_code": {
                      "type": "string",
                      "example": "ABCD-EFGH"
                    },
                    "verification_uri": {
                      "type": "string",
                      "format": "uri"
                    },
                    "verification_uri_complete": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expires_in": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "interval": {
                      "type": "integer",
                      "minimum": 1
                    }
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The OAuth request is malformed or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The OAuth client authentication or authorization is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "The OAuth endpoint rate limit was exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "The OAuth state store is temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_id": {
                    "type": "string"
                  },
                  "scope": {
                    "type": "string",
                    "description": "Space-delimited requested OAuth scopes."
                  },
                  "resource": {
                    "type": "string",
                    "description": "Canonical resource URI for the device token."
                  }
                }
              }
            }
          }
        },
        "operationId": "OAuthDeviceCodeController.issue"
      }
    },
    "/oauth/revoke": {
      "post": {
        "x-controller-name": "OAuthRevokeController",
        "x-operation-name": "revoke",
        "tags": [
          "OAuth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "OAuth token revocation succeeded. The response body is empty by RFC 7009.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "description": "The response body is empty; this schema documents the successful response media type."
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "Opaque access or refresh token to revoke."
                  },
                  "token_type_hint": {
                    "type": "string"
                  },
                  "client_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "operationId": "OAuthRevokeController.revoke"
      }
    },
    "/oauth/token": {
      "post": {
        "x-controller-name": "OAuthTokenController",
        "x-operation-name": "token",
        "tags": [
          "OAuth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "OAuth access and refresh token response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "access_token",
                    "token_type",
                    "expires_in",
                    "scope"
                  ],
                  "properties": {
                    "access_token": {
                      "type": "string",
                      "description": "Bearer access token."
                    },
                    "token_type": {
                      "type": "string",
                      "enum": [
                        "Bearer"
                      ]
                    },
                    "expires_in": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "refresh_token": {
                      "type": "string",
                      "description": "Opaque rotating refresh token."
                    },
                    "scope": {
                      "type": "string",
                      "description": "Space-delimited scopes granted to the access token."
                    },
                    "issued_token_type": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The OAuth request is malformed or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "The OAuth client authentication or authorization is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "The OAuth endpoint rate limit was exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "The OAuth request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "The OAuth state store is temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "OAuth responses are not cacheable.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                }
              },
              "Pragma": {
                "description": "Legacy cache directive for OAuth responses.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-cache"
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "grant_type": {
                    "type": "string",
                    "description": "Grant type: authorization_code, refresh_token, urn:ietf:params:oauth:grant-type:device_code, or urn:ietf:params:oauth:grant-type:token-exchange."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Registered OAuth client identifier."
                  },
                  "code": {
                    "type": "string",
                    "description": "Single-use authorization code."
                  },
                  "redirect_uri": {
                    "type": "string",
                    "description": "Exact redirect URI registered for the OAuth client."
                  },
                  "code_verifier": {
                    "type": "string",
                    "description": "RFC 7636 verifier matching the authorization request challenge."
                  },
                  "refresh_token": {
                    "type": "string",
                    "description": "Opaque refresh token."
                  },
                  "device_code": {
                    "type": "string",
                    "description": "Opaque RFC 8628 device code."
                  },
                  "subject_token": {
                    "type": "string",
                    "description": "MCP access token for the fixed gateway exchange."
                  },
                  "subject_token_type": {
                    "type": "string"
                  },
                  "resource": {
                    "type": "string",
                    "description": "Canonical resource URI for the requested token."
                  },
                  "requested_token_type": {
                    "type": "string"
                  },
                  "scope": {
                    "type": "string",
                    "description": "Space-delimited requested OAuth scopes."
                  }
                }
              }
            }
          }
        },
        "operationId": "OAuthTokenController.token"
      }
    },
    "/openai/audio/speech": {
      "post": {
        "x-controller-name": "OpenAiController",
        "x-operation-name": "speech",
        "tags": [
          "OpenAI Compatible"
        ],
        "summary": "Open AI compatible endpoint",
        "description": "Generate audio from text. The response is the raw audio stream; its media type follows the `response_format` field of the body and defaults to `audio/mpeg`.",
        "security": [
          {
            "jwt": []
          },
          {
            "ApiKeyAuth": []
          },
          {
            "guest-token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Synthesized audio stream",
            "content": {
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/ogg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/aac": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/flac": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/L16; rate=24000; channels=1": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "x-bot-id",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-room-name",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpeechBodyParams"
              }
            }
          }
        },
        "operationId": "OpenAiController.speech"
      }
    },
    "/openai/audio/transcriptions": {
      "post": {
        "x-controller-name": "OpenAiController",
        "x-operation-name": "transcriptions",
        "tags": [
          "OpenAI Compatible"
        ],
        "summary": "Transcribe an Audio Adapter to Open AI",
        "description": "Transcribe an audio file to text, mirroring the OpenAI transcriptions API.",
        "security": [
          {
            "jwt": []
          },
          {
            "ApiKeyAuth": []
          },
          {
            "guest-token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Transcription of the submitted audio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAiTranscriptionResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "x-bot-id",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the bot the audio came from. Used for usage attribution."
          },
          {
            "name": "x-room-name",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the realtime room the audio came from. Used for usage attribution."
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "x-parser": "stream",
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "description": "Transcription model to use."
                  },
                  "language": {
                    "type": "string",
                    "description": "Language of the audio, ISO 639-1."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "Optional text to bias the transcription."
                  },
                  "response_format": {
                    "type": "string",
                    "description": "Shape of the response payload."
                  },
                  "temperature": {
                    "type": "string",
                    "description": "Sampling temperature, 0 to 1."
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Audio file to transcribe."
                  }
                }
              }
            }
          },
          "description": "Audio to transcribe, plus the OpenAI compatible form fields. The `file` part is required. Send the text fields BEFORE the file part: the server stops parsing when the file part ends, so anything after it is ignored.",
          "required": true
        },
        "operationId": "OpenAiController.transcriptions"
      }
    },
    "/openai/chat/completions": {
      "post": {
        "x-controller-name": "OpenAiController",
        "x-operation-name": "completions",
        "tags": [
          "OpenAI Compatible"
        ],
        "summary": "Chat Completion",
        "description": "Endpoint designed to be compatible with OpenAI SDK",
        "responses": {
          "200": {
            "description": "Chat completion",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletion"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompletionRequest"
              }
            }
          },
          "description": "Chat completion request"
        },
        "operationId": "OpenAiController.completions"
      }
    },
    "/openai/embeddings": {
      "post": {
        "x-controller-name": "OpenAiController",
        "x-operation-name": "embeddings",
        "tags": [
          "OpenAI Compatible"
        ],
        "summary": "OpenAI-compatible embeddings endpoint",
        "description": "Generate embeddings for text input. Compatible with OpenAI /v1/embeddings format.",
        "responses": {
          "200": {
            "description": "Embedding response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "example": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "object": {
                            "type": "string",
                            "example": "embedding"
                          },
                          "embedding": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            }
                          },
                          "index": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "model": {
                      "type": "string"
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "prompt_tokens": {
                          "type": "number"
                        },
                        "total_tokens": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "input",
                  "model"
                ],
                "properties": {
                  "input": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ],
                    "description": "Text to embed"
                  },
                  "model": {
                    "type": "string",
                    "description": "Model name"
                  },
                  "dimensions": {
                    "type": "number",
                    "description": "Output dimensions (Matryoshka truncation)"
                  },
                  "encoding_format": {
                    "type": "string",
                    "enum": [
                      "float",
                      "base64"
                    ],
                    "default": "float"
                  }
                }
              }
            }
          }
        },
        "operationId": "OpenAiController.embeddings"
      }
    },
    "/openai/models": {
      "get": {
        "x-controller-name": "OpenAiController",
        "x-operation-name": "models",
        "tags": [
          "OpenAI Compatible"
        ],
        "summary": "OpenAI-compatible model list endpoint",
        "description": "List available text-generation models. Compatible with OpenAI /v1/models format.",
        "responses": {
          "200": {
            "description": "Model list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "example": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "object",
                          "created",
                          "owned_by"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string",
                            "example": "model"
                          },
                          "created": {
                            "type": "number"
                          },
                          "owned_by": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "operationId": "OpenAiController.models"
      }
    },
    "/organization/available-dids": {
      "get": {
        "x-controller-name": "OrganizationController",
        "x-operation-name": "availableDids",
        "tags": [
          "Organizations"
        ],
        "summary": "Available DIDs",
        "description": "Get available DIDs for the organization with usage information",
        "responses": {
          "200": {
            "description": "Array of available DIDs with usage info",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AvailableDidView"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Restrict the result to the numbers usable by this project. Defaults to every project the caller can reach."
          }
        ],
        "operationId": "OrganizationController.availableDids"
      }
    },
    "/organization/credits": {
      "get": {
        "x-controller-name": "OrganizationController",
        "x-operation-name": "credits",
        "tags": [
          "Organizations"
        ],
        "summary": "Organization Credits",
        "description": "Get organization credits",
        "responses": {
          "200": {
            "description": "Organization credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationCredits"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "operationId": "OrganizationController.credits"
      }
    },
    "/organization/dids/provider/allocate": {
      "post": {
        "x-controller-name": "OrganizationController",
        "x-operation-name": "allocateProviderDid",
        "tags": [
          "Organizations"
        ],
        "summary": "Allocate and bill a provider DID",
        "description": "Reserves a number from the provider pool and starts its monthly charge. Send an `Idempotency-Key` to make a retry safe: the same key returns the DID allocated by the first call instead of reserving a second number.",
        "responses": {
          "201": {
            "description": "Allocated organization DID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailableDidView"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Client generated key, at most 128 characters, that makes the allocation safe to retry. Generated server side when omitted, which makes a retry allocate another number."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ddd"
                ],
                "properties": {
                  "ddd": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]$"
                  },
                  "agent_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "number": {
                    "type": "string",
                    "pattern": "^\\+[1-9][0-9]{7,14}$"
                  },
                  "destination": {
                    "type": "object",
                    "required": [
                      "scope"
                    ],
                    "properties": {
                      "scope": {
                        "type": "string",
                        "enum": [
                          "global",
                          "restricted"
                        ]
                      },
                      "project_ids": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 36
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "required": true
        },
        "operationId": "OrganizationController.allocateProviderDid"
      }
    },
    "/organization/dids/provider/available": {
      "get": {
        "x-controller-name": "OrganizationController",
        "x-operation-name": "providerAvailableDids",
        "tags": [
          "Organizations"
        ],
        "summary": "Available provider DIDs",
        "description": "List the numbers the upstream provider currently has free, optionally filtered by area code.",
        "responses": {
          "200": {
            "description": "Provider DID pool for a Brazilian DDD",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderDidPool"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "ddd",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Brazilian area code (DDD), two digits. Omit to list every area code."
          }
        ],
        "operationId": "OrganizationController.providerAvailableDids"
      }
    },
    "/organization/dids/provider/quote": {
      "get": {
        "x-controller-name": "OrganizationController",
        "x-operation-name": "providerDidQuote",
        "tags": [
          "Organizations"
        ],
        "summary": "Monthly provider DID quote",
        "description": "Price of one provider DID per month, converted to the organization currency.",
        "responses": {
          "200": {
            "description": "Organization-currency monthly DID quote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DidQuote"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "operationId": "OrganizationController.providerDidQuote"
      }
    },
    "/organization/dids/{id}/assign": {
      "post": {
        "x-controller-name": "OrganizationController",
        "x-operation-name": "assignDid",
        "tags": [
          "Organizations"
        ],
        "summary": "Assign an organization DID to an agent",
        "description": "Links the DID to the agent and auto-enables inbound calls for it.",
        "responses": {
          "200": {
            "description": "DID linked to the agent with inbound enabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DidAssignmentResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the organization DID.",
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "agent_id"
                ],
                "properties": {
                  "agent_id": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "OrganizationController.assignDid"
      }
    },
    "/organization/dids/{id}/destination": {
      "patch": {
        "x-controller-name": "OrganizationController",
        "x-operation-name": "setDidDestination",
        "tags": [
          "Organizations"
        ],
        "summary": "Set the project destination of an organization DID",
        "description": "Restricts the number to a set of projects, or opens it to every project in the organization.",
        "responses": {
          "200": {
            "description": "Updated organization DID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailableDidView"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the organization DID.",
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "scope"
                ],
                "properties": {
                  "scope": {
                    "type": "string",
                    "enum": [
                      "global",
                      "restricted"
                    ]
                  },
                  "project_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 36
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "required": true,
          "x-parameter-index": 1
        },
        "operationId": "OrganizationController.setDidDestination"
      }
    },
    "/organization/dids/{id}/release": {
      "post": {
        "x-controller-name": "OrganizationController",
        "x-operation-name": "releaseProviderDid",
        "tags": [
          "Organizations"
        ],
        "summary": "Release a provider DID",
        "description": "Gives the number back to the provider and stops its monthly charge. The row is kept for audit.",
        "responses": {
          "200": {
            "description": "Released DID retained for audit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DidReleaseResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the organization DID.",
            "required": true
          }
        ],
        "operationId": "OrganizationController.releaseProviderDid"
      }
    },
    "/organization/dids/{id}/unassign": {
      "post": {
        "x-controller-name": "OrganizationController",
        "x-operation-name": "unassignDid",
        "tags": [
          "Organizations"
        ],
        "summary": "Unassign an organization DID from its agent",
        "description": "Detaches the number from the agent answering it. Idempotent: a free DID answers `unassigned: false`.",
        "responses": {
          "200": {
            "description": "DID detached from its agent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DidUnassignmentResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the organization DID.",
            "required": true
          }
        ],
        "operationId": "OrganizationController.unassignDid"
      }
    },
    "/organization/dids": {
      "get": {
        "x-controller-name": "OrganizationController",
        "x-operation-name": "ownedDids",
        "tags": [
          "Organizations"
        ],
        "summary": "Organization DIDs",
        "description": "List all organization DIDs, including non-active billing and provisioning states",
        "responses": {
          "200": {
            "description": "Organization DID inventory",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationDidView"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "operationId": "OrganizationController.ownedDids"
      }
    },
    "/organization/pricing": {
      "get": {
        "x-controller-name": "PricingController",
        "x-operation-name": "getoOrgPricing",
        "tags": [
          "Pricing"
        ],
        "summary": "Pricing",
        "description": "Get models pricing",
        "security": [
          {
            "jwt": []
          }
        ],
        "responses": {
          "200": {
            "description": "Price list of the organization plan, in the organization currency",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationPricing"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "operationId": "PricingController.getoOrgPricing"
      }
    },
    "/organizations/{id}/delete": {
      "post": {
        "x-controller-name": "OrganizationController",
        "x-operation-name": "deleteOrganization",
        "tags": [
          "Organizations"
        ],
        "summary": "Delete Organization",
        "description": "Soft-delete an organization immediately. Data is retained for 30 days for emergency restoration via admin. Only owners can delete.",
        "responses": {
          "200": {
            "description": "Organization deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationMessage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the organization to delete.",
            "required": true
          }
        ],
        "operationId": "OrganizationController.deleteOrganization"
      }
    },
    "/organizations/{id}/leave": {
      "post": {
        "x-controller-name": "OrganizationController",
        "x-operation-name": "leaveOrganization",
        "tags": [
          "Organizations"
        ],
        "summary": "Leave Organization",
        "description": "Leave an organization. Cannot leave if sole owner or if this is the user's only organization.",
        "responses": {
          "200": {
            "description": "Left organization successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeaveOrganizationResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the organization to leave.",
            "required": true
          }
        ],
        "operationId": "OrganizationController.leaveOrganization"
      }
    },
    "/organizations/{id}/transfer-ownership": {
      "post": {
        "x-controller-name": "OrganizationController",
        "x-operation-name": "transferOwnership",
        "tags": [
          "Organizations"
        ],
        "summary": "Transfer Ownership",
        "description": "Transfer owner role to another active member. Current owner keeps their role (multiple owners allowed).",
        "responses": {
          "200": {
            "description": "Ownership transferred successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationMessage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the organization.",
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "target_user_id"
                ],
                "properties": {
                  "target_user_id": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "OrganizationController.transferOwnership"
      }
    },
    "/organizations": {
      "post": {
        "x-controller-name": "OrganizationController",
        "x-operation-name": "createOrganization",
        "tags": [
          "Organizations"
        ],
        "summary": "Create Organization",
        "description": "Create a new organization (self-service). The current user becomes the owner.",
        "responses": {
          "201": {
            "description": "Created organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 255
                  },
                  "key": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 40,
                    "pattern": "^[a-z0-9-]+$"
                  },
                  "currency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3,
                    "default": "USD"
                  }
                }
              }
            }
          }
        },
        "operationId": "OrganizationController.createOrganization"
      }
    },
    "/permissions/grouped": {
      "get": {
        "x-controller-name": "PermissionController",
        "x-operation-name": "findGrouped",
        "tags": [
          "Permissions"
        ],
        "summary": "List permissions grouped by resource",
        "description": "Get all permissions grouped by resource for UI display",
        "security": [
          {
            "jwt": []
          }
        ],
        "responses": {
          "200": {
            "description": "Array of permission groups",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "resource": {
                        "type": "string"
                      },
                      "permissions": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Permission"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "operationId": "PermissionController.findGrouped"
      }
    },
    "/permissions": {
      "get": {
        "x-controller-name": "PermissionController",
        "x-operation-name": "find",
        "tags": [
          "Permissions"
        ],
        "summary": "List all permissions",
        "description": "Get all available permissions in the system",
        "security": [
          {
            "jwt": []
          }
        ],
        "responses": {
          "200": {
            "description": "Array of Permission model instances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Permission"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "operationId": "PermissionController.find"
      }
    },
    "/projects/{id}/budget/breakdown": {
      "get": {
        "x-controller-name": "ProjectController",
        "x-operation-name": "getBudgetBreakdown",
        "tags": [
          "Projects"
        ],
        "summary": "Get project budget composition",
        "description": "Returns how the budget window consumption splits by charge type and model, as percentages. Answers `null` when the project has no budget configured.",
        "responses": {
          "200": {
            "description": "Budget composition, or null when no budget is configured",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "nullable": true,
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/BudgetBreakdown"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the project.",
            "required": true
          },
          {
            "name": "window",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "short",
                "long"
              ],
              "default": "short"
            },
            "description": "Budget window to describe."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "number",
              "default": 8
            },
            "description": "Slices kept per level before the tail collapses into `other`. Clamped to 1..20."
          }
        ],
        "operationId": "ProjectController.getBudgetBreakdown"
      }
    },
    "/projects/{id}/budget/status": {
      "get": {
        "x-controller-name": "ProjectController",
        "x-operation-name": "getBudgetStatus",
        "tags": [
          "Projects"
        ],
        "summary": "Get project budget status",
        "description": "Get budget status with role-scoped visibility. Organization scoped roles get limits and absolute spend; project scoped roles get percentages only. Answers `null` when the project has no budget configured.",
        "responses": {
          "200": {
            "description": "Budget status, or null when no budget is configured",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "nullable": true,
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/OrgScopeBudgetStatus"
                    },
                    {
                      "$ref": "#/components/schemas/ProjectScopeBudgetStatus"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the project.",
            "required": true
          }
        ],
        "operationId": "ProjectController.getBudgetStatus"
      }
    },
    "/projects/{id}/budget": {
      "put": {
        "x-controller-name": "ProjectController",
        "x-operation-name": "configureBudget",
        "tags": [
          "Projects"
        ],
        "summary": "Configure project budget",
        "description": "Create or update the budget configuration for a project",
        "responses": {
          "200": {
            "description": "ProjectBudget model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectBudget"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "short_window_hours": {
                    "type": "number",
                    "minimum": 1
                  },
                  "short_window_limit": {
                    "type": "number",
                    "nullable": true,
                    "minimum": 0
                  },
                  "long_window_days": {
                    "type": "number",
                    "minimum": 1
                  },
                  "long_window_limit": {
                    "type": "number",
                    "nullable": true,
                    "minimum": 0
                  },
                  "alert_threshold_pct": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "enforce_limit": {
                    "type": "boolean"
                  },
                  "enforce_for_org_scope": {
                    "type": "boolean"
                  },
                  "count_org_scope_usage": {
                    "type": "boolean"
                  },
                  "short_window_alert_pct": {
                    "type": "number",
                    "nullable": true,
                    "minimum": 0,
                    "maximum": 100
                  },
                  "long_window_alert_pct": {
                    "type": "number",
                    "nullable": true,
                    "minimum": 0,
                    "maximum": 100
                  },
                  "budget_alert_roles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "ProjectController.configureBudget"
      },
      "get": {
        "x-controller-name": "ProjectController",
        "x-operation-name": "getBudget",
        "tags": [
          "Projects"
        ],
        "summary": "Get project budget configuration",
        "description": "Get the raw budget configuration for a project",
        "responses": {
          "200": {
            "description": "Budget configuration, or null when the project has none",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "nullable": true,
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ProjectBudget"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ProjectController.getBudget"
      },
      "delete": {
        "x-controller-name": "ProjectController",
        "x-operation-name": "removeBudget",
        "tags": [
          "Projects"
        ],
        "summary": "Remove project budget",
        "description": "Remove budget configuration, returning to unlimited",
        "responses": {
          "204": {
            "description": "Budget removed"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ProjectController.removeBudget"
      }
    },
    "/projects/{id}/members/{memberId}": {
      "delete": {
        "x-controller-name": "ProjectController",
        "x-operation-name": "removeMember",
        "tags": [
          "Projects"
        ],
        "summary": "Remove member from project",
        "description": "Remove a member from the project (cannot remove project creator)",
        "responses": {
          "204": {
            "description": "ProjectMember DELETE success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "memberId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ProjectController.removeMember"
      }
    },
    "/projects/{id}/members": {
      "post": {
        "x-controller-name": "ProjectController",
        "x-operation-name": "addMember",
        "tags": [
          "Projects"
        ],
        "summary": "Add member to project",
        "description": "Add an organization member to the project",
        "responses": {
          "200": {
            "description": "ProjectMember model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectMember"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user_id"
                ],
                "properties": {
                  "user_id": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "ProjectController.addMember"
      },
      "get": {
        "x-controller-name": "ProjectController",
        "x-operation-name": "findMembers",
        "tags": [
          "Projects"
        ],
        "summary": "List project members",
        "description": "Get all members of a project with their roles",
        "responses": {
          "200": {
            "description": "Array of ProjectMember model instances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/ProjectMember"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "user": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "email": {
                                "type": "string"
                              },
                              "full_name": {
                                "type": "string"
                              }
                            }
                          },
                          "role": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "display_name": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ProjectController.findMembers"
      }
    },
    "/projects/{id}/reactivate": {
      "post": {
        "x-controller-name": "ProjectController",
        "x-operation-name": "reactivateById",
        "tags": [
          "Projects"
        ],
        "summary": "Reactivate archived project",
        "description": "Reactivate a previously archived project (sets status back to active)",
        "responses": {
          "204": {
            "description": "Project reactivated successfully"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Project not found"
          },
          "409": {
            "description": "Project is not archived"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ProjectController.reactivateById"
      }
    },
    "/projects/{id}": {
      "patch": {
        "x-controller-name": "ProjectController",
        "x-operation-name": "updateById",
        "tags": [
          "Projects"
        ],
        "summary": "Update project by ID",
        "description": "Update project details",
        "responses": {
          "204": {
            "description": "Project PATCH success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "settings": {
                    "type": "object",
                    "properties": {
                      "default_model": {
                        "type": "string"
                      },
                      "icon": {
                        "type": "string"
                      },
                      "color": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "ProjectController.updateById"
      },
      "get": {
        "x-controller-name": "ProjectController",
        "x-operation-name": "findById",
        "tags": [
          "Projects"
        ],
        "summary": "Get project by ID",
        "description": "Get project details with budget and stats",
        "responses": {
          "200": {
            "description": "Project model instance with details",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Project"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "budget": {
                          "$ref": "#/components/schemas/ProjectBudget"
                        },
                        "stats": {
                          "type": "object",
                          "properties": {
                            "members_count": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ProjectController.findById"
      },
      "delete": {
        "x-controller-name": "ProjectController",
        "x-operation-name": "deleteById",
        "tags": [
          "Projects"
        ],
        "summary": "Archive project by ID",
        "description": "Archive a project (soft delete, sets status to archived)",
        "responses": {
          "204": {
            "description": "Project DELETE success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ProjectController.deleteById"
      }
    },
    "/projects": {
      "post": {
        "x-controller-name": "ProjectController",
        "x-operation-name": "create",
        "tags": [
          "Projects"
        ],
        "summary": "Create new project",
        "description": "Create a new project in the organization",
        "responses": {
          "200": {
            "description": "Project model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "settings": {
                    "type": "object",
                    "properties": {
                      "default_model": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "ProjectController.create"
      },
      "get": {
        "x-controller-name": "ProjectController",
        "x-operation-name": "find",
        "tags": [
          "Projects"
        ],
        "summary": "List all projects",
        "description": "Get all projects the user is a member of in their organization",
        "responses": {
          "200": {
            "description": "Array of Project model instances with stats",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "member_count": {
                        "type": "number"
                      },
                      "my_role": {
                        "type": "string"
                      },
                      "budget": {
                        "type": "object",
                        "properties": {
                          "short_window_limit": {
                            "type": "number",
                            "nullable": true
                          },
                          "short_window_usage": {
                            "type": "number"
                          },
                          "long_window_limit": {
                            "type": "number",
                            "nullable": true
                          },
                          "long_window_usage": {
                            "type": "number"
                          }
                        }
                      },
                      "created_at": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "operationId": "ProjectController.find"
      }
    },
    "/roles/{id}": {
      "get": {
        "x-controller-name": "RoleController",
        "x-operation-name": "findById",
        "tags": [
          "Roles"
        ],
        "summary": "Get role by ID",
        "description": "Get role details with permissions array",
        "security": [
          {
            "jwt": []
          }
        ],
        "responses": {
          "200": {
            "description": "Role model instance with permissions",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Role"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "permissions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "RoleController.findById"
      }
    },
    "/roles": {
      "get": {
        "x-controller-name": "RoleController",
        "x-operation-name": "find",
        "tags": [
          "Roles"
        ],
        "summary": "List all roles",
        "description": "Get all roles with permission counts",
        "security": [
          {
            "jwt": []
          }
        ],
        "responses": {
          "200": {
            "description": "Array of Role model instances with stats",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/Role"
                      },
                      {
                        "type": "object",
                        "properties": {
                          "permission_count": {
                            "type": "number"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "operationId": "RoleController.find"
      }
    },
    "/shared/thread/{token}/raw": {
      "get": {
        "x-controller-name": "SharedThreadsController",
        "x-operation-name": "getSharedThreadRaw",
        "tags": [
          "Shared Threads"
        ],
        "summary": "Get Shared Thread Raw Data",
        "description": "Get raw shared thread data for API consumption. Public: the token is the only credential.",
        "security": [],
        "responses": {
          "200": {
            "description": "Raw shared thread data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedThreadRaw"
                }
              }
            }
          },
          "404": {
            "description": "Thread not found or not shared"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Share token generated by `POST /threads/{id}/share`.",
            "required": true
          }
        ],
        "operationId": "SharedThreadsController.getSharedThreadRaw"
      }
    },
    "/shared/thread/{token}": {
      "get": {
        "x-controller-name": "SharedThreadsController",
        "x-operation-name": "getSharedThread",
        "tags": [
          "Shared Threads"
        ],
        "summary": "Get Shared Thread",
        "description": "Get a shared thread by its token. Public: the token is the only credential, so anyone holding the share link can read the conversation.",
        "security": [],
        "responses": {
          "200": {
            "description": "Shared thread details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedThreadView"
                }
              }
            }
          },
          "404": {
            "description": "Thread not found or not shared"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Share token generated by `POST /threads/{id}/share`.",
            "required": true
          }
        ],
        "operationId": "SharedThreadsController.getSharedThread"
      }
    },
    "/structured-analyses/count": {
      "get": {
        "x-controller-name": "StructuredAnalysisController",
        "x-operation-name": "count",
        "tags": [
          "Structured Analysis"
        ],
        "summary": "Count Structured Analyses",
        "description": "Count the number of structured analyses for the current organization. The organization_id is automatically set based on the current user.",
        "responses": {
          "200": {
            "description": "StructuredAnalysis model count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/loopback.Count"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "where",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "StructuredAnalysis.WhereFilter",
                  "additionalProperties": true,
                  "x-typescript-type": "@loopback/repository#Where<StructuredAnalysis>"
                }
              }
            },
            "description": "Match criteria applied to the collection, using the same operators as `filter.where` (`eq`, `neq`, `gt`, `lt`, `inq`, `between`, `like`, `and`, `or`)."
          }
        ],
        "operationId": "StructuredAnalysisController.count"
      }
    },
    "/structured-analyses/{id}/execute": {
      "post": {
        "x-controller-name": "StructuredAnalysisController",
        "x-operation-name": "execute",
        "tags": [
          "Structured Analysis"
        ],
        "summary": "Execute Structured Analysis",
        "description": "Execute a structured analysis by ID. The organization_id is automatically set based on the current user.",
        "responses": {
          "200": {
            "description": "Execution result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StructuredAnalysisExecution"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string"
                  }
                },
                "required": [
                  "content"
                ]
              }
            }
          }
        },
        "operationId": "StructuredAnalysisController.execute"
      }
    },
    "/structured-analyses/{id}": {
      "patch": {
        "x-controller-name": "StructuredAnalysisController",
        "x-operation-name": "updateById",
        "tags": [
          "Structured Analysis"
        ],
        "summary": "Update Structured Analysis",
        "description": "Update an existing structured analysis by ID. The organization_id is automatically set based on the current user.",
        "responses": {
          "204": {
            "description": "StructuredAnalysis PATCH success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StructuredAnalysisUpdate"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "StructuredAnalysisController.updateById"
      },
      "delete": {
        "x-controller-name": "StructuredAnalysisController",
        "x-operation-name": "deleteById",
        "tags": [
          "Structured Analysis"
        ],
        "summary": "Delete Structured Analysis",
        "description": "Delete an existing structured analysis by ID. The organization_id is automatically set based on the current user.",
        "responses": {
          "204": {
            "description": "StructuredAnalysis DELETE success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "StructuredAnalysisController.deleteById"
      }
    },
    "/structured-analyses": {
      "post": {
        "x-controller-name": "StructuredAnalysisController",
        "x-operation-name": "create",
        "tags": [
          "Structured Analysis"
        ],
        "summary": "Create Structured Analysis",
        "description": "Create a new structured analysis. The organization_id and user_id are automatically set based on the current user.",
        "responses": {
          "200": {
            "description": "The created structured analysis, with the generated id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StructuredAnalysis"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewStructuredAnalysis"
              }
            }
          }
        },
        "operationId": "StructuredAnalysisController.create"
      },
      "get": {
        "x-controller-name": "StructuredAnalysisController",
        "x-operation-name": "find",
        "tags": [
          "Structured Analysis"
        ],
        "summary": "Find Structured Analyses",
        "description": "Find all structured analyses for the current organization. The organization_id is automatically set based on the current user.",
        "responses": {
          "200": {
            "description": "Array of StructuredAnalysis model instances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StructuredAnalysisWithRelations"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StructuredAnalysis.Filter"
                }
              }
            },
            "description": "Query criteria: `where`, `fields`, `order`, `limit`, `skip`, `cursor` and `include`. Send it as a JSON string (`filter={\"where\":{\"name\":\"x\"},\"limit\":10}`) or as nested keys (`filter[limit]=10`)."
          }
        ],
        "operationId": "StructuredAnalysisController.find"
      }
    },
    "/subscription/limits": {
      "get": {
        "x-controller-name": "SubscriptionLimitsController",
        "x-operation-name": "getLimits",
        "tags": [
          "Subscription Limits"
        ],
        "summary": "Get Subscription Limits",
        "description": "Get all subscription limits and usage for the current organization. Requires organization-scope role (owner/admin).",
        "responses": {
          "200": {
            "description": "Subscription limits and usage",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "subscription": {
                      "type": "string"
                    },
                    "subscriptionLabel": {
                      "type": "string"
                    },
                    "organizationLimits": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "resource": {
                            "type": "string"
                          },
                          "model": {
                            "type": "string"
                          },
                          "current": {
                            "type": "number"
                          },
                          "limit": {
                            "type": "number",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "perProjectLimits": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "resource": {
                            "type": "string"
                          },
                          "limit": {
                            "type": "number",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "credits": {
                      "type": "object",
                      "properties": {
                        "monthly": {
                          "type": "number"
                        },
                        "signup": {
                          "type": "number"
                        }
                      }
                    },
                    "settings": {
                      "type": "object",
                      "properties": {
                        "threadsExpiringDays": {
                          "type": "number"
                        },
                        "maxConcurrentLivekitRooms": {
                          "type": "number",
                          "nullable": true
                        }
                      }
                    },
                    "features": {
                      "type": "object",
                      "properties": {
                        "sip_outbound": {
                          "type": "boolean"
                        },
                        "copilot_access": {
                          "type": "boolean"
                        },
                        "shared_threads": {
                          "type": "boolean"
                        },
                        "advanced_analytics": {
                          "type": "boolean"
                        },
                        "export_data": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Insufficient permissions (requires organization-scope role)"
          }
        },
        "operationId": "SubscriptionLimitsController.getLimits"
      }
    },
    "/text-inteligence": {
      "post": {
        "x-controller-name": "TextIntelligenceController",
        "x-operation-name": "analyzeText",
        "tags": [
          "Text Intelligence"
        ],
        "summary": "Analyze Text Intelligence",
        "responses": {
          "200": {
            "description": "Text intelligence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TextInsights"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "options": {
                    "$ref": "#/components/schemas/TextInsightsOptions"
                  }
                }
              }
            }
          }
        },
        "operationId": "TextIntelligenceController.analyzeText"
      }
    },
    "/threads/{id}/agent-overrides": {
      "patch": {
        "x-controller-name": "ThreadsController",
        "x-operation-name": "updateAgentOverrides",
        "tags": [
          "Threads"
        ],
        "summary": "Update Thread Agent Overrides",
        "description": "Set the per-thread model and/or parameters used by the next turn. Writes only `agent_snapshot.llm_model` and `agent_snapshot.parameters`, spread over the existing snapshot; the agent itself is untouched. Send at least one field.",
        "responses": {
          "200": {
            "description": "The persisted override values",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "llm_model",
                    "parameters"
                  ],
                  "properties": {
                    "llm_model": {
                      "type": "string"
                    },
                    "parameters": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the thread.",
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "minProperties": 1,
                "additionalProperties": false,
                "properties": {
                  "llm_model": {
                    "type": "string"
                  },
                  "parameters": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "description": "At least one of `llm_model` or `parameters`.",
          "required": true,
          "x-parameter-index": 1
        },
        "operationId": "ThreadsController.updateAgentOverrides"
      }
    },
    "/threads/{id}/agent-snapshot": {
      "patch": {
        "x-controller-name": "ThreadsController",
        "x-operation-name": "updateAgentSnapshot",
        "tags": [
          "Threads"
        ],
        "summary": "Update Thread Agent Snapshot",
        "description": "Update the agent snapshot of a thread",
        "responses": {
          "204": {
            "description": "Thread agent snapshot updated successfully"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentSnapshotUpdate"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "ThreadsController.updateAgentSnapshot"
      }
    },
    "/threads/{id}/human-control/messages/{message_id}/retry": {
      "post": {
        "x-controller-name": "ThreadControlController",
        "x-operation-name": "retryMessage",
        "tags": [
          "Threads"
        ],
        "summary": "Retry a failed human-authored channel message",
        "responses": {
          "200": {
            "description": "Current human message delivery state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelMessage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "message_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ThreadControlController.retryMessage"
      }
    },
    "/threads/{id}/human-control/messages": {
      "post": {
        "x-controller-name": "ThreadControlController",
        "x-operation-name": "sendMessage",
        "tags": [
          "Threads"
        ],
        "summary": "Send a human-authored message through the thread channel",
        "responses": {
          "200": {
            "description": "Persisted human message and delivery state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelMessage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "content",
                  "idempotency_key"
                ],
                "properties": {
                  "content": {
                    "type": "string",
                    "minLength": 1
                  },
                  "idempotency_key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 191
                  }
                },
                "additionalProperties": false
              }
            }
          },
          "required": true,
          "x-parameter-index": 1
        },
        "operationId": "ThreadControlController.sendMessage"
      }
    },
    "/threads/{id}/human-control/release": {
      "post": {
        "x-controller-name": "ThreadControlController",
        "x-operation-name": "release",
        "tags": [
          "Threads"
        ],
        "summary": "Return a human-controlled thread to the AI agent",
        "responses": {
          "200": {
            "description": "Current human-control state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadControl"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ThreadControlController.release"
      }
    },
    "/threads/{id}/human-control/takeover": {
      "post": {
        "x-controller-name": "ThreadControlController",
        "x-operation-name": "takeover",
        "tags": [
          "Threads"
        ],
        "summary": "Take over a channel thread from the AI agent",
        "responses": {
          "200": {
            "description": "Current human-control state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadControl"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ThreadControlController.takeover"
      }
    },
    "/threads/{id}/messages": {
      "post": {
        "x-controller-name": "ThreadsController",
        "x-operation-name": "addMessages",
        "tags": [
          "Threads"
        ],
        "summary": "Add Messages to Thread",
        "description": "Add messages to thread history without running the agent",
        "security": [
          {
            "jwt": []
          },
          {
            "ApiKeyAuth": []
          },
          {
            "guest-token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Messages added successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "thread_id": {
                      "type": "string"
                    },
                    "added_count": {
                      "type": "number"
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "role",
                        "content"
                      ],
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "user",
                            "assistant",
                            "tool"
                          ]
                        },
                        "content": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "tool_call_id": {
                          "type": "string"
                        },
                        "tool_calls": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "function": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "arguments": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        },
                        "metadata": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "ThreadsController.addMessages"
      }
    },
    "/threads/{id}/run": {
      "post": {
        "x-controller-name": "ThreadsController",
        "x-operation-name": "run",
        "tags": [
          "Threads"
        ],
        "summary": "Run Thread",
        "description": "Run a thread. When billing is emitted for this turn, the response includes header `x-request-id` with the last billing request id (aligns with GET /usage-requests/{id}). See also `x-usage` for token counts.",
        "security": [
          {
            "jwt": []
          },
          {
            "ApiKeyAuth": []
          },
          {
            "guest-token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Chat completion-shaped body, or a pending-human acknowledgement while the thread awaits an attendant. Headers may include `x-request-id` and `x-usage`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ChatCompletion"
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "expires_at"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "pending_human"
                          ]
                        },
                        "expires_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "takeover_pending",
                            "human_active",
                            "release_pending",
                            "duplicate"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "x-bot-id",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-room-name",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "role": {
                        "type": "string"
                      },
                      "content": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "array"
                          }
                        ]
                      },
                      "name": {
                        "type": "string"
                      },
                      "tool_call_id": {
                        "type": "string"
                      },
                      "metadata": {
                        "type": "object",
                        "properties": {
                          "escalation": {
                            "type": "object",
                            "required": [
                              "status"
                            ],
                            "properties": {
                              "status": {
                                "type": "string",
                                "enum": [
                                  "answered",
                                  "skipped"
                                ]
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "required": [
                      "role"
                    ]
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "content": {
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array"
                            }
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "tool_call_id": {
                          "type": "string"
                        },
                        "metadata": {
                          "type": "object",
                          "properties": {
                            "escalation": {
                              "type": "object",
                              "required": [
                                "status"
                              ],
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "answered",
                                    "skipped"
                                  ]
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "additionalProperties": true
                        }
                      },
                      "required": [
                        "role"
                      ]
                    }
                  }
                ]
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "ThreadsController.run"
      }
    },
    "/threads/{id}/share": {
      "post": {
        "x-controller-name": "ThreadsController",
        "x-operation-name": "shareThread",
        "tags": [
          "Threads"
        ],
        "summary": "Share Thread",
        "description": "Generate a shareable link for a thread. Anyone holding the returned token can read the conversation through `GET /shared/thread/{token}` without authenticating.",
        "responses": {
          "200": {
            "description": "Thread sharing enabled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadShareResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the thread to share.",
            "required": true
          }
        ],
        "operationId": "ThreadsController.shareThread"
      }
    },
    "/threads/{id}/stream": {
      "post": {
        "x-controller-name": "ThreadsController",
        "x-operation-name": "stream",
        "tags": [
          "Threads"
        ],
        "summary": "Stream Thread",
        "description": "Stream a thread (SSE). The final `total_report` event may include `billing_request_ids` (billing request ids for this turn, for correlation with usage requests).",
        "security": [
          {
            "jwt": []
          },
          {
            "ApiKeyAuth": []
          },
          {
            "guest-token": []
          }
        ],
        "responses": {
          "200": {
            "description": "text/event-stream; includes `total_report` with optional `billing_request_ids`.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "parameters": [
            {
              "name": "x-bot-id",
              "in": "header",
              "required": false,
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "x-room-name",
              "in": "header",
              "required": false,
              "schema": {
                "type": "string"
              }
            }
          ]
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "x-stream-mode",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "role": {
                        "type": "string"
                      },
                      "content": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "array"
                          }
                        ]
                      },
                      "name": {
                        "type": "string"
                      },
                      "tool_call_id": {
                        "type": "string"
                      },
                      "metadata": {
                        "type": "object",
                        "properties": {
                          "escalation": {
                            "type": "object",
                            "required": [
                              "status"
                            ],
                            "properties": {
                              "status": {
                                "type": "string",
                                "enum": [
                                  "answered",
                                  "skipped"
                                ]
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "additionalProperties": true
                      }
                    },
                    "required": [
                      "role"
                    ]
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "content": {
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array"
                            }
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "tool_call_id": {
                          "type": "string"
                        },
                        "metadata": {
                          "type": "object",
                          "properties": {
                            "escalation": {
                              "type": "object",
                              "required": [
                                "status"
                              ],
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "answered",
                                    "skipped"
                                  ]
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "additionalProperties": true
                        }
                      },
                      "required": [
                        "role"
                      ]
                    }
                  }
                ]
              }
            }
          },
          "x-parameter-index": 2
        },
        "operationId": "ThreadsController.stream"
      }
    },
    "/threads/{id}/unshare": {
      "post": {
        "x-controller-name": "ThreadsController",
        "x-operation-name": "unshareThread",
        "tags": [
          "Threads"
        ],
        "summary": "Unshare Thread",
        "description": "Revoke access to a shared thread. The previous token stops working immediately.",
        "responses": {
          "200": {
            "description": "Thread sharing revoked successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadUnshareResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the thread to unshare.",
            "required": true
          }
        ],
        "operationId": "ThreadsController.unshareThread"
      }
    },
    "/threads/{id}": {
      "put": {
        "x-controller-name": "ThreadsController",
        "x-operation-name": "putById",
        "tags": [
          "Threads"
        ],
        "summary": "Update Thread by ID (PUT)",
        "description": "Update a thread by its ID and return the updated thread",
        "security": [
          {
            "jwt": []
          },
          {
            "ApiKeyAuth": []
          },
          {
            "guest-token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Updated thread instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thread"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThreadUpdate"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "ThreadsController.putById"
      },
      "patch": {
        "x-controller-name": "ThreadsController",
        "x-operation-name": "updateById",
        "tags": [
          "Threads"
        ],
        "summary": "Update Thread by ID",
        "description": "Update a thread by its ID",
        "responses": {
          "204": {
            "description": "Threads PATCH success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThreadUpdate"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "ThreadsController.updateById"
      },
      "get": {
        "x-controller-name": "ThreadsController",
        "x-operation-name": "findById",
        "tags": [
          "Threads"
        ],
        "summary": "Get Thread by ID",
        "description": "Get thread by ID",
        "security": [
          {
            "jwt": []
          },
          {
            "ApiKeyAuth": []
          },
          {
            "guest-token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Thread detail with queued human-escalation messages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadDetailViewWithRelations"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Identifier of the thread.",
            "required": true
          },
          {
            "name": "include_usage_request",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Include the billing usage requests generated by this thread. Defaults to false."
          }
        ],
        "operationId": "ThreadsController.findById"
      },
      "delete": {
        "x-controller-name": "ThreadsController",
        "x-operation-name": "deleteById",
        "tags": [
          "Threads"
        ],
        "summary": "Delete Thread by ID",
        "description": "Delete a thread by its ID",
        "responses": {
          "204": {
            "description": "Threads DELETE success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "ThreadsController.deleteById"
      }
    },
    "/threads": {
      "post": {
        "x-controller-name": "ThreadsController",
        "x-operation-name": "create",
        "tags": [
          "Threads"
        ],
        "summary": "Create Thread",
        "description": "Create a new thread",
        "security": [
          {
            "jwt": []
          },
          {
            "ApiKeyAuth": []
          },
          {
            "guest-token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Threads model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thread"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "x-triggered-by",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-room-name",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-phone-number",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateThread"
              }
            }
          }
        },
        "operationId": "ThreadsController.create"
      },
      "get": {
        "x-controller-name": "ThreadsController",
        "x-operation-name": "find",
        "tags": [
          "Threads"
        ],
        "summary": "Get Threads",
        "description": "Get all threads",
        "responses": {
          "200": {
            "description": "Array of Threads model instances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Thread"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thread.Filter"
                }
              }
            },
            "description": "Query criteria: `where`, `fields`, `order`, `limit`, `skip`, `cursor` and `include`. Send it as a JSON string (`filter={\"where\":{\"name\":\"x\"},\"limit\":10}`) or as nested keys (`filter[limit]=10`)."
          }
        ],
        "operationId": "ThreadsController.find"
      }
    },
    "/tts/download/{filename}": {
      "get": {
        "x-controller-name": "TtsController",
        "x-operation-name": "getTtsDownload",
        "tags": [
          "Text to Speech"
        ],
        "summary": "Download Audio File",
        "description": "Download a TTS audio file as an attachment using a signed link that expires (24 hours by default). The link is still public and can be opened directly in a browser.",
        "security": [],
        "responses": {
          "200": {
            "description": "Audio file, served with `Content-Disposition: attachment`",
            "content": {
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/ogg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/aac": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/flac": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/L16; rate=24000; channels=1": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "No generated audio matches this file name. The body is a plain message, not the standard error envelope."
          }
        },
        "parameters": [
          {
            "name": "filename",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Signed, expiring path segment (id.exp.sig.ext) returned as `filename` by `POST /tts/generate`.",
            "required": true
          }
        ],
        "operationId": "TtsController.getTtsDownload"
      }
    },
    "/tts/generate": {
      "post": {
        "x-controller-name": "TtsController",
        "x-operation-name": "generateTTS",
        "tags": [
          "Text to Speech"
        ],
        "summary": "Generate Audio",
        "description": "Generate audio from text and return the URLs to fetch it from. The audio itself is served by `GET /tts/stream/{filename}` and `GET /tts/download/{filename}`.",
        "security": [
          {
            "jwt": []
          },
          {
            "ApiKeyAuth": []
          },
          {
            "guest-token": []
          }
        ],
        "responses": {
          "200": {
            "description": "Generated audio, with the URLs to fetch it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TtsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "x-bot-id",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-room-name",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpeechBodyParams"
              }
            }
          }
        },
        "operationId": "TtsController.generateTTS"
      }
    },
    "/tts/models": {
      "get": {
        "x-controller-name": "TtsController",
        "x-operation-name": "models",
        "tags": [
          "Text to Speech"
        ],
        "summary": "TTS models",
        "description": "List of all TTS models",
        "responses": {
          "200": {
            "description": "List of all TTS models",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "active"
              ]
            },
            "required": false,
            "default": "active",
            "description": "Model status (only active models are listed)"
          }
        ],
        "operationId": "TtsController.models"
      }
    },
    "/tts/stream/{filename}": {
      "get": {
        "x-controller-name": "TtsController",
        "x-operation-name": "getTtsStream",
        "tags": [
          "Text to Speech"
        ],
        "description": "Stream a TTS audio file using a signed link that expires (24 hours by default). The link is still public and can be opened directly in a browser or audio player.",
        "summary": "Stream Audio File",
        "security": [],
        "responses": {
          "200": {
            "description": "Audio stream, with the media type matching the file extension",
            "content": {
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/ogg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/aac": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/flac": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/wav": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/L16; rate=24000; channels=1": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "No generated audio matches this file name. The body is a plain message, not the standard error envelope."
          }
        },
        "parameters": [
          {
            "name": "filename",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "Signed, expiring path segment (id.exp.sig.ext) returned as `filename` by `POST /tts/generate`.",
            "required": true
          }
        ],
        "operationId": "TtsController.getTtsStream"
      }
    },
    "/tts/voices": {
      "get": {
        "x-controller-name": "TtsController",
        "x-operation-name": "voices",
        "tags": [
          "Text to Speech"
        ],
        "summary": "Voices",
        "description": "List of voices for each model",
        "responses": {
          "200": {
            "description": "Voices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/VoiceParams",
                      "definitions": {
                        "VoiceParams": {
                          "$ref": "#/components/schemas/VoiceParams"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "model",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only return the voices offered by this TTS model. Defaults to every model."
          }
        ],
        "operationId": "TtsController.voices"
      }
    },
    "/usage/budget/breakdown": {
      "get": {
        "x-controller-name": "UsageRequestController",
        "x-operation-name": "getBudgetBreakdown",
        "tags": [
          "Usage"
        ],
        "summary": "Get project budget composition",
        "description": "Returns how the budget window consumption splits by charge type and model, as percentages, for the project associated with the API key or X-Project-ID header. Never exposes absolute values.",
        "responses": {
          "200": {
            "description": "Budget composition (percentages only) or null if no budget configured",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "nullable": true,
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/BudgetBreakdown"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "short",
                "long"
              ],
              "default": "short"
            },
            "description": "Budget window to describe."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "number",
              "default": 8
            },
            "description": "Slices kept per level before the tail collapses into `other`. Clamped to 1..20."
          }
        ],
        "operationId": "UsageRequestController.getBudgetBreakdown"
      }
    },
    "/usage/budget": {
      "get": {
        "x-controller-name": "UsageRequestController",
        "x-operation-name": "getBudget",
        "tags": [
          "Usage"
        ],
        "summary": "Get project budget status",
        "description": "Returns budget usage as percentages for the project associated with the API key or X-Project-ID header. Never exposes absolute values.",
        "responses": {
          "200": {
            "description": "Budget status (percentages only) or null if no budget configured",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "nullable": true,
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ProjectScopeBudgetStatus"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "operationId": "UsageRequestController.getBudget"
      }
    },
    "/usage/sessions": {
      "get": {
        "x-controller-name": "UsageRequestController",
        "x-operation-name": "listSessions",
        "tags": [
          "Usage"
        ],
        "summary": "List billed voice sessions",
        "description": "Returns one row per billed voice session (agent voice time), newest first, with the metered duration, the billed quantity and unit (e.g. rounded-up minutes) and the selling price. Scoped like the other usage endpoints: a project-scoped API key or the X-Project-ID header narrows it to one project. Page with `next_cursor` until `has_more` is false.",
        "responses": {
          "200": {
            "description": "A page of billed voice sessions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageSessionPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "required": true,
            "description": "First local day (YYYY-MM-DD, inclusive) in `tz`, matched against the session end."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "required": true,
            "description": "Last local day (YYYY-MM-DD, inclusive) in `tz`, matched against the session end."
          },
          {
            "name": "tz",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "UTC"
            },
            "description": "IANA timezone the days are interpreted in."
          },
          {
            "name": "agent_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only sessions of this agent."
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Opaque `next_cursor` of the previous page."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            },
            "description": "Page size."
          }
        ],
        "operationId": "UsageRequestController.listSessions"
      }
    },
    "/usage-requests/{id}": {
      "get": {
        "x-controller-name": "UsageRequestController",
        "x-operation-name": "findById",
        "tags": [
          "Usage"
        ],
        "summary": "Get Usage Request by ID",
        "description": "Get detailed usage request with items",
        "responses": {
          "200": {
            "description": "UsageRequest model instance with items",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageRequestWithRelations"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "UsageRequestController.findById"
      }
    },
    "/v1/decisions": {
      "post": {
        "x-controller-name": "DecisionsController",
        "x-operation-name": "decisions",
        "tags": [
          "Decisions"
        ],
        "summary": "Answer decision questions",
        "description": "Native SIPPulse decisions endpoint.",
        "responses": {
          "200": {
            "description": "Decision answers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DecisionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/DecisionBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/DecisionUnauthorized"
          },
          "402": {
            "$ref": "#/components/responses/DecisionPaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/DecisionForbidden"
          },
          "404": {
            "$ref": "#/components/responses/DecisionNotFound"
          },
          "413": {
            "$ref": "#/components/responses/DecisionPayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/DecisionTooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/DecisionInternalServerError"
          },
          "502": {
            "$ref": "#/components/responses/DecisionBadGateway"
          },
          "503": {
            "$ref": "#/components/responses/DecisionServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/DecisionGatewayTimeout"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecisionRequest"
              }
            }
          }
        },
        "operationId": "DecisionsController.decisions"
      }
    },
    "/v1/models": {
      "get": {
        "x-controller-name": "DecisionsController",
        "x-operation-name": "typeSafeModels",
        "tags": [
          "Decisions"
        ],
        "summary": "List decision models (TypeSafe SDK shape)",
        "description": "TypeSafe SDK model listing. Wire shape is `{models:[...]}`; the SDK unwraps it to an array.",
        "responses": {
          "200": {
            "description": "Model cards",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TypeSafeModelList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/DecisionBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/DecisionUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/DecisionForbidden"
          },
          "500": {
            "$ref": "#/components/responses/DecisionInternalServerError"
          }
        },
        "operationId": "DecisionsController.typeSafeModels"
      }
    },
    "/webhooks/count": {
      "get": {
        "x-controller-name": "WebhooksController",
        "x-operation-name": "count",
        "tags": [
          "Webhooks"
        ],
        "summary": "Count Webhooks",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Count the number of webhooks for the current organization.",
        "responses": {
          "200": {
            "description": "Webhook model count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/loopback.Count"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "where",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "Webhook.WhereFilter",
                  "additionalProperties": true,
                  "x-typescript-type": "@loopback/repository#Where<Webhook>"
                }
              }
            },
            "description": "Match criteria applied to the collection, using the same operators as `filter.where` (`eq`, `neq`, `gt`, `lt`, `inq`, `between`, `like`, `and`, `or`)."
          }
        ],
        "operationId": "WebhooksController.count"
      }
    },
    "/webhooks/{id}/event-logs/count": {
      "get": {
        "x-controller-name": "WebhooksController",
        "x-operation-name": "countLogs",
        "tags": [
          "Webhooks"
        ],
        "summary": "Count Webhook Event Logs",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Count the number of event logs for a specific webhook in the current organization.",
        "responses": {
          "200": {
            "description": "WebhookEventLog model count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/loopback.Count"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "where",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "WebhookEventLog.WhereFilter",
                  "additionalProperties": true,
                  "x-typescript-type": "@loopback/repository#Where<WebhookEventLog>"
                }
              }
            },
            "description": "Match criteria applied to the collection, using the same operators as `filter.where` (`eq`, `neq`, `gt`, `lt`, `inq`, `between`, `like`, `and`, `or`)."
          }
        ],
        "operationId": "WebhooksController.countLogs"
      }
    },
    "/webhooks/{id}/event-logs/{log_id}": {
      "delete": {
        "x-controller-name": "WebhooksController",
        "x-operation-name": "deleteLogById",
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete Webhook Event Log",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Delete a specific webhook event log. The organization_id is automatically set based on the current user.",
        "responses": {
          "204": {
            "description": "WebhookEventLog DELETE success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "log_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "WebhooksController.deleteLogById"
      }
    },
    "/webhooks/{id}/event-logs": {
      "get": {
        "x-controller-name": "WebhooksController",
        "x-operation-name": "findLogs",
        "tags": [
          "Webhooks"
        ],
        "summary": "Find Webhook Event Logs",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Find all event logs for a specific webhook in the current organization.",
        "responses": {
          "200": {
            "description": "Array of WebhookEventLog model instances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookEventLogWithRelations"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEventLog.Filter"
                }
              }
            },
            "description": "Query criteria: `where`, `fields`, `order`, `limit`, `skip`, `cursor` and `include`. Send it as a JSON string (`filter={\"where\":{\"name\":\"x\"},\"limit\":10}`) or as nested keys (`filter[limit]=10`)."
          }
        ],
        "operationId": "WebhooksController.findLogs"
      }
    },
    "/webhooks/{id}/events/{log_id}/retry": {
      "post": {
        "x-controller-name": "WebhooksController",
        "x-operation-name": "retryEvent",
        "tags": [
          "Webhooks"
        ],
        "summary": "Retry Webhook Event Log",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Retry a specific webhook event log. The organization_id is automatically set based on the current user.",
        "responses": {
          "204": {
            "description": "WebhookEventLog retry success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "log_id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "WebhooksController.retryEvent"
      }
    },
    "/webhooks/{id}": {
      "patch": {
        "x-controller-name": "WebhooksController",
        "x-operation-name": "updateById",
        "tags": [
          "Webhooks"
        ],
        "summary": "Update Webhook by ID",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Update an existing webhook by ID. The organization_id is automatically set based on the current user.",
        "responses": {
          "204": {
            "description": "Webhook PATCH success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookUpdate"
              }
            }
          },
          "x-parameter-index": 1
        },
        "operationId": "WebhooksController.updateById"
      },
      "get": {
        "x-controller-name": "WebhooksController",
        "x-operation-name": "findById",
        "tags": [
          "Webhooks"
        ],
        "summary": "Find Webhook by ID",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Find a webhook by its ID for the current organization.",
        "responses": {
          "200": {
            "description": "Webhook model instance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookView"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook.Filter"
                }
              }
            },
            "description": "Query criteria: `where`, `fields`, `order`, `limit`, `skip`, `cursor` and `include`. Send it as a JSON string (`filter={\"where\":{\"name\":\"x\"},\"limit\":10}`) or as nested keys (`filter[limit]=10`)."
          }
        ],
        "operationId": "WebhooksController.findById"
      },
      "delete": {
        "x-controller-name": "WebhooksController",
        "x-operation-name": "deleteById",
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete Webhook by ID",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Delete an existing webhook by ID. The organization_id is automatically set based on the current user.",
        "responses": {
          "204": {
            "description": "Webhook DELETE success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "operationId": "WebhooksController.deleteById"
      }
    },
    "/webhooks": {
      "post": {
        "x-controller-name": "WebhooksController",
        "x-operation-name": "create",
        "tags": [
          "Webhooks"
        ],
        "summary": "Create Webhook",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Create a new webhook. The organization_id is automatically set based on the current user.",
        "responses": {
          "200": {
            "description": "The created webhook, with the generated id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookView"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewWebhook"
              }
            }
          }
        },
        "operationId": "WebhooksController.create"
      },
      "get": {
        "x-controller-name": "WebhooksController",
        "x-operation-name": "find",
        "tags": [
          "Webhooks"
        ],
        "summary": "Find all Webhooks",
        "security": [
          {
            "jwt": []
          }
        ],
        "description": "Find all webhooks for the current organization.",
        "responses": {
          "200": {
            "description": "Array of Webhook model instances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WebhookView"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook.Filter1"
                }
              }
            },
            "description": "Query criteria: `where`, `fields`, `order`, `limit`, `skip`, `cursor` and `include`. Send it as a JSON string (`filter={\"where\":{\"name\":\"x\"},\"limit\":10}`) or as nested keys (`filter[limit]=10`)."
          }
        ],
        "operationId": "WebhooksController.find"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.sippulse.ai/v1",
      "description": "Production"
    },
    {
      "url": "https://api.sippulse.ai",
      "description": "Configured for this deployment (SWAGGER_SERVERS)"
    }
  ],
  "components": {
    "schemas": {
      "WebhookView": {
        "title": "WebhookView",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "organization_id": {
            "type": "string",
            "nullable": true
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "target_url": {
            "type": "string"
          },
          "secret_hint": {
            "type": "string",
            "description": "Last 4 characters of the stored signing secret."
          },
          "is_active": {
            "type": "boolean"
          },
          "retries": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "id",
          "target_url",
          "is_active"
        ],
        "additionalProperties": false
      },
      "NewWebhook": {
        "title": "NewWebhook",
        "type": "object",
        "description": "(tsType: Omit<Webhook, 'id' | 'organization_id'>, schemaOptions: { title: 'NewWebhook', exclude: [ 'id', 'organization_id' ] })",
        "properties": {
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "target_url": {
            "type": "string",
            "nullable": false
          },
          "secret": {
            "type": "string",
            "nullable": false
          },
          "is_active": {
            "type": "boolean",
            "nullable": false
          },
          "retries": {
            "type": "number",
            "nullable": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "target_url",
          "secret",
          "is_active"
        ],
        "additionalProperties": false,
        "x-typescript-type": "Omit<Webhook, 'id' | 'organization_id'>"
      },
      "WebhookUpdate": {
        "title": "WebhookUpdate",
        "type": "object",
        "description": "(tsType: Partial<Webhook>, schemaOptions: { title: 'WebhookUpdate', partial: true })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": true
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "target_url": {
            "type": "string",
            "nullable": false
          },
          "secret": {
            "type": "string",
            "nullable": false
          },
          "is_active": {
            "type": "boolean",
            "nullable": false
          },
          "retries": {
            "type": "number",
            "nullable": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Partial<Webhook>"
      },
      "Webhook": {
        "title": "Webhook",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": true
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "target_url": {
            "type": "string",
            "nullable": false
          },
          "secret": {
            "type": "string",
            "nullable": false
          },
          "is_active": {
            "type": "boolean",
            "nullable": false
          },
          "retries": {
            "type": "number",
            "nullable": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "id",
          "target_url",
          "secret",
          "is_active"
        ],
        "additionalProperties": false
      },
      "WebhookEventLogWithRelations": {
        "title": "WebhookEventLogWithRelations",
        "type": "object",
        "description": "(tsType: WebhookEventLogWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "webhook_id": {
            "type": "string",
            "nullable": false
          },
          "payload": {
            "type": "object",
            "nullable": false
          },
          "status": {
            "type": "string",
            "nullable": false
          },
          "attempts": {
            "type": "number",
            "nullable": false
          },
          "last_error": {
            "type": "string",
            "nullable": true
          },
          "response_code": {
            "type": "number",
            "nullable": true
          },
          "response_body": {
            "type": "string",
            "nullable": true
          },
          "next_retry_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "event": {
            "type": "string",
            "nullable": false
          }
        },
        "required": [
          "id",
          "webhook_id",
          "payload",
          "status",
          "attempts",
          "event"
        ],
        "additionalProperties": false,
        "x-typescript-type": "WebhookEventLogWithRelations"
      },
      "WaitingList": {
        "title": "WaitingList",
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": false
          },
          "full_name": {
            "type": "string",
            "nullable": false
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "credits": {
            "type": "number",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "email",
          "full_name"
        ],
        "additionalProperties": false
      },
      "NewWaitingList": {
        "title": "NewWaitingList",
        "type": "object",
        "description": "(tsType: Omit<WaitingList, 'status' | 'credits'>, schemaOptions: { title: 'NewWaitingList', exclude: [ 'status', 'credits' ] })",
        "properties": {
          "email": {
            "type": "string",
            "nullable": false
          },
          "full_name": {
            "type": "string",
            "nullable": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "email",
          "full_name"
        ],
        "additionalProperties": false,
        "x-typescript-type": "Omit<WaitingList, 'status' | 'credits'>"
      },
      "MfaVerificationBody": {
        "title": "MfaVerificationBody",
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "code": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "code"
        ],
        "additionalProperties": false
      },
      "Function": {},
      "UserWithRoleView": {
        "title": "UserWithRoleView",
        "type": "object",
        "description": "(tsType: Omit<UserWithRole, 'password'>, schemaOptions: { title: 'UserWithRoleView', exclude: [ 'password' ] })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "email": {
            "type": "string",
            "nullable": false,
            "format": "email"
          },
          "full_name": {
            "type": "string",
            "nullable": false
          },
          "language": {
            "type": "string",
            "nullable": false,
            "enum": [
              "pt",
              "en"
            ]
          },
          "settings": {
            "type": "object",
            "nullable": true
          },
          "email_opt_out_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "email_preferences_token": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": false
          },
          "last_organization_id": {
            "type": "string",
            "nullable": true
          },
          "role": {
            "type": "string"
          },
          "role_priority": {
            "type": "number"
          }
        },
        "required": [
          "email",
          "full_name"
        ],
        "additionalProperties": false,
        "x-typescript-type": "Omit<UserWithRole, 'password'>"
      },
      "InviteUser": {
        "title": "InviteUser",
        "type": "object",
        "description": "(tsType: @loopback/repository-json-schema#Optional<Omit<User, 'id' | 'created_at' | 'updated_at' | 'deleted_at'>, 'full_name' | 'password' | 'language' | 'status' | 'settings'>, schemaOptions: { title: 'InviteUser', exclude: [ 'id', 'created_at', 'updated_at', 'deleted_at' ], optional: [ 'full_name', 'password', 'language', 'status', 'settings' ] })",
        "properties": {
          "password": {
            "type": "string",
            "nullable": false
          },
          "email": {
            "type": "string",
            "nullable": false,
            "format": "email"
          },
          "full_name": {
            "type": "string",
            "nullable": false
          },
          "language": {
            "type": "string",
            "nullable": false,
            "enum": [
              "pt",
              "en"
            ]
          },
          "settings": {
            "type": "object",
            "nullable": true
          },
          "email_opt_out_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "email_preferences_token": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": false
          },
          "last_organization_id": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository-json-schema#Optional<Omit<User, 'id' | 'created_at' | 'updated_at' | 'deleted_at'>, 'full_name' | 'password' | 'language' | 'status' | 'settings'>"
      },
      "User": {
        "title": "User",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "password": {
            "type": "string",
            "nullable": false
          },
          "email": {
            "type": "string",
            "nullable": false,
            "format": "email"
          },
          "full_name": {
            "type": "string",
            "nullable": false
          },
          "language": {
            "type": "string",
            "nullable": false,
            "enum": [
              "pt",
              "en"
            ]
          },
          "settings": {
            "type": "object",
            "nullable": true
          },
          "email_opt_out_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "email_preferences_token": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": false
          },
          "last_organization_id": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "password",
          "email",
          "full_name"
        ],
        "additionalProperties": false
      },
      "Subscription": {
        "title": "Subscription",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": false
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "price": {
            "type": "number",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "integrations": {
            "type": "string",
            "nullable": true
          },
          "resources": {
            "type": "object",
            "nullable": true
          },
          "monthly_credits": {
            "type": "number",
            "nullable": true
          },
          "signup_credits": {
            "type": "number",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "rate_deck_id": {
            "type": "string",
            "nullable": true
          },
          "max_concurrent_livekit_rooms": {
            "type": "number",
            "nullable": true
          },
          "features": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "CurrencyRelation": {
        "title": "CurrencyRelation",
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "nullable": false
          },
          "rate": {
            "type": "number",
            "nullable": true
          },
          "tax": {
            "type": "number",
            "nullable": true
          }
        },
        "required": [
          "currency"
        ],
        "additionalProperties": false
      },
      "Organization": {
        "title": "Organization",
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "founder_id": {
            "type": "string",
            "nullable": false
          },
          "id": {
            "type": "string",
            "nullable": false
          },
          "key": {
            "type": "string",
            "nullable": false
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "subscription": {
            "type": "string",
            "nullable": true
          },
          "settings": {
            "type": "object",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "promo_code": {
            "type": "string",
            "nullable": true
          },
          "is_internal": {
            "type": "boolean",
            "nullable": false
          },
          "deletion_scheduled_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "deletion_reason": {
            "type": "string",
            "nullable": true
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "founder": {
            "$ref": "#/components/schemas/User"
          },
          "subscription_info": {
            "$ref": "#/components/schemas/Subscription"
          },
          "currency_info": {
            "$ref": "#/components/schemas/CurrencyRelation"
          }
        },
        "required": [
          "key",
          "name"
        ],
        "additionalProperties": false
      },
      "Project": {
        "title": "Project",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "settings": {
            "type": "object",
            "nullable": true
          },
          "created_by": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "organization": {
            "$ref": "#/components/schemas/Organization"
          },
          "creator": {
            "$ref": "#/components/schemas/User"
          }
        },
        "required": [
          "id",
          "organization_id",
          "name"
        ],
        "additionalProperties": false
      },
      "ProjectMember": {
        "title": "ProjectMember",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": false
          },
          "joined_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "invited_by": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "project": {
            "$ref": "#/components/schemas/Project"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "inviter": {
            "$ref": "#/components/schemas/User"
          }
        },
        "required": [
          "id",
          "user_id"
        ],
        "additionalProperties": false
      },
      "UsageItemWithRelations": {
        "title": "UsageItemWithRelations",
        "type": "object",
        "description": "(tsType: UsageItemWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "charge_subtype": {
            "type": "string",
            "nullable": false
          },
          "charge_type": {
            "type": "string",
            "nullable": false
          },
          "cost_amount": {
            "type": "number",
            "nullable": false
          },
          "cost_amount_local": {
            "type": "number",
            "nullable": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false
          },
          "event_timestamp": {
            "type": "string",
            "format": "date-time",
            "nullable": false
          },
          "currency": {
            "type": "string",
            "nullable": false
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "exchange_rate": {
            "type": "number",
            "nullable": true
          },
          "execution_time_ms": {
            "type": "number",
            "nullable": true
          },
          "id": {
            "type": "string",
            "nullable": false
          },
          "identifier": {
            "type": "string",
            "nullable": true
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": true
          },
          "price_amount": {
            "type": "number",
            "nullable": false
          },
          "pricing_rule": {
            "type": "string",
            "nullable": false
          },
          "quantity": {
            "type": "number",
            "nullable": false
          },
          "billed_quantity": {
            "type": "number",
            "nullable": true
          },
          "billed_unit": {
            "type": "string",
            "nullable": true
          },
          "request_id": {
            "type": "string",
            "nullable": true
          },
          "ttfb_ms": {
            "type": "number",
            "nullable": true
          },
          "throughput": {
            "type": "number",
            "nullable": true
          },
          "performance_details": {
            "type": "object",
            "nullable": true
          },
          "unit": {
            "type": "string",
            "nullable": false
          },
          "cost_attribution": {
            "type": "string",
            "nullable": false
          },
          "cache_read_tokens": {
            "type": "number",
            "nullable": true
          },
          "cache_write_tokens": {
            "type": "number",
            "nullable": true
          }
        },
        "required": [
          "charge_subtype",
          "charge_type",
          "cost_amount",
          "cost_amount_local",
          "created_at",
          "event_timestamp",
          "currency",
          "id",
          "organization_id",
          "price_amount",
          "pricing_rule",
          "quantity",
          "unit",
          "cost_attribution"
        ],
        "additionalProperties": false,
        "x-typescript-type": "UsageItemWithRelations"
      },
      "UsageRequestWithRelations": {
        "title": "UsageRequestWithRelations",
        "type": "object",
        "description": "(tsType: UsageRequestWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "agent_id": {
            "type": "string",
            "nullable": true
          },
          "api_key_id": {
            "type": "string",
            "nullable": true
          },
          "auth_mode": {
            "type": "string",
            "nullable": true
          },
          "bot_id": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false
          },
          "event_timestamp": {
            "type": "string",
            "format": "date-time",
            "nullable": false
          },
          "execution_time_ms": {
            "type": "number",
            "nullable": true
          },
          "id": {
            "type": "string",
            "nullable": false
          },
          "metadata": {
            "type": "string",
            "nullable": true
          },
          "guest": {
            "type": "object",
            "nullable": true
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "processing_time_ms": {
            "type": "number",
            "nullable": true
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "room_name": {
            "type": "string",
            "nullable": true
          },
          "source_service": {
            "type": "string",
            "nullable": false
          },
          "speed": {
            "type": "number",
            "nullable": true
          },
          "thread_id": {
            "type": "string",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false
          },
          "user_id": {
            "type": "string",
            "nullable": false
          },
          "total_price_local": {
            "type": "number",
            "nullable": false
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageItemWithRelations"
            }
          }
        },
        "required": [
          "created_at",
          "event_timestamp",
          "id",
          "organization_id",
          "source_service",
          "updated_at",
          "user_id",
          "total_price_local"
        ],
        "additionalProperties": false,
        "x-typescript-type": "UsageRequestWithRelations"
      },
      "ProjectScopeBudgetStatus": {
        "title": "ProjectScopeBudgetStatus",
        "type": "object",
        "properties": {
          "short_window": {
            "type": "object",
            "description": "Short rolling window, null when not configured.",
            "nullable": true,
            "properties": {
              "used_percentage": {
                "type": "number",
                "description": "Share of the window limit already consumed, 0 to 100."
              },
              "is_exceeded": {
                "type": "boolean",
                "description": "True once the window limit has been reached."
              },
              "resets_in_seconds": {
                "type": "number",
                "nullable": true,
                "description": "Seconds until the window rolls over, null when no window is running."
              },
              "window_hours": {
                "type": "number",
                "description": "Length of the window in hours."
              }
            }
          },
          "long_window": {
            "type": "object",
            "description": "Long rolling window, null when not configured.",
            "nullable": true,
            "properties": {
              "used_percentage": {
                "type": "number",
                "description": "Share of the window limit already consumed, 0 to 100."
              },
              "is_exceeded": {
                "type": "boolean",
                "description": "True once the window limit has been reached."
              },
              "resets_in_seconds": {
                "type": "number",
                "nullable": true,
                "description": "Seconds until the window rolls over, null when no window is running."
              },
              "window_days": {
                "type": "number",
                "description": "Length of the window in days."
              }
            }
          },
          "is_blocked": {
            "type": "boolean",
            "description": "True when the budget is currently rejecting new requests for this project."
          },
          "enforce_limit": {
            "type": "boolean",
            "description": "True when exceeding the budget blocks requests instead of only alerting."
          },
          "enforce_for_org_scope": {
            "type": "boolean",
            "description": "True when organization scoped callers are blocked as well."
          },
          "count_org_scope_usage": {
            "type": "boolean",
            "description": "True when spend by organization scoped callers counts against the budget."
          }
        },
        "required": [
          "is_blocked",
          "enforce_limit",
          "enforce_for_org_scope",
          "count_org_scope_usage"
        ],
        "additionalProperties": false
      },
      "BudgetBreakdown": {
        "title": "BudgetBreakdown",
        "type": "object",
        "properties": {
          "window": {
            "type": "string",
            "description": "Window the breakdown describes.",
            "enum": [
              "short",
              "long"
            ]
          },
          "window_hours": {
            "type": "number",
            "description": "Length of the short window in hours, null when the breakdown describes the long window.",
            "nullable": true
          },
          "window_days": {
            "type": "number",
            "description": "Length of the long window in days, null when the breakdown describes the short window.",
            "nullable": true
          },
          "used_percentage": {
            "type": "number",
            "description": "Share of the window limit already consumed, 0 to 100. Mirrors the budget status, never recomputed."
          },
          "basis": {
            "type": "string",
            "description": "How the numbers were derived: measured shares of the window consumption, projected onto `used_percentage`.",
            "enum": [
              "measured_share_projected_contribution"
            ]
          },
          "is_approximate": {
            "type": "boolean",
            "description": "True when the measured consumption and the budget counter disagree by more than 5 percent, so the shares are indicative."
          },
          "byok_present": {
            "type": "boolean",
            "description": "True when the window contains consumption billed to a customer owned provider key, which is excluded from the shares."
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "First level slices, by charge subtype, ordered by weight. `other` is always last when present.",
              "properties": {
                "key": {
                  "type": "string",
                  "description": "Stable machine key of the slice, e.g. `text-generation`, a model name, `unknown` or `other`."
                },
                "label": {
                  "type": "string",
                  "description": "Human readable name of the slice, in English."
                },
                "share_percentage": {
                  "type": "number",
                  "description": "Share of the measured window consumption this slice represents, 0 to 100. First level slices add up to 100."
                },
                "contribution_percentage": {
                  "type": "number",
                  "description": "Share of the window limit this slice accounts for. First level slices add up to `used_percentage`."
                },
                "children": {
                  "type": "array",
                  "description": "Second level split of the slice, by identifier (model name, resource, `unknown` or `other`).",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string",
                        "description": "Stable machine key of the slice, e.g. `text-generation`, a model name, `unknown` or `other`."
                      },
                      "label": {
                        "type": "string",
                        "description": "Human readable name of the slice, in English."
                      },
                      "share_percentage": {
                        "type": "number",
                        "description": "Share of the measured window consumption this slice represents, 0 to 100. First level slices add up to 100."
                      },
                      "contribution_percentage": {
                        "type": "number",
                        "description": "Share of the window limit this slice accounts for. First level slices add up to `used_percentage`."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "required": [
          "window",
          "used_percentage",
          "basis",
          "is_approximate",
          "byok_present"
        ],
        "additionalProperties": false
      },
      "UsageSession": {
        "title": "UsageSession",
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "description": "Usage request ID of the session."
          },
          "thread_id": {
            "type": "string",
            "nullable": true
          },
          "room_name": {
            "type": "string",
            "nullable": true
          },
          "agent_id": {
            "type": "string",
            "nullable": true
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "ended_at": {
            "type": "string",
            "description": "ISO-8601 end of the session; the timestamp period filters use."
          },
          "duration_seconds": {
            "type": "number",
            "description": "Session length in seconds, as metered."
          },
          "billed_quantity": {
            "type": "number",
            "description": "Quantity the price was multiplied by, in billed_unit. Null for sessions billed before billed quantities were recorded.",
            "nullable": true
          },
          "billed_unit": {
            "type": "string",
            "description": "Unit of billed_quantity, e.g. `minute`.",
            "nullable": true
          },
          "price": {
            "type": "number",
            "description": "Selling price of the session voice time, in currency."
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "ended_at",
          "duration_seconds",
          "price",
          "currency"
        ],
        "additionalProperties": false
      },
      "UsageSessionPage": {
        "title": "UsageSessionPage",
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageSession"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": "string",
            "description": "Opaque cursor for the next page; null on the last page.",
            "nullable": true
          }
        },
        "required": [
          "data",
          "has_more"
        ],
        "additionalProperties": false
      },
      "ModelResponse": {
        "title": "ModelResponse",
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "active_instances": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "resources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "execution_type": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "status"
        ],
        "additionalProperties": false
      },
      "SpeechBodyParams": {
        "title": "SpeechBodyParams",
        "type": "object",
        "properties": {
          "input": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "voice": {
            "type": "string"
          },
          "response_format": {
            "type": "string",
            "enum": [
              "mp3",
              "opus",
              "aac",
              "flac",
              "wav",
              "pcm"
            ]
          },
          "stream_format": {
            "type": "string",
            "enum": [
              "audio",
              "sse"
            ]
          },
          "speed": {
            "type": "number"
          },
          "metadata": {
            "type": "object"
          },
          "extra_body": {
            "type": "object"
          },
          "instructions": {
            "type": "string",
            "nullable": true,
            "maxLength": 1000
          }
        },
        "required": [
          "input",
          "model",
          "voice"
        ],
        "additionalProperties": true
      },
      "TtsResponse": {
        "title": "TtsResponse",
        "type": "object",
        "properties": {
          "filename": {
            "type": "string",
            "description": "Name of the file to be used in the endpoint /tts/stream/{filename}"
          },
          "usage": {
            "type": "object",
            "description": "DEPRECATED: Use x-request-id header to query usage via /requests endpoint. This field may contain requestId for tracking."
          },
          "performance": {
            "type": "object",
            "description": "DEPRECATED: Use x-request-id header to query performance via /requests endpoint"
          },
          "unit": {
            "type": "string"
          },
          "stream": {
            "type": "string"
          },
          "download": {
            "type": "string"
          }
        },
        "required": [
          "filename",
          "unit",
          "stream",
          "download"
        ],
        "additionalProperties": false
      },
      "Thread": {
        "title": "Thread",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": false
          },
          "agent_id": {
            "type": "string",
            "nullable": false
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "nullable": true
            }
          },
          "full_history": {
            "type": "array",
            "items": {
              "type": "object",
              "nullable": true
            }
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "additional_instructions": {
            "type": "string",
            "nullable": true
          },
          "vars": {
            "type": "object",
            "nullable": true
          },
          "post_analysis": {
            "type": "array",
            "items": {
              "type": "object",
              "nullable": true
            }
          },
          "agent_snapshot": {
            "type": "object",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "triggered": {
            "type": "string",
            "nullable": true
          },
          "identifier": {
            "type": "string",
            "nullable": true
          },
          "uid": {
            "type": "string",
            "nullable": true
          },
          "is_shared": {
            "type": "boolean",
            "nullable": true
          },
          "share_token": {
            "type": "string",
            "nullable": true
          },
          "shared_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "id",
          "organization_id",
          "user_id",
          "agent_id"
        ],
        "additionalProperties": false
      },
      "CreateThread": {
        "title": "CreateThread",
        "type": "object",
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "additional_instructions": {
            "type": "string",
            "nullable": true
          },
          "vars": {
            "type": "object",
            "nullable": true
          },
          "uid": {
            "type": "string",
            "maxLength": 64,
            "nullable": true
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "agent_overrides": {
            "type": "object",
            "nullable": true,
            "properties": {
              "llm_model": {
                "type": "string"
              },
              "parameters": {
                "type": "object"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "agent_id"
        ],
        "additionalProperties": false
      },
      "ThreadDetailViewWithRelations": {
        "title": "ThreadDetailViewWithRelations",
        "type": "object",
        "description": "(tsType: ThreadDetailViewWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": false
          },
          "agent_id": {
            "type": "string",
            "nullable": false
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "nullable": true
            }
          },
          "full_history": {
            "type": "array",
            "items": {
              "type": "object",
              "nullable": true
            }
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "additional_instructions": {
            "type": "string",
            "nullable": true
          },
          "vars": {
            "type": "object",
            "nullable": true
          },
          "post_analysis": {
            "type": "array",
            "items": {
              "type": "object",
              "nullable": true
            }
          },
          "agent_snapshot": {
            "type": "object",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "triggered": {
            "type": "string",
            "nullable": true
          },
          "identifier": {
            "type": "string",
            "nullable": true
          },
          "uid": {
            "type": "string",
            "nullable": true
          },
          "is_shared": {
            "type": "boolean",
            "nullable": true
          },
          "share_token": {
            "type": "string",
            "nullable": true
          },
          "shared_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "pending_human_messages": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "content"
              ],
              "properties": {
                "content": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "human_control": {
            "type": "object"
          },
          "human_capabilities": {
            "type": "object",
            "required": [
              "takeover",
              "human_message",
              "release"
            ],
            "properties": {
              "takeover": {
                "type": "boolean"
              },
              "human_message": {
                "type": "boolean"
              },
              "release": {
                "type": "boolean"
              }
            }
          },
          "channel_messages": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "active_session_thread_id": {
            "type": "string"
          },
          "usage_requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageRequestWithRelations"
            }
          }
        },
        "required": [
          "id",
          "organization_id",
          "user_id",
          "agent_id",
          "pending_human_messages",
          "human_capabilities"
        ],
        "additionalProperties": false,
        "x-typescript-type": "ThreadDetailViewWithRelations"
      },
      "ThreadUpdate": {
        "title": "ThreadUpdate",
        "type": "object",
        "description": "(tsType: Omit<Partial<Thread>, 'id' | 'history' | 'agent_id' | 'organization_id'>, schemaOptions: { title: 'ThreadUpdate', partial: true, exclude: [ 'id', 'history', 'agent_id', 'organization_id' ] })",
        "properties": {
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": false
          },
          "full_history": {
            "type": "array",
            "items": {
              "type": "object",
              "nullable": true
            }
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "additional_instructions": {
            "type": "string",
            "nullable": true
          },
          "vars": {
            "type": "object",
            "nullable": true
          },
          "post_analysis": {
            "type": "array",
            "items": {
              "type": "object",
              "nullable": true
            }
          },
          "agent_snapshot": {
            "type": "object",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "triggered": {
            "type": "string",
            "nullable": true
          },
          "identifier": {
            "type": "string",
            "nullable": true
          },
          "uid": {
            "type": "string",
            "nullable": true
          },
          "is_shared": {
            "type": "boolean",
            "nullable": true
          },
          "share_token": {
            "type": "string",
            "nullable": true
          },
          "shared_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Omit<Partial<Thread>, 'id' | 'history' | 'agent_id' | 'organization_id'>"
      },
      "Choice": {
        "title": "Choice",
        "type": "object",
        "properties": {
          "finish_reason": {
            "type": "string"
          },
          "message": {
            "type": "object"
          }
        },
        "additionalProperties": false
      },
      "CompletionUsage": {
        "title": "CompletionUsage",
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": "number"
          },
          "output_tokens": {
            "type": "number"
          },
          "total_tokens": {
            "type": "number"
          },
          "output_tokens_details": {
            "type": "object"
          },
          "input_tokens_details": {
            "type": "object"
          }
        },
        "additionalProperties": false
      },
      "Performance": {
        "title": "Performance",
        "type": "object",
        "properties": {
          "delay": {
            "type": "number",
            "description": "The delay in milliseconds between the request and the response."
          },
          "execution_time": {
            "type": "number",
            "description": "The time taken by the model to process the response."
          },
          "relative_execution_time": {
            "type": "number",
            "description": "The relative execution time of the model. It is relative to the unit of the model. For example, if the model is a text-generation model, the unit is tokens. The relative execution time is the number of tokens processed by the model per second."
          },
          "first_reasoning_ms": {
            "type": "number"
          },
          "first_content_ms": {
            "type": "number"
          }
        },
        "additionalProperties": false
      },
      "ChatCompletion": {
        "title": "ChatCompletion",
        "type": "object",
        "properties": {
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Choice"
            }
          },
          "created": {
            "type": "number"
          },
          "model": {
            "type": "string"
          },
          "usage": {
            "$ref": "#/components/schemas/CompletionUsage"
          },
          "performance": {
            "$ref": "#/components/schemas/Performance"
          }
        },
        "additionalProperties": true
      },
      "AgentSnapshotUpdate": {
        "title": "AgentSnapshotUpdate",
        "type": "object",
        "description": "(tsType: Omit<Partial<Agent>, 'id' | 'organization_id' | 'created_at' | 'updated_at'>, schemaOptions: { title: 'AgentSnapshotUpdate', partial: true, exclude: [ 'id', 'organization_id', 'created_at', 'updated_at' ] })",
        "properties": {
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": false
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "share": {
            "type": "string",
            "nullable": true
          },
          "instructions": {
            "type": "string",
            "nullable": true
          },
          "llm_model": {
            "type": "string",
            "nullable": false
          },
          "tts_model": {
            "type": "string",
            "nullable": false
          },
          "tts_voice": {
            "type": "string",
            "nullable": false
          },
          "tts_params": {
            "type": "object",
            "nullable": true
          },
          "keyterm": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "language": {
            "type": "string",
            "nullable": false
          },
          "tools": {
            "type": "array",
            "items": {
              "nullable": true,
              "type": "object"
            }
          },
          "call_configuration": {
            "type": "object",
            "nullable": true
          },
          "chat_configuration": {
            "type": "object",
            "nullable": true
          },
          "mcp_servers": {
            "type": "array",
            "items": {
              "nullable": true,
              "type": "object"
            }
          },
          "parameters": {
            "type": "object",
            "nullable": true
          },
          "settings": {
            "type": "object",
            "nullable": true,
            "properties": {
              "max_steps": {
                "type": "integer",
                "minimum": 2,
                "maximum": 50
              },
              "tool_search_enabled": {
                "type": "boolean"
              },
              "tool_search_threshold": {
                "type": "integer",
                "minimum": 1
              },
              "tool_search_catalog": {
                "type": "boolean"
              },
              "tool_prune_preserve_last": {
                "type": "integer",
                "minimum": 1,
                "maximum": 20
              },
              "tool_catalog_limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              },
              "tool_output_max_chars": {
                "type": "integer",
                "minimum": 1000,
                "maximum": 200000
              }
            }
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Omit<Partial<Agent>, 'id' | 'organization_id' | 'created_at' | 'updated_at'>"
      },
      "ThreadShareResult": {
        "title": "ThreadShareResult",
        "type": "object",
        "properties": {
          "is_shared": {
            "type": "boolean",
            "description": "True while the thread is publicly readable."
          },
          "share_token": {
            "type": "string",
            "description": "Token that identifies the share, to be used on `GET /shared/thread/{token}`."
          },
          "share_url": {
            "type": "string",
            "description": "Ready to use public URL of the shared thread."
          }
        },
        "required": [
          "is_shared",
          "share_token",
          "share_url"
        ],
        "additionalProperties": false
      },
      "ThreadUnshareResult": {
        "title": "ThreadUnshareResult",
        "type": "object",
        "properties": {
          "is_shared": {
            "type": "boolean",
            "description": "Always false, the thread is no longer publicly readable."
          }
        },
        "required": [
          "is_shared"
        ],
        "additionalProperties": false
      },
      "ThreadControl": {
        "title": "ThreadControl",
        "type": "object",
        "properties": {
          "thread_id": {
            "type": "string"
          },
          "organization_id": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "agent_id": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "version": {
            "type": "number"
          },
          "operator_user_id": {
            "type": "string"
          },
          "operator_name": {
            "type": "string"
          },
          "takeover_session_id": {
            "type": "string"
          },
          "active_execution_id": {
            "type": "string"
          },
          "execution_lease_until": {
            "type": "string",
            "format": "date-time"
          },
          "taken_over_at": {
            "type": "string",
            "format": "date-time"
          },
          "released_by_user_id": {
            "type": "string"
          },
          "released_by_name": {
            "type": "string"
          },
          "released_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "thread_id",
          "organization_id",
          "agent_id",
          "mode",
          "version"
        ],
        "additionalProperties": false
      },
      "ChannelMessage": {
        "title": "ChannelMessage",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "thread_id": {
            "type": "string"
          },
          "organization_id": {
            "type": "string"
          },
          "agent_id": {
            "type": "string"
          },
          "sequence": {
            "type": "number"
          },
          "channel": {
            "type": "string"
          },
          "address": {
            "type": "object"
          },
          "direction": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "actor_type": {
            "type": "string"
          },
          "actor_user_id": {
            "type": "string"
          },
          "actor_name": {
            "type": "string"
          },
          "external_message_id": {
            "type": "string"
          },
          "idempotency_key": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          },
          "delivery_status": {
            "type": "string"
          },
          "delivery_attempt": {
            "type": "number"
          },
          "provider_message_id": {
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "sent_at": {
            "type": "string",
            "format": "date-time"
          },
          "failed_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "thread_id",
          "organization_id",
          "agent_id",
          "sequence",
          "channel",
          "address",
          "direction",
          "role",
          "actor_type",
          "idempotency_key",
          "content",
          "metadata",
          "delivery_attempt"
        ],
        "additionalProperties": false
      },
      "TextInsights": {
        "title": "TextInsights",
        "type": "object",
        "description": "(tsType: Omit<TextInsightsResponse, 'model' | 'usage'>, schemaOptions: { title: 'TextInsights', exclude: [ 'model', 'usage' ] })",
        "properties": {
          "content": {
            "type": "object"
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Omit<TextInsightsResponse, 'model' | 'usage'>"
      },
      "SentimentAnalysisOptions": {
        "title": "SentimentAnalysisOptions",
        "type": "object",
        "properties": {
          "sentiments": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "TopicDetectionOptions": {
        "title": "TopicDetectionOptions",
        "type": "object",
        "properties": {
          "topics": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "CustomOption": {
        "title": "CustomOption",
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "string",
              "number",
              "boolean"
            ]
          }
        },
        "required": [
          "title",
          "description"
        ],
        "additionalProperties": false
      },
      "TextInsightsOptions": {
        "title": "TextInsightsOptions",
        "type": "object",
        "description": "(tsType: TextInsightsOptions, schemaOptions: { title: 'TextInsightsOptions' })",
        "properties": {
          "language": {
            "type": "string"
          },
          "summarization": {
            "type": "boolean"
          },
          "sentiment_analysis": {
            "$ref": "#/components/schemas/SentimentAnalysisOptions"
          },
          "topic_detection": {
            "$ref": "#/components/schemas/TopicDetectionOptions"
          },
          "custom": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomOption"
            }
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "TextInsightsOptions"
      },
      "StructuredAnalysis": {
        "title": "StructuredAnalysis",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "model": {
            "type": "string",
            "nullable": false
          },
          "schema": {
            "type": "object",
            "nullable": false
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "metadata": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "id",
          "organization_id",
          "name",
          "model",
          "schema"
        ],
        "additionalProperties": false
      },
      "NewStructuredAnalysis": {
        "title": "NewStructuredAnalysis",
        "type": "object",
        "description": "(tsType: Omit<StructuredAnalysis, 'id' | 'organization_id' | 'user_id'>, schemaOptions: { title: 'NewStructuredAnalysis', exclude: [ 'id', 'organization_id', 'user_id' ] })",
        "properties": {
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "model": {
            "type": "string",
            "nullable": false
          },
          "schema": {
            "type": "object",
            "nullable": false
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "metadata": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "name",
          "model",
          "schema"
        ],
        "additionalProperties": false,
        "x-typescript-type": "Omit<StructuredAnalysis, 'id' | 'organization_id' | 'user_id'>"
      },
      "StructuredAnalysisWithRelations": {
        "title": "StructuredAnalysisWithRelations",
        "type": "object",
        "description": "(tsType: StructuredAnalysisWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "model": {
            "type": "string",
            "nullable": false
          },
          "schema": {
            "type": "object",
            "nullable": false
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "metadata": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "id",
          "organization_id",
          "name",
          "model",
          "schema"
        ],
        "additionalProperties": false,
        "x-typescript-type": "StructuredAnalysisWithRelations"
      },
      "StructuredAnalysisUpdate": {
        "title": "StructuredAnalysisUpdate",
        "type": "object",
        "description": "(tsType: Partial<StructuredAnalysis>, schemaOptions: { title: 'StructuredAnalysisUpdate', partial: true })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "model": {
            "type": "string",
            "nullable": false
          },
          "schema": {
            "type": "object",
            "nullable": false
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "metadata": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Partial<StructuredAnalysis>"
      },
      "SharedThreadView": {
        "title": "SharedThreadView",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Identifier of the thread."
          },
          "title": {
            "type": "string",
            "description": "Title of the conversation, or `Untitled Conversation` when it has none."
          },
          "history": {
            "type": "array",
            "description": "Visible messages, oldest first, with system turns and internal metadata removed.",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string",
                  "description": "Who produced the message. System messages are never exposed here."
                },
                "content": {
                  "type": "string",
                  "description": "Message text."
                },
                "metadata": {
                  "type": "object",
                  "properties": {
                    "created_at": {
                      "type": "string",
                      "description": "When the message was produced, ISO 8601."
                    },
                    "model": {
                      "type": "string",
                      "description": "Model that produced the message, for agent turns."
                    }
                  }
                }
              }
            }
          },
          "agent": {
            "type": "object",
            "description": "Public identity of the agent that took part in the conversation.",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            }
          },
          "created_at": {
            "type": "string",
            "description": "When the thread was created, ISO 8601."
          },
          "shared_at": {
            "type": "string",
            "description": "When the thread was shared, ISO 8601."
          }
        },
        "required": [
          "id",
          "title",
          "created_at",
          "shared_at"
        ],
        "additionalProperties": false
      },
      "SharedThreadRaw": {
        "title": "SharedThreadRaw",
        "type": "object",
        "description": "(tsType: Omit<Thread, 'organization_id' | 'user_id' | 'share_token' | 'deleted_at'>, schemaOptions: { title: 'SharedThreadRaw', exclude: [ 'organization_id', 'user_id', 'share_token', 'deleted_at' ] })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "agent_id": {
            "type": "string",
            "nullable": false
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "nullable": true
            }
          },
          "full_history": {
            "type": "array",
            "items": {
              "type": "object",
              "nullable": true
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "additional_instructions": {
            "type": "string",
            "nullable": true
          },
          "vars": {
            "type": "object",
            "nullable": true
          },
          "post_analysis": {
            "type": "array",
            "items": {
              "type": "object",
              "nullable": true
            }
          },
          "agent_snapshot": {
            "type": "object",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "triggered": {
            "type": "string",
            "nullable": true
          },
          "identifier": {
            "type": "string",
            "nullable": true
          },
          "uid": {
            "type": "string",
            "nullable": true
          },
          "is_shared": {
            "type": "boolean",
            "nullable": true
          },
          "shared_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "id",
          "agent_id"
        ],
        "additionalProperties": false,
        "x-typescript-type": "Omit<Thread, 'organization_id' | 'user_id' | 'share_token' | 'deleted_at'>"
      },
      "UserSettings": {
        "title": "UserSettings",
        "type": "object",
        "description": "(tsType: Omit<User, 'created_at' | 'updated_at' | 'deleted_at' | 'password' | 'id'>, schemaOptions: { exclude: [ 'created_at', 'updated_at', 'deleted_at', 'password', 'id' ], title: 'UserSettings' })",
        "properties": {
          "email": {
            "type": "string",
            "nullable": false,
            "format": "email"
          },
          "full_name": {
            "type": "string",
            "nullable": false
          },
          "language": {
            "type": "string",
            "nullable": false,
            "enum": [
              "pt",
              "en"
            ]
          },
          "settings": {
            "type": "object",
            "nullable": true
          },
          "email_opt_out_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "email_preferences_token": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": false
          },
          "last_organization_id": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "email",
          "full_name"
        ],
        "additionalProperties": false,
        "x-typescript-type": "Omit<User, 'created_at' | 'updated_at' | 'deleted_at' | 'password' | 'id'>"
      },
      "PatchUserSettings": {
        "title": "PatchUserSettings",
        "type": "object",
        "description": "(tsType: Omit<Partial<User>, 'created_at' | 'updated_at' | 'deleted_at' | 'password' | 'email' | 'id'>, schemaOptions: { exclude: [ 'created_at', 'updated_at', 'deleted_at', 'password', 'email', 'id' ], title: 'PatchUserSettings', partial: true })",
        "properties": {
          "full_name": {
            "type": "string",
            "nullable": false
          },
          "language": {
            "type": "string",
            "nullable": false,
            "enum": [
              "pt",
              "en"
            ]
          },
          "settings": {
            "type": "object",
            "nullable": true
          },
          "email_opt_out_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "email_preferences_token": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": false
          },
          "last_organization_id": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Omit<Partial<User>, 'created_at' | 'updated_at' | 'deleted_at' | 'password' | 'email' | 'id'>"
      },
      "OrganizationSettings": {
        "title": "OrganizationSettings",
        "type": "object",
        "description": "(tsType: Omit<Partial<Organization>, 'created_at' | 'updated_at' | 'founder_id' | 'currency' | 'founder_id' | 'key' | 'subscription' | 'id'>, schemaOptions: { exclude: [ 'created_at', 'updated_at', 'founder_id', 'currency', 'founder_id', 'key', 'subscription', 'id' ], title: 'OrganizationSettings', partial: true })",
        "properties": {
          "name": {
            "type": "string",
            "nullable": false
          },
          "settings": {
            "type": "object",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "promo_code": {
            "type": "string",
            "nullable": true
          },
          "is_internal": {
            "type": "boolean",
            "nullable": false
          },
          "deletion_scheduled_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "deletion_reason": {
            "type": "string",
            "nullable": true
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "founder": {
            "$ref": "#/components/schemas/User"
          },
          "subscription_info": {
            "$ref": "#/components/schemas/Subscription"
          },
          "currency_info": {
            "$ref": "#/components/schemas/CurrencyRelation"
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Omit<Partial<Organization>, 'created_at' | 'updated_at' | 'founder_id' | 'currency' | 'founder_id' | 'key' | 'subscription' | 'id'>"
      },
      "Role": {
        "title": "Role",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": false
          },
          "display_name": {
            "type": "string",
            "nullable": false
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "priority": {
            "type": "number",
            "nullable": true
          },
          "scope": {
            "type": "string",
            "nullable": false,
            "enum": [
              "organization",
              "project"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "name",
          "display_name",
          "scope"
        ],
        "additionalProperties": false
      },
      "ProjectBudget": {
        "title": "ProjectBudget",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": false
          },
          "short_window_hours": {
            "type": "number",
            "nullable": true
          },
          "short_window_limit": {
            "type": "number",
            "nullable": true
          },
          "short_window_usage": {
            "type": "number",
            "nullable": true
          },
          "short_window_started_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "long_window_days": {
            "type": "number",
            "nullable": true
          },
          "long_window_limit": {
            "type": "number",
            "nullable": true
          },
          "long_window_usage": {
            "type": "number",
            "nullable": true
          },
          "long_window_started_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "alert_threshold_pct": {
            "type": "number",
            "nullable": true
          },
          "enforce_limit": {
            "type": "number",
            "nullable": true
          },
          "enforce_for_org_scope": {
            "type": "number",
            "nullable": true
          },
          "count_org_scope_usage": {
            "type": "number",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "short_window_alert_pct": {
            "type": "number",
            "nullable": true
          },
          "long_window_alert_pct": {
            "type": "number",
            "nullable": true
          },
          "budget_alert_roles": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "project": {
            "$ref": "#/components/schemas/Project"
          }
        },
        "required": [
          "id",
          "project_id"
        ],
        "additionalProperties": false
      },
      "OrgScopeBudgetStatus": {
        "title": "OrgScopeBudgetStatus",
        "type": "object",
        "properties": {
          "short_window": {
            "type": "object",
            "description": "Short rolling window, null when not configured.",
            "nullable": true,
            "properties": {
              "limit": {
                "type": "number",
                "description": "Spend cap of the window, in the project currency."
              },
              "used": {
                "type": "number",
                "description": "Amount already spent in the window."
              },
              "remaining": {
                "type": "number",
                "description": "Amount still available in the window."
              },
              "started_at": {
                "type": "string",
                "nullable": true,
                "description": "Moment the current window started, ISO 8601."
              },
              "used_percentage": {
                "type": "number",
                "description": "Share of the window limit already consumed, 0 to 100."
              },
              "is_exceeded": {
                "type": "boolean",
                "description": "True once the window limit has been reached."
              },
              "resets_in_seconds": {
                "type": "number",
                "nullable": true,
                "description": "Seconds until the window rolls over, null when no window is running."
              },
              "window_hours": {
                "type": "number",
                "description": "Length of the window in hours."
              }
            }
          },
          "long_window": {
            "type": "object",
            "description": "Long rolling window, null when not configured.",
            "nullable": true,
            "properties": {
              "limit": {
                "type": "number",
                "description": "Spend cap of the window, in the project currency."
              },
              "used": {
                "type": "number",
                "description": "Amount already spent in the window."
              },
              "remaining": {
                "type": "number",
                "description": "Amount still available in the window."
              },
              "started_at": {
                "type": "string",
                "nullable": true,
                "description": "Moment the current window started, ISO 8601."
              },
              "used_percentage": {
                "type": "number",
                "description": "Share of the window limit already consumed, 0 to 100."
              },
              "is_exceeded": {
                "type": "boolean",
                "description": "True once the window limit has been reached."
              },
              "resets_in_seconds": {
                "type": "number",
                "nullable": true,
                "description": "Seconds until the window rolls over, null when no window is running."
              },
              "window_days": {
                "type": "number",
                "description": "Length of the window in days."
              }
            }
          },
          "enforce_limit": {
            "type": "boolean",
            "description": "True when exceeding the budget blocks requests instead of only alerting."
          },
          "enforce_for_org_scope": {
            "type": "boolean",
            "description": "True when organization scoped callers are blocked as well."
          },
          "count_org_scope_usage": {
            "type": "boolean",
            "description": "True when spend by organization scoped callers counts against the budget."
          },
          "is_blocked": {
            "type": "boolean",
            "description": "True when the budget is currently rejecting new requests for this project."
          },
          "currency": {
            "type": "string",
            "description": "Currency of `limit`, `used` and `remaining`, ISO 4217."
          }
        },
        "required": [
          "enforce_limit",
          "enforce_for_org_scope",
          "count_org_scope_usage",
          "is_blocked",
          "currency"
        ],
        "additionalProperties": false
      },
      "Permission": {
        "title": "Permission",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "resource": {
            "type": "string",
            "nullable": false
          },
          "action": {
            "type": "string",
            "nullable": false
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "scope": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "name",
          "resource",
          "action"
        ],
        "additionalProperties": false
      },
      "OrganizationCredits": {
        "title": "OrganizationCredits",
        "type": "object",
        "properties": {
          "credits": {
            "type": "number",
            "nullable": false
          },
          "overdraft_limit": {
            "type": "number",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "organization": {
            "$ref": "#/components/schemas/Organization"
          }
        },
        "required": [
          "credits",
          "currency",
          "organization_id"
        ],
        "additionalProperties": false
      },
      "AvailableDidView": {
        "title": "AvailableDidView",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal DID identifier."
          },
          "did": {
            "type": "string",
            "description": "Number in E.164 format."
          },
          "description": {
            "type": "string",
            "description": "Free text label set by the organization."
          },
          "status": {
            "type": "string",
            "description": "Provisioning state of the number, e.g. `active`, `pending`, `released`."
          },
          "in_use": {
            "type": "boolean",
            "description": "True when an agent currently answers calls to this number."
          },
          "used_by_agent_id": {
            "type": "string",
            "description": "Agent answering this number, when assigned."
          },
          "used_by_agent_name": {
            "type": "string",
            "description": "Name of the agent answering this number."
          },
          "provider": {
            "type": "string",
            "description": "`manual` for a number registered by hand, `aitrunk` for one allocated from the provider pool.",
            "enum": [
              "manual",
              "aitrunk"
            ]
          },
          "external_sync_status": {
            "type": "string",
            "description": "Synchronization state with the upstream provider."
          },
          "cache_sync_status": {
            "type": "string",
            "description": "Synchronization state with the SIP routing cache."
          },
          "next_billing_at": {
            "type": "string",
            "description": "Next monthly charge, ISO 8601. Only returned to callers that can read billing."
          },
          "billing_project_id": {
            "type": "string",
            "description": "Project the monthly fee is charged to. Only returned to callers that can read projects."
          },
          "allocated_at": {
            "type": "string",
            "description": "When the number was allocated from the provider pool, ISO 8601. Absent on a number registered by hand, which is never allocated."
          },
          "destination_scope": {
            "type": "string",
            "description": "`global` allows any project to use the number, `restricted` limits it to `destination_projects`.",
            "enum": [
              "global",
              "restricted"
            ]
          },
          "destination_projects": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Projects allowed to use the number. Only meaningful when `destination_scope` is `restricted`.",
              "items": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "required": [
          "id",
          "did",
          "in_use",
          "provider"
        ],
        "additionalProperties": false
      },
      "OrganizationDidView": {
        "title": "OrganizationDidView",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Internal DID identifier."
          },
          "did": {
            "type": "string",
            "description": "Number in E.164 format."
          },
          "description": {
            "type": "string",
            "description": "Free text label set by the organization."
          },
          "status": {
            "type": "string",
            "description": "Provisioning state of the number, e.g. `active`, `pending`, `released`."
          },
          "in_use": {
            "type": "boolean",
            "description": "True when an agent currently answers calls to this number."
          },
          "used_by_agent_id": {
            "type": "string",
            "description": "Agent answering this number, when assigned."
          },
          "used_by_agent_name": {
            "type": "string",
            "description": "Name of the agent answering this number."
          },
          "provider": {
            "type": "string",
            "description": "`manual` for a number registered by hand, `aitrunk` for one allocated from the provider pool.",
            "enum": [
              "manual",
              "aitrunk"
            ]
          },
          "external_sync_status": {
            "type": "string",
            "description": "Synchronization state with the upstream provider."
          },
          "next_billing_at": {
            "type": "string",
            "description": "Next monthly charge, ISO 8601. Only returned to callers that can read billing."
          },
          "billing_project_id": {
            "type": "string",
            "description": "Project the monthly fee is charged to. Only returned to callers that can read projects."
          },
          "last_charged_at": {
            "type": "string",
            "description": "Timestamp of the last monthly charge, ISO 8601."
          },
          "last_charge_amount": {
            "type": "number",
            "description": "Amount of the last monthly charge."
          },
          "last_charge_currency": {
            "type": "string",
            "description": "Currency of the last monthly charge, ISO 4217."
          },
          "locked_price_local": {
            "type": "number",
            "description": "Monthly price locked at allocation time, in the organization currency. Billing readers only."
          },
          "locked_currency": {
            "type": "string",
            "description": "Currency of `locked_price_local`. Billing readers only."
          },
          "cache_sync_status": {
            "type": "string",
            "description": "Synchronization state with the SIP routing cache."
          },
          "destination_scope": {
            "type": "string",
            "description": "`global` allows any project to use the number, `restricted` limits it to `destination_projects`.",
            "enum": [
              "global",
              "restricted"
            ]
          },
          "destination_projects": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Projects allowed to use the number. Only meaningful when `destination_scope` is `restricted`.",
              "items": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "required": [
          "id",
          "did",
          "in_use",
          "provider"
        ],
        "additionalProperties": false
      },
      "ProviderAvailableDid": {
        "title": "ProviderAvailableDid",
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "description": "Number in E.164 format."
          },
          "ddd": {
            "type": "string",
            "description": "Brazilian area code (DDD)."
          },
          "city": {
            "type": "string",
            "description": "City the area code belongs to."
          },
          "provider": {
            "type": "string",
            "description": "Upstream carrier offering the number."
          }
        },
        "required": [
          "number",
          "ddd",
          "city",
          "provider"
        ],
        "additionalProperties": false
      },
      "ProviderDidPool": {
        "title": "ProviderDidPool",
        "type": "object",
        "properties": {
          "ddd": {
            "type": "string",
            "description": "Area code the pool was filtered by, echoed back."
          },
          "dids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderAvailableDid"
            }
          }
        },
        "additionalProperties": false
      },
      "DidQuote": {
        "title": "DidQuote",
        "type": "object",
        "properties": {
          "service_name": {
            "type": "string",
            "description": "Billable service, always `telephony_did`."
          },
          "pricing_rule_name": {
            "type": "string",
            "description": "Rate deck rule applied, always `monthly`."
          },
          "billing_period": {
            "type": "string",
            "description": "Billing period, always `month`."
          },
          "base_currency": {
            "type": "string",
            "description": "Currency the rate deck is priced in, ISO 4217."
          },
          "currency": {
            "type": "string",
            "description": "Organization currency, ISO 4217."
          },
          "base_amount": {
            "type": "number",
            "description": "Monthly price in `base_currency`."
          },
          "amount": {
            "type": "number",
            "description": "Monthly price in `currency`, taxes included."
          },
          "exchange_rate": {
            "type": "number",
            "description": "Rate used to convert `base_amount` into `amount`."
          },
          "tax_rate": {
            "type": "number",
            "description": "Tax rate applied on top of the converted amount."
          },
          "price_source": {
            "type": "string",
            "description": "`derived` when converted from the base currency, `local_override` when priced directly.",
            "enum": [
              "derived",
              "local_override"
            ]
          }
        },
        "required": [
          "service_name",
          "pricing_rule_name",
          "billing_period",
          "base_currency",
          "currency",
          "base_amount",
          "amount",
          "exchange_rate",
          "tax_rate",
          "price_source"
        ],
        "additionalProperties": false
      },
      "DidReleaseResult": {
        "title": "DidReleaseResult",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Identifier of the released DID."
          },
          "status": {
            "type": "string",
            "description": "State after the release, `released`."
          },
          "released_at": {
            "type": "string",
            "description": "Moment the release was accepted, ISO 8601."
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": false
      },
      "DidUnassignmentResult": {
        "title": "DidUnassignmentResult",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Identifier of the DID."
          },
          "unassigned": {
            "type": "boolean",
            "description": "True when a link existed and was removed, false when the DID was already free."
          }
        },
        "required": [
          "id",
          "unassigned"
        ],
        "additionalProperties": false
      },
      "DidAssignmentResult": {
        "title": "DidAssignmentResult",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Identifier of the DID."
          },
          "assigned": {
            "type": "boolean",
            "description": "True when the link was created."
          }
        },
        "required": [
          "id",
          "assigned"
        ],
        "additionalProperties": false
      },
      "LeaveOrganizationResult": {
        "title": "LeaveOrganizationResult",
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Human readable confirmation of what was done."
          },
          "next_organization_id": {
            "type": "string",
            "description": "Organization to switch the session to, or null when the user has no remaining membership.",
            "nullable": true
          }
        },
        "required": [
          "message"
        ],
        "additionalProperties": false
      },
      "OperationMessage": {
        "title": "OperationMessage",
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Human readable confirmation of what was done."
          }
        },
        "required": [
          "message"
        ],
        "additionalProperties": false
      },
      "CompletionRequest": {
        "title": "CompletionRequest",
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "default": "gpt-3.5-turbo-0125"
          },
          "messages": {
            "type": "array",
            "items": {}
          },
          "seed": {
            "type": "number"
          },
          "temperature": {
            "type": "number",
            "nullable": true
          },
          "max_tokens": {
            "type": "number"
          },
          "top_p": {
            "type": "number"
          },
          "top_k": {
            "type": "number"
          },
          "do_sample": {
            "type": "boolean"
          },
          "stream": {
            "type": "boolean"
          },
          "stop": {
            "type": "string",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "frequency_penalty": {
            "type": "number"
          },
          "presence_penalty": {
            "type": "number"
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "nullable": true
            }
          }
        },
        "required": [
          "model"
        ],
        "additionalProperties": true
      },
      "OktaIntegration": {
        "title": "OktaIntegration",
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "nullable": false
          },
          "client_id": {
            "type": "string",
            "nullable": false
          },
          "client_secret": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "domain": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": false
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "address",
          "client_id",
          "domain",
          "organization_id",
          "type"
        ],
        "additionalProperties": false
      },
      "OktaIntegrationUpdate": {
        "title": "OktaIntegrationUpdate",
        "type": "object",
        "description": "(tsType: Omit<OktaIntegration, 'organization_id'>, schemaOptions: { title: 'OktaIntegrationUpdate', exclude: [ 'organization_id' ] })",
        "properties": {
          "address": {
            "type": "string",
            "nullable": false
          },
          "client_id": {
            "type": "string",
            "nullable": false
          },
          "client_secret": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "domain": {
            "type": "string",
            "nullable": false
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": false
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "address",
          "client_id",
          "domain",
          "type"
        ],
        "additionalProperties": false,
        "x-typescript-type": "Omit<OktaIntegration, 'organization_id'>"
      },
      "ModelPricingRuleWithRelations": {
        "title": "ModelPricingRuleWithRelations",
        "type": "object",
        "description": "(tsType: ModelPricingRuleWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "model_name": {
            "type": "string",
            "nullable": false
          },
          "pricing_rule_name": {
            "type": "string",
            "nullable": false
          },
          "condition": {
            "type": "string",
            "nullable": false,
            "maxLength": 32
          },
          "pricing_rule": {
            "type": "object",
            "nullable": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "id",
          "model_name",
          "pricing_rule_name",
          "pricing_rule"
        ],
        "additionalProperties": false,
        "x-typescript-type": "ModelPricingRuleWithRelations"
      },
      "ModelWithRelations": {
        "title": "ModelWithRelations",
        "type": "object",
        "description": "(tsType: ModelWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": false
          },
          "group": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "provider": {
            "type": "string",
            "nullable": false
          },
          "type": {
            "type": "string",
            "nullable": false
          },
          "execution_type": {
            "type": "string",
            "nullable": false
          },
          "alias": {
            "type": "string",
            "nullable": true
          },
          "unit": {
            "type": "string",
            "nullable": false
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true,
            "enum": [
              "active",
              "inactive",
              "deprecated",
              "legacy"
            ]
          },
          "parameters": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "architecture": {
            "type": "object"
          },
          "capabilities": {
            "type": "object"
          },
          "credential_key": {
            "type": "string",
            "nullable": true
          },
          "hidden": {
            "type": "boolean",
            "nullable": true
          },
          "deprecated": {
            "type": "boolean",
            "nullable": true
          },
          "experimental": {
            "type": "boolean",
            "nullable": true
          },
          "priority": {
            "type": "number",
            "nullable": true
          },
          "ratings": {
            "type": "object"
          },
          "recommended_for": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Uses this model is the SipPulse recommendation for, within its `type`. Known values: `realtime` (latency-bound: voice agent, in-call decision, call TTS, streaming STT) and `general` (no strict latency budget: chat, post-call analysis, recording transcription, embedding). Always an array, empty when the model is not recommended. Consumers must ignore unknown values.",
              "example": [
                "realtime",
                "general"
              ]
            }
          },
          "created": {
            "type": "integer",
            "nullable": true,
            "description": "Unix timestamp (seconds) of the model's first activation, same meaning as `created` in the OpenAI and OpenRouter model lists. Null when unknown.",
            "example": 1760000000
          },
          "deprecation": {
            "type": "object"
          },
          "metadata": {
            "type": "object"
          },
          "pricing_rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelPricingRuleWithRelations"
            }
          }
        },
        "required": [
          "description",
          "name",
          "provider",
          "type",
          "execution_type",
          "unit"
        ],
        "additionalProperties": false,
        "x-typescript-type": "ModelWithRelations"
      },
      "ModelPreset": {
        "title": "ModelPreset",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "type": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": true
          },
          "template": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "id",
          "name",
          "type"
        ],
        "additionalProperties": false
      },
      "NewModelPreset": {
        "title": "NewModelPreset",
        "type": "object",
        "description": "(tsType: Omit<ModelPreset, 'id' | 'organization_id' | 'user_id'>, schemaOptions: { title: 'NewModelPreset', exclude: [ 'id', 'organization_id', 'user_id' ] })",
        "properties": {
          "description": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "type": {
            "type": "string",
            "nullable": false
          },
          "template": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "name",
          "type"
        ],
        "additionalProperties": false,
        "x-typescript-type": "Omit<ModelPreset, 'id' | 'organization_id' | 'user_id'>"
      },
      "ModelPresetWithRelations": {
        "title": "ModelPresetWithRelations",
        "type": "object",
        "description": "(tsType: ModelPresetWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "type": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": true
          },
          "template": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "id",
          "name",
          "type"
        ],
        "additionalProperties": false,
        "x-typescript-type": "ModelPresetWithRelations"
      },
      "ModelPresetUpdate": {
        "title": "ModelPresetUpdate",
        "type": "object",
        "description": "(tsType: Omit<Partial<ModelPreset>, 'organization_id' | 'user_id' | 'id'>, schemaOptions: { title: 'ModelPresetUpdate', partial: true, exclude: [ 'organization_id', 'user_id', 'id' ] })",
        "properties": {
          "description": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "type": {
            "type": "string",
            "nullable": false
          },
          "template": {
            "type": "object",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Omit<Partial<ModelPreset>, 'organization_id' | 'user_id' | 'id'>"
      },
      "MfaEmailBody": {
        "title": "MfaEmailBody",
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "language": {
            "type": "string"
          }
        },
        "required": [
          "email",
          "full_name",
          "language"
        ],
        "additionalProperties": false
      },
      "KnowledgeCollectionSummary": {
        "title": "KnowledgeCollectionSummary",
        "type": "object",
        "description": "(tsType: Omit<KnowledgeCollection, 'documents'>, schemaOptions: { title: 'KnowledgeCollectionSummary', exclude: [ 'documents' ] })",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "size": {
            "type": "number"
          },
          "count": {
            "type": "number"
          },
          "model_name": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          },
          "schema": {
            "type": "object"
          }
        },
        "required": [
          "name",
          "size",
          "count"
        ],
        "additionalProperties": false,
        "x-typescript-type": "Omit<KnowledgeCollection, 'documents'>"
      },
      "KnowledgeQueryBody": {
        "title": "KnowledgeQueryBody",
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "n": {
            "type": "number"
          }
        },
        "required": [
          "query"
        ],
        "additionalProperties": false
      },
      "GuestTokenBody": {
        "title": "GuestTokenBody",
        "type": "object",
        "properties": {
          "organization_id": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "payload": {
            "type": "object"
          }
        },
        "required": [
          "organization_id",
          "type"
        ],
        "additionalProperties": false
      },
      "IntegrationCredential": {
        "title": "IntegrationCredential",
        "type": "object",
        "description": "(tsType: Omit<Credential, 'organization_id' | 'id' | 'hint'>, schemaOptions: { title: 'IntegrationCredential', exclude: [ 'organization_id', 'id', 'hint' ] })",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "metadata": {
            "type": "string",
            "nullable": true
          },
          "provider": {
            "type": "string",
            "nullable": false
          },
          "type": {
            "type": "string",
            "nullable": false
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "value": {
            "type": "string",
            "nullable": false
          }
        },
        "required": [
          "provider",
          "type",
          "value"
        ],
        "additionalProperties": false,
        "x-typescript-type": "Omit<Credential, 'organization_id' | 'id' | 'hint'>"
      },
      "UsagePerModel": {
        "title": "UsagePerModel",
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "total_cost": {
            "type": "number"
          },
          "total_usage": {
            "type": "number"
          },
          "total_requests": {
            "type": "number"
          },
          "model": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Model": {
        "title": "Model",
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": false
          },
          "group": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "provider": {
            "type": "string",
            "nullable": false
          },
          "type": {
            "type": "string",
            "nullable": false
          },
          "execution_type": {
            "type": "string",
            "nullable": false
          },
          "alias": {
            "type": "string",
            "nullable": true
          },
          "unit": {
            "type": "string",
            "nullable": false
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true,
            "enum": [
              "active",
              "inactive",
              "deprecated",
              "legacy"
            ]
          },
          "parameters": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "architecture": {
            "type": "object"
          },
          "capabilities": {
            "type": "object"
          },
          "credential_key": {
            "type": "string",
            "nullable": true
          },
          "hidden": {
            "type": "boolean",
            "nullable": true
          },
          "deprecated": {
            "type": "boolean",
            "nullable": true
          },
          "experimental": {
            "type": "boolean",
            "nullable": true
          },
          "priority": {
            "type": "number",
            "nullable": true
          },
          "ratings": {
            "type": "object"
          },
          "recommended_for": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Uses this model is the SipPulse recommendation for, within its `type`. Known values: `realtime` (latency-bound: voice agent, in-call decision, call TTS, streaming STT) and `general` (no strict latency budget: chat, post-call analysis, recording transcription, embedding). Always an array, empty when the model is not recommended. Consumers must ignore unknown values.",
              "example": [
                "realtime",
                "general"
              ]
            }
          },
          "created": {
            "type": "integer",
            "nullable": true,
            "description": "Unix timestamp (seconds) of the model's first activation, same meaning as `created` in the OpenAI and OpenRouter model lists. Null when unknown.",
            "example": 1760000000
          },
          "deprecation": {
            "type": "object"
          },
          "metadata": {
            "type": "object"
          }
        },
        "required": [
          "description",
          "name",
          "provider",
          "type",
          "execution_type",
          "unit"
        ],
        "additionalProperties": false
      },
      "SubscriptionWithRelations": {
        "title": "SubscriptionWithRelations",
        "type": "object",
        "description": "(tsType: SubscriptionWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "name": {
            "type": "string",
            "nullable": false
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "price": {
            "type": "number",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "integrations": {
            "type": "string",
            "nullable": true
          },
          "resources": {
            "type": "object",
            "nullable": true
          },
          "monthly_credits": {
            "type": "number",
            "nullable": true
          },
          "signup_credits": {
            "type": "number",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "rate_deck_id": {
            "type": "string",
            "nullable": true
          },
          "max_concurrent_livekit_rooms": {
            "type": "number",
            "nullable": true
          },
          "features": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "x-typescript-type": "SubscriptionWithRelations"
      },
      "CurrencyRelationWithRelations": {
        "title": "CurrencyRelationWithRelations",
        "type": "object",
        "description": "(tsType: CurrencyRelationWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "currency": {
            "type": "string",
            "nullable": false
          },
          "rate": {
            "type": "number",
            "nullable": true
          },
          "tax": {
            "type": "number",
            "nullable": true
          }
        },
        "required": [
          "currency"
        ],
        "additionalProperties": false,
        "x-typescript-type": "CurrencyRelationWithRelations"
      },
      "OrganizationWithRelations": {
        "title": "OrganizationWithRelations",
        "type": "object",
        "description": "(tsType: OrganizationWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "founder_id": {
            "type": "string",
            "nullable": false
          },
          "id": {
            "type": "string",
            "nullable": false
          },
          "key": {
            "type": "string",
            "nullable": false
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "subscription": {
            "type": "string",
            "nullable": true
          },
          "settings": {
            "type": "object",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "nullable": true
          },
          "promo_code": {
            "type": "string",
            "nullable": true
          },
          "is_internal": {
            "type": "boolean",
            "nullable": false
          },
          "deletion_scheduled_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "deletion_reason": {
            "type": "string",
            "nullable": true
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "founder": {
            "$ref": "#/components/schemas/User"
          },
          "subscription_info": {
            "$ref": "#/components/schemas/Subscription"
          },
          "currency_info": {
            "$ref": "#/components/schemas/CurrencyRelation"
          },
          "foreignKey": {}
        },
        "required": [
          "key",
          "name"
        ],
        "additionalProperties": false,
        "x-typescript-type": "OrganizationWithRelations"
      },
      "ProjectBudgetWithRelations": {
        "title": "ProjectBudgetWithRelations",
        "type": "object",
        "description": "(tsType: ProjectBudgetWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": false
          },
          "short_window_hours": {
            "type": "number",
            "nullable": true
          },
          "short_window_limit": {
            "type": "number",
            "nullable": true
          },
          "short_window_usage": {
            "type": "number",
            "nullable": true
          },
          "short_window_started_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "long_window_days": {
            "type": "number",
            "nullable": true
          },
          "long_window_limit": {
            "type": "number",
            "nullable": true
          },
          "long_window_usage": {
            "type": "number",
            "nullable": true
          },
          "long_window_started_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "alert_threshold_pct": {
            "type": "number",
            "nullable": true
          },
          "enforce_limit": {
            "type": "number",
            "nullable": true
          },
          "enforce_for_org_scope": {
            "type": "number",
            "nullable": true
          },
          "count_org_scope_usage": {
            "type": "number",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "short_window_alert_pct": {
            "type": "number",
            "nullable": true
          },
          "long_window_alert_pct": {
            "type": "number",
            "nullable": true
          },
          "budget_alert_roles": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "project": {
            "$ref": "#/components/schemas/Project"
          },
          "foreignKey": {}
        },
        "required": [
          "id",
          "project_id"
        ],
        "additionalProperties": false,
        "x-typescript-type": "ProjectBudgetWithRelations"
      },
      "ProjectWithRelations": {
        "title": "ProjectWithRelations",
        "type": "object",
        "description": "(tsType: ProjectWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "settings": {
            "type": "object",
            "nullable": true
          },
          "created_by": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "organization": {
            "$ref": "#/components/schemas/Organization"
          },
          "creator": {
            "$ref": "#/components/schemas/User"
          },
          "foreignKey": {},
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectMemberWithRelations"
            }
          },
          "budget": {
            "$ref": "#/components/schemas/ProjectBudgetWithRelations"
          }
        },
        "required": [
          "id",
          "organization_id",
          "name"
        ],
        "additionalProperties": false,
        "x-typescript-type": "ProjectWithRelations"
      },
      "ProjectMemberWithRelations": {
        "title": "ProjectMemberWithRelations",
        "type": "object",
        "description": "(tsType: ProjectMemberWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": false
          },
          "joined_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "invited_by": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "project": {
            "$ref": "#/components/schemas/Project"
          },
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "inviter": {
            "$ref": "#/components/schemas/User"
          },
          "foreignKey": {}
        },
        "required": [
          "id",
          "user_id"
        ],
        "additionalProperties": false,
        "x-typescript-type": "ProjectMemberWithRelations"
      },
      "UserWithRelations": {
        "title": "UserWithRelations",
        "type": "object",
        "description": "(tsType: UserWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "password": {
            "type": "string",
            "nullable": false
          },
          "email": {
            "type": "string",
            "nullable": false,
            "format": "email"
          },
          "full_name": {
            "type": "string",
            "nullable": false
          },
          "language": {
            "type": "string",
            "nullable": false,
            "enum": [
              "pt",
              "en"
            ]
          },
          "settings": {
            "type": "object",
            "nullable": true
          },
          "email_opt_out_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "email_preferences_token": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": false
          },
          "last_organization_id": {
            "type": "string",
            "nullable": true
          },
          "projectMembers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectMemberWithRelations"
            }
          }
        },
        "required": [
          "password",
          "email",
          "full_name"
        ],
        "additionalProperties": false,
        "x-typescript-type": "UserWithRelations"
      },
      "ModelUsageWithRelations": {
        "title": "ModelUsageWithRelations",
        "type": "object",
        "description": "(tsType: ModelUsageWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "amount": {
            "type": "number",
            "nullable": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "nullable": false
          },
          "id": {
            "type": "string",
            "nullable": false
          },
          "model_name": {
            "type": "string",
            "nullable": true
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "cost": {
            "type": "number",
            "nullable": false
          },
          "cost_details": {
            "type": "object",
            "nullable": true
          },
          "supplier_cost": {
            "type": "number",
            "nullable": true
          },
          "supplier_cost_details": {
            "type": "object",
            "nullable": true
          },
          "metadata": {
            "type": "object",
            "nullable": true
          },
          "execution_type": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "subscription_name": {
            "type": "string",
            "nullable": false
          },
          "unit": {
            "type": "string",
            "nullable": false
          },
          "user_id": {
            "type": "string",
            "nullable": false
          },
          "overdraft": {
            "type": "boolean",
            "nullable": true
          },
          "cached": {
            "type": "boolean",
            "nullable": true
          },
          "agent_id": {
            "type": "string",
            "nullable": true
          },
          "bot_id": {
            "type": "string",
            "nullable": true
          },
          "room_name": {
            "type": "string",
            "nullable": true
          },
          "thread_id": {
            "type": "string",
            "nullable": true
          },
          "delay": {
            "type": "number",
            "nullable": true
          },
          "execution_time": {
            "type": "number",
            "nullable": true
          },
          "relative_execution_time": {
            "type": "number",
            "nullable": true
          },
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "organization": {
            "$ref": "#/components/schemas/Organization"
          },
          "model": {
            "$ref": "#/components/schemas/Model"
          },
          "subscription": {
            "$ref": "#/components/schemas/Subscription"
          },
          "foreignKey": {}
        },
        "required": [
          "amount",
          "currency",
          "model_name",
          "organization_id",
          "cost",
          "execution_type",
          "type",
          "subscription_name",
          "unit",
          "user_id"
        ],
        "additionalProperties": false,
        "x-typescript-type": "ModelUsageWithRelations"
      },
      "UsageByType": {
        "title": "UsageByType",
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "total_cost": {
            "type": "number"
          },
          "total_usage": {
            "type": "number"
          },
          "total_requests": {
            "type": "number"
          },
          "type": {
            "type": "string"
          },
          "identifier": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "pricing_rule": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "UsageItem": {
        "title": "UsageItem",
        "type": "object",
        "properties": {
          "charge_subtype": {
            "type": "string",
            "nullable": false
          },
          "charge_type": {
            "type": "string",
            "nullable": false
          },
          "cost_amount": {
            "type": "number",
            "nullable": false
          },
          "cost_amount_local": {
            "type": "number",
            "nullable": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false
          },
          "event_timestamp": {
            "type": "string",
            "format": "date-time",
            "nullable": false
          },
          "currency": {
            "type": "string",
            "nullable": false
          },
          "details": {
            "type": "string",
            "nullable": true
          },
          "exchange_rate": {
            "type": "number",
            "nullable": true
          },
          "execution_time_ms": {
            "type": "number",
            "nullable": true
          },
          "id": {
            "type": "string",
            "nullable": false
          },
          "identifier": {
            "type": "string",
            "nullable": true
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": true
          },
          "price_amount": {
            "type": "number",
            "nullable": false
          },
          "pricing_rule": {
            "type": "string",
            "nullable": false
          },
          "quantity": {
            "type": "number",
            "nullable": false
          },
          "billed_quantity": {
            "type": "number",
            "nullable": true
          },
          "billed_unit": {
            "type": "string",
            "nullable": true
          },
          "request_id": {
            "type": "string",
            "nullable": true
          },
          "ttfb_ms": {
            "type": "number",
            "nullable": true
          },
          "throughput": {
            "type": "number",
            "nullable": true
          },
          "performance_details": {
            "type": "object",
            "nullable": true
          },
          "unit": {
            "type": "string",
            "nullable": false
          },
          "cost_attribution": {
            "type": "string",
            "nullable": false
          },
          "cache_read_tokens": {
            "type": "number",
            "nullable": true
          },
          "cache_write_tokens": {
            "type": "number",
            "nullable": true
          }
        },
        "required": [
          "charge_subtype",
          "charge_type",
          "cost_amount",
          "cost_amount_local",
          "created_at",
          "event_timestamp",
          "currency",
          "id",
          "organization_id",
          "price_amount",
          "pricing_rule",
          "quantity",
          "unit",
          "cost_attribution"
        ],
        "additionalProperties": false
      },
      "UsageRequest": {
        "title": "UsageRequest",
        "type": "object",
        "properties": {
          "agent_id": {
            "type": "string",
            "nullable": true
          },
          "api_key_id": {
            "type": "string",
            "nullable": true
          },
          "auth_mode": {
            "type": "string",
            "nullable": true
          },
          "bot_id": {
            "type": "string",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false
          },
          "event_timestamp": {
            "type": "string",
            "format": "date-time",
            "nullable": false
          },
          "execution_time_ms": {
            "type": "number",
            "nullable": true
          },
          "id": {
            "type": "string",
            "nullable": false
          },
          "metadata": {
            "type": "string",
            "nullable": true
          },
          "guest": {
            "type": "object",
            "nullable": true
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "processing_time_ms": {
            "type": "number",
            "nullable": true
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "room_name": {
            "type": "string",
            "nullable": true
          },
          "source_service": {
            "type": "string",
            "nullable": false
          },
          "speed": {
            "type": "number",
            "nullable": true
          },
          "thread_id": {
            "type": "string",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false
          },
          "user_id": {
            "type": "string",
            "nullable": false
          },
          "total_price_local": {
            "type": "number",
            "nullable": false
          }
        },
        "required": [
          "created_at",
          "event_timestamp",
          "id",
          "organization_id",
          "source_service",
          "updated_at",
          "user_id",
          "total_price_local"
        ],
        "additionalProperties": false
      },
      "CreditTransactions": {
        "title": "CreditTransactions",
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "nullable": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "nullable": false
          },
          "id": {
            "type": "string",
            "nullable": false
          },
          "metadata": {
            "type": "string",
            "nullable": true
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": false
          },
          "type": {
            "type": "string",
            "nullable": false,
            "enum": [
              "credit",
              "debit"
            ]
          },
          "source": {
            "type": "string",
            "nullable": true,
            "enum": [
              "purchased",
              "plan",
              "auto_recharge",
              "admin",
              "system"
            ]
          },
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "organization": {
            "$ref": "#/components/schemas/Organization"
          }
        },
        "required": [
          "amount",
          "currency",
          "organization_id",
          "user_id",
          "type"
        ],
        "additionalProperties": false
      },
      "AuthResponse": {
        "title": "AuthResponse",
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string"
          }
        },
        "required": [
          "access_token"
        ],
        "additionalProperties": false
      },
      "RegisterBody": {
        "title": "RegisterBody",
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 64
          },
          "full_name": {
            "type": "string",
            "minLength": 4,
            "maxLength": 64
          },
          "company_name": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "subscription_id": {
            "type": "string",
            "minLength": 4,
            "maxLength": 64
          },
          "language": {
            "type": "string",
            "minLength": 2,
            "maxLength": 5,
            "enum": [
              "pt",
              "en"
            ]
          },
          "promo_code": {
            "type": "string",
            "minLength": 4,
            "maxLength": 20
          },
          "phone": {
            "type": "string",
            "minLength": 4,
            "maxLength": 20
          }
        },
        "required": [
          "email",
          "password",
          "full_name",
          "company_name",
          "currency",
          "phone"
        ],
        "additionalProperties": false
      },
      "MfaChallenge": {
        "title": "MfaChallenge",
        "type": "object",
        "properties": {
          "mfa_required": {
            "type": "boolean",
            "description": "Always `true`. Present only on the MFA branch, so it is what a client branches on.",
            "enum": [
              true
            ]
          },
          "email": {
            "type": "string",
            "description": "Email the challenge was issued for."
          },
          "full_name": {
            "type": "string",
            "description": "Display name of the user."
          },
          "language": {
            "type": "string",
            "description": "Language of the user, used to localize the challenge. Defaults to `en`."
          }
        },
        "required": [
          "mfa_required",
          "email",
          "full_name",
          "language"
        ],
        "additionalProperties": false
      },
      "MfaCredentials": {
        "title": "MfaCredentials",
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "password": {
            "type": "string",
            "minLength": 8,
            "maxLength": 64
          },
          "mfa": {
            "type": "object"
          }
        },
        "required": [
          "email",
          "password"
        ],
        "additionalProperties": false
      },
      "AccessTokenSession": {
        "title": "AccessTokenSession",
        "type": "object",
        "properties": {
          "user_id": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "impersonation_context": {
            "type": "object"
          }
        },
        "required": [
          "user_id",
          "full_name",
          "email"
        ],
        "additionalProperties": true
      },
      "OktaCredentials": {
        "title": "OktaCredentials",
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          }
        },
        "required": [
          "access_token",
          "domain"
        ],
        "additionalProperties": false
      },
      "ApiKey": {
        "title": "ApiKey",
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "hint": {
            "type": "string",
            "nullable": false
          },
          "id": {
            "type": "string",
            "nullable": false
          },
          "key": {
            "type": "string",
            "nullable": false
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "user_id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "predecessor_key_hash": {
            "type": "string",
            "nullable": true
          },
          "predecessor_hint": {
            "type": "string",
            "nullable": true
          },
          "predecessor_expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "predecessor_last_used_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "rotated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "hint",
          "key",
          "name",
          "user_id",
          "organization_id"
        ],
        "additionalProperties": false
      },
      "NewApiKey": {
        "title": "NewApiKey",
        "type": "object",
        "description": "(tsType: Omit<ApiKey, 'id' | 'user_id' | 'organization_id' | 'created_at' | 'key' | 'hint' | 'created_at' | 'last_used_at' | 'predecessor_key_hash' | 'predecessor_hint' | 'predecessor_expires_at' | 'predecessor_last_used_at' | 'rotated_at'>, schemaOptions: { title: 'NewApiKey', exclude: [ 'id', 'user_id', 'organization_id', 'created_at', 'key', 'hint', 'created_at', 'last_used_at', 'predecessor_key_hash', 'predecessor_hint', 'predecessor_expires_at', 'predecessor_last_used_at', 'rotated_at' ] })",
        "properties": {
          "name": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "x-typescript-type": "Omit<ApiKey, 'id' | 'user_id' | 'organization_id' | 'created_at' | 'key' | 'hint' | 'created_at' | 'last_used_at' | 'predecessor_key_hash' | 'predecessor_hint' | 'predecessor_expires_at' | 'predecessor_last_used_at' | 'rotated_at'>"
      },
      "ApiKeyView": {
        "title": "ApiKeyView",
        "type": "object",
        "description": "(tsType: Omit<ApiKeyWithRelations, 'key' | 'predecessor_key_hash'>, schemaOptions: { title: 'ApiKeyView', includeRelations: true, exclude: [ 'key', 'predecessor_key_hash' ] })",
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "hint": {
            "type": "string",
            "nullable": false
          },
          "id": {
            "type": "string",
            "nullable": false
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "user_id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "predecessor_hint": {
            "type": "string",
            "nullable": true
          },
          "predecessor_expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "predecessor_last_used_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "rotated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "hint",
          "name",
          "user_id",
          "organization_id"
        ],
        "additionalProperties": false,
        "x-typescript-type": "Omit<ApiKeyWithRelations, 'key' | 'predecessor_key_hash'>"
      },
      "ApiKeyUpdate": {
        "title": "ApiKeyUpdate",
        "type": "object",
        "description": "(tsType: Omit<Partial<ApiKey>, 'created_at' | 'hint' | 'key' | 'user_id' | 'last_used_at' | 'organization_id' | 'predecessor_key_hash' | 'predecessor_hint' | 'predecessor_expires_at' | 'predecessor_last_used_at' | 'rotated_at'>, schemaOptions: { title: 'ApiKeyUpdate', partial: true, exclude: [ 'created_at', 'hint', 'key', 'user_id', 'last_used_at', 'organization_id', 'predecessor_key_hash', 'predecessor_hint', 'predecessor_expires_at', 'predecessor_last_used_at', 'rotated_at' ] })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "name": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Omit<Partial<ApiKey>, 'created_at' | 'hint' | 'key' | 'user_id' | 'last_used_at' | 'organization_id' | 'predecessor_key_hash' | 'predecessor_hint' | 'predecessor_expires_at' | 'predecessor_last_used_at' | 'rotated_at'>"
      },
      "ApiKeyUsageAggregate": {
        "title": "ApiKeyUsageAggregate",
        "type": "object",
        "properties": {
          "period": {
            "type": "string",
            "description": "Time bucket of the row, present only when `period` was requested in `group_by`. Formatted per `period_unit`: `YYYY-MM-DD`, `YYYY-WW` or `YYYY-MM`."
          },
          "charge_type": {
            "type": "string",
            "description": "Billable family, e.g. `llm`, `asr`, `tts`. Present when grouping by type."
          },
          "charge_subtype": {
            "type": "string",
            "description": "Billable subfamily inside `charge_type`. Present when grouping by type."
          },
          "identifier": {
            "type": "string",
            "description": "Resource the usage was attributed to, e.g. the model name. Present when grouping by identifier."
          },
          "total_cost": {
            "type": "number",
            "description": "Total spend of the row, in the organization currency."
          },
          "total_requests": {
            "type": "number",
            "description": "Number of billed requests in the row."
          },
          "total_usage": {
            "type": "number",
            "description": "Total quantity consumed, expressed in `unit`."
          },
          "unit": {
            "type": "string",
            "description": "Unit of `total_usage`, e.g. `tokens`, `seconds`."
          }
        },
        "required": [
          "total_cost",
          "total_requests",
          "total_usage",
          "unit"
        ],
        "additionalProperties": false
      },
      "ApiKeyUsageComparison": {
        "title": "ApiKeyUsageComparison",
        "type": "object",
        "properties": {
          "api_key_id": {
            "type": "string",
            "description": "Identifier of the API key."
          },
          "api_key_name": {
            "type": "string",
            "description": "Name of the API key."
          },
          "total_cost": {
            "type": "number",
            "description": "Total spend attributed to the key in the window."
          },
          "total_requests": {
            "type": "number",
            "description": "Number of billed requests in the window."
          },
          "currency": {
            "type": "string",
            "description": "Currency of `total_cost`, ISO 4217."
          }
        },
        "required": [
          "api_key_id",
          "api_key_name",
          "total_cost",
          "total_requests",
          "currency"
        ],
        "additionalProperties": false
      },
      "SearchReplace": {
        "title": "SearchReplace",
        "type": "object",
        "properties": {
          "search": {
            "type": "string"
          },
          "replace": {
            "type": "string"
          },
          "case_sensitive": {
            "type": "boolean"
          }
        },
        "required": [
          "search",
          "replace"
        ],
        "additionalProperties": false
      },
      "AnonymizeRequest": {
        "title": "AnonymizeRequest",
        "type": "object",
        "description": "(tsType: Omit<AnonymizerBody, 'segments'>, schemaOptions: { title: 'AnonymizeRequest', exclude: [ 'segments' ] })",
        "properties": {
          "text": {
            "type": "string"
          },
          "entities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sequence": {
            "type": "number"
          },
          "language": {
            "type": "string",
            "nullable": true
          },
          "search_and_replace": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchReplace"
            }
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Omit<AnonymizerBody, 'segments'>"
      },
      "AnonymizerBody": {
        "title": "AnonymizerBody",
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "entities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sequence": {
            "type": "number"
          },
          "segments": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "language": {
            "type": "string",
            "nullable": true
          },
          "search_and_replace": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchReplace"
            }
          }
        },
        "additionalProperties": false
      },
      "AnalyticsCatalogResponse": {
        "title": "AnalyticsCatalogResponse",
        "type": "object",
        "properties": {
          "datasets": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "limits": {
            "type": "object"
          },
          "scope": {
            "type": "object"
          }
        },
        "additionalProperties": true
      },
      "AnalyticsResult": {
        "title": "AnalyticsResult",
        "type": "object",
        "properties": {
          "columns": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {}
            }
          },
          "meta": {
            "type": "object"
          }
        },
        "additionalProperties": true
      },
      "AnalyticsQuery": {
        "title": "AnalyticsQuery",
        "type": "object",
        "properties": {
          "dataset": {
            "type": "string"
          },
          "measures": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "dimensions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "time": {
            "type": "object"
          },
          "filters": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "compare": {
            "type": "string",
            "enum": [
              "previous_period"
            ]
          },
          "order": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "limit": {
            "type": "number"
          }
        },
        "required": [
          "dataset",
          "measures"
        ],
        "additionalProperties": true
      },
      "AgentWithExtension": {
        "title": "AgentWithExtension",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": false
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "share": {
            "type": "string",
            "nullable": true
          },
          "instructions": {
            "type": "string",
            "nullable": true
          },
          "llm_model": {
            "type": "string",
            "nullable": false
          },
          "tts_model": {
            "type": "string",
            "nullable": false
          },
          "tts_voice": {
            "type": "string",
            "nullable": false
          },
          "tts_params": {
            "type": "object",
            "nullable": true
          },
          "keyterm": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "language": {
            "type": "string",
            "nullable": false
          },
          "tools": {
            "type": "array",
            "items": {
              "nullable": true,
              "type": "object"
            }
          },
          "call_configuration": {
            "type": "object",
            "nullable": true
          },
          "chat_configuration": {
            "type": "object",
            "nullable": true
          },
          "mcp_servers": {
            "type": "array",
            "items": {
              "nullable": true,
              "type": "object"
            }
          },
          "parameters": {
            "type": "object",
            "nullable": true
          },
          "settings": {
            "type": "object",
            "nullable": true,
            "properties": {
              "max_steps": {
                "type": "integer",
                "minimum": 2,
                "maximum": 50
              },
              "tool_search_enabled": {
                "type": "boolean"
              },
              "tool_search_threshold": {
                "type": "integer",
                "minimum": 1
              },
              "tool_search_catalog": {
                "type": "boolean"
              },
              "tool_prune_preserve_last": {
                "type": "integer",
                "minimum": 1,
                "maximum": 20
              },
              "tool_catalog_limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              },
              "tool_output_max_chars": {
                "type": "integer",
                "minimum": 1000,
                "maximum": 200000
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "post_analysis": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          }
        },
        "required": [
          "id",
          "organization_id",
          "user_id",
          "llm_model",
          "tts_model",
          "tts_voice",
          "language"
        ],
        "additionalProperties": false
      },
      "AgentBody": {
        "title": "AgentBody",
        "type": "object",
        "description": "(tsType: Omit<AgentWithExtension, 'id' | 'user_id' | 'organization_id' | 'created_at' | 'updated_at'>, schemaOptions: { title: 'AgentBody', exclude: [ 'id', 'user_id', 'organization_id', 'created_at', 'updated_at' ] })",
        "properties": {
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "share": {
            "type": "string",
            "nullable": true
          },
          "instructions": {
            "type": "string",
            "nullable": true
          },
          "llm_model": {
            "type": "string",
            "nullable": false
          },
          "tts_model": {
            "type": "string",
            "nullable": false
          },
          "tts_voice": {
            "type": "string",
            "nullable": false
          },
          "tts_params": {
            "type": "object",
            "nullable": true
          },
          "keyterm": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "language": {
            "type": "string",
            "nullable": false
          },
          "tools": {
            "type": "array",
            "items": {
              "nullable": true,
              "type": "object"
            }
          },
          "call_configuration": {
            "type": "object",
            "nullable": true
          },
          "chat_configuration": {
            "type": "object",
            "nullable": true
          },
          "mcp_servers": {
            "type": "array",
            "items": {
              "nullable": true,
              "type": "object"
            }
          },
          "parameters": {
            "type": "object",
            "nullable": true
          },
          "settings": {
            "type": "object",
            "nullable": true,
            "properties": {
              "max_steps": {
                "type": "integer",
                "minimum": 2,
                "maximum": 50
              },
              "tool_search_enabled": {
                "type": "boolean"
              },
              "tool_search_threshold": {
                "type": "integer",
                "minimum": 1
              },
              "tool_search_catalog": {
                "type": "boolean"
              },
              "tool_prune_preserve_last": {
                "type": "integer",
                "minimum": 1,
                "maximum": 20
              },
              "tool_catalog_limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              },
              "tool_output_max_chars": {
                "type": "integer",
                "minimum": 1000,
                "maximum": 200000
              }
            }
          },
          "post_analysis": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          }
        },
        "required": [
          "llm_model",
          "tts_model",
          "tts_voice",
          "language"
        ],
        "additionalProperties": false,
        "x-typescript-type": "Omit<AgentWithExtension, 'id' | 'user_id' | 'organization_id' | 'created_at' | 'updated_at'>"
      },
      "AgentDeployWhatsappWithRelations": {
        "title": "AgentDeployWhatsappWithRelations",
        "type": "object",
        "description": "(tsType: AgentDeployWhatsappWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "agent_id": {
            "type": "string",
            "nullable": false
          },
          "business_id": {
            "type": "string",
            "nullable": false
          },
          "configuration": {
            "type": "object",
            "nullable": true
          },
          "disabled": {
            "type": "boolean",
            "nullable": true
          },
          "organization_id": {
            "type": "string",
            "nullable": true
          },
          "phone_number_id": {
            "type": "string",
            "nullable": false
          },
          "display_phone_number": {
            "type": "string",
            "nullable": true
          },
          "phone_number_status": {
            "type": "string",
            "nullable": true
          },
          "waba_id": {
            "type": "string",
            "nullable": false
          },
          "webhook_subscription_status": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "agent_id",
          "business_id",
          "phone_number_id",
          "waba_id"
        ],
        "additionalProperties": false,
        "x-typescript-type": "AgentDeployWhatsappWithRelations"
      },
      "AgentDeployChatWidgetWithRelations": {
        "title": "AgentDeployChatWidgetWithRelations",
        "type": "object",
        "description": "(tsType: AgentDeployChatWidgetWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "organization_id": {
            "type": "string",
            "nullable": true
          },
          "agent_id": {
            "type": "string",
            "nullable": false
          },
          "disabled": {
            "type": "boolean",
            "nullable": true
          },
          "key": {
            "type": "string",
            "nullable": false
          },
          "allowed_origins": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "configuration": {
            "type": "object",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "agent_id",
          "key"
        ],
        "additionalProperties": false,
        "x-typescript-type": "AgentDeployChatWidgetWithRelations"
      },
      "AgentDeploySipWithRelations": {
        "title": "AgentDeploySipWithRelations",
        "type": "object",
        "description": "(tsType: AgentDeploySipWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "agent_id": {
            "type": "string",
            "nullable": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "dispatch_rule_id": {
            "type": "string",
            "nullable": true
          },
          "enable_inbound": {
            "type": "boolean",
            "nullable": true
          },
          "enable_outbound": {
            "type": "boolean",
            "nullable": true
          },
          "inbound_trunk_id": {
            "type": "string",
            "nullable": true
          },
          "did_id": {
            "type": "string",
            "nullable": true
          },
          "organization_id": {
            "type": "string",
            "nullable": true
          },
          "outbound_trunk_id": {
            "type": "string",
            "nullable": true
          },
          "outbound_configuration": {
            "type": "object",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "sip_username": {
            "type": "string",
            "nullable": true
          },
          "sip_password": {
            "type": "string",
            "nullable": true
          },
          "sip_server": {
            "type": "string",
            "nullable": true
          },
          "sip_register_expires": {
            "type": "number",
            "nullable": true
          }
        },
        "required": [
          "agent_id"
        ],
        "additionalProperties": false,
        "x-typescript-type": "AgentDeploySipWithRelations"
      },
      "AgentWithExtensionWithRelations": {
        "title": "AgentWithExtensionWithRelations",
        "type": "object",
        "description": "(tsType: AgentWithExtensionWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "user_id": {
            "type": "string",
            "nullable": false
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "share": {
            "type": "string",
            "nullable": true
          },
          "instructions": {
            "type": "string",
            "nullable": true
          },
          "llm_model": {
            "type": "string",
            "nullable": false
          },
          "tts_model": {
            "type": "string",
            "nullable": false
          },
          "tts_voice": {
            "type": "string",
            "nullable": false
          },
          "tts_params": {
            "type": "object",
            "nullable": true
          },
          "keyterm": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "language": {
            "type": "string",
            "nullable": false
          },
          "tools": {
            "type": "array",
            "items": {
              "nullable": true,
              "type": "object"
            }
          },
          "call_configuration": {
            "type": "object",
            "nullable": true
          },
          "chat_configuration": {
            "type": "object",
            "nullable": true
          },
          "mcp_servers": {
            "type": "array",
            "items": {
              "nullable": true,
              "type": "object"
            }
          },
          "parameters": {
            "type": "object",
            "nullable": true
          },
          "settings": {
            "type": "object",
            "nullable": true,
            "properties": {
              "max_steps": {
                "type": "integer",
                "minimum": 2,
                "maximum": 50
              },
              "tool_search_enabled": {
                "type": "boolean"
              },
              "tool_search_threshold": {
                "type": "integer",
                "minimum": 1
              },
              "tool_search_catalog": {
                "type": "boolean"
              },
              "tool_prune_preserve_last": {
                "type": "integer",
                "minimum": 1,
                "maximum": 20
              },
              "tool_catalog_limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              },
              "tool_output_max_chars": {
                "type": "integer",
                "minimum": 1000,
                "maximum": 200000
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "post_analysis": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "agent_deploy_whatsapp": {
            "$ref": "#/components/schemas/AgentDeployWhatsappWithRelations"
          },
          "agent_deploy_chat_widget": {
            "$ref": "#/components/schemas/AgentDeployChatWidgetWithRelations"
          },
          "agent_deploy_sip": {
            "$ref": "#/components/schemas/AgentDeploySipWithRelations"
          },
          "llm": {
            "$ref": "#/components/schemas/ModelWithRelations"
          },
          "foreignKey": {}
        },
        "required": [
          "id",
          "organization_id",
          "user_id",
          "llm_model",
          "tts_model",
          "tts_voice",
          "language"
        ],
        "additionalProperties": false,
        "x-typescript-type": "AgentWithExtensionWithRelations"
      },
      "AgentUpdate": {
        "title": "AgentUpdate",
        "type": "object",
        "description": "(tsType: Omit<Partial<AgentWithExtension>, 'user_id' | 'organization_id' | 'created_at' | 'updated_at'>, schemaOptions: { title: 'AgentUpdate', partial: true, exclude: [ 'user_id', 'organization_id', 'created_at', 'updated_at' ] })",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "project_id": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "share": {
            "type": "string",
            "nullable": true
          },
          "instructions": {
            "type": "string",
            "nullable": true
          },
          "llm_model": {
            "type": "string",
            "nullable": false
          },
          "tts_model": {
            "type": "string",
            "nullable": false
          },
          "tts_voice": {
            "type": "string",
            "nullable": false
          },
          "tts_params": {
            "type": "object",
            "nullable": true
          },
          "keyterm": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "language": {
            "type": "string",
            "nullable": false
          },
          "tools": {
            "type": "array",
            "items": {
              "nullable": true,
              "type": "object"
            }
          },
          "call_configuration": {
            "type": "object",
            "nullable": true
          },
          "chat_configuration": {
            "type": "object",
            "nullable": true
          },
          "mcp_servers": {
            "type": "array",
            "items": {
              "nullable": true,
              "type": "object"
            }
          },
          "parameters": {
            "type": "object",
            "nullable": true
          },
          "settings": {
            "type": "object",
            "nullable": true,
            "properties": {
              "max_steps": {
                "type": "integer",
                "minimum": 2,
                "maximum": 50
              },
              "tool_search_enabled": {
                "type": "boolean"
              },
              "tool_search_threshold": {
                "type": "integer",
                "minimum": 1
              },
              "tool_search_catalog": {
                "type": "boolean"
              },
              "tool_prune_preserve_last": {
                "type": "integer",
                "minimum": 1,
                "maximum": 20
              },
              "tool_catalog_limit": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              },
              "tool_output_max_chars": {
                "type": "integer",
                "minimum": 1000,
                "maximum": 200000
              }
            }
          },
          "post_analysis": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Omit<Partial<AgentWithExtension>, 'user_id' | 'organization_id' | 'created_at' | 'updated_at'>"
      },
      "OutboundCallResponse": {
        "title": "OutboundCallResponse",
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "callId": {
            "type": "string"
          },
          "roomName": {
            "type": "string"
          },
          "participantId": {
            "type": "string"
          }
        },
        "required": [
          "success"
        ],
        "additionalProperties": false
      },
      "OutboundCallRequest": {
        "title": "OutboundCallRequest",
        "type": "object",
        "properties": {
          "phone_number": {
            "type": "string",
            "description": "Destination number in E.164 format, e.g. `+5511999998888`."
          },
          "metadata_overrides": {
            "type": "object",
            "description": "Per call overrides of the agent configuration. Every field is optional and falls back to the agent's own setting; nothing here is persisted on the agent.",
            "properties": {
              "initial_message": {
                "type": "string",
                "description": "First sentence the agent says once the call is answered."
              },
              "additional_instructions": {
                "type": "string",
                "description": "Extra instructions appended to the agent prompt for this call only."
              },
              "variables": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Values interpolated into the agent prompt, keyed by variable name."
              },
              "inactivity_timeout": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "time_in_seconds": {
                    "type": "number",
                    "description": "Silence tolerated before the agent reacts."
                  },
                  "message": {
                    "type": "string",
                    "description": "What the agent says when the timeout fires."
                  }
                }
              },
              "max_duration": {
                "type": "object",
                "properties": {
                  "time_in_minutes": {
                    "type": "number",
                    "description": "Hard cap on the call length."
                  },
                  "message": {
                    "type": "string",
                    "description": "What the agent says before hanging up."
                  }
                }
              },
              "thinking_sound": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "audio": {
                    "type": "string",
                    "description": "Identifier or URL of the audio to play."
                  },
                  "volume": {
                    "type": "number",
                    "description": "Playback volume, 0 to 1."
                  }
                }
              },
              "ambient_sound": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "audio": {
                    "type": "string",
                    "description": "Identifier or URL of the audio to play."
                  },
                  "volume": {
                    "type": "number",
                    "description": "Playback volume, 0 to 1."
                  }
                }
              }
            }
          }
        },
        "required": [
          "phone_number"
        ],
        "additionalProperties": false
      },
      "AgentDeployWhatsapp": {
        "title": "AgentDeployWhatsapp",
        "type": "object",
        "properties": {
          "agent_id": {
            "type": "string",
            "nullable": false
          },
          "business_id": {
            "type": "string",
            "nullable": false
          },
          "configuration": {
            "type": "object",
            "nullable": true
          },
          "disabled": {
            "type": "boolean",
            "nullable": true
          },
          "organization_id": {
            "type": "string",
            "nullable": true
          },
          "phone_number_id": {
            "type": "string",
            "nullable": false
          },
          "display_phone_number": {
            "type": "string",
            "nullable": true
          },
          "phone_number_status": {
            "type": "string",
            "nullable": true
          },
          "waba_id": {
            "type": "string",
            "nullable": false
          },
          "webhook_subscription_status": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "agent_id",
          "business_id",
          "phone_number_id",
          "waba_id"
        ],
        "additionalProperties": false
      },
      "NewAgentDeployWhatsapp": {
        "title": "NewAgentDeployWhatsapp",
        "type": "object",
        "description": "(tsType: Omit<AgentDeployWhatsapp, 'organization_id' | 'disabled' | 'webhook_subscription_status' | 'phone_number_status'>, schemaOptions: { title: 'NewAgentDeployWhatsapp', exclude: [ 'organization_id', 'disabled', 'webhook_subscription_status', 'phone_number_status' ] })",
        "properties": {
          "agent_id": {
            "type": "string",
            "nullable": false
          },
          "business_id": {
            "type": "string",
            "nullable": false
          },
          "configuration": {
            "type": "object",
            "nullable": true
          },
          "phone_number_id": {
            "type": "string",
            "nullable": false
          },
          "display_phone_number": {
            "type": "string",
            "nullable": true
          },
          "waba_id": {
            "type": "string",
            "nullable": false
          }
        },
        "required": [
          "agent_id",
          "business_id",
          "phone_number_id",
          "waba_id"
        ],
        "additionalProperties": false,
        "x-typescript-type": "Omit<AgentDeployWhatsapp, 'organization_id' | 'disabled' | 'webhook_subscription_status' | 'phone_number_status'>"
      },
      "WhatsappEvent": {
        "title": "WhatsappEvent",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": true
          },
          "thread_id": {
            "type": "string",
            "nullable": true
          },
          "message_id": {
            "type": "string",
            "nullable": true
          },
          "from_number": {
            "type": "string",
            "nullable": true
          },
          "to_number": {
            "type": "string",
            "nullable": true
          },
          "direction": {
            "type": "string",
            "nullable": true
          },
          "message_type": {
            "type": "string",
            "nullable": true
          },
          "content": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "error_code": {
            "type": "string",
            "nullable": true
          },
          "attempts": {
            "type": "number",
            "nullable": true
          },
          "processed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "agent_id": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": false
      },
      "AgentDeployWhatsappUpdate": {
        "title": "AgentDeployWhatsappUpdate",
        "type": "object",
        "description": "(tsType: Omit<Partial<AgentDeployWhatsapp>, 'agent_id' | 'organization_id' | 'business_id' | 'phone_number_id' | 'waba_id' | 'webhook_subscription_status' | 'phone_number_status' | 'disabled'>, schemaOptions: { partial: true, title: 'AgentDeployWhatsappUpdate', exclude: [ 'agent_id', 'organization_id', 'business_id', 'phone_number_id', 'waba_id', 'webhook_subscription_status', 'phone_number_status', 'disabled' ] })",
        "properties": {
          "configuration": {
            "type": "object",
            "nullable": true
          },
          "display_phone_number": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Omit<Partial<AgentDeployWhatsapp>, 'agent_id' | 'organization_id' | 'business_id' | 'phone_number_id' | 'waba_id' | 'webhook_subscription_status' | 'phone_number_status' | 'disabled'>"
      },
      "MessageContact": {
        "title": "MessageContact",
        "type": "object",
        "properties": {
          "input": {
            "type": "string"
          },
          "wa_id": {
            "type": "string"
          }
        },
        "required": [
          "input",
          "wa_id"
        ],
        "additionalProperties": false
      },
      "SentMessage": {
        "title": "SentMessage",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": false
      },
      "SendMessageResponse": {
        "title": "SendMessageResponse",
        "type": "object",
        "properties": {
          "messaging_product": {
            "type": "string"
          },
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageContact"
            }
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SentMessage"
            }
          }
        },
        "required": [
          "messaging_product",
          "contacts",
          "messages"
        ],
        "additionalProperties": false
      },
      "ThreadOptions": {
        "title": "ThreadOptions",
        "type": "object",
        "properties": {
          "additional_instructions": {
            "type": "string"
          },
          "vars": {
            "type": "object"
          }
        },
        "additionalProperties": false
      },
      "SendMessageRequest": {
        "title": "SendMessageRequest",
        "type": "object",
        "properties": {
          "to": {
            "type": "string"
          },
          "template_name": {
            "type": "string"
          },
          "variables": {
            "type": "object"
          },
          "thread_options": {
            "$ref": "#/components/schemas/ThreadOptions"
          }
        },
        "required": [
          "to",
          "template_name"
        ],
        "additionalProperties": false
      },
      "AgentDeployWhatsappBaileysWithRelations": {
        "title": "AgentDeployWhatsappBaileysWithRelations",
        "type": "object",
        "description": "(tsType: AgentDeployWhatsappBaileysWithRelations, schemaOptions: { includeRelations: true })",
        "properties": {
          "agent_id": {
            "type": "string",
            "nullable": false
          },
          "organization_id": {
            "type": "string",
            "nullable": false
          },
          "disabled": {
            "type": "boolean",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "human_activity_timeout": {
            "type": "number",
            "nullable": true
          },
          "qr_code": {
            "type": "string",
            "nullable": true
          },
          "lid": {
            "type": "string",
            "nullable": true
          },
          "phone_number": {
            "type": "string",
            "nullable": true
          },
          "configuration": {
            "type": "object",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false
          }
        },
        "required": [
          "agent_id",
          "organization_id"
        ],
        "additionalProperties": false,
        "x-typescript-type": "AgentDeployWhatsappBaileysWithRelations"
      },
      "AgentDeploySip": {
        "title": "AgentDeploySip",
        "type": "object",
        "properties": {
          "agent_id": {
            "type": "string",
            "nullable": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "dispatch_rule_id": {
            "type": "string",
            "nullable": true
          },
          "enable_inbound": {
            "type": "boolean",
            "nullable": true
          },
          "enable_outbound": {
            "type": "boolean",
            "nullable": true
          },
          "inbound_trunk_id": {
            "type": "string",
            "nullable": true
          },
          "did_id": {
            "type": "string",
            "nullable": true
          },
          "organization_id": {
            "type": "string",
            "nullable": true
          },
          "outbound_trunk_id": {
            "type": "string",
            "nullable": true
          },
          "outbound_configuration": {
            "type": "object",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "sip_username": {
            "type": "string",
            "nullable": true
          },
          "sip_password": {
            "type": "string",
            "nullable": true
          },
          "sip_server": {
            "type": "string",
            "nullable": true
          },
          "sip_register_expires": {
            "type": "number",
            "nullable": true
          }
        },
        "required": [
          "agent_id"
        ],
        "additionalProperties": false
      },
      "SipDeployRequest": {
        "title": "SipDeployRequest",
        "type": "object",
        "properties": {
          "enable_inbound": {
            "type": "boolean"
          },
          "enable_outbound": {
            "type": "boolean"
          },
          "did_id": {
            "type": "string",
            "description": "DID (phone number) ID to associate with inbound calls",
            "nullable": true
          },
          "outbound_configuration": {
            "type": "object",
            "description": "SIP trunk configuration for outbound calls",
            "nullable": true
          },
          "sip_username": {
            "type": "string",
            "description": "SIP registration username",
            "nullable": true
          },
          "sip_password": {
            "type": "string",
            "description": "SIP registration password",
            "nullable": true
          },
          "sip_server": {
            "type": "string",
            "description": "SIP server address for registration",
            "nullable": true
          },
          "sip_register_expires": {
            "type": "number",
            "description": "SIP registration expiry time in seconds",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "NewAgentDeployChatWidget": {
        "title": "NewAgentDeployChatWidget",
        "type": "object",
        "description": "(tsType: Omit<AgentDeployChatWidget, 'key' | 'organization_id' | 'disabled' | 'agent_id'>, schemaOptions: { title: 'NewAgentDeployChatWidget', exclude: [ 'key', 'organization_id', 'disabled', 'agent_id' ] })",
        "properties": {
          "allowed_origins": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "configuration": {
            "type": "object",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Omit<AgentDeployChatWidget, 'key' | 'organization_id' | 'disabled' | 'agent_id'>"
      },
      "AgentDeployChatWidgetUpdate": {
        "title": "AgentDeployChatWidgetUpdate",
        "type": "object",
        "description": "(tsType: Omit<Partial<AgentDeployChatWidget>, 'key' | 'organization_id' | 'agent_id'>, schemaOptions: { title: 'AgentDeployChatWidgetUpdate', partial: true, exclude: [ 'key', 'organization_id', 'agent_id' ] })",
        "properties": {
          "disabled": {
            "type": "boolean",
            "nullable": true
          },
          "allowed_origins": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "configuration": {
            "type": "object",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Omit<Partial<AgentDeployChatWidget>, 'key' | 'organization_id' | 'agent_id'>"
      },
      "AgentDeployChatWidget": {
        "title": "AgentDeployChatWidget",
        "type": "object",
        "properties": {
          "organization_id": {
            "type": "string",
            "nullable": true
          },
          "agent_id": {
            "type": "string",
            "nullable": false
          },
          "disabled": {
            "type": "boolean",
            "nullable": true
          },
          "key": {
            "type": "string",
            "nullable": false
          },
          "allowed_origins": {
            "type": "array",
            "items": {
              "type": "string",
              "nullable": true
            }
          },
          "configuration": {
            "type": "object",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "agent_id",
          "key"
        ],
        "additionalProperties": false
      },
      "Agent.ScopeFilter": {
        "type": "object",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "uniqueItems": true
              }
            ]
          },
          "include": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false,
        "title": "Agent.ScopeFilter"
      },
      "Agent.IncludeFilter.Items": {
        "title": "Agent.IncludeFilter.Items",
        "type": "object",
        "properties": {
          "relation": {
            "type": "string",
            "enum": [
              "agent_deploy_whatsapp",
              "agent_deploy_chat_widget",
              "agent_deploy_sip",
              "llm"
            ]
          },
          "scope": {
            "$ref": "#/components/schemas/Agent.ScopeFilter"
          }
        }
      },
      "Agent.Filter": {
        "type": "object",
        "title": "Agent.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "boolean"
                  },
                  "organization_id": {
                    "type": "boolean"
                  },
                  "project_id": {
                    "type": "boolean"
                  },
                  "user_id": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "boolean"
                  },
                  "description": {
                    "type": "boolean"
                  },
                  "share": {
                    "type": "boolean"
                  },
                  "instructions": {
                    "type": "boolean"
                  },
                  "llm_model": {
                    "type": "boolean"
                  },
                  "tts_model": {
                    "type": "boolean"
                  },
                  "tts_voice": {
                    "type": "boolean"
                  },
                  "tts_params": {
                    "type": "boolean"
                  },
                  "keyterm": {
                    "type": "boolean"
                  },
                  "language": {
                    "type": "boolean"
                  },
                  "tools": {
                    "type": "boolean"
                  },
                  "call_configuration": {
                    "type": "boolean"
                  },
                  "chat_configuration": {
                    "type": "boolean"
                  },
                  "mcp_servers": {
                    "type": "boolean"
                  },
                  "parameters": {
                    "type": "boolean"
                  },
                  "settings": {
                    "type": "boolean"
                  },
                  "created_at": {
                    "type": "boolean"
                  },
                  "updated_at": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "id",
                    "organization_id",
                    "project_id",
                    "user_id",
                    "name",
                    "description",
                    "share",
                    "instructions",
                    "llm_model",
                    "tts_model",
                    "tts_voice",
                    "tts_params",
                    "keyterm",
                    "language",
                    "tools",
                    "call_configuration",
                    "chat_configuration",
                    "mcp_servers",
                    "parameters",
                    "settings",
                    "created_at",
                    "updated_at"
                  ],
                  "example": "id"
                },
                "uniqueItems": true
              }
            ],
            "title": "Agent.Fields"
          },
          "include": {
            "title": "Agent.IncludeFilter",
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Agent.IncludeFilter.Items"
                },
                {
                  "type": "string"
                }
              ]
            }
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<Agent>"
      },
      "Agent.Filter1": {
        "type": "object",
        "title": "Agent.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "title": "Agent.WhereFilter",
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "boolean"
                  },
                  "organization_id": {
                    "type": "boolean"
                  },
                  "project_id": {
                    "type": "boolean"
                  },
                  "user_id": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "boolean"
                  },
                  "description": {
                    "type": "boolean"
                  },
                  "share": {
                    "type": "boolean"
                  },
                  "instructions": {
                    "type": "boolean"
                  },
                  "llm_model": {
                    "type": "boolean"
                  },
                  "tts_model": {
                    "type": "boolean"
                  },
                  "tts_voice": {
                    "type": "boolean"
                  },
                  "tts_params": {
                    "type": "boolean"
                  },
                  "keyterm": {
                    "type": "boolean"
                  },
                  "language": {
                    "type": "boolean"
                  },
                  "tools": {
                    "type": "boolean"
                  },
                  "call_configuration": {
                    "type": "boolean"
                  },
                  "chat_configuration": {
                    "type": "boolean"
                  },
                  "mcp_servers": {
                    "type": "boolean"
                  },
                  "parameters": {
                    "type": "boolean"
                  },
                  "settings": {
                    "type": "boolean"
                  },
                  "created_at": {
                    "type": "boolean"
                  },
                  "updated_at": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "id",
                    "organization_id",
                    "project_id",
                    "user_id",
                    "name",
                    "description",
                    "share",
                    "instructions",
                    "llm_model",
                    "tts_model",
                    "tts_voice",
                    "tts_params",
                    "keyterm",
                    "language",
                    "tools",
                    "call_configuration",
                    "chat_configuration",
                    "mcp_servers",
                    "parameters",
                    "settings",
                    "created_at",
                    "updated_at"
                  ],
                  "example": "id"
                },
                "uniqueItems": true
              }
            ],
            "title": "Agent.Fields"
          },
          "include": {
            "title": "Agent.IncludeFilter",
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Agent.IncludeFilter.Items"
                },
                {
                  "type": "string"
                }
              ]
            }
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<Agent>"
      },
      "loopback.Count": {
        "type": "object",
        "title": "loopback.Count",
        "x-typescript-type": "@loopback/repository#Count",
        "properties": {
          "count": {
            "type": "number"
          }
        }
      },
      "UsageRequest.ScopeFilter": {
        "type": "object",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "uniqueItems": true
              }
            ]
          },
          "include": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false,
        "title": "UsageRequest.ScopeFilter"
      },
      "UsageRequest.IncludeFilter.Items": {
        "title": "UsageRequest.IncludeFilter.Items",
        "type": "object",
        "properties": {
          "relation": {
            "type": "string",
            "enum": [
              "items"
            ]
          },
          "scope": {
            "$ref": "#/components/schemas/UsageRequest.ScopeFilter"
          }
        }
      },
      "UsageRequest.Filter": {
        "type": "object",
        "title": "UsageRequest.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "title": "UsageRequest.WhereFilter",
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "agent_id": {
                    "type": "boolean"
                  },
                  "api_key_id": {
                    "type": "boolean"
                  },
                  "auth_mode": {
                    "type": "boolean"
                  },
                  "bot_id": {
                    "type": "boolean"
                  },
                  "created_at": {
                    "type": "boolean"
                  },
                  "event_timestamp": {
                    "type": "boolean"
                  },
                  "execution_time_ms": {
                    "type": "boolean"
                  },
                  "id": {
                    "type": "boolean"
                  },
                  "metadata": {
                    "type": "boolean"
                  },
                  "guest": {
                    "type": "boolean"
                  },
                  "organization_id": {
                    "type": "boolean"
                  },
                  "processing_time_ms": {
                    "type": "boolean"
                  },
                  "project_id": {
                    "type": "boolean"
                  },
                  "room_name": {
                    "type": "boolean"
                  },
                  "source_service": {
                    "type": "boolean"
                  },
                  "speed": {
                    "type": "boolean"
                  },
                  "thread_id": {
                    "type": "boolean"
                  },
                  "updated_at": {
                    "type": "boolean"
                  },
                  "user_id": {
                    "type": "boolean"
                  },
                  "total_price_local": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "agent_id",
                    "api_key_id",
                    "auth_mode",
                    "bot_id",
                    "created_at",
                    "event_timestamp",
                    "execution_time_ms",
                    "id",
                    "metadata",
                    "guest",
                    "organization_id",
                    "processing_time_ms",
                    "project_id",
                    "room_name",
                    "source_service",
                    "speed",
                    "thread_id",
                    "updated_at",
                    "user_id",
                    "total_price_local"
                  ],
                  "example": "agent_id"
                },
                "uniqueItems": true
              }
            ],
            "title": "UsageRequest.Fields"
          },
          "include": {
            "title": "UsageRequest.IncludeFilter",
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/UsageRequest.IncludeFilter.Items"
                },
                {
                  "type": "string"
                }
              ]
            }
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<UsageRequest>"
      },
      "ApiKey.Filter": {
        "type": "object",
        "title": "ApiKey.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "created_at": {
                    "type": "boolean"
                  },
                  "hint": {
                    "type": "boolean"
                  },
                  "id": {
                    "type": "boolean"
                  },
                  "key": {
                    "type": "boolean"
                  },
                  "last_used_at": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "boolean"
                  },
                  "user_id": {
                    "type": "boolean"
                  },
                  "organization_id": {
                    "type": "boolean"
                  },
                  "project_id": {
                    "type": "boolean"
                  },
                  "predecessor_key_hash": {
                    "type": "boolean"
                  },
                  "predecessor_hint": {
                    "type": "boolean"
                  },
                  "predecessor_expires_at": {
                    "type": "boolean"
                  },
                  "predecessor_last_used_at": {
                    "type": "boolean"
                  },
                  "rotated_at": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "created_at",
                    "hint",
                    "id",
                    "key",
                    "last_used_at",
                    "name",
                    "user_id",
                    "organization_id",
                    "project_id",
                    "predecessor_key_hash",
                    "predecessor_hint",
                    "predecessor_expires_at",
                    "predecessor_last_used_at",
                    "rotated_at"
                  ],
                  "example": "created_at"
                },
                "uniqueItems": true
              }
            ],
            "title": "ApiKey.Fields"
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<ApiKey>"
      },
      "ApiKey.Filter1": {
        "type": "object",
        "title": "ApiKey.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "title": "ApiKey.WhereFilter",
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "created_at": {
                    "type": "boolean"
                  },
                  "hint": {
                    "type": "boolean"
                  },
                  "id": {
                    "type": "boolean"
                  },
                  "key": {
                    "type": "boolean"
                  },
                  "last_used_at": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "boolean"
                  },
                  "user_id": {
                    "type": "boolean"
                  },
                  "organization_id": {
                    "type": "boolean"
                  },
                  "project_id": {
                    "type": "boolean"
                  },
                  "predecessor_key_hash": {
                    "type": "boolean"
                  },
                  "predecessor_hint": {
                    "type": "boolean"
                  },
                  "predecessor_expires_at": {
                    "type": "boolean"
                  },
                  "predecessor_last_used_at": {
                    "type": "boolean"
                  },
                  "rotated_at": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "created_at",
                    "hint",
                    "id",
                    "key",
                    "last_used_at",
                    "name",
                    "user_id",
                    "organization_id",
                    "project_id",
                    "predecessor_key_hash",
                    "predecessor_hint",
                    "predecessor_expires_at",
                    "predecessor_last_used_at",
                    "rotated_at"
                  ],
                  "example": "created_at"
                },
                "uniqueItems": true
              }
            ],
            "title": "ApiKey.Fields"
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<ApiKey>"
      },
      "TranscriptionObject": {
        "type": "object",
        "title": "TranscriptionObject",
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "description": "Transcribed text."
          }
        },
        "additionalProperties": true
      },
      "BatchTranscriptionStatus": {
        "type": "object",
        "title": "BatchTranscriptionStatus",
        "required": [
          "request_id",
          "status"
        ],
        "properties": {
          "request_id": {
            "type": "string",
            "description": "Identifier the batch was submitted with, echoed back."
          },
          "status": {
            "type": "string",
            "enum": [
              "in_progress",
              "completed",
              "failed"
            ],
            "description": "`completed` carries `result`, `failed` carries `error`, `in_progress` carries neither - poll again."
          },
          "result": {
            "description": "Transcription, present once `status` is `completed`.",
            "oneOf": [
              {
                "type": "string",
                "title": "PlainTextTranscription",
                "description": "Plain text, returned by the text response formats."
              },
              {
                "$ref": "#/components/schemas/TranscriptionObject"
              }
            ]
          },
          "error": {
            "type": "string",
            "description": "Reason the transcription failed, present when `status` is `failed`."
          }
        }
      },
      "BatchTranscriptionSubmission": {
        "type": "object",
        "title": "BatchTranscriptionSubmission",
        "required": [
          "request_id",
          "model",
          "status"
        ],
        "properties": {
          "request_id": {
            "type": "string",
            "description": "Identifier to poll with `GET /asr/batch/{request_id}/status`."
          },
          "model": {
            "type": "string",
            "description": "Model that will run the transcription."
          },
          "status": {
            "type": "string",
            "enum": [
              "submitted"
            ]
          }
        }
      },
      "TranscriptionResult": {
        "type": "object",
        "title": "TranscriptionResult",
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "description": "Transcribed text."
          }
        },
        "additionalProperties": true
      },
      "AsrInsightsOptions": {
        "title": "AsrInsightsOptions",
        "type": "object",
        "description": "(tsType: Omit<TextInsightsOptions, 'language'>, schemaOptions: { title: 'AsrInsightsOptions', exclude: [ 'language' ] })",
        "properties": {
          "summarization": {
            "type": "boolean"
          },
          "sentiment_analysis": {
            "$ref": "#/components/schemas/SentimentAnalysisOptions"
          },
          "topic_detection": {
            "$ref": "#/components/schemas/TopicDetectionOptions"
          },
          "custom": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomOption"
            }
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Omit<TextInsightsOptions, 'language'>"
      },
      "AsrAnonymizeOptions": {
        "title": "AsrAnonymizeOptions",
        "type": "object",
        "description": "(tsType: Omit<AnonymizerBody, 'text' | 'segments'>, schemaOptions: { title: 'AsrAnonymizeOptions', exclude: [ 'text', 'segments' ] })",
        "properties": {
          "entities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sequence": {
            "type": "number"
          },
          "language": {
            "type": "string",
            "nullable": true
          },
          "search_and_replace": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchReplace"
            }
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "Omit<AnonymizerBody, 'text' | 'segments'>"
      },
      "CreditTransactions.ScopeFilter": {
        "type": "object",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "uniqueItems": true
              }
            ]
          },
          "include": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false,
        "title": "CreditTransactions.ScopeFilter"
      },
      "CreditTransactions.IncludeFilter.Items": {
        "title": "CreditTransactions.IncludeFilter.Items",
        "type": "object",
        "properties": {
          "relation": {
            "type": "string",
            "enum": [
              "user",
              "organization"
            ]
          },
          "scope": {
            "$ref": "#/components/schemas/CreditTransactions.ScopeFilter"
          }
        }
      },
      "CreditTransactions.Filter": {
        "type": "object",
        "title": "CreditTransactions.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "title": "CreditTransactions.WhereFilter",
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "boolean"
                  },
                  "created_at": {
                    "type": "boolean"
                  },
                  "currency": {
                    "type": "boolean"
                  },
                  "id": {
                    "type": "boolean"
                  },
                  "metadata": {
                    "type": "boolean"
                  },
                  "organization_id": {
                    "type": "boolean"
                  },
                  "description": {
                    "type": "boolean"
                  },
                  "user_id": {
                    "type": "boolean"
                  },
                  "type": {
                    "type": "boolean"
                  },
                  "source": {
                    "type": "boolean"
                  },
                  "user": {
                    "type": "boolean"
                  },
                  "organization": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "amount",
                    "created_at",
                    "currency",
                    "id",
                    "metadata",
                    "organization_id",
                    "description",
                    "user_id",
                    "type",
                    "source",
                    "user",
                    "organization"
                  ],
                  "example": "amount"
                },
                "uniqueItems": true
              }
            ],
            "title": "CreditTransactions.Fields"
          },
          "include": {
            "title": "CreditTransactions.IncludeFilter",
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/CreditTransactions.IncludeFilter.Items"
                },
                {
                  "type": "string"
                }
              ]
            }
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<CreditTransactions>"
      },
      "HealthResponse": {
        "type": "object",
        "title": "HealthResponse",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "healthy",
              "unhealthy"
            ]
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OpenAiTranscriptionResult": {
        "type": "object",
        "title": "OpenAiTranscriptionResult",
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "description": "Transcribed text."
          }
        },
        "additionalProperties": true
      },
      "PricingRuleView": {
        "type": "object",
        "title": "PricingRuleView",
        "required": [
          "name",
          "metric",
          "calculation",
          "selling_price"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Identifier of the rule. Model rules are drawn from a fixed catalog (`input_token`, `output_token`, `transcription`, `tts_char`, ...); service rules are free snake_case identifiers. `cache_read_token` and `cache_write_token` only appear when the subscription's rate deck has `cache_pricing_mode` `passthrough` - on `absorb` cached tokens are billed as a plain `input_token` line item at the full input price, so those two rules are stripped from the response."
          },
          "description": {
            "type": "string",
            "description": "Human readable purpose of the rule."
          },
          "metric": {
            "type": "object",
            "description": "What is measured. `type` selects the shape: `tokens`, `time`, `characters`, `requests`, `recurring`, `images` or `bytes`.",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string"
              },
              "subtype": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "per": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "calculation": {
            "type": "object",
            "description": "How the metric turns into a price. `method` selects the shape: `linear`, `stepped`, `tiered` or `fixed`.",
            "required": [
              "method"
            ],
            "properties": {
              "method": {
                "type": "string",
                "enum": [
                  "linear",
                  "stepped",
                  "tiered",
                  "fixed"
                ]
              },
              "minimum": {
                "type": "number"
              },
              "blockSize": {
                "type": "number",
                "description": "`stepped` only: size of the billed block."
              },
              "rounding": {
                "type": "string",
                "enum": [
                  "up",
                  "down",
                  "nearest"
                ],
                "description": "`stepped` only: how a partial block is rounded."
              },
              "tiers": {
                "type": "array",
                "description": "`tiered` only, in ascending order. `to: null` closes the last tier.",
                "items": {
                  "type": "object",
                  "required": [
                    "from",
                    "pricePerUnit"
                  ],
                  "properties": {
                    "from": {
                      "type": "number"
                    },
                    "to": {
                      "type": "number",
                      "nullable": true
                    },
                    "pricePerUnit": {
                      "type": "number"
                    }
                  }
                }
              }
            },
            "additionalProperties": true
          },
          "modifiers": {
            "type": "array",
            "description": "Adjustments applied on top of the calculated price.",
            "items": {
              "type": "object",
              "required": [
                "type",
                "value"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "surcharge",
                    "multiplier",
                    "override"
                  ]
                },
                "value": {
                  "type": "number"
                },
                "condition": {
                  "type": "string"
                }
              }
            }
          },
          "selling_price": {
            "type": "number",
            "description": "Final price per unit of the metric, in the currency of the response. Already converted and taxed, or taken from the fixed local price when one is declared for that currency."
          },
          "base_currency": {
            "type": "string",
            "description": "Service rules only: currency the rule was authored in, ISO 4217."
          },
          "billing_period": {
            "type": "string",
            "enum": [
              "month"
            ],
            "description": "Service rules only: recurring charges are monthly."
          }
        }
      },
      "ServicePricing": {
        "type": "object",
        "title": "ServicePricing",
        "required": [
          "service_name",
          "pricing_rules"
        ],
        "properties": {
          "service_name": {
            "type": "string"
          },
          "pricing_rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PricingRuleView"
            }
          }
        }
      },
      "ModelPricingRuleView": {
        "type": "object",
        "title": "ModelPricingRuleView",
        "required": [
          "name",
          "metric",
          "calculation",
          "selling_price"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Identifier of the rule. Model rules are drawn from a fixed catalog (`input_token`, `output_token`, `transcription`, `tts_char`, ...); service rules are free snake_case identifiers. `cache_read_token` and `cache_write_token` only appear when the subscription's rate deck has `cache_pricing_mode` `passthrough` - on `absorb` cached tokens are billed as a plain `input_token` line item at the full input price, so those two rules are stripped from the response."
          },
          "description": {
            "type": "string",
            "description": "Human readable purpose of the rule."
          },
          "metric": {
            "type": "object",
            "description": "What is measured. `type` selects the shape: `tokens`, `time`, `characters`, `requests`, `recurring`, `images` or `bytes`.",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string"
              },
              "subtype": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "per": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "calculation": {
            "type": "object",
            "description": "How the metric turns into a price. `method` selects the shape: `linear`, `stepped`, `tiered` or `fixed`.",
            "required": [
              "method"
            ],
            "properties": {
              "method": {
                "type": "string",
                "enum": [
                  "linear",
                  "stepped",
                  "tiered",
                  "fixed"
                ]
              },
              "minimum": {
                "type": "number"
              },
              "blockSize": {
                "type": "number",
                "description": "`stepped` only: size of the billed block."
              },
              "rounding": {
                "type": "string",
                "enum": [
                  "up",
                  "down",
                  "nearest"
                ],
                "description": "`stepped` only: how a partial block is rounded."
              },
              "tiers": {
                "type": "array",
                "description": "`tiered` only, in ascending order. `to: null` closes the last tier.",
                "items": {
                  "type": "object",
                  "required": [
                    "from",
                    "pricePerUnit"
                  ],
                  "properties": {
                    "from": {
                      "type": "number"
                    },
                    "to": {
                      "type": "number",
                      "nullable": true
                    },
                    "pricePerUnit": {
                      "type": "number"
                    }
                  }
                }
              }
            },
            "additionalProperties": true
          },
          "modifiers": {
            "type": "array",
            "description": "Adjustments applied on top of the calculated price.",
            "items": {
              "type": "object",
              "required": [
                "type",
                "value"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "surcharge",
                    "multiplier",
                    "override"
                  ]
                },
                "value": {
                  "type": "number"
                },
                "condition": {
                  "type": "string"
                }
              }
            }
          },
          "selling_price": {
            "type": "number",
            "description": "Final price per unit of the metric, in the currency of the response. Already converted and taxed, or taken from the fixed local price when one is declared for that currency."
          },
          "base_currency": {
            "type": "string",
            "description": "Service rules only: currency the rule was authored in, ISO 4217."
          },
          "billing_period": {
            "type": "string",
            "enum": [
              "month"
            ],
            "description": "Service rules only: recurring charges are monthly."
          },
          "conditions": {
            "type": "array",
            "description": "Conditional selling prices for this rule in this deck. Omitted when empty; prices are already resolved in the response currency.",
            "items": {
              "type": "object",
              "required": [
                "name",
                "when",
                "selling_price"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,31}$",
                  "maxLength": 32
                },
                "when": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "prompt_tokens_gt"
                      ],
                      "properties": {
                        "prompt_tokens_gt": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "utc_windows"
                      ],
                      "properties": {
                        "utc_windows": {
                          "type": "array",
                          "minItems": 1,
                          "items": {
                            "type": "object",
                            "required": [
                              "days",
                              "from",
                              "to"
                            ],
                            "properties": {
                              "days": {
                                "type": "array",
                                "minItems": 1,
                                "items": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 7
                                }
                              },
                              "from": {
                                "type": "string",
                                "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$",
                                "description": "Inclusive UTC time, before `to`."
                              },
                              "to": {
                                "type": "string",
                                "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$",
                                "description": "Exclusive UTC time; windows do not cross midnight."
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "selling_price": {
                  "type": "number",
                  "description": "Final price per unit of the metric, in the currency of the response. Already converted and taxed, or taken from the fixed local price when one is declared for that currency."
                },
                "local_price_overrides": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "currency",
                      "price"
                    ],
                    "properties": {
                      "currency": {
                        "type": "string"
                      },
                      "price": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "ModelPricing": {
        "type": "object",
        "title": "ModelPricing",
        "required": [
          "name",
          "type",
          "provider",
          "priority",
          "realtime",
          "rate_limit",
          "pricing_rules"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "Model family, e.g. `text-generation`, `speech-to-text`."
          },
          "provider": {
            "type": "string"
          },
          "priority": {
            "type": "number",
            "description": "Ordering hint for the catalog, lower comes first."
          },
          "deprecated": {
            "type": "boolean",
            "description": "Present and true when the model is on its way out."
          },
          "realtime": {
            "type": "boolean",
            "description": "Always present. True when the model is only consumable by a realtime WebSocket session (`/v1/asr/listen`); the REST transcription API refuses it. Absent/null capabilities read as false."
          },
          "rate_limit": {
            "type": "array",
            "description": "Per organization limits for this model.",
            "items": {
              "type": "object",
              "required": [
                "type",
                "limit"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "description": "`rpm`/`rpd` requests, `tpm`/`tpd` tokens, `ash`/`asd` audio seconds."
                },
                "limit": {
                  "type": "number"
                }
              }
            }
          },
          "pricing_rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelPricingRuleView"
            }
          }
        }
      },
      "OrganizationPricing": {
        "type": "object",
        "title": "OrganizationPricing",
        "required": [
          "name",
          "currency",
          "services",
          "models"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Subscription plan the prices belong to."
          },
          "currency": {
            "type": "string",
            "description": "Currency every `selling_price` is expressed in, ISO 4217."
          },
          "services": {
            "type": "array",
            "description": "Billable services that are not a model, e.g. telephony numbers.",
            "items": {
              "$ref": "#/components/schemas/ServicePricing"
            }
          },
          "models": {
            "type": "array",
            "description": "Models available to the organization, with their price and rate limits.",
            "items": {
              "$ref": "#/components/schemas/ModelPricing"
            }
          }
        }
      },
      "StructuredAnalysisExecution": {
        "type": "object",
        "title": "StructuredAnalysisExecution",
        "required": [
          "result"
        ],
        "properties": {
          "result": {
            "type": "object",
            "required": [
              "name",
              "content"
            ],
            "properties": {
              "name": {
                "type": "string",
                "description": "Name of the analysis that ran."
              },
              "description": {
                "type": "string",
                "description": "Description of the analysis."
              },
              "content": {
                "type": "object",
                "additionalProperties": true,
                "description": "Model output parsed from JSON. Its properties are the ones declared in the `schema` of the analysis."
              }
            }
          }
        }
      },
      "StructuredAnalysis.Filter": {
        "type": "object",
        "title": "StructuredAnalysis.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "title": "StructuredAnalysis.WhereFilter",
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "boolean"
                  },
                  "organization_id": {
                    "type": "boolean"
                  },
                  "project_id": {
                    "type": "boolean"
                  },
                  "user_id": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "boolean"
                  },
                  "description": {
                    "type": "boolean"
                  },
                  "model": {
                    "type": "boolean"
                  },
                  "schema": {
                    "type": "boolean"
                  },
                  "status": {
                    "type": "boolean"
                  },
                  "metadata": {
                    "type": "boolean"
                  },
                  "created_at": {
                    "type": "boolean"
                  },
                  "updated_at": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "id",
                    "organization_id",
                    "project_id",
                    "user_id",
                    "name",
                    "description",
                    "model",
                    "schema",
                    "status",
                    "metadata",
                    "created_at",
                    "updated_at"
                  ],
                  "example": "id"
                },
                "uniqueItems": true
              }
            ],
            "title": "StructuredAnalysis.Fields"
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<StructuredAnalysis>"
      },
      "Thread.ScopeFilter": {
        "type": "object",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": true
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "uniqueItems": true
              }
            ]
          },
          "include": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false,
        "title": "Thread.ScopeFilter"
      },
      "Thread.IncludeFilter.Items": {
        "title": "Thread.IncludeFilter.Items",
        "type": "object",
        "properties": {
          "relation": {
            "type": "string",
            "enum": [
              "usage_requests"
            ]
          },
          "scope": {
            "$ref": "#/components/schemas/Thread.ScopeFilter"
          }
        }
      },
      "Thread.Filter": {
        "type": "object",
        "title": "Thread.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "title": "Thread.WhereFilter",
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "boolean"
                  },
                  "organization_id": {
                    "type": "boolean"
                  },
                  "project_id": {
                    "type": "boolean"
                  },
                  "user_id": {
                    "type": "boolean"
                  },
                  "agent_id": {
                    "type": "boolean"
                  },
                  "history": {
                    "type": "boolean"
                  },
                  "full_history": {
                    "type": "boolean"
                  },
                  "deleted_at": {
                    "type": "boolean"
                  },
                  "created_at": {
                    "type": "boolean"
                  },
                  "updated_at": {
                    "type": "boolean"
                  },
                  "additional_instructions": {
                    "type": "boolean"
                  },
                  "vars": {
                    "type": "boolean"
                  },
                  "post_analysis": {
                    "type": "boolean"
                  },
                  "agent_snapshot": {
                    "type": "boolean"
                  },
                  "title": {
                    "type": "boolean"
                  },
                  "status": {
                    "type": "boolean"
                  },
                  "triggered": {
                    "type": "boolean"
                  },
                  "identifier": {
                    "type": "boolean"
                  },
                  "uid": {
                    "type": "boolean"
                  },
                  "is_shared": {
                    "type": "boolean"
                  },
                  "share_token": {
                    "type": "boolean"
                  },
                  "shared_at": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "id",
                    "organization_id",
                    "project_id",
                    "user_id",
                    "agent_id",
                    "history",
                    "full_history",
                    "deleted_at",
                    "created_at",
                    "updated_at",
                    "additional_instructions",
                    "vars",
                    "post_analysis",
                    "agent_snapshot",
                    "title",
                    "status",
                    "triggered",
                    "identifier",
                    "uid",
                    "is_shared",
                    "share_token",
                    "shared_at"
                  ],
                  "example": "id"
                },
                "uniqueItems": true
              }
            ],
            "title": "Thread.Fields"
          },
          "include": {
            "title": "Thread.IncludeFilter",
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Thread.IncludeFilter.Items"
                },
                {
                  "type": "string"
                }
              ]
            }
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<Thread>"
      },
      "VoiceParams": {
        "title": "VoiceParams",
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "name",
          "key",
          "languages"
        ],
        "additionalProperties": false
      },
      "DecisionResponse": {
        "type": "object",
        "title": "DecisionResponse",
        "properties": {
          "model": {
            "type": "string"
          },
          "answers": {
            "type": "object",
            "additionalProperties": true
          },
          "usage": {
            "type": "object",
            "properties": {
              "input_tokens": {
                "type": "number"
              },
              "output_tokens": {
                "type": "number"
              }
            }
          },
          "id": {
            "type": "string"
          },
          "provider_request_id": {
            "type": "string"
          }
        }
      },
      "DecisionRequest": {
        "type": "object",
        "title": "DecisionRequest",
        "additionalProperties": true,
        "properties": {
          "state": {},
          "questions": {
            "type": "object",
            "additionalProperties": true
          },
          "model": {
            "type": "string"
          },
          "provider": {
            "type": "object",
            "additionalProperties": true
          },
          "user": {
            "type": "string"
          },
          "session_id": {
            "type": "string"
          },
          "trace": {
            "type": "object",
            "additionalProperties": true
          },
          "id": {
            "type": "string"
          }
        }
      },
      "TypeSafeModelList": {
        "type": "object",
        "title": "TypeSafeModelList",
        "properties": {
          "models": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "release_date": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "WebhookEventLog.Filter": {
        "type": "object",
        "title": "WebhookEventLog.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "title": "WebhookEventLog.WhereFilter",
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "boolean"
                  },
                  "webhook_id": {
                    "type": "boolean"
                  },
                  "payload": {
                    "type": "boolean"
                  },
                  "status": {
                    "type": "boolean"
                  },
                  "attempts": {
                    "type": "boolean"
                  },
                  "last_error": {
                    "type": "boolean"
                  },
                  "response_code": {
                    "type": "boolean"
                  },
                  "response_body": {
                    "type": "boolean"
                  },
                  "next_retry_at": {
                    "type": "boolean"
                  },
                  "created_at": {
                    "type": "boolean"
                  },
                  "updated_at": {
                    "type": "boolean"
                  },
                  "event": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "id",
                    "webhook_id",
                    "payload",
                    "status",
                    "attempts",
                    "last_error",
                    "response_code",
                    "response_body",
                    "next_retry_at",
                    "created_at",
                    "updated_at",
                    "event"
                  ],
                  "example": "id"
                },
                "uniqueItems": true
              }
            ],
            "title": "WebhookEventLog.Fields"
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<WebhookEventLog>"
      },
      "Webhook.Filter": {
        "type": "object",
        "title": "Webhook.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "boolean"
                  },
                  "organization_id": {
                    "type": "boolean"
                  },
                  "project_id": {
                    "type": "boolean"
                  },
                  "events": {
                    "type": "boolean"
                  },
                  "target_url": {
                    "type": "boolean"
                  },
                  "secret": {
                    "type": "boolean"
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "retries": {
                    "type": "boolean"
                  },
                  "created_at": {
                    "type": "boolean"
                  },
                  "updated_at": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "id",
                    "organization_id",
                    "project_id",
                    "events",
                    "target_url",
                    "secret",
                    "is_active",
                    "retries",
                    "created_at",
                    "updated_at"
                  ],
                  "example": "id"
                },
                "uniqueItems": true
              }
            ],
            "title": "Webhook.Fields"
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<Webhook>"
      },
      "Webhook.Filter1": {
        "type": "object",
        "title": "Webhook.Filter",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "example": 100
          },
          "skip": {
            "type": "integer",
            "minimum": 0
          },
          "order": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "where": {
            "title": "Webhook.WhereFilter",
            "type": "object",
            "additionalProperties": true
          },
          "fields": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "boolean"
                  },
                  "organization_id": {
                    "type": "boolean"
                  },
                  "project_id": {
                    "type": "boolean"
                  },
                  "events": {
                    "type": "boolean"
                  },
                  "target_url": {
                    "type": "boolean"
                  },
                  "secret": {
                    "type": "boolean"
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "retries": {
                    "type": "boolean"
                  },
                  "created_at": {
                    "type": "boolean"
                  },
                  "updated_at": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "id",
                    "organization_id",
                    "project_id",
                    "events",
                    "target_url",
                    "secret",
                    "is_active",
                    "retries",
                    "created_at",
                    "updated_at"
                  ],
                  "example": "id"
                },
                "uniqueItems": true
              }
            ],
            "title": "Webhook.Fields"
          }
        },
        "additionalProperties": false,
        "x-typescript-type": "@loopback/repository#Filter<Webhook>"
      },
      "ErrorResponse": {
        "title": "ErrorResponse",
        "type": "object",
        "description": "Standard error envelope returned by every endpoint of this API.",
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "statusCode",
              "message"
            ],
            "properties": {
              "statusCode": {
                "type": "integer",
                "description": "HTTP status code, repeated in the body for convenience.",
                "example": 404
              },
              "name": {
                "type": "string",
                "description": "Error class name, e.g. `NotFoundError`.",
                "example": "NotFoundError"
              },
              "message": {
                "type": "string",
                "description": "Human readable description. Meant for logs and debugging - do not branch on it, use `code`.",
                "example": "Entity not found"
              },
              "code": {
                "type": "string",
                "description": "Stable machine readable error code from the platform catalog, e.g. `entity_not_found`, `insufficient_credits`, `permission_denied`. Absent for errors raised by the framework before reaching application code (malformed JSON, schema validation).",
                "example": "entity_not_found"
              },
              "details": {
                "description": "Structured context for validation failures or a rejected outbound SIP INVITE.",
                "oneOf": [
                  {
                    "type": "array",
                    "description": "Per-field validation failures on a 422 response.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string",
                          "example": "/name"
                        },
                        "code": {
                          "type": "string",
                          "example": "required"
                        },
                        "message": {
                          "type": "string",
                          "example": "should have required property 'name'"
                        },
                        "info": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    }
                  },
                  {
                    "type": "object",
                    "description": "SIP response details returned with `sip_invite_failed` (HTTP 502).",
                    "required": [
                      "sipStatus",
                      "sipReason"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "sipStatus": {
                        "type": "integer",
                        "example": 603
                      },
                      "sipReason": {
                        "type": "string",
                        "example": "Decline"
                      }
                    }
                  }
                ]
              }
            }
          }
        }
      },
      "DecisionErrorResponse": {
        "title": "DecisionErrorResponse",
        "type": "object",
        "description": "Error envelope of the Decisions facades. Same fields as `ErrorResponse`,\nexcept `error.code` is the HTTP status as a number and the catalog code\ntravels in `error.platform_code`.",
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "statusCode",
              "message",
              "code"
            ],
            "properties": {
              "statusCode": {
                "type": "integer",
                "description": "HTTP status code, repeated in the body for convenience.",
                "example": 404
              },
              "name": {
                "type": "string",
                "description": "Error class name, e.g. `NotFoundError`.",
                "example": "NotFoundError"
              },
              "message": {
                "type": "string",
                "description": "Human readable description. Meant for logs and debugging - do not branch on it, use `platform_code`.",
                "example": "The decision provider rate limit was reached"
              },
              "code": {
                "type": "integer",
                "description": "HTTP status code as a number, the shape the OpenRouter SDK parses. Always the same value as `statusCode`.",
                "example": 429
              },
              "details": {
                "type": "array",
                "description": "Per-field request validation failures, returned with the 400 a malformed decision body is normalized to. The standard `ErrorResponse` also carries a SIP 502 variant, which the facades never return.",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string",
                      "example": "/questions"
                    },
                    "code": {
                      "type": "string",
                      "example": "type"
                    },
                    "message": {
                      "type": "string",
                      "example": "should be object"
                    },
                    "info": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              },
              "platform_code": {
                "type": "string",
                "description": "Stable machine readable code from the platform catalog (`src/utils/errors.ts`), e.g. `decision_provider_rate_limited`. Absent when the failure was raised before application code ran.",
                "example": "decision_provider_rate_limited"
              }
            }
          }
        }
      },
      "OAuthError": {
        "title": "OAuthError",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error",
          "error_description"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "OAuth protocol error code.",
            "example": "invalid_request"
          },
          "error_description": {
            "type": "string",
            "description": "Safe human-readable explanation of the protocol error.",
            "example": "The authorization request is invalid"
          }
        }
      }
    },
    "securitySchemes": {
      "jwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "api-key",
        "description": "Organization API key. Interchangeable with a user JWT: send one or the other, never both."
      },
      "guest-token": {
        "type": "apiKey",
        "in": "header",
        "name": "x-guest-token",
        "description": "Short lived token issued for an unauthenticated visitor of a public agent. Scoped to a single agent and thread, and accepted only where an anonymous conversation is allowed."
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The request is malformed or carries invalid values.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing, malformed or expired credentials. Send a JWT in `Authorization: Bearer <token>` or an API key in the `api-key` header.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "The organization does not have enough credits to run the operation. Top up and retry.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Authenticated but not allowed: the role lacks the required permission, the resource belongs to another organization, or the subscription plan does not include the feature.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "NotFound": {
        "description": "No resource matches the identifier in the path.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Conflict": {
        "description": "The request collides with the current state of the resource.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "The body is syntactically valid JSON but fails schema validation.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Rate limit or project budget window exceeded. Only the request limiters keyed by IP or by user (`/login`, `/forgot-password`) describe when to come back, through `Retry-After` and the `X-RateLimit-*` trio below. The per model limits reject the request as soon as a window is full and send no header with the `429` - their `x-ratelimit-*` counters ride on the responses that ARE served - and a spent project budget carries no header either: it clears when the budget window rolls over.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before retrying. Authentication route limiters only.",
            "schema": {
              "type": "integer",
              "example": 60
            }
          },
          "X-RateLimit-Limit": {
            "description": "Requests allowed in the window. Authentication route limiters only.",
            "schema": {
              "type": "integer",
              "example": 10
            }
          },
          "X-RateLimit-Remaining": {
            "description": "Requests left in the window, `0` on a `429`. Authentication route limiters only.",
            "schema": {
              "type": "integer",
              "example": 0
            }
          },
          "X-RateLimit-Reset": {
            "description": "Moment the window resets, in seconds since the Unix epoch. Authentication route limiters only.",
            "schema": {
              "type": "integer",
              "example": 1735689600
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Unexpected failure on the server or on an upstream provider.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "The service needed to process the request is temporarily unavailable.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "BadGateway": {
        "description": "The request was valid, but an upstream hop failed. An outbound SIP rejection uses `sip_invite_failed` with `details.sipStatus` and `details.sipReason`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "DecisionUnauthorized": {
        "description": "Missing, malformed or expired credentials. Send a JWT in `Authorization: Bearer <token>` or an API key in the `api-key` header.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DecisionErrorResponse"
            }
          }
        }
      },
      "DecisionForbidden": {
        "description": "Authenticated but not allowed: the role lacks the `decisions:execute` permission, or the resource belongs to another organization.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DecisionErrorResponse"
            }
          }
        }
      },
      "DecisionBadRequest": {
        "description": "The decision request is malformed, uses an unknown question type, nests deeper than 64 levels, or asks for a provider preference the gateway cannot honor.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DecisionErrorResponse"
            }
          }
        }
      },
      "DecisionPaymentRequired": {
        "description": "The organization does not have enough credits to run the decision. Top up and retry.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DecisionErrorResponse"
            }
          }
        }
      },
      "DecisionNotFound": {
        "description": "No decision model matches the requested name, or the referenced project does not belong to the organization.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DecisionErrorResponse"
            }
          }
        }
      },
      "DecisionPayloadTooLarge": {
        "description": "The serialized decision request exceeds 2 MiB.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DecisionErrorResponse"
            }
          }
        }
      },
      "DecisionTooManyRequests": {
        "description": "The per model rate limit, the project budget window or the upstream decision provider limited the request. A provider 429 preserves the provider's `Retry-After`; the SIPPulse model rate limit and the project budget send no header.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before retrying, when the upstream decision provider sent one. Absent for the SIPPulse model rate limit and the project budget.",
            "schema": {
              "type": "integer",
              "example": 30
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DecisionErrorResponse"
            }
          }
        }
      },
      "DecisionInternalServerError": {
        "description": "Unexpected failure on the server. `platform_code` is present when the failure maps to a controlled catalog code.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DecisionErrorResponse"
            }
          }
        }
      },
      "DecisionBadGateway": {
        "description": "The upstream decision provider rejected our credential, failed, or returned a response we could not parse.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DecisionErrorResponse"
            }
          }
        }
      },
      "DecisionServiceUnavailable": {
        "description": "Credit authorization is temporarily unavailable.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DecisionErrorResponse"
            }
          }
        }
      },
      "DecisionGatewayTimeout": {
        "description": "The upstream decision provider did not answer in time.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DecisionErrorResponse"
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "jwt": []
    },
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "description": "Sign in, token refresh, password recovery and OAuth flows."
    },
    {
      "name": "OAuth",
      "description": "OAuth authorization, device flow, token lifecycle and resource discovery."
    },
    {
      "name": "Organizations",
      "description": "Organizations, membership lifecycle and the telephony numbers (DIDs) they own."
    },
    {
      "name": "Projects",
      "description": "Projects, their members and the spend budget enforced on them."
    },
    {
      "name": "Roles",
      "description": "Roles and the permissions attached to them."
    },
    {
      "name": "Permissions",
      "description": "Catalog of permissions that can be granted to a role."
    },
    {
      "name": "API Keys",
      "description": "Organization API keys and the usage accounted to each of them."
    },
    {
      "name": "Agents",
      "description": "Conversational agents, their configuration and outbound calls."
    },
    {
      "name": "Threads",
      "description": "Conversations with an agent: messages, runs, streaming and sharing."
    },
    {
      "name": "Shared Threads",
      "description": "Read only access to a thread published through a share token."
    },
    {
      "name": "Knowledge Base",
      "description": "Vector collections, the documents in them and semantic queries."
    },
    {
      "name": "Speech to Text",
      "description": "Audio transcription, synchronous and batch."
    },
    {
      "name": "Text to Speech",
      "description": "Speech synthesis and retrieval of the generated audio."
    },
    {
      "name": "Anonymization",
      "description": "Detection and masking of personal data in text."
    },
    {
      "name": "Text Intelligence",
      "description": "Summarization, sentiment analysis and topic detection over text."
    },
    {
      "name": "Structured Analysis",
      "description": "Templates that extract structured data from a conversation."
    },
    {
      "name": "Decisions",
      "description": "Decision questions and answers (noul, choice, score) and the decision model facades."
    },
    {
      "name": "ModelCatalog",
      "description": "Organization-visible LLM capabilities and agent parameter contracts."
    },
    {
      "name": "OpenAI Compatible",
      "description": "Drop in replacement routes that mirror the OpenAI API surface."
    },
    {
      "name": "Webhooks",
      "description": "Event subscriptions and the delivery log of each one."
    },
    {
      "name": "Usage",
      "description": "Consumption records and the budget status derived from them."
    },
    {
      "name": "Analytics",
      "description": "Caller-scoped usage, conversation and structured-analysis reports."
    },
    {
      "name": "Billing",
      "description": "Credits, purchases and invoice history."
    },
    {
      "name": "Pricing",
      "description": "Public price list for the billable services."
    },
    {
      "name": "Subscription Limits",
      "description": "Quotas and features included in the current plan."
    },
    {
      "name": "Service",
      "description": "Liveness probe and build metadata."
    },
    {
      "name": "Email Preferences",
      "description": "Public email preference pages (one-click unsubscribe)."
    }
  ]
}