{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["platform-badges","cards","card"]},"redocly_category":"AI","product_name":"Treasure AI Studio","type":"markdown"},"seo":{"title":"Agent Channels in Treasure AI Studio","description":"Agent Channels let your own application run Treasure AI Studio chats through the Agent Gateway, anchored to one shared work folder and one executor.","siteUrl":"https://docs.treasure.ai","image":"/assets/treasure-ai-social-preview.e6fefb35676f6da91c2d1bc783bd39e618e7af2b1ad3aa52a96ae69d72e700fe.b1bff462.png","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"agent-channels","__idx":0},"children":["Agent Channels"]},{"$$mdtype":"Tag","name":"PlatformBadges","attributes":{"platforms":["Web","Desktop"]},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An Agent Channel is a governed entry point that lets software outside Treasure AI Studio run chats inside it. Your application gets the same agent your team talks to in Studio — grounded in the same shared work folder, running with the same permissions — without you building an agent, hosting a model, or handing anyone a login. Set one up when a product you own needs a conversation with your data in it: a support widget, an internal tool, a customer-facing assistant."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This page explains what an Agent Channel is, what it fixes at creation time, and how a request travels from your application to an answer. The pages under it cover creating one, the credentials involved, and writing the application itself."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-an-agent-channel-is","__idx":1},"children":["What an Agent Channel Is"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An Agent Channel is a named, account-level object that binds together three things: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["one shared work folder"]}," the chats read, ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["one executor"]}," whose permissions and credits the chats run with, and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["one or more connection secrets"]}," your application authenticates with. Every chat that arrives through the channel gets exactly that combination — there is no request parameter that changes it."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Anchoring the folder and the executor to the channel, rather than to the secret, is what makes a channel governable. A secret carries no permissions of its own, so issuing another one grants nothing new, and rotating one cannot widen what the channel reaches without anyone noticing."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Agent Channels come in one kind, the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SDK App"]},": an entry point for an application you host, which creates chats from its own server and streams them to its users."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-a-request-reaches-an-agent","__idx":2},"children":["How a Request Reaches an Agent"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Your application never talks to Treasure AI Studio's internal APIs. It talks to the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Agent Gateway"]},", a service that speaks the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://ai-sdk.dev/"},"children":["Vercel AI SDK"]}," UI Message Stream protocol so you can drive a chat with an unmodified open-source client."]},{"$$mdtype":"Tag","name":"Diagram","attributes":{"data-language":"mermaid","diagramType":"mermaid","diagramSource":"flowchart LR\n    A[\"End user<br/>(browser or mobile)\"] --> B[\"Your server<br/>holds the Gateway Token\"]\n    B -->|\"Create a chat\"| C[\"Agent Gateway\"]\n    C -->|\"Chat Access Token<br/>+ endpoint URLs\"| B\n    B -->|\"Run a turn (SSE)\"| C\n    C --> D[\"Treasure AI Studio<br/>agent + shared work folder\"]\n    D -->|\"Streamed answer\"| C\n","diagramHtml":"<svg id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05\" width=\"100%\" xmlns=\"http://www.w3.org/2000/svg\" class=\"flowchart\" style=\"max-width: 1283.65625px;\" viewBox=\"0 0.10095024108886719 1283.65625 151.69761657714844\" role=\"graphics-document document\" aria-roledescription=\"flowchart-v2\"><style>\n    #diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 foreignObject {\n      overflow: visible;\n    }\n  </style><style>#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05{font-family:\"Redocly Mermaid Sans\",Arial,\"Liberation Sans\",Arimo,Helvetica,\"Redocly Mermaid CJK\",sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .error-icon{fill:#552222;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .error-text{fill:#552222;stroke:#552222;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .edge-thickness-normal{stroke-width:1px;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .edge-thickness-thick{stroke-width:3.5px;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .edge-pattern-solid{stroke-dasharray:0;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .edge-thickness-invisible{stroke-width:0;fill:none;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .edge-pattern-dashed{stroke-dasharray:3;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .edge-pattern-dotted{stroke-dasharray:2;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .marker{fill:#333333;stroke:#333333;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .marker.cross{stroke:#333333;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 svg{font-family:\"Redocly Mermaid Sans\",Arial,\"Liberation Sans\",Arimo,Helvetica,\"Redocly Mermaid CJK\",sans-serif;font-size:16px;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 p{margin:0;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .label{font-family:\"Redocly Mermaid Sans\",Arial,\"Liberation Sans\",Arimo,Helvetica,\"Redocly Mermaid CJK\",sans-serif;color:#333;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .cluster-label text{fill:#333;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .cluster-label span{color:#333;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .cluster-label span p{background-color:transparent;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .label text,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 span{fill:#333;color:#333;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .node rect,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .node circle,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .node ellipse,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .node polygon,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .rough-node .label text,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .node .label text,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .image-shape .label,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .icon-shape .label{text-anchor:middle;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .rough-node .label,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .node .label,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .image-shape .label,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .icon-shape .label{text-align:center;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .node.clickable{cursor:pointer;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .arrowheadPath{fill:#333333;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .edgePath .path{stroke:#333333;stroke-width:1px;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .flowchart-link{stroke:#333333;fill:none;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .cluster text{fill:#333;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .cluster span{color:#333;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\"Redocly Mermaid Sans\",Arial,\"Liberation Sans\",Arimo,Helvetica,\"Redocly Mermaid CJK\",sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 rect.text{fill:none;stroke-width:0;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .icon-shape,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .icon-shape p,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .icon-shape .label rect,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 .node .neo-node{stroke:#9370DB;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 [data-look=\"neo\"].node rect,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 [data-look=\"neo\"].cluster rect,#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 [data-look=\"neo\"].node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 [data-look=\"neo\"].swimlane.cluster rect{filter:none;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 [data-look=\"neo\"].node path{stroke:#9370DB;stroke-width:1px;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 [data-look=\"neo\"].node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 [data-look=\"neo\"].node .neo-line path{stroke:#9370DB;filter:none;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 [data-look=\"neo\"].node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 [data-look=\"neo\"].node circle .state-start{fill:#000000;}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 [data-look=\"neo\"].icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 [data-look=\"neo\"].icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05 :root{--mermaid-font-family:\"Redocly Mermaid Sans\",Arial,\"Liberation Sans\",Arimo,Helvetica,\"Redocly Mermaid CJK\",sans-serif;}</style><g><marker id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-pointEnd\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refX=\"5\" refY=\"5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"8\" markerHeight=\"8\" orient=\"auto\"><path d=\"M 0 0 L 10 5 L 0 10 z\" class=\"arrowMarkerPath\" style=\"stroke-width: 1; stroke-dasharray: 1, 0;\"></path></marker><marker id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-pointStart\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refX=\"4.5\" refY=\"5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"8\" markerHeight=\"8\" orient=\"auto\"><path d=\"M 0 5 L 10 10 L 10 0 z\" class=\"arrowMarkerPath\" style=\"stroke-width: 1; stroke-dasharray: 1, 0;\"></path></marker><marker id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-pointEnd-margin\" class=\"marker flowchart-v2\" viewBox=\"0 0 11.5 14\" refX=\"11.5\" refY=\"7\" markerUnits=\"userSpaceOnUse\" markerWidth=\"10.5\" markerHeight=\"14\" orient=\"auto\"><path d=\"M 0 0 L 11.5 7 L 0 14 z\" class=\"arrowMarkerPath\" style=\"stroke-width: 0; stroke-dasharray: 1, 0;\"></path></marker><marker id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-pointStart-margin\" class=\"marker flowchart-v2\" viewBox=\"0 0 11.5 14\" refX=\"1\" refY=\"7\" markerUnits=\"userSpaceOnUse\" markerWidth=\"11.5\" markerHeight=\"14\" orient=\"auto\"><polygon points=\"0,7 11.5,14 11.5,0\" class=\"arrowMarkerPath\" style=\"stroke-width: 0; stroke-dasharray: 1, 0;\"></polygon></marker><marker id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-circleEnd\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refX=\"11\" refY=\"5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"11\" markerHeight=\"11\" orient=\"auto\"><circle cx=\"5\" cy=\"5\" r=\"5\" class=\"arrowMarkerPath\" style=\"stroke-width: 1; stroke-dasharray: 1, 0;\"></circle></marker><marker id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-circleStart\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refX=\"-1\" refY=\"5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"11\" markerHeight=\"11\" orient=\"auto\"><circle cx=\"5\" cy=\"5\" r=\"5\" class=\"arrowMarkerPath\" style=\"stroke-width: 1; stroke-dasharray: 1, 0;\"></circle></marker><marker id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-circleEnd-margin\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refY=\"5\" refX=\"12.25\" markerUnits=\"userSpaceOnUse\" markerWidth=\"14\" markerHeight=\"14\" orient=\"auto\"><circle cx=\"5\" cy=\"5\" r=\"5\" class=\"arrowMarkerPath\" style=\"stroke-width: 0; stroke-dasharray: 1, 0;\"></circle></marker><marker id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-circleStart-margin\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refX=\"-2\" refY=\"5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"14\" markerHeight=\"14\" orient=\"auto\"><circle cx=\"5\" cy=\"5\" r=\"5\" class=\"arrowMarkerPath\" style=\"stroke-width: 0; stroke-dasharray: 1, 0;\"></circle></marker><marker id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-crossEnd\" class=\"marker cross flowchart-v2\" viewBox=\"0 0 11 11\" refX=\"12\" refY=\"5.2\" markerUnits=\"userSpaceOnUse\" markerWidth=\"11\" markerHeight=\"11\" orient=\"auto\"><path d=\"M 1,1 l 9,9 M 10,1 l -9,9\" class=\"arrowMarkerPath\" style=\"stroke-width: 2; stroke-dasharray: 1, 0;\"></path></marker><marker id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-crossStart\" class=\"marker cross flowchart-v2\" viewBox=\"0 0 11 11\" refX=\"-1\" refY=\"5.2\" markerUnits=\"userSpaceOnUse\" markerWidth=\"11\" markerHeight=\"11\" orient=\"auto\"><path d=\"M 1,1 l 9,9 M 10,1 l -9,9\" class=\"arrowMarkerPath\" style=\"stroke-width: 2; stroke-dasharray: 1, 0;\"></path></marker><marker id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-crossEnd-margin\" class=\"marker cross flowchart-v2\" viewBox=\"0 0 15 15\" refX=\"17.7\" refY=\"7.5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"12\" markerHeight=\"12\" orient=\"auto\"><path d=\"M 1,1 L 14,14 M 1,14 L 14,1\" class=\"arrowMarkerPath\" style=\"stroke-width: 2.5;\"></path></marker><marker id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-crossStart-margin\" class=\"marker cross flowchart-v2\" viewBox=\"0 0 15 15\" refX=\"-3.5\" refY=\"7.5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"12\" markerHeight=\"12\" orient=\"auto\"><path d=\"M 1,1 L 14,14 M 1,14 L 14,1\" class=\"arrowMarkerPath\" style=\"stroke-width: 2.5; stroke-dasharray: 1, 0;\"></path></marker><g class=\"root\"><g class=\"clusters\"></g><g class=\"edgePaths\"><path d=\"M205.813,64L209.979,64C214.146,64,222.479,64,230.146,64C237.813,64,244.813,64,248.313,64L251.813,64\" id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05-L_A_B_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_A_B_0\" data-points=\"W3sieCI6MjA1LjgxMjUsInkiOjY0fSx7IngiOjIzMC44MTI1LCJ5Ijo2NH0seyJ4IjoyNTUuODEyNSwieSI6NjR9XQ==\" data-look=\"classic\" marker-end=\"url(#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-pointEnd)\"></path><path d=\"M495.188,39.227L510.669,36.022C526.151,32.818,557.115,26.409,587.431,26.88C617.747,27.351,647.417,34.702,662.251,38.377L677.086,42.052\" id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05-L_B_C_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_B_C_0\" data-points=\"W3sieCI6NDk1LjE4NzUsInkiOjM5LjIyNjc1NDg2OTUzMzI2fSx7IngiOjU4OC4wNzgxMjUsInkiOjIwfSx7IngiOjY4MC45Njg3NSwieSI6NDMuMDE0MjUzMDM1MzY4NjR9XQ==\" data-look=\"classic\" marker-end=\"url(#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-pointEnd)\"></path><path d=\"M680.969,90.709L665.487,95.591C650.005,100.473,619.042,110.236,588.723,111.21C558.404,112.183,528.73,104.366,513.893,100.457L499.056,96.549\" id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05-L_C_B_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_C_B_0\" data-points=\"W3sieCI6NjgwLjk2ODc1LCJ5Ijo5MC43MDkxMzI1MDA0Mzk5fSx7IngiOjU4OC4wNzgxMjUsInkiOjEyMH0seyJ4Ijo0OTUuMTg3NSwieSI6OTUuNTI5NTg0NzExNTAzMTJ9XQ==\" data-look=\"classic\" marker-end=\"url(#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-pointEnd)\"></path><path d=\"M495.188,64L510.669,64C526.151,64,557.115,64,587.411,64C617.708,64,647.339,64,662.154,64L676.969,64\" id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05-L_B_C_2\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_B_C_2\" data-points=\"W3sieCI6NDk1LjE4NzUsInkiOjY0fSx7IngiOjU4OC4wNzgxMjUsInkiOjY0fSx7IngiOjY4MC45Njg3NSwieSI6NjR9XQ==\" data-look=\"classic\" marker-end=\"url(#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-pointEnd)\"></path><path d=\"M850.375,56.139L864.991,54.782C879.607,53.426,908.839,50.713,937.406,50.406C965.973,50.099,993.875,52.199,1007.826,53.249L1021.777,54.298\" id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05-L_C_D_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_C_D_0\" data-points=\"W3sieCI6ODUwLjM3NSwieSI6NTYuMTM4ODQ5ODY2MzE2MjJ9LHsieCI6OTM4LjA3MDMxMjUsInkiOjQ4fSx7IngiOjEwMjUuNzY1NjI1LCJ5Ijo1NC41OTg1NzQ0NzI3NzUzN31d\" data-look=\"classic\" marker-end=\"url(#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-pointEnd)\"></path><path d=\"M1025.766,73.401L1011.15,74.501C996.534,75.601,967.302,77.8,938.734,77.605C910.166,77.41,882.262,74.821,868.31,73.526L854.358,72.231\" id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05-L_D_C_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_D_C_0\" data-points=\"W3sieCI6MTAyNS43NjU2MjUsInkiOjczLjQwMTQyNTUyNzIyNDYzfSx7IngiOjkzOC4wNzAzMTI1LCJ5Ijo4MH0seyJ4Ijo4NTAuMzc1LCJ5Ijo3MS44NjExNTAxMzM2ODM3OH1d\" data-look=\"classic\" marker-end=\"url(#diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05_flowchart-v2-pointEnd)\"></path></g><g class=\"edgeLabels\"><g class=\"edgeLabel\"><g class=\"label\" data-id=\"L_A_B_0\" transform=\"translate(0, 0)\"><foreignObject width=\"0\" height=\"0\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"></span></div></foreignObject></g></g><g class=\"edgeLabel\" transform=\"translate(588.48559, 20.10095)\"><g class=\"label\" data-id=\"L_B_C_0\" transform=\"translate(-48.03125, -12)\"><foreignObject width=\"96.0625\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"><p>Create a chat</p></span></div></foreignObject></g></g><g class=\"edgeLabel\" transform=\"translate(588.71691, 119.79857)\"><g class=\"label\" data-id=\"L_C_B_0\" transform=\"translate(-67.890625, -24)\"><foreignObject width=\"135.78125\" height=\"48\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"><p>Chat Access Token<br>+ endpoint URLs</p></span></div></foreignObject></g></g><g class=\"edgeLabel\" transform=\"translate(588.078125, 64)\"><g class=\"label\" data-id=\"L_B_C_2\" transform=\"translate(-60.9140625, -12)\"><foreignObject width=\"121.828125\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"><p>Run a turn (SSE)</p></span></div></foreignObject></g></g><g class=\"edgeLabel\"><g class=\"label\" data-id=\"L_C_D_0\" transform=\"translate(0, 0)\"><foreignObject width=\"0\" height=\"0\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"></span></div></foreignObject></g></g><g class=\"edgeLabel\" transform=\"translate(938.00611, 79.99404)\"><g class=\"label\" data-id=\"L_D_C_0\" transform=\"translate(-62.6953125, -12)\"><foreignObject width=\"125.390625\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"><p>Streamed answer</p></span></div></foreignObject></g></g></g><g class=\"nodes\"><g class=\"node default\" id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05-flowchart-A-0\" data-look=\"classic\" transform=\"translate(106.90625, 64)\"><rect class=\"basic label-container\" style=\"\" x=\"-98.90625\" y=\"-39\" width=\"197.8125\" height=\"78\"></rect><g class=\"label\" style=\"\" transform=\"translate(-68.90625, -24)\"><rect></rect><foreignObject width=\"137.8125\" height=\"48\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>End user<br>(browser or mobile)</p></span></div></foreignObject></g></g><g class=\"node default\" id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05-flowchart-B-1\" data-look=\"classic\" transform=\"translate(375.5, 64)\"><rect class=\"basic label-container\" style=\"\" x=\"-119.6875\" y=\"-39\" width=\"239.375\" height=\"78\"></rect><g class=\"label\" style=\"\" transform=\"translate(-89.6875, -24)\"><rect></rect><foreignObject width=\"179.375\" height=\"48\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>Your server<br>holds the Gateway Token</p></span></div></foreignObject></g></g><g class=\"node default\" id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05-flowchart-C-3\" data-look=\"classic\" transform=\"translate(765.671875, 64)\"><rect class=\"basic label-container\" style=\"\" x=\"-84.703125\" y=\"-27\" width=\"169.40625\" height=\"54\"></rect><g class=\"label\" style=\"\" transform=\"translate(-54.703125, -12)\"><rect></rect><foreignObject width=\"109.40625\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>Agent Gateway</p></span></div></foreignObject></g></g><g class=\"node default\" id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05-flowchart-D-9\" data-look=\"classic\" transform=\"translate(1150.7109375, 64)\"><rect class=\"basic label-container\" style=\"\" x=\"-124.9453125\" y=\"-39\" width=\"249.890625\" height=\"78\"></rect><g class=\"label\" style=\"\" transform=\"translate(-94.9453125, -24)\"><rect></rect><foreignObject width=\"189.890625\" height=\"48\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>Treasure AI Studio<br>agent + shared work folder</p></span></div></foreignObject></g></g></g></g></g><defs><filter id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05-drop-shadow\" height=\"130%\" width=\"130%\"><feDropShadow dx=\"4\" dy=\"4\" stdDeviation=\"0\" flood-opacity=\"0.06\" flood-color=\"#000000\"></feDropShadow></filter></defs><defs><filter id=\"diagram-1d9d34c7427162c28fc6bfc7ee19c30a8782860ac2413c6f2e55d84e7041cb05-drop-shadow-small\" height=\"150%\" width=\"150%\"><feDropShadow dx=\"2\" dy=\"2\" stdDeviation=\"0\" flood-opacity=\"0.06\" flood-color=\"#000000\"></feDropShadow></filter></defs></svg>","diagramHtmlDark":"<svg id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd\" width=\"100%\" xmlns=\"http://www.w3.org/2000/svg\" class=\"flowchart\" style=\"max-width: 1283.65625px;\" viewBox=\"0 0.10095024108886719 1283.65625 151.69761657714844\" role=\"graphics-document document\" aria-roledescription=\"flowchart-v2\"><style>\n    #diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd foreignObject {\n      overflow: visible;\n    }\n  </style><style>#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd{font-family:\"Redocly Mermaid Sans\",Arial,\"Liberation Sans\",Arimo,Helvetica,\"Redocly Mermaid CJK\",sans-serif;font-size:16px;fill:#ccc;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .error-icon{fill:#a44141;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .error-text{fill:#ddd;stroke:#ddd;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .edge-thickness-normal{stroke-width:1px;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .edge-thickness-thick{stroke-width:3.5px;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .edge-pattern-solid{stroke-dasharray:0;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .edge-thickness-invisible{stroke-width:0;fill:none;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .edge-pattern-dashed{stroke-dasharray:3;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .edge-pattern-dotted{stroke-dasharray:2;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .marker{fill:lightgrey;stroke:lightgrey;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .marker.cross{stroke:lightgrey;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd svg{font-family:\"Redocly Mermaid Sans\",Arial,\"Liberation Sans\",Arimo,Helvetica,\"Redocly Mermaid CJK\",sans-serif;font-size:16px;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd p{margin:0;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .label{font-family:\"Redocly Mermaid Sans\",Arial,\"Liberation Sans\",Arimo,Helvetica,\"Redocly Mermaid CJK\",sans-serif;color:#ccc;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .cluster-label text{fill:#F9FFFE;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .cluster-label span{color:#F9FFFE;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .cluster-label span p{background-color:transparent;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .label text,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd span{fill:#ccc;color:#ccc;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .node rect,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .node circle,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .node ellipse,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .node polygon,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .node path{fill:#1f2020;stroke:#ccc;stroke-width:1px;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .rough-node .label text,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .node .label text,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .image-shape .label,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .icon-shape .label{text-anchor:middle;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .rough-node .label,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .node .label,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .image-shape .label,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .icon-shape .label{text-align:center;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .node.clickable{cursor:pointer;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .root .anchor path{fill:lightgrey!important;stroke-width:0;stroke:lightgrey;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .arrowheadPath{fill:lightgrey;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .edgePath .path{stroke:lightgrey;stroke-width:1px;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .flowchart-link{stroke:lightgrey;fill:none;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .edgeLabel{background-color:hsl(0, 0%, 34.4117647059%);text-align:center;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .edgeLabel p{background-color:hsl(0, 0%, 34.4117647059%);}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .edgeLabel rect{opacity:0.5;background-color:hsl(0, 0%, 34.4117647059%);fill:hsl(0, 0%, 34.4117647059%);}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .labelBkg{background-color:rgba(87.75, 87.75, 87.75, 0.5);}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .cluster rect{fill:hsl(180, 1.5873015873%, 28.3529411765%);stroke:rgba(255, 255, 255, 0.25);stroke-width:1px;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .cluster text{fill:#F9FFFE;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .cluster span{color:#F9FFFE;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\"Redocly Mermaid Sans\",Arial,\"Liberation Sans\",Arimo,Helvetica,\"Redocly Mermaid CJK\",sans-serif;font-size:12px;background:hsl(20, 1.5873015873%, 12.3529411765%);border:1px solid rgba(255, 255, 255, 0.25);border-radius:2px;pointer-events:none;z-index:100;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#ccc;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd rect.text{fill:none;stroke-width:0;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .icon-shape,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .image-shape{background-color:hsl(0, 0%, 34.4117647059%);text-align:center;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .icon-shape p,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .image-shape p{background-color:hsl(0, 0%, 34.4117647059%);padding:2px;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .icon-shape .label rect,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .image-shape .label rect{opacity:0.5;background-color:hsl(0, 0%, 34.4117647059%);fill:hsl(0, 0%, 34.4117647059%);}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd .node .neo-node{stroke:#ccc;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd [data-look=\"neo\"].node rect,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd [data-look=\"neo\"].cluster rect,#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd [data-look=\"neo\"].node polygon{stroke:url(#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd [data-look=\"neo\"].swimlane.cluster rect{filter:none;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd [data-look=\"neo\"].node path{stroke:url(#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-gradient);stroke-width:1px;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd [data-look=\"neo\"].node .outer-path{filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd [data-look=\"neo\"].node .neo-line path{stroke:#ccc;filter:none;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd [data-look=\"neo\"].node circle{stroke:url(#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd [data-look=\"neo\"].node circle .state-start{fill:#000000;}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd [data-look=\"neo\"].icon-shape .icon{fill:url(#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd [data-look=\"neo\"].icon-shape .icon-neo path{stroke:url(#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd :root{--mermaid-font-family:\"Redocly Mermaid Sans\",Arial,\"Liberation Sans\",Arimo,Helvetica,\"Redocly Mermaid CJK\",sans-serif;}</style><g><marker id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-pointEnd\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refX=\"5\" refY=\"5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"8\" markerHeight=\"8\" orient=\"auto\"><path d=\"M 0 0 L 10 5 L 0 10 z\" class=\"arrowMarkerPath\" style=\"stroke-width: 1; stroke-dasharray: 1, 0;\"></path></marker><marker id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-pointStart\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refX=\"4.5\" refY=\"5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"8\" markerHeight=\"8\" orient=\"auto\"><path d=\"M 0 5 L 10 10 L 10 0 z\" class=\"arrowMarkerPath\" style=\"stroke-width: 1; stroke-dasharray: 1, 0;\"></path></marker><marker id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-pointEnd-margin\" class=\"marker flowchart-v2\" viewBox=\"0 0 11.5 14\" refX=\"11.5\" refY=\"7\" markerUnits=\"userSpaceOnUse\" markerWidth=\"10.5\" markerHeight=\"14\" orient=\"auto\"><path d=\"M 0 0 L 11.5 7 L 0 14 z\" class=\"arrowMarkerPath\" style=\"stroke-width: 0; stroke-dasharray: 1, 0;\"></path></marker><marker id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-pointStart-margin\" class=\"marker flowchart-v2\" viewBox=\"0 0 11.5 14\" refX=\"1\" refY=\"7\" markerUnits=\"userSpaceOnUse\" markerWidth=\"11.5\" markerHeight=\"14\" orient=\"auto\"><polygon points=\"0,7 11.5,14 11.5,0\" class=\"arrowMarkerPath\" style=\"stroke-width: 0; stroke-dasharray: 1, 0;\"></polygon></marker><marker id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-circleEnd\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refX=\"11\" refY=\"5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"11\" markerHeight=\"11\" orient=\"auto\"><circle cx=\"5\" cy=\"5\" r=\"5\" class=\"arrowMarkerPath\" style=\"stroke-width: 1; stroke-dasharray: 1, 0;\"></circle></marker><marker id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-circleStart\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refX=\"-1\" refY=\"5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"11\" markerHeight=\"11\" orient=\"auto\"><circle cx=\"5\" cy=\"5\" r=\"5\" class=\"arrowMarkerPath\" style=\"stroke-width: 1; stroke-dasharray: 1, 0;\"></circle></marker><marker id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-circleEnd-margin\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refY=\"5\" refX=\"12.25\" markerUnits=\"userSpaceOnUse\" markerWidth=\"14\" markerHeight=\"14\" orient=\"auto\"><circle cx=\"5\" cy=\"5\" r=\"5\" class=\"arrowMarkerPath\" style=\"stroke-width: 0; stroke-dasharray: 1, 0;\"></circle></marker><marker id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-circleStart-margin\" class=\"marker flowchart-v2\" viewBox=\"0 0 10 10\" refX=\"-2\" refY=\"5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"14\" markerHeight=\"14\" orient=\"auto\"><circle cx=\"5\" cy=\"5\" r=\"5\" class=\"arrowMarkerPath\" style=\"stroke-width: 0; stroke-dasharray: 1, 0;\"></circle></marker><marker id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-crossEnd\" class=\"marker cross flowchart-v2\" viewBox=\"0 0 11 11\" refX=\"12\" refY=\"5.2\" markerUnits=\"userSpaceOnUse\" markerWidth=\"11\" markerHeight=\"11\" orient=\"auto\"><path d=\"M 1,1 l 9,9 M 10,1 l -9,9\" class=\"arrowMarkerPath\" style=\"stroke-width: 2; stroke-dasharray: 1, 0;\"></path></marker><marker id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-crossStart\" class=\"marker cross flowchart-v2\" viewBox=\"0 0 11 11\" refX=\"-1\" refY=\"5.2\" markerUnits=\"userSpaceOnUse\" markerWidth=\"11\" markerHeight=\"11\" orient=\"auto\"><path d=\"M 1,1 l 9,9 M 10,1 l -9,9\" class=\"arrowMarkerPath\" style=\"stroke-width: 2; stroke-dasharray: 1, 0;\"></path></marker><marker id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-crossEnd-margin\" class=\"marker cross flowchart-v2\" viewBox=\"0 0 15 15\" refX=\"17.7\" refY=\"7.5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"12\" markerHeight=\"12\" orient=\"auto\"><path d=\"M 1,1 L 14,14 M 1,14 L 14,1\" class=\"arrowMarkerPath\" style=\"stroke-width: 2.5;\"></path></marker><marker id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-crossStart-margin\" class=\"marker cross flowchart-v2\" viewBox=\"0 0 15 15\" refX=\"-3.5\" refY=\"7.5\" markerUnits=\"userSpaceOnUse\" markerWidth=\"12\" markerHeight=\"12\" orient=\"auto\"><path d=\"M 1,1 L 14,14 M 1,14 L 14,1\" class=\"arrowMarkerPath\" style=\"stroke-width: 2.5; stroke-dasharray: 1, 0;\"></path></marker><g class=\"root\"><g class=\"clusters\"></g><g class=\"edgePaths\"><path d=\"M205.813,64L209.979,64C214.146,64,222.479,64,230.146,64C237.813,64,244.813,64,248.313,64L251.813,64\" id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-L_A_B_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_A_B_0\" data-points=\"W3sieCI6MjA1LjgxMjUsInkiOjY0fSx7IngiOjIzMC44MTI1LCJ5Ijo2NH0seyJ4IjoyNTUuODEyNSwieSI6NjR9XQ==\" data-look=\"classic\" marker-end=\"url(#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-pointEnd)\"></path><path d=\"M495.188,39.227L510.669,36.022C526.151,32.818,557.115,26.409,587.431,26.88C617.747,27.351,647.417,34.702,662.251,38.377L677.086,42.052\" id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-L_B_C_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_B_C_0\" data-points=\"W3sieCI6NDk1LjE4NzUsInkiOjM5LjIyNjc1NDg2OTUzMzI2fSx7IngiOjU4OC4wNzgxMjUsInkiOjIwfSx7IngiOjY4MC45Njg3NSwieSI6NDMuMDE0MjUzMDM1MzY4NjR9XQ==\" data-look=\"classic\" marker-end=\"url(#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-pointEnd)\"></path><path d=\"M680.969,90.709L665.487,95.591C650.005,100.473,619.042,110.236,588.723,111.21C558.404,112.183,528.73,104.366,513.893,100.457L499.056,96.549\" id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-L_C_B_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_C_B_0\" data-points=\"W3sieCI6NjgwLjk2ODc1LCJ5Ijo5MC43MDkxMzI1MDA0Mzk5fSx7IngiOjU4OC4wNzgxMjUsInkiOjEyMH0seyJ4Ijo0OTUuMTg3NSwieSI6OTUuNTI5NTg0NzExNTAzMTJ9XQ==\" data-look=\"classic\" marker-end=\"url(#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-pointEnd)\"></path><path d=\"M495.188,64L510.669,64C526.151,64,557.115,64,587.411,64C617.708,64,647.339,64,662.154,64L676.969,64\" id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-L_B_C_2\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_B_C_2\" data-points=\"W3sieCI6NDk1LjE4NzUsInkiOjY0fSx7IngiOjU4OC4wNzgxMjUsInkiOjY0fSx7IngiOjY4MC45Njg3NSwieSI6NjR9XQ==\" data-look=\"classic\" marker-end=\"url(#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-pointEnd)\"></path><path d=\"M850.375,56.139L864.991,54.782C879.607,53.426,908.839,50.713,937.406,50.406C965.973,50.099,993.875,52.199,1007.826,53.249L1021.777,54.298\" id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-L_C_D_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_C_D_0\" data-points=\"W3sieCI6ODUwLjM3NSwieSI6NTYuMTM4ODQ5ODY2MzE2MjJ9LHsieCI6OTM4LjA3MDMxMjUsInkiOjQ4fSx7IngiOjEwMjUuNzY1NjI1LCJ5Ijo1NC41OTg1NzQ0NzI3NzUzN31d\" data-look=\"classic\" marker-end=\"url(#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-pointEnd)\"></path><path d=\"M1025.766,73.401L1011.15,74.501C996.534,75.601,967.302,77.8,938.734,77.605C910.166,77.41,882.262,74.821,868.31,73.526L854.358,72.231\" id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-L_D_C_0\" class=\"edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link\" style=\";\" data-edge=\"true\" data-et=\"edge\" data-id=\"L_D_C_0\" data-points=\"W3sieCI6MTAyNS43NjU2MjUsInkiOjczLjQwMTQyNTUyNzIyNDYzfSx7IngiOjkzOC4wNzAzMTI1LCJ5Ijo4MH0seyJ4Ijo4NTAuMzc1LCJ5Ijo3MS44NjExNTAxMzM2ODM3OH1d\" data-look=\"classic\" marker-end=\"url(#diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd_flowchart-v2-pointEnd)\"></path></g><g class=\"edgeLabels\"><g class=\"edgeLabel\"><g class=\"label\" data-id=\"L_A_B_0\" transform=\"translate(0, 0)\"><foreignObject width=\"0\" height=\"0\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"></span></div></foreignObject></g></g><g class=\"edgeLabel\" transform=\"translate(588.48559, 20.10095)\"><g class=\"label\" data-id=\"L_B_C_0\" transform=\"translate(-48.03125, -12)\"><foreignObject width=\"96.0625\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"><p>Create a chat</p></span></div></foreignObject></g></g><g class=\"edgeLabel\" transform=\"translate(588.71691, 119.79857)\"><g class=\"label\" data-id=\"L_C_B_0\" transform=\"translate(-67.890625, -24)\"><foreignObject width=\"135.78125\" height=\"48\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"><p>Chat Access Token<br>+ endpoint URLs</p></span></div></foreignObject></g></g><g class=\"edgeLabel\" transform=\"translate(588.078125, 64)\"><g class=\"label\" data-id=\"L_B_C_2\" transform=\"translate(-60.9140625, -12)\"><foreignObject width=\"121.828125\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"><p>Run a turn (SSE)</p></span></div></foreignObject></g></g><g class=\"edgeLabel\"><g class=\"label\" data-id=\"L_C_D_0\" transform=\"translate(0, 0)\"><foreignObject width=\"0\" height=\"0\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"></span></div></foreignObject></g></g><g class=\"edgeLabel\" transform=\"translate(938.00611, 79.99404)\"><g class=\"label\" data-id=\"L_D_C_0\" transform=\"translate(-62.6953125, -12)\"><foreignObject width=\"125.390625\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"labelBkg\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"edgeLabel\"><p>Streamed answer</p></span></div></foreignObject></g></g></g><g class=\"nodes\"><g class=\"node default\" id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-flowchart-A-0\" data-look=\"classic\" transform=\"translate(106.90625, 64)\"><rect class=\"basic label-container\" style=\"\" x=\"-98.90625\" y=\"-39\" width=\"197.8125\" height=\"78\"></rect><g class=\"label\" style=\"\" transform=\"translate(-68.90625, -24)\"><rect></rect><foreignObject width=\"137.8125\" height=\"48\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>End user<br>(browser or mobile)</p></span></div></foreignObject></g></g><g class=\"node default\" id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-flowchart-B-1\" data-look=\"classic\" transform=\"translate(375.5, 64)\"><rect class=\"basic label-container\" style=\"\" x=\"-119.6875\" y=\"-39\" width=\"239.375\" height=\"78\"></rect><g class=\"label\" style=\"\" transform=\"translate(-89.6875, -24)\"><rect></rect><foreignObject width=\"179.375\" height=\"48\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>Your server<br>holds the Gateway Token</p></span></div></foreignObject></g></g><g class=\"node default\" id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-flowchart-C-3\" data-look=\"classic\" transform=\"translate(765.671875, 64)\"><rect class=\"basic label-container\" style=\"\" x=\"-84.703125\" y=\"-27\" width=\"169.40625\" height=\"54\"></rect><g class=\"label\" style=\"\" transform=\"translate(-54.703125, -12)\"><rect></rect><foreignObject width=\"109.40625\" height=\"24\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>Agent Gateway</p></span></div></foreignObject></g></g><g class=\"node default\" id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-flowchart-D-9\" data-look=\"classic\" transform=\"translate(1150.7109375, 64)\"><rect class=\"basic label-container\" style=\"\" x=\"-124.9453125\" y=\"-39\" width=\"249.890625\" height=\"78\"></rect><g class=\"label\" style=\"\" transform=\"translate(-94.9453125, -24)\"><rect></rect><foreignObject width=\"189.890625\" height=\"48\"><div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"display: table-cell; white-space: nowrap; line-height: 1.5; max-width: 200px; text-align: center;\"><span class=\"nodeLabel\"><p>Treasure AI Studio<br>agent + shared work folder</p></span></div></foreignObject></g></g></g></g></g><defs><filter id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-drop-shadow\" height=\"130%\" width=\"130%\"><feDropShadow dx=\"4\" dy=\"4\" stdDeviation=\"0\" flood-opacity=\"0.06\" flood-color=\"#FFFFFF\"></feDropShadow></filter></defs><defs><filter id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-drop-shadow-small\" height=\"150%\" width=\"150%\"><feDropShadow dx=\"2\" dy=\"2\" stdDeviation=\"0\" flood-opacity=\"0.06\" flood-color=\"#FFFFFF\"></feDropShadow></filter></defs><linearGradient id=\"diagram-710a24559f70e5df9365ca76569608f6f02db19258c66a78d97266e463279bfd-gradient\" gradientUnits=\"objectBoundingBox\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"><stop offset=\"0%\" stop-color=\"#cccccc\" stop-opacity=\"1\"></stop><stop offset=\"100%\" stop-color=\"hsl(180, 0%, 18.3529411765%)\" stop-opacity=\"1\"></stop></linearGradient></svg>"},"children":["flowchart LR\n    A[\"End user<br/>(browser or mobile)\"] --> B[\"Your server<br/>holds the Gateway Token\"]\n    B -->|\"Create a chat\"| C[\"Agent Gateway\"]\n    C -->|\"Chat Access Token<br/>+ endpoint URLs\"| B\n    B -->|\"Run a turn (SSE)\"| C\n    C --> D[\"Treasure AI Studio<br/>agent + shared work folder\"]\n    D -->|\"Streamed answer\"| C\n"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Four things happen, in this order:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Your server creates a chat"]}," by calling the Agent Gateway with its ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Gateway Token"]},", the channel's long-lived connection secret."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["The gateway answers with a Chat Access Token and a set of endpoint URLs."]}," That token is scoped to that one chat and nothing else."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Turns run against those endpoints"]},", streamed as server-sent events. Your server can proxy them, or your client can call the gateway directly."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["The agent works inside the channel's shared work folder"]},", reading it as the executor, and its answer streams back the same way."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The two credentials exist because the second one can safely reach a browser and the first one cannot. ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/agent-channels/tokens"},"children":["Gateway Tokens and Chat Access Tokens"]}," explains what each one permits and how long it lives."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-an-sdk-app-fixes-at-creation-time","__idx":3},"children":["What an SDK App Fixes at Creation Time"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The choices that decide how much a channel exposes are made once, when it is created, by someone who already holds the permission to make them:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"28%","data-label":"What Is Fixed"},"children":["What Is Fixed "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"72%","data-label":"Meaning"},"children":["Meaning "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Shared work folder"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The single folder the channel's chats can read. Chosen from folders the creator manages, and it cannot be changed afterward — a different folder means a different SDK App"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Executor"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Treasure AI Studio user the chats run as. Always the creator at first; another manager of the same folder can take over later. Permissions, connections, credits, and audit trail all follow the executor — ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["never the end user who triggered the chat"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Browser access"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Whether the gateway accepts calls that carry an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Origin"]}," header. Off by default, which means only your server can drive a chat"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Chat Access Token lifetimes"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["How long a per-chat credential survives idle, and its absolute ceiling. Defaults are 24 hours and 30 days"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Because these are fixed on the channel, an end user of your application has no way to reach a second folder, borrow someone else's permissions, or extend their own access. What they can do is send a prompt and stop a running answer — ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/agent-channels/channel-chats"},"children":["What an Agent Channel Chat Can Reach"]}," sets out the full boundary, including the parts that are ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["not"]}," restricted."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"where-agent-channels-live","__idx":4},"children":["Where Agent Channels Live"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Agent Channels have their own section in Treasure AI Studio's settings, on Web and Desktop. Open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Settings → Agent Channels"]}," to see the account's channels."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every member of the account can see that a channel exists, along with its name and status. The folder it reaches, its executor, its connection settings, and its tokens are shown only to the people who manage that folder, the executor, and account administrators — for everyone else those cells are masked. ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/agent-channels/sdk-apps"},"children":["Creating and Managing an SDK App"]}," covers the page in detail."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"who-does-what","__idx":5},"children":["Who Does What"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Setting up a channel involves up to three roles, and one person often fills more than one:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"26%","data-label":"Role"},"children":["Role "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"74%","data-label":"Responsibility"},"children":["Responsibility "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Folder manager"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Creates the SDK App, picks the folder, issues and revokes connection secrets, and deletes the channel. Opening a folder to an outside application is their decision, so the irreversible actions stay with them"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Executor"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Consents to chats running under their permissions and cost. Becomes executor by claiming the role, and can step down at any time, which stops the channel but leaves it and its tokens intact"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Account administrator"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Sees every channel in the account, can switch one off or back on, and sets who may create channels. Being an administrator alone does not let them create, edit, delete, or revoke — administrator actions on a channel are all reversible by design"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Whether a folder manager can create a channel at all depends on the account's creation policy: by default any folder manager can, and an account administrator can limit creation to administrators. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/agent-channels/sdk-apps#choose-who-can-create-agent-channels"},"children":["Choose Who Can Create Agent Channels"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-a-channel-covers","__idx":6},"children":["What a Channel Covers"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"34%","data-label":"Aspect"},"children":["Aspect "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"66%","data-label":"Detail"},"children":["Detail "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Kinds of channel"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["One: the SDK App. One shared work folder per channel, running as a fixed executor"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Protocol"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Vercel AI SDK UI Message Stream — the one protocol the Agent Gateway publishes for chat clients"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Per-channel tool and credential restrictions"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["None. A channel's chats run with the executor's full set of tools, connections, and credentials — see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/agent-channels/channel-chats#what-is-not-restricted"},"children":["What an Agent Channel Chat Can Reach"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"frequently-asked-questions","__idx":7},"children":["Frequently Asked Questions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Do my application's users need Treasure AI Studio accounts?"]}," ","No. An Agent Channel exists so that people without a Treasure AI Studio account can use an agent through your application. Identifying your own users, and deciding which of them may start a chat, is your application's job."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Whose credits do these chats consume?"]}," ","The executor's. Every chat created through a channel is attributed to the executor for permissions, connections, quota, and cost, regardless of which end user triggered it. Budget for a channel as you would for one heavy user."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Can two applications share one SDK App?"]}," ","They can share a Gateway Token, but it is usually not what you want. A channel is the unit you disable, delete, and audit, so two applications sharing one lose the ability to stop one without stopping the other. Create one SDK App per application and give each its own token."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Can an Agent Channel write to the shared work folder?"]}," ","No. The channel's chats can read the folder but never write to it, and the scratch space each chat writes to is discarded when the chat ends. Anything the agent produces has to leave through the conversation."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Can I see these chats in Treasure AI Studio?"]}," ","The executor sees them in their own chat list, labelled ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SDK App"]}," with a key on the chat icon, which distinguishes them from chats started in the app."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":8},"children":["Next Steps"]},{"$$mdtype":"Tag","name":"Cards","attributes":{"columns":3,"cardMinWidth":240},"children":[{"$$mdtype":"Tag","name":"Card","attributes":{"title":"Creating and Managing an SDK App","imagePosition":"start","iconPosition":"auto","layout":"vertical","align":"start","variant":"filled","to":"/products/ai-studio/agent-channels/sdk-apps"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a channel, issue its first token, and run it: statuses, executor handover, and shutdown."]}]},{"$$mdtype":"Tag","name":"Card","attributes":{"title":"Gateway Tokens and Chat Access Tokens","imagePosition":"start","iconPosition":"auto","layout":"vertical","align":"start","variant":"filled","to":"/products/ai-studio/agent-channels/tokens"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The two credentials, what each one permits, how long they last, and how to rotate and revoke them."]}]},{"$$mdtype":"Tag","name":"Card","attributes":{"title":"Building a Chat App with the Vercel AI SDK","imagePosition":"start","iconPosition":"auto","layout":"vertical","align":"start","variant":"filled","to":"/products/ai-studio/agent-channels/building-an-app"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create chats from your server, stream turns with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["useChat"]},", and handle the one tool you must implement."]}]},{"$$mdtype":"Tag","name":"Card","attributes":{"title":"What an Agent Channel Chat Can Reach","imagePosition":"start","iconPosition":"auto","layout":"vertical","align":"start","variant":"filled","to":"/products/ai-studio/agent-channels/channel-chats"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The workspace, the credentials, and the limits that apply to a chat arriving through a channel."]}]}]}]},"headings":[{"value":"Agent Channels","id":"agent-channels","depth":1},{"value":"What an Agent Channel Is","id":"what-an-agent-channel-is","depth":2},{"value":"How a Request Reaches an Agent","id":"how-a-request-reaches-an-agent","depth":2},{"value":"What an SDK App Fixes at Creation Time","id":"what-an-sdk-app-fixes-at-creation-time","depth":2},{"value":"Where Agent Channels Live","id":"where-agent-channels-live","depth":2},{"value":"Who Does What","id":"who-does-what","depth":2},{"value":"What a Channel Covers","id":"what-a-channel-covers","depth":2},{"value":"Frequently Asked Questions","id":"frequently-asked-questions","depth":2},{"value":"Next Steps","id":"next-steps","depth":2}],"frontmatter":{"seo":{"title":"Agent Channels in Treasure AI Studio","description":"Agent Channels let your own application run Treasure AI Studio chats through the Agent Gateway, anchored to one shared work folder and one executor."},"platforms":["Web","Desktop"]},"lastModified":"2026-10-21T13:29:05.739Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/ai-studio/agent-channels","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}