1"use strict";(self.webpackChunkmastra_docs=self.webpackChunkmastra_docs||[]).push([["19884"],{35173(e,n,t){t.r(n),t.d(n,{metadata:()=>o,default:()=>m,frontMatter:()=>i,contentTitle:()=>r,toc:()=>l,assets:()=>c});var o=JSON.parse('{"id":"providers/tencent-token-plan","title":"Tencent Token Plan Models: IDs, Pricing & Usage","description":"Browse Tencent Token Plan model IDs, capabilities, context windows, and pricing. Learn how to use them in TypeScript with Mastra\'s model router.","source":"@site/src/content/en/models/providers/tencent-token-plan.mdx","sourceDirName":"providers","slug":"/providers/tencent-token-plan","permalink":"/models/providers/tencent-token-plan","draft":false,"unlisted":false,"editUrl":"https://github.com/mastra-ai/mastra/tree/main/docs/src/content/en/models/providers/tencent-token-plan.mdx","tags":[],"version":"current","frontMatter":{"title":"Tencent Token Plan Models: IDs, Pricing & Usage","description":"Browse Tencent Token Plan model IDs, capabilities, context windows, and pricing. Learn how to use them in TypeScript with Mastra\'s model router."},"sidebar":"modelsSidebar","previous":{"title":"Tencent Coding Plan (China)","permalink":"/models/providers/tencent-coding-plan"},"next":{"title":"Tencent TokenHub","permalink":"/models/providers/tencent-tokenhub"}}'),a=t(74848),s=t(28453);let i={title:"Tencent Token Plan Models: IDs, Pricing & Usage",description:"Browse Tencent Token Plan model IDs, capabilities, context windows, and pricing. Learn how to use them in TypeScript with Mastra's model router."},r="Tencent Token Plan",c={},l=[{value:"Models",id:"models",level:2},{value:"Advanced configuration",id:"advanced-configuration",level:2},{value:"Custom headers",id:"custom-headers",level:3},{value:"Dynamic model selection",id:"dynamic-model-selection",level:3}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,s.R)(),...e.components},{ProviderModelsTable:t}=n;return t||function(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("ProviderModelsTable",!0),(0,a.jsxs)(a.Fragment,{children:["\n",(0,a.jsx)(n.header,{children:(0,a.jsxs)(n.h1,{id:"tencent-token-plan",children:[(0,a.jsx)("img",{src:"https://models.dev/logos/tencent-token-plan.svg",alt:"Tencent Token Plan logo",className:"inline w-8 h-8 mr-2 align-middle dark:invert dark:brightness-0 dark:contrast-200"}),"Tencent Token Plan"]})}),"\n",(0,a.jsxs)(n.p,{children:["Access 2 Tencent Token Plan models through Mastra's model router. Authentication is handled automatically using the ",(0,a.jsx)(n.code,{children:"TENCENT_TOKEN_PLAN_API_KEY"})," environment variable."]}),"\n",(0,a.jsxs)(n.p,{children:["Learn more in the ",(0,a.jsx)(n.a,{href:"https://cloud.tencent.com/document/product/1823/130060",children:"Tencent Token Plan documentation"}),"."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",metastring:'title=".env"',children:"TENCENT_TOKEN_PLAN_API_KEY=your-api-key\n"})}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",metastring:'title="src/mastra/agents/my-agent.ts" {7}',children:'import { Agent } from "@mastra/core/agent";\n\nconst agent = new Agent({\n id: "my-agent",\n name: "My Agent",\n instructions: "You are a helpful assistant",\n model: "tencent-token-plan/hy3"\n});\n\n// Generate a response\nconst response = await agent.generate("Hello!");\n\n// Stream a response\nconst stream = await agent.stream("Tell me a story");\nfor await (const chunk of stream) {\n console.log(chunk);\n}\n'})}),"\n",(0,a.jsx)(n.admonition,{type:"note",children:(0,a.jsxs)(n.p,{children:["Mastra uses the OpenAI-compatible ",(0,a.jsx)(n.code,{children:"/chat/completions"})," endpoint. Some provider-specific features may not be available. Check the ",(0,a.jsx)(n.a,{href:"https://cloud.tencent.com/document/product/1823/130060",children:"Tencent Token Plan documentation"})," for details."]})}),"\n",(0,a.jsx)(n.h2,{id:"models",children:"Models"}),"\n",(0,a.jsx)(t,{models:[{model:"tencent-token-plan/hy3",imageInput:!1,audioInput:!1,videoInput:!1,toolUsage:!0,reasoning:!0,contextWindow:256e3,maxOutput:128e3,inputCost:null,outputCost:null},{model:"tencent-token-plan/hy4-preview",imageInput:!1,audioInput:!1,videoInput:!1,toolUsage:!0,reasoning:!0,contextWindow:1024e3,maxOutput:64e3,inputCost:.834,outputCost:2.501}]}),"\n",(0,a.jsxs)(n.p,{children:["Model availability, capabilities, context windows, and pricing are sourced from ",(0,a.jsx)(n.a,{href:"https://models.dev",children:"models.dev"})," and may change."]}),"\n",(0,a.jsx)(n.h2,{id:"advanced-configuration",children:"Advanced configuration"}),"\n",(0,a.jsx)(n.h3,{id:"custom-headers",children:"Custom headers"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",metastring:'title="src/mastra/agents/my-agent.ts"',children:'const agent = new Agent({\n id: "custom-agent",\n name: "custom-agent",\n model: {\
1n url: "https://api.lkeap.cloud.tencent.com/plan/v3",\n id: "tencent-token-plan/hy3",\n apiKey: process.env.TENCENT_TOKEN_PLAN_API_KEY,\n headers: {\n "X-Custom-Header": "value"\n }\n }\n});\n'})}),"\n",(0,a.jsx)(n.h3,{id:"dynamic-model-selection",children:"Dynamic model selection"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",metastring:'title="src/mastra/agents/my-agent.ts"',children:'const agent = new Agent({\n id: "dynamic-agent",\n name: "Dynamic Agent",\n model: ({ requestContext }) => {\n const useAdvanced = requestContext.task === "complex";\n return useAdvanced\n ? "tencent-token-plan/hy4-preview"\n : "tencent-token-plan/hy3";\n }\n});\n'})})]})}function m(e={}){let{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},28453(e,n,t){t.d(n,{R:()=>i,x:()=>r});var o=t(96540);let a={},s=o.createContext(a);function i(e){let n=o.useContext(s);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.