@shumai-one/shumai-agent 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/shumai-agent-app.js
CHANGED
|
@@ -13866,7 +13866,7 @@ To resolve this, you can:
|
|
|
13866
13866
|
`)}}function BLB(B,Q){let F=Q.plugins?.reduce((I,G)=>{return{...I,...G.endpoints}},{})??{},U=Q.plugins?.map((I)=>I.middlewares?.map((G)=>{let Z=async(W)=>{let g=await B;return x0(`middleware ${G.path} ${I.id}`,{[zW]:"middleware",[HF.ATTR_HTTP_ROUTE]:G.path,[wW]:`plugin:${I.id}`},()=>G.middleware({...W,context:{...g,...W.context}}))};return Z.options=G.middleware.options,{path:G.path,middleware:Z}})).filter((I)=>I!==void 0).flat()||[];return{api:xwQ({signInSocial:VwQ(),callbackOAuth:BwQ,getSession:PYB(),signOut:XwQ,signUpEmail:CwQ(),signInEmail:bwQ(),resetPassword:WwQ,verifyPassword:gwQ,verifyEmail:ezQ,sendVerificationEmail:tzQ,changeEmail:HwQ,changePassword:AwQ,setPassword:YwQ,updateSession:RwQ(),updateUser:NwQ(),deleteUser:LwQ,requestPasswordReset:GwQ,requestPasswordResetCallback:ZwQ,listSessions:S3Q(),revokeSession:y3Q,revokeSessions:M3Q,revokeOtherSessions:T3Q,linkSocialAccount:azQ,listUserAccounts:pzQ,deleteUserCallback:eYB,unlinkAccount:ozQ,refreshToken:rzQ,getAccessToken:sYB,accountInfo:szQ,...F,ok:UwQ,error:FwQ},B),middlewares:U}}var DwQ=(B,Q)=>{let{api:F,middlewares:U}=BLB(B,Q),I=new URL(B.baseURL).pathname;return KYB(F,{routerContext:B,openapi:{disabled:!0},basePath:I,routerMiddleware:[{path:"/**",middleware:J3Q},...U],allowedMediaTypes:["application/json"],skipTrailingSlashes:Q.advanced?.skipTrailingSlashes??!1,async onRequest(G){let Z=B.options.disabledPaths||[],W=Qm(G.url,I);if(Z.includes(W))return new Response("Not Found",{status:404});let g=G;for(let b of B.options.plugins||[])if(b.onRequest){let X=await x0(`onRequest ${b.id}`,{[zW]:"onRequest",[wW]:`plugin:${b.id}`},()=>b.onRequest(g,B));if(X&&"response"in X)return X.response;if(X&&"request"in X)g=X.request}let V=await z3Q(g,B);if(V)return V;return g},async onResponse(G,Z){await w3Q(Z,B);for(let W of B.options.plugins||[])if(W.onResponse){let g=await x0(`onResponse ${W.id}`,{[zW]:"onResponse",[wW]:`plugin:${W.id}`,[HF.ATTR_HTTP_RESPONSE_STATUS_CODE]:G.status},()=>W.onResponse(G,B));if(g)return g.response}return G},onError(G){if(WV(G)&&G.status==="FOUND")return;if(Q.onAPIError?.throw)throw G;if(Q.onAPIError?.onError){Q.onAPIError.onError(G,B);return}let Z=Q.logger?.level,W=Z==="error"||Z==="warn"||Z==="debug"?ZF:void 0;if(Q.logger?.disabled!==!0){if(G&&typeof G==="object"&&"message"in G&&typeof G.message==="string"){if(G.message.includes("no column")||G.message.includes("column")||G.message.includes("relation")||G.message.includes("table")||G.message.includes("does not exist")){B.logger?.error(G.message);return}}if(WV(G)){if(G.status==="INTERNAL_SERVER_ERROR")B.logger.error(G.status,G);W?.error(G.message)}else B.logger?.error(G&&typeof G==="object"&&"name"in G?G.name:"",G)}}})};var zwQ="better-auth-secret-12345678901234567890";PU();function z6F(B){let Q=new Set(B).size;if(Q===0)return 0;return Math.log2(Math.pow(Q,B.length))}function wwQ(B){if(!B)return null;return B.split(",").map((Q)=>{Q=Q.trim();let F=Q.indexOf(":");if(F===-1)throw new OQ(`Invalid BETTER_AUTH_SECRETS entry: "${Q}". Expected format: "<version>:<secret>"`);let U=parseInt(Q.slice(0,F),10);if(!Number.isInteger(U)||U<0)throw new OQ(`Invalid version in BETTER_AUTH_SECRETS: "${Q.slice(0,F)}". Version must be a non-negative integer.`);let I=Q.slice(F+1).trim();if(!I)throw new OQ(`Empty secret value for version ${U} in BETTER_AUTH_SECRETS.`);return{version:U,value:I}})}function SwQ(B,Q){if(B.length===0)throw new OQ("`secrets` array must contain at least one entry.");let F=new Set;for(let I of B){let G=parseInt(String(I.version),10);if(!Number.isInteger(G)||G<0||String(G)!==String(I.version).trim())throw new OQ(`Invalid version ${I.version} in \`secrets\`. Version must be a non-negative integer.`);if(!I.value)throw new OQ(`Empty secret value for version ${G} in \`secrets\`.`);if(F.has(G))throw new OQ(`Duplicate version ${G} in \`secrets\`. Each version must be unique.`);F.add(G)}let U=B[0];if(U.value.length<32)Q.warn(`[better-auth] Warning: the current secret (version ${U.version}) should be at least 32 characters long for adequate security.`);if(z6F(U.value)<120)Q.warn("[better-auth] Warning: the current secret appears low-entropy. Use a randomly generated secret for production.")}function ywQ(B,Q){let F=new Map;for(let U of B)F.set(parseInt(String(U.version),10),U.value);return{keys:F,currentVersion:parseInt(String(B[0].version),10),legacySecret:Q&&Q!=="better-auth-secret-12345678901234567890"?Q:void 0}}Tb();PU();pz();Tb();import Br from"fs";import cwQ from"fs/promises";import Vm from"os";import KwQ from"path";Op();async function w6F(B,Q){return{database:Q?.database,adapter:Q?.adapter,emailVerification:{sendVerificationEmail:!!B.emailVerification?.sendVerificationEmail,sendOnSignUp:!!B.emailVerification?.sendOnSignUp,sendOnSignIn:!!B.emailVerification?.sendOnSignIn,autoSignInAfterVerification:!!B.emailVerification?.autoSignInAfterVerification,expiresIn:B.emailVerification?.expiresIn,beforeEmailVerification:!!B.emailVerification?.beforeEmailVerification,afterEmailVerification:!!B.emailVerification?.afterEmailVerification},emailAndPassword:{enabled:!!B.emailAndPassword?.enabled,disableSignUp:!!B.emailAndPassword?.disableSignUp,requireEmailVerification:!!B.emailAndPassword?.requireEmailVerification,maxPasswordLength:B.emailAndPassword?.maxPasswordLength,minPasswordLength:B.emailAndPassword?.minPasswordLength,sendResetPassword:!!B.emailAndPassword?.sendResetPassword,resetPasswordTokenExpiresIn:B.emailAndPassword?.resetPasswordTokenExpiresIn,onPasswordReset:!!B.emailAndPassword?.onPasswordReset,password:{hash:!!B.emailAndPassword?.password?.hash,verify:!!B.emailAndPassword?.password?.verify},autoSignIn:!!B.emailAndPassword?.autoSignIn,revokeSessionsOnPasswordReset:!!B.emailAndPassword?.revokeSessionsOnPasswordReset},socialProviders:await Promise.all(Object.keys(B.socialProviders||{}).map(async(F)=>{let U=B.socialProviders?.[F];if(!U)return{};let I=typeof U==="function"?await U():U;return{id:F,mapProfileToUser:!!I.mapProfileToUser,disableDefaultScope:!!I.disableDefaultScope,disableIdTokenSignIn:!!I.disableIdTokenSignIn,disableImplicitSignUp:I.disableImplicitSignUp,disableSignUp:I.disableSignUp,getUserInfo:!!I.getUserInfo,overrideUserInfoOnSignIn:!!I.overrideUserInfoOnSignIn,prompt:I.prompt,verifyIdToken:!!I.verifyIdToken,scope:I.scope,refreshAccessToken:!!I.refreshAccessToken}})),plugins:B.plugins?.map((F)=>F.id.toString()),user:{modelName:B.user?.modelName,fields:B.user?.fields,additionalFields:B.user?.additionalFields,changeEmail:{enabled:B.user?.changeEmail?.enabled,sendChangeEmailConfirmation:!!B.user?.changeEmail?.sendChangeEmailConfirmation}},verification:{modelName:B.verification?.modelName,disableCleanup:B.verification?.disableCleanup,fields:B.verification?.fields},session:{modelName:B.session?.modelName,additionalFields:B.session?.additionalFields,cookieCache:{enabled:B.session?.cookieCache?.enabled,maxAge:B.session?.cookieCache?.maxAge,strategy:B.session?.cookieCache?.strategy},disableSessionRefresh:B.session?.disableSessionRefresh,expiresIn:B.session?.expiresIn,fields:B.session?.fields,freshAge:B.session?.freshAge,preserveSessionInDatabase:B.session?.preserveSessionInDatabase,storeSessionInDatabase:B.session?.storeSessionInDatabase,updateAge:B.session?.updateAge},account:{modelName:B.account?.modelName,fields:B.account?.fields,encryptOAuthTokens:B.account?.encryptOAuthTokens,updateAccountOnSignIn:B.account?.updateAccountOnSignIn,accountLinking:{enabled:B.account?.accountLinking?.enabled,trustedProviders:B.account?.accountLinking?.trustedProviders,updateUserInfoOnLink:B.account?.accountLinking?.updateUserInfoOnLink,allowUnlinkingAll:B.account?.accountLinking?.allowUnlinkingAll}},hooks:{after:!!B.hooks?.after,before:!!B.hooks?.before},secondaryStorage:!!B.secondaryStorage,advanced:{cookiePrefix:!!B.advanced?.cookiePrefix,cookies:!!B.advanced?.cookies,crossSubDomainCookies:{domain:!!B.advanced?.crossSubDomainCookies?.domain,enabled:B.advanced?.crossSubDomainCookies?.enabled,additionalCookies:B.advanced?.crossSubDomainCookies?.additionalCookies},database:{generateId:B.advanced?.database?.generateId,defaultFindManyLimit:B.advanced?.database?.defaultFindManyLimit},useSecureCookies:B.advanced?.useSecureCookies,ipAddress:{disableIpTracking:B.advanced?.ipAddress?.disableIpTracking,ipAddressHeaders:B.advanced?.ipAddress?.ipAddressHeaders},disableCSRFCheck:B.advanced?.disableCSRFCheck,cookieAttributes:{expires:B.advanced?.defaultCookieAttributes?.expires,secure:B.advanced?.defaultCookieAttributes?.secure,sameSite:B.advanced?.defaultCookieAttributes?.sameSite,domain:!!B.advanced?.defaultCookieAttributes?.domain,path:B.advanced?.defaultCookieAttributes?.path,httpOnly:B.advanced?.defaultCookieAttributes?.httpOnly}},trustedOrigins:B.trustedOrigins?.length,rateLimit:{storage:B.rateLimit?.storage,modelName:B.rateLimit?.modelName,window:B.rateLimit?.window,customStorage:!!B.rateLimit?.customStorage,enabled:B.rateLimit?.enabled,max:B.rateLimit?.max},onAPIError:{errorURL:B.onAPIError?.errorURL,onError:!!B.onAPIError?.onError,throw:B.onAPIError?.throw},logger:{disabled:B.logger?.disabled,level:B.logger?.level,log:!!B.logger?.log},databaseHooks:{user:{create:{after:!!B.databaseHooks?.user?.create?.after,before:!!B.databaseHooks?.user?.create?.before},update:{after:!!B.databaseHooks?.user?.update?.after,before:!!B.databaseHooks?.user?.update?.before}},session:{create:{after:!!B.databaseHooks?.session?.create?.after,before:!!B.databaseHooks?.session?.create?.before},update:{after:!!B.databaseHooks?.session?.update?.after,before:!!B.databaseHooks?.session?.update?.before}},account:{create:{after:!!B.databaseHooks?.account?.create?.after,before:!!B.databaseHooks?.account?.create?.before},update:{after:!!B.databaseHooks?.account?.update?.after,before:!!B.databaseHooks?.account?.update?.before}},verification:{create:{after:!!B.databaseHooks?.verification?.create?.after,before:!!B.databaseHooks?.verification?.create?.before},update:{after:!!B.databaseHooks?.verification?.update?.after,before:!!B.databaseHooks?.verification?.update?.before}}}}}function S6F(){let B=T0.npm_config_user_agent;if(!B)return;let Q=B.split(" ")[0],F=Q.lastIndexOf("/"),U=Q.substring(0,F);return{name:U==="npminstall"?"cnpm":U,version:Q.substring(F+1)}}function y6F(){return T0.CI!=="false"&&(("BUILD_ID"in T0)||("BUILD_NUMBER"in T0)||("CI"in T0)||("CI_APP_ID"in T0)||("CI_BUILD_ID"in T0)||("CI_BUILD_NUMBER"in T0)||("CI_NAME"in T0)||("CONTINUOUS_INTEGRATION"in T0)||("RUN_ID"in T0))}function M6F(){if(typeof Deno<"u")return{name:"deno",version:Deno?.version?.deno??null};if(typeof Bun<"u")return{name:"bun",version:Bun?.version??null};if(typeof process<"u"&&process?.versions?.node)return{name:"node",version:process.versions.node??null};return{name:"edge",version:null}}function T6F(){return ZI("NODE_ENV")==="production"?"production":y6F()?"ci":HJ()?"test":"development"}async function MwQ(B){let Q=await Sw("SHA-256").digest(B);return ZV.encode(Q)}var m6F=(B)=>{return oT("a-z","A-Z","0-9")(B||32)},sE;async function hwQ(){if(sE)return sE;try{let B=process.cwd();if(!B)return;let Q=await cwQ.readFile(KwQ.join(B,"package.json"),"utf-8");return sE=JSON.parse(Q),sE}catch{}}async function kwQ(B){if(sE)return sE.dependencies?.[B]||sE.devDependencies?.[B]||sE.peerDependencies?.[B];try{let Q=process.cwd();if(!Q)throw Error("no-cwd");let F=KwQ.join(Q,"node_modules",B,"package.json"),U=await cwQ.readFile(F,"utf-8");return JSON.parse(U).version||await TwQ(B)||void 0}catch{}return TwQ(B)}async function TwQ(B){let Q=await hwQ();if(!Q)return;return{...Q.dependencies,...Q.devDependencies,...Q.peerDependencies}[B]}async function O6F(){return(await hwQ())?.name}async function c6F(){try{let B=Vm.cpus();return{deploymentVendor:K6F(),systemPlatform:Vm.platform(),systemRelease:Vm.release(),systemArchitecture:Vm.arch(),cpuCount:B.length,cpuModel:B.length?B[0].model:null,cpuSpeed:B.length?B[0].speed:null,memory:Vm.totalmem(),isWSL:await $6F(),isDocker:await dwQ(),isTTY:process.stdout?process.stdout.isTTY:null}}catch{return{systemPlatform:null,systemRelease:null,systemArchitecture:null,cpuCount:null,cpuModel:null,cpuSpeed:null,memory:null,isWSL:null,isDocker:null,isTTY:null}}}function K6F(){let B=process.env,Q=(...F)=>F.some((U)=>Boolean(B[U]));if(Q("CF_PAGES","CF_PAGES_URL","CF_ACCOUNT_ID")||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers")return"cloudflare";if(Q("VERCEL","VERCEL_URL","VERCEL_ENV"))return"vercel";if(Q("NETLIFY","NETLIFY_URL"))return"netlify";if(Q("RENDER","RENDER_URL","RENDER_INTERNAL_HOSTNAME","RENDER_SERVICE_ID"))return"render";if(Q("AWS_LAMBDA_FUNCTION_NAME","AWS_EXECUTION_ENV","LAMBDA_TASK_ROOT"))return"aws";if(Q("GOOGLE_CLOUD_FUNCTION_NAME","GOOGLE_CLOUD_PROJECT","GCP_PROJECT","K_SERVICE"))return"gcp";if(Q("AZURE_FUNCTION_NAME","FUNCTIONS_WORKER_RUNTIME","WEBSITE_INSTANCE_ID","WEBSITE_SITE_NAME"))return"azure";if(Q("DENO_DEPLOYMENT_ID","DENO_REGION"))return"deno-deploy";if(Q("FLY_APP_NAME","FLY_REGION","FLY_ALLOC_ID"))return"fly-io";if(Q("RAILWAY_STATIC_URL","RAILWAY_ENVIRONMENT_NAME"))return"railway";if(Q("DYNO","HEROKU_APP_NAME"))return"heroku";if(Q("DO_DEPLOYMENT_ID","DO_APP_NAME","DIGITALOCEAN"))return"digitalocean";if(Q("KOYEB","KOYEB_DEPLOYMENT_ID","KOYEB_APP_NAME"))return"koyeb";return null}var QLB;async function h6F(){try{return Br.statSync("/.dockerenv"),!0}catch{return!1}}async function k6F(){try{return Br.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}async function dwQ(){if(QLB===void 0)QLB=await h6F()||await k6F();return QLB}var FLB,d6F=async()=>{try{return Br.statSync("/run/.containerenv"),!0}catch{return!1}};async function mwQ(){if(FLB===void 0)FLB=await d6F()||await dwQ();return FLB}async function $6F(){try{if(process.platform!=="linux")return!1;if(Vm.release().toLowerCase().includes("microsoft")){if(await mwQ())return!1;return!0}return Br.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!await mwQ():!1}catch{return!1}}var rE=null;async function OwQ(B){if(rE)return rE;let Q=await O6F();if(Q)return rE=await MwQ(B?B+Q:Q),rE;if(B)return rE=await MwQ(B),rE;return rE=m6F(32),rE}async function _6F(){for(let[B,Q]of Object.entries({pg:"postgresql",mysql:"mysql",mariadb:"mariadb",sqlite3:"sqlite","better-sqlite3":"sqlite","@prisma/client":"prisma",mongoose:"mongodb",mongodb:"mongodb","drizzle-orm":"drizzle"})){let F=await kwQ(B);if(F)return{name:Q,version:F}}}async function v6F(){for(let[B,Q]of Object.entries({next:"next",nuxt:"nuxt","react-router":"react-router",astro:"astro","@sveltejs/kit":"sveltekit","solid-start":"solid-start","tanstack-start":"tanstack-start",hono:"hono",express:"express",elysia:"elysia",expo:"expo"})){let F=await kwQ(B);if(F)return{name:Q,version:F}}}var P6F=async function(){};async function $wQ(B,Q){let F=B.telemetry?.debug||Sp("BETTER_AUTH_TELEMETRY_DEBUG",!1),U=Y2B.BETTER_AUTH_TELEMETRY_ENDPOINT;if(!U&&!Q?.customTrack)return{publish:P6F};let I=async(g)=>{if(Q?.customTrack)await Q.customTrack(g).catch(ZF.error);else if(U)if(F)ZF.info("telemetry event",JSON.stringify(g,null,2));else await kQ(U,{method:"POST",body:g}).catch(ZF.error)},Z=await(async()=>{let g=B.telemetry?.enabled!==void 0?B.telemetry.enabled:!1;return(Sp("BETTER_AUTH_TELEMETRY",!1)||g)&&(Q?.skipTestCheck||!HJ())})(),W;if(Z)W=await OwQ(typeof B.baseURL==="string"?B.baseURL:void 0),I({type:"init",payload:{config:await w6F(B,Q),runtime:M6F(),database:await _6F(),framework:await v6F(),environment:T6F(),systemInfo:await c6F(),packageManager:S6F()},anonymousId:W});return{publish:async(g)=>{if(!Z)return;if(!W)W=await OwQ(typeof B.baseURL==="string"?B.baseURL:void 0);await I({type:g.type,payload:g.payload,anonymousId:W})}}}function f6F(B){let Q=new Set(B).size;if(Q===0)return 0;return Math.log2(Math.pow(Q,B.length))}function l6F(B,Q){let F=B===zwQ;if(HJ())return;if(F&&VE)throw new OQ("You are using the default secret. Please set `BETTER_AUTH_SECRET` in your environment variables or pass `secret` in your auth config.");if(!B)throw new OQ("BETTER_AUTH_SECRET is missing. Set it in your environment or pass `secret` to betterAuth({ secret }).");if(B.length<32)Q.warn("[better-auth] Warning: your BETTER_AUTH_SECRET should be at least 32 characters long for adequate security. Generate one with `npx auth secret` or `openssl rand -base64 32`.");if(f6F(B)<120)Q.warn("[better-auth] Warning: your BETTER_AUTH_SECRET appears low-entropy. Use a randomly generated secret for production.")}async function _wQ(B,Q,F){if(!Q.database)Q=$o(Q,{session:{cookieCache:{enabled:!0,strategy:"jwe",refreshCache:!0,maxAge:Q.session?.expiresIn||604800}},account:{storeStateStrategy:"cookie",storeAccountCookie:!0}});let U=Q.plugins||[],I=tDQ(Q),G=JJ(Q.logger),Z=Q2(Q.baseURL);if(Q2(Q.baseURL)){let{allowedHosts:c}=Q.baseURL;if(!c||c.length===0)throw new OQ('baseURL.allowedHosts cannot be empty. Provide at least one allowed host pattern (e.g., ["myapp.com", "*.vercel.app"]).')}let W=Z?void 0:_J(typeof Q.baseURL==="string"?Q.baseURL:void 0,Q.basePath);if(!W&&!Z)G.warn("[better-auth] Base URL could not be determined. Please set a valid base URL using the baseURL config option or the BETTER_AUTH_URL environment variable. Without this, callbacks and redirects may not work correctly.");if(B.id==="memory"&&Q.advanced?.database?.generateId===!1)G.error(`[better-auth] Misconfiguration detected.
|
|
13867
13867
|
You are using the memory DB with generateId: false.
|
|
13868
13868
|
This will cause no id to be generated for any model.
|
|
13869
|
-
Most of the features of Better Auth will not work correctly.`);let g=Q.secrets??wwQ(T0.BETTER_AUTH_SECRETS),V=Q.secret||T0.BETTER_AUTH_SECRET||T0.AUTH_SECRET||"",b,X;if(g)SwQ(g,G),b=g[0].value,X=ywQ(g,V);else b=V||"better-auth-secret-12345678901234567890",l6F(b,G),X=b;Q={...Q,secret:b,baseURL:Z?Q.baseURL:W?new URL(W).origin:"",basePath:Q.basePath||"/api/auth",plugins:U.concat(I)},EwQ(Q,G);let C=mo(Q),N=mX(Q),R=(await Promise.all(Object.entries(Q.socialProviders||{}).map(async([c,k])=>{let d=typeof k==="function"?await k():k;if(d==null)return null;if(d.enabled===!1)return null;if(!d.clientId)G.warn(`Social provider ${c} is missing clientId or clientSecret`);let $=rYB[c](d);return $.disableImplicitSignUp=d.disableImplicitSignUp,$}))).filter((c)=>c!==null),A=({model:c,size:k})=>{if(typeof Q.advanced?.generateId==="function")return Q.advanced.generateId({model:c,size:k});let d=Q?.advanced?.database?.generateId;if(typeof d==="function")return d({model:c,size:k});if(d==="uuid")return crypto.randomUUID();if(d==="serial"||d===!1)return!1;return vN(k)},{publish:Y}=await $wQ(Q,{adapter:B.id,database:typeof Q.database==="function"?"adapter":F(Q.database)}),L=new Set(Q.plugins.map((c)=>c.id)),H=(c)=>Q.plugins.find((k)=>k.id===c)??null,J=(c)=>L.has(c),w=await jd(Q),M=await nd(Q),y={appName:Q.appName||"Better Auth",baseURL:W||"",version:gYB(),socialProviders:R,options:Q,oauthConfig:{storeStateStrategy:Q.account?.storeStateStrategy||(Q.database?"database":"cookie"),skipStateCookieCheck:!!Q.account?.skipStateCookieCheck},tables:N,trustedOrigins:w,trustedProviders:M,isTrustedOrigin(c,k){return this.trustedOrigins.some((d)=>ea(c,d,k))},sessionConfig:{updateAge:Q.session?.updateAge!==void 0?Q.session.updateAge:86400,expiresIn:Q.session?.expiresIn||604800,freshAge:Q.session?.freshAge===void 0?86400:Q.session.freshAge,cookieRefreshCache:(()=>{let c=Q.session?.cookieCache?.refreshCache,k=Q.session?.cookieCache?.maxAge||300;if((!!Q.database||!!Q.secondaryStorage)&&c)return G.warn("[better-auth] `session.cookieCache.refreshCache` is enabled while `database` or `secondaryStorage` is configured. `refreshCache` is meant for stateless (DB-less) setups. Disabling `refreshCache` \u2014 remove it from your config to silence this warning."),!1;if(c===!1||c===void 0)return!1;if(c===!0)return{enabled:!0,updateAge:Math.floor(k*0.2)};return{enabled:!0,updateAge:c.updateAge!==void 0?c.updateAge:Math.floor(k*0.2)}})()},secret:b,secretConfig:X,rateLimit:{...Q.rateLimit,enabled:Q.rateLimit?.enabled??VE,window:Q.rateLimit?.window||10,max:Q.rateLimit?.max||100,storage:Q.rateLimit?.storage||(Q.secondaryStorage?"secondary-storage":"memory")},authCookies:C,logger:G,generateId:A,session:null,secondaryStorage:Q.secondaryStorage,password:{hash:Q.emailAndPassword?.password?.hash||YEQ,verify:Q.emailAndPassword?.password?.verify||LEQ,config:{minPasswordLength:Q.emailAndPassword?.minPasswordLength||8,maxPasswordLength:Q.emailAndPassword?.maxPasswordLength||128},checkPassword:Q3Q},setNewSession(c){this.newSession=c},newSession:null,adapter:B,internalAdapter:ko(B,{options:Q,logger:G,hooks:Q.databaseHooks?[{source:"user",hooks:Q.databaseHooks}]:[],generateId:A}),createAuthCookie:_d(Q),async runMigrations(){throw new OQ("runMigrations will be set by the specific init implementation")},publishTelemetry:Y,skipCSRFCheck:!!Q.advanced?.disableCSRFCheck,skipOriginCheck:Q.advanced?.disableOriginCheck!==void 0?Q.advanced.disableOriginCheck:HJ()?!0:!1,runInBackground:Q.advanced?.backgroundTasks?.handler??((c)=>{c.catch(()=>{})}),async runInBackgroundOrAwait(c){try{if(Q.advanced?.backgroundTasks?.handler){if(c instanceof Promise)Q.advanced.backgroundTasks.handler(c.catch((k)=>{G.error("Failed to run background task:",k)}))}else await c}catch(k){G.error("Failed to run background task:",k)}},getPlugin:H,hasPlugin:J},m=sDQ(y);if(_7(m))await m;return y}PU();ta();var vwQ=async(B)=>{let Q=await GEQ(B),U=await _wQ(Q,B,(I)=>Ld(I)||"unknown");return U.runMigrations=async function(){if(!B.database||"updateMany"in B.database)throw new OQ("Database is not provided or it's an adapter. Migrations are only supported with a database instance.");let{runMigrations:I}=await WEQ(B);await I()},U};PU();var PwQ=(B,Q)=>{let F=Q(B),{api:U}=BLB(F,B);return{handler:async(I)=>{let G=await F,Z=G.options.basePath||"/api/auth",W;if(Q2(B.baseURL))W=await vo(G,I,_o(G.options));else{if(W=G,!G.options.baseURL){let V=_J(void 0,Z,I,void 0,G.options.advanced?.trustedProxyHeaders);if(V)G.baseURL=V,G.options.baseURL=OE(G.baseURL)||void 0;else throw new OQ("Could not get base URL from request. Please provide a valid base URL.")}W.trustedOrigins=await jd(G.options,I),W.trustedProviders=await nd(G.options,I)}let{handler:g}=DwQ(W,B);return RYB(W.adapter,()=>g(I))},api:U,options:B,$context:F,$ERROR_CODES:{...B.plugins?.reduce((I,G)=>{if(G.$ERROR_CODES)return{...I,...G.$ERROR_CODES};return I},{}),...LQ}}};var ULB=(B)=>{return PwQ(B,vwQ)};Tb();PU();J2B();pz();XE();wk();PU();function ILB(B){return B?.code==="P2025"||B?.meta?.cause==="Record to delete does not exist."}var fwQ=(B,Q)=>{let F=null,U=(Z,W=!1)=>({getFieldName:g,getModelName:V,getFieldAttributes:b,getDefaultModelName:X,schema:C})=>{let N=Z,R=(J,w,M)=>{if(!J&&!M)return;let y={};if(J)for(let m of J)y[g({model:w,field:m})]=!0;if(M){if(!J){let m=C[X(w)]?.fields||{};m.id={type:"string"};for(let c of Object.keys(m))y[g({model:w,field:c})]=!0}for(let[m,c]of Object.entries(M)){let k=A(w,V(m),C);if(c.relation==="one-to-one")y[k]=!0;else y[k]={take:c.limit}}}return y},A=(J,w,M)=>{try{let y=X(J),m=X(w),c=V(w).toLowerCase(),k=Object.entries(M[m]?.fields||{}).filter(([d,$])=>$.references&&X($.references.model)===y);if(k.length>0){let[d,$]=k[0];return $?.unique===!0||Q.usePlural===!0?c:`${c}s`}if(k=Object.entries(M[y]?.fields||{}).filter(([d,$])=>$.references&&X($.references.model)===m),k.length>0)return c}catch{}return`${V(w).toLowerCase()}s`};function Y(J){switch(J){case"starts_with":return"startsWith";case"ends_with":return"endsWith";case"ne":return"not";case"not_in":return"notIn";default:return J}}let L=(J,w)=>{if(!w?.length)return!1;return w.some((M)=>{if(M.connector==="OR")return!1;if(M.operator&&M.operator!=="eq")return!1;if(M.mode==="insensitive"){let y=Q.provider==="postgresql"||Q.provider==="mongodb",m=typeof M.value==="string"||Array.isArray(M.value)&&M.value.every((c)=>typeof c==="string");if(y&&m)return!1}if(M.field==="id")return!0;return b({model:J,field:M.field})?.unique===!0})},H=({action:J,model:w,where:M})=>{if(!M||!M.length)return{};let y=($)=>{let FB=g({model:w,field:$.field}),bB=($.mode??"sensitive")==="insensitive"&&(typeof $.value==="string"||Array.isArray($.value)&&$.value.every((LB)=>typeof LB==="string")),CB=Q.provider==="postgresql"||Q.provider==="mongodb",IB=bB&&CB?"insensitive":void 0,t=IB?{mode:IB}:{};if($.operator==="ne"&&$.value===null)return b({model:w,field:$.field})?.required!==!0?{[FB]:{not:null}}:{};if(($.operator==="in"||$.operator==="not_in")&&Array.isArray($.value)){let LB=$.value.filter((HQ)=>HQ!=null);if(LB.length===0)if($.operator==="in")return{AND:[{[FB]:{equals:"__never__"}},{[FB]:{not:"__never__"}}]};else return{};let NQ=Y($.operator);return{[FB]:{[NQ]:LB,...t}}}if($.operator==="eq"||!$.operator)return{[FB]:{equals:$.value,...t}};if($.operator==="ne")return{[FB]:{not:{equals:$.value},...t}};let ZB=Y($.operator);return{[FB]:{[ZB]:$.value,...t}}};if(J==="update"){let $=M.filter((ZB)=>ZB.connector==="AND"||!ZB.connector),FB=M.filter((ZB)=>ZB.connector==="OR"),bB=$.filter((ZB)=>ZB.operator==="eq"||!ZB.operator),CB=$.filter((ZB)=>ZB.operator!=="eq"&&ZB.operator!==void 0).map((ZB)=>y(ZB)),IB=FB.map((ZB)=>y(ZB)),t={};for(let ZB of bB){let LB=g({model:w,field:ZB.field});t[LB]=ZB.value}if(CB.length>0)t.AND=CB;if(IB.length>0)t.OR=IB;return t}if(J==="delete"){let $=M.find((FB)=>FB.field==="id");if($){let FB=g({model:w,field:"id"}),bB=M.filter((NQ)=>NQ.field!=="id");if(bB.length===0)return{[FB]:$.value};let CB=bB.filter((NQ)=>NQ.connector==="AND"||!NQ.connector),IB=bB.filter((NQ)=>NQ.connector==="OR"),t=CB.map((NQ)=>y(NQ)),ZB=IB.map((NQ)=>y(NQ)),LB={[FB]:$.value};if(t.length>0)LB.AND=t;if(ZB.length>0)LB.OR=ZB;return LB}}if(M.length===1){let $=M[0];if(!$)return;return y($)}let m=M.filter(($)=>$.connector==="AND"||!$.connector),c=M.filter(($)=>$.connector==="OR"),k=m.map(($)=>y($)),d=c.map(($)=>y($));return{...k.length?{AND:k}:{},...d.length?{OR:d}:{}}};return{async create({model:J,data:w,select:M}){if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);return await N[J].create({data:w,select:R(M,J)})},async findOne({model:J,where:w,select:M,join:y}){let m=H({model:J,where:w,action:"findOne"});if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);let c=new Map;for(let $ of Object.keys(y??{})){let FB=A(J,$,C);c.set(FB,V($))}let k=R(M,J,y),d=await N[J].findFirst({where:m,select:k});if(y&&d)for(let[$,FB]of c.entries()){if($===FB)continue;if($ in d)d[FB]=d[$],delete d[$]}return d},async findMany({model:J,where:w,limit:M,select:y,offset:m,sortBy:c,join:k}){let d=H({model:J,where:w,action:"findMany"});if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);let $=new Map;if(k)for(let[CB,IB]of Object.entries(k)){let t=A(J,CB,C);$.set(t,V(CB))}let FB=R(y,J,k),bB=await N[J].findMany({where:d,take:M||100,skip:m||0,...c?.field?{orderBy:{[g({model:J,field:c.field})]:c.direction==="desc"?"desc":"asc"}}:{},select:FB});if(k&&Array.isArray(bB))for(let CB of bB)for(let[IB,t]of $.entries()){if(IB===t)continue;if(IB in CB)CB[t]=CB[IB],delete CB[IB]}return bB},async count({model:J,where:w}){let M=H({model:J,where:w,action:"count"});if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);return await N[J].count({where:M})},async update({model:J,where:w,update:M}){if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);if(!L(J,w)){let m=H({model:J,where:w,action:"updateMany"});if(!(await N[J].updateMany({where:m,data:M}))?.count)return null;return await N[J].findFirst({where:m})}let y=H({model:J,where:w,action:"update"});return await N[J].update({where:y,data:M})},async updateMany({model:J,where:w,update:M}){if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);let y=H({model:J,where:w,action:"updateMany"}),m=await N[J].updateMany({where:y,data:M});return m?m.count:0},async delete({model:J,where:w}){if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);if(!w?.some((y)=>y.field==="id")){let y=H({model:J,where:w,action:"deleteMany"});await N[J].deleteMany({where:y});return}let M=H({model:J,where:w,action:"delete"});try{await N[J].delete({where:M})}catch(y){if(ILB(y))return;console.log(y)}},async deleteMany({model:J,where:w}){let M=H({model:J,where:w,action:"deleteMany"}),y=await N[J].deleteMany({where:M});return y?y.count:0},async consumeOne({model:J,where:w}){if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);if(w?.some((m)=>m.field==="id")){let m=H({model:J,where:w,action:"delete"});try{return await N[J].delete({where:m})??null}catch(c){if(ILB(c))return null;throw c}}let M=H({model:J,where:w,action:"findOne"}),y=async(m)=>{let c=await m[J].findFirst({where:M});if(!c)return null;try{return(await m[J].deleteMany({where:H({model:J,where:[...w??[],{field:"id",value:c.id,operator:"eq",connector:"AND",mode:"sensitive"}],action:"deleteMany"})}))?.count>0?c:null}catch(k){if(ILB(k))return null;throw k}};return W||typeof N.$transaction!=="function"?y(N):N.$transaction(y)},options:Q}},I=null;I={config:{adapterId:"prisma",adapterName:"Prisma Adapter",usePlural:Q.usePlural??!1,debugLogs:Q.debugLogs??!1,supportsUUIDs:Q.provider==="postgresql"?!0:!1,supportsArrays:Q.provider==="postgresql"||Q.provider==="mongodb"?!0:!1,transaction:Q.transaction??!1?(Z)=>B.$transaction((W)=>{return Z(EJ({config:{...I.config,transaction:!1},adapter:U(W,!0)})(F))}):!1},adapter:U(B)};let G=EJ(I);return(Z)=>{return F=Z,G(Z)}};var lwQ={openai:{name:"openai",config:{api:"openai-responses",baseUrl:"https://api.openai.com/v1",apiKey:"OPENAI_API_KEY"},models:[{modelId:"gpt-4",name:"GPT-4",config:{api:"openai-responses",reasoning:!1,input:["text"],contextWindow:8192,maxTokens:8192,cost:{input:30,output:60,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4-turbo",name:"GPT-4 Turbo",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:10,output:30,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4.1",name:"GPT-4.1",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"gpt-4.1-mini",name:"GPT-4.1 mini",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.4,output:1.6,cacheRead:0.1,cacheWrite:0}}},{modelId:"gpt-4.1-nano",name:"GPT-4.1 nano",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.1,output:0.4,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-4o",name:"GPT-4o",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"gpt-4o-2024-05-13",name:"GPT-4o (2024-05-13)",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:5,output:15,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4o-2024-08-06",name:"GPT-4o (2024-08-06)",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"gpt-4o-2024-11-20",name:"GPT-4o (2024-11-20)",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"gpt-4o-mini",name:"GPT-4o mini",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0.075,cacheWrite:0}}},{modelId:"gpt-5",name:"GPT-5",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5-chat-latest",name:"GPT-5 Chat Latest",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5-codex",name:"GPT-5-Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5-mini",name:"GPT-5 Mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-5-nano",name:"GPT-5 Nano",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.05,output:0.4,cacheRead:0.005,cacheWrite:0}}},{modelId:"gpt-5-pro",name:"GPT-5 Pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:15,output:120,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-5.1",name:"GPT-5.1",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-chat-latest",name:"GPT-5.1 Chat",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-codex",name:"GPT-5.1 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-codex-max",name:"GPT-5.1 Codex Max",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-codex-mini",name:"GPT-5.1 Codex mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-5.2",name:"GPT-5.2",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-chat-latest",name:"GPT-5.2 Chat",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-codex",name:"GPT-5.2 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-pro",name:"GPT-5.2 Pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:21,output:168,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-5.3-chat-latest",name:"GPT-5.3 Chat (latest)",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.3-codex",name:"GPT-5.3 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:32000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.4",name:"GPT-5.4",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"gpt-5.4-mini",name:"GPT-5.4 mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"gpt-5.4-nano",name:"GPT-5.4 nano",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.2,output:1.25,cacheRead:0.02,cacheWrite:0}}},{modelId:"gpt-5.4-pro",name:"GPT-5.4 Pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-5.5",name:"GPT-5.5",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"gpt-5.5-pro",name:"GPT-5.5 Pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"o1",name:"o1",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:15,output:60,cacheRead:7.5,cacheWrite:0}}},{modelId:"o1-pro",name:"o1-pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:150,output:600,cacheRead:0,cacheWrite:0}}},{modelId:"o3",name:"o3",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"o3-deep-research",name:"o3-deep-research",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:10,output:40,cacheRead:2.5,cacheWrite:0}}},{modelId:"o3-mini",name:"o3-mini",config:{api:"openai-responses",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.55,cacheWrite:0}}},{modelId:"o3-pro",name:"o3-pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:20,output:80,cacheRead:0,cacheWrite:0}}},{modelId:"o4-mini",name:"o4-mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.275,cacheWrite:0}}},{modelId:"o4-mini-deep-research",name:"o4-mini-deep-research",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}}]},anthropic:{name:"anthropic",config:{api:"anthropic-messages",baseUrl:"https://api.anthropic.com",apiKey:"ANTHROPIC_API_KEY"},models:[{modelId:"claude-3-5-haiku-20241022",name:"Claude Haiku 3.5",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:0.8,output:4,cacheRead:0.08,cacheWrite:1}}},{modelId:"claude-3-5-haiku-latest",name:"Claude Haiku 3.5 (latest)",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:0.8,output:4,cacheRead:0.08,cacheWrite:1}}},{modelId:"claude-3-5-sonnet-20240620",name:"Claude Sonnet 3.5",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-3-5-sonnet-20241022",name:"Claude Sonnet 3.5 v2",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-3-7-sonnet-20250219",name:"Claude Sonnet 3.7",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-3-haiku-20240307",name:"Claude Haiku 3",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:0.25,output:1.25,cacheRead:0.03,cacheWrite:0.3}}},{modelId:"claude-3-opus-20240229",name:"Claude Opus 3",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-3-sonnet-20240229",name:"Claude Sonnet 3",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:0.3}}},{modelId:"claude-fable-5",name:"Claude Fable 5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"claude-haiku-4-5",name:"Claude Haiku 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"claude-haiku-4-5-20251001",name:"Claude Haiku 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"claude-opus-4-0",name:"Claude Opus 4 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-opus-4-1",name:"Claude Opus 4.1 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-opus-4-1-20250805",name:"Claude Opus 4.1",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-opus-4-20250514",name:"Claude Opus 4",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-opus-4-5",name:"Claude Opus 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-5-20251101",name:"Claude Opus 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-6",name:"Claude Opus 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-7",name:"Claude Opus 4.7",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-8",name:"Claude Opus 4.8",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-sonnet-4-0",name:"Claude Sonnet 4 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-20250514",name:"Claude Sonnet 4",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-5",name:"Claude Sonnet 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-5-20250929",name:"Claude Sonnet 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}}]},google:{name:"google",config:{api:"google-generative-ai",baseUrl:"https://generativelanguage.googleapis.com/v1beta",apiKey:"GEMINI_API_KEY"},models:[{modelId:"gemini-2.0-flash",name:"Gemini 2.0 Flash",config:{api:"google-generative-ai",reasoning:!1,input:["text","image"],contextWindow:1048576,maxTokens:8192,cost:{input:0.1,output:0.4,cacheRead:0.025,cacheWrite:0}}},{modelId:"gemini-2.0-flash-lite",name:"Gemini 2.0 Flash-Lite",config:{api:"google-generative-ai",reasoning:!1,input:["text","image"],contextWindow:1048576,maxTokens:8192,cost:{input:0.075,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"gemini-2.5-flash",name:"Gemini 2.5 Flash",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.3,output:2.5,cacheRead:0.03,cacheWrite:0}}},{modelId:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash-Lite",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.1,output:0.4,cacheRead:0.01,cacheWrite:0}}},{modelId:"gemini-2.5-pro",name:"Gemini 2.5 Pro",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0}}},{modelId:"gemini-3-pro-preview",name:"Gemini 3 Pro Preview",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"gemini-3.1-flash-lite",name:"Gemini 3.1 Flash Lite",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.25,output:1.5,cacheRead:0.025,cacheWrite:0}}},{modelId:"gemini-3.1-flash-lite-preview",name:"Gemini 3.1 Flash Lite Preview",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.25,output:1.5,cacheRead:0.025,cacheWrite:0}}},{modelId:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"gemini-3.1-pro-preview-customtools",name:"Gemini 3.1 Pro Preview Custom Tools",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"gemini-3.5-flash",name:"Gemini 3.5 Flash",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.5,output:9,cacheRead:0.15,cacheWrite:0}}},{modelId:"gemini-flash-latest",name:"Gemini Flash Latest",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.3,output:2.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"gemini-flash-lite-latest",name:"Gemini Flash-Lite Latest",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.1,output:0.4,cacheRead:0.025,cacheWrite:0}}},{modelId:"gemma-4-26b-a4b-it",name:"Gemma 4 26B A4B IT",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"gemma-4-31b-it",name:"Gemma 4 31B IT",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"gemma-4-E2B-it",name:"Gemma 4 E2B IT",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:8192,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"gemma-4-E4B-it",name:"Gemma 4 E4B IT",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:8192,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}}]},deepseek:{name:"deepseek",config:{api:"openai-completions",baseUrl:"https://api.deepseek.com",apiKey:"DEEPSEEK_API_KEY"},models:[{modelId:"deepseek-v4-flash",name:"DeepSeek V4 Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:0.14,output:0.28,cacheRead:0.0028,cacheWrite:0}}},{modelId:"deepseek-v4-pro",name:"DeepSeek V4 Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:0.435,output:0.87,cacheRead:0.003625,cacheWrite:0}}}]},groq:{name:"groq",config:{api:"openai-completions",baseUrl:"https://api.groq.com/openai/v1",apiKey:"GROQ_API_KEY"},models:[{modelId:"llama-3.1-8b-instant",name:"Llama 3.1 8B",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.05,output:0.08,cacheRead:0,cacheWrite:0}}},{modelId:"llama-3.3-70b-versatile",name:"Llama 3.3 70B",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:32768,cost:{input:0.59,output:0.79,cacheRead:0,cacheWrite:0}}},{modelId:"meta-llama/llama-4-scout-17b-16e-instruct",name:"Llama 4 Scout 17B 16E",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:131072,maxTokens:8192,cost:{input:0.11,output:0.34,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-120b",name:"GPT OSS 120B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.15,output:0.6,cacheRead:0.075,cacheWrite:0}}},{modelId:"openai/gpt-oss-20b",name:"GPT OSS 20B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.075,output:0.3,cacheRead:0.0375,cacheWrite:0}}},{modelId:"openai/gpt-oss-safeguard-20b",name:"Safety GPT OSS 20B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.075,output:0.3,cacheRead:0.037,cacheWrite:0}}},{modelId:"qwen/qwen3-32b",name:"Qwen3-32B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:40960,cost:{input:0.29,output:0.59,cacheRead:0,cacheWrite:0}}}]},openrouter:{name:"openrouter",config:{api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",apiKey:"OPENROUTER_API_KEY"},models:[{modelId:"ai21/jamba-large-1.7",name:"AI21: Jamba Large 1.7",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:4096,cost:{input:2,output:8,cacheRead:0,cacheWrite:0}}},{modelId:"amazon/nova-2-lite-v1",name:"Amazon: Nova 2 Lite",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65535,cost:{input:0.3,output:2.5,cacheRead:0,cacheWrite:0}}},{modelId:"amazon/nova-lite-v1",name:"Amazon: Nova Lite 1.0",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:300000,maxTokens:5120,cost:{input:0.06,output:0.24,cacheRead:0,cacheWrite:0}}},{modelId:"amazon/nova-micro-v1",name:"Amazon: Nova Micro 1.0",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:5120,cost:{input:0.035,output:0.14,cacheRead:0,cacheWrite:0}}},{modelId:"amazon/nova-premier-v1",name:"Amazon: Nova Premier 1.0",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:32000,cost:{input:2.5,output:12.5,cacheRead:0.625,cacheWrite:0}}},{modelId:"amazon/nova-pro-v1",name:"Amazon: Nova Pro 1.0",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:300000,maxTokens:5120,cost:{input:0.8,output:3.2,cacheRead:0,cacheWrite:0}}},{modelId:"anthropic/claude-3-haiku",name:"Anthropic: Claude 3 Haiku",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:0.25,output:1.25,cacheRead:0.03,cacheWrite:0.3}}},{modelId:"anthropic/claude-3.5-haiku",name:"Anthropic: Claude 3.5 Haiku",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:0.8,output:4,cacheRead:0.08,cacheWrite:1}}},{modelId:"anthropic/claude-fable-5",name:"Anthropic: Claude Fable 5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"anthropic/claude-haiku-4.5",name:"Anthropic: Claude Haiku 4.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"anthropic/claude-opus-4",name:"Anthropic: Claude Opus 4",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"anthropic/claude-opus-4.1",name:"Anthropic: Claude Opus 4.1",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"anthropic/claude-opus-4.5",name:"Anthropic: Claude Opus 4.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-opus-4.6",name:"Anthropic: Claude Opus 4.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-opus-4.6-fast",name:"Anthropic: Claude Opus 4.6 (Fast)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:30,output:150,cacheRead:3,cacheWrite:37.5}}},{modelId:"anthropic/claude-opus-4.7",name:"Anthropic: Claude Opus 4.7",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-opus-4.7-fast",name:"Anthropic: Claude Opus 4.7 (Fast)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:30,output:150,cacheRead:3,cacheWrite:37.5}}},{modelId:"anthropic/claude-opus-4.8",name:"Anthropic: Claude Opus 4.8",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-opus-4.8-fast",name:"Anthropic: Claude Opus 4.8 (Fast)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"anthropic/claude-sonnet-4",name:"Anthropic: Claude Sonnet 4",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"anthropic/claude-sonnet-4.5",name:"Anthropic: Claude Sonnet 4.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"anthropic/claude-sonnet-4.6",name:"Anthropic: Claude Sonnet 4.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"arcee-ai/trinity-large-thinking",name:"Arcee AI: Trinity Large Thinking",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.22,output:0.85,cacheRead:0.06,cacheWrite:0}}},{modelId:"arcee-ai/trinity-mini",name:"Arcee AI: Trinity Mini",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.045,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"arcee-ai/virtuoso-large",name:"Arcee AI: Virtuoso Large",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:64000,cost:{input:0.75,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"auto",name:"Auto",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:2000000,maxTokens:30000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"bytedance-seed/seed-1.6",name:"ByteDance Seed: Seed 1.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0.25,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"bytedance-seed/seed-1.6-flash",name:"ByteDance Seed: Seed 1.6 Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0.075,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"bytedance-seed/seed-2.0-lite",name:"ByteDance Seed: Seed-2.0-Lite",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.25,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"bytedance-seed/seed-2.0-mini",name:"ByteDance Seed: Seed-2.0-Mini",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.1,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"cohere/command-r-08-2024",name:"Cohere: Command R (08-2024)",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4000,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"cohere/command-r-plus-08-2024",name:"Cohere: Command R+ (08-2024)",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4000,cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-chat",name:"DeepSeek: DeepSeek V3",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16000,cost:{input:0.2002,output:0.8001,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-chat-v3-0324",name:"DeepSeek: DeepSeek V3 0324",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:163840,maxTokens:16384,cost:{input:0.2,output:0.77,cacheRead:0.135,cacheWrite:0}}},{modelId:"deepseek/deepseek-chat-v3.1",name:"DeepSeek: DeepSeek V3.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:32768,cost:{input:0.21,output:0.79,cacheRead:0.13,cacheWrite:0}}},{modelId:"deepseek/deepseek-r1",name:"DeepSeek: R1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:16000,cost:{input:0.7,output:2.5,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-r1-0528",name:"DeepSeek: R1 0528",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:32768,cost:{input:0.5,output:2.15,cacheRead:0.35,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3.1-terminus",name:"DeepSeek: DeepSeek V3.1 Terminus",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:32768,cost:{input:0.27,output:0.95,cacheRead:0.13,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3.2",name:"DeepSeek: DeepSeek V3.2",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:64000,cost:{input:0.2288,output:0.3432,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3.2-exp",name:"DeepSeek: DeepSeek V3.2 Exp",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:65536,cost:{input:0.27,output:0.41,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-v4-flash",name:"DeepSeek: DeepSeek V4 Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:65536,cost:{input:0.09,output:0.18,cacheRead:0.02,cacheWrite:0}}},{modelId:"deepseek/deepseek-v4-pro",name:"DeepSeek: DeepSeek V4 Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:384000,cost:{input:0.435,output:0.87,cacheRead:0.003625,cacheWrite:0}}},{modelId:"essentialai/rnj-1-instruct",name:"EssentialAI: Rnj 1 Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32768,maxTokens:4096,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"google/gemini-2.5-flash",name:"Google: Gemini 2.5 Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65535,cost:{input:0.3,output:2.5,cacheRead:0.03,cacheWrite:0.083333}}},{modelId:"google/gemini-2.5-flash-lite",name:"Google: Gemini 2.5 Flash Lite",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65535,cost:{input:0.1,output:0.4,cacheRead:0.01,cacheWrite:0.083333}}},{modelId:"google/gemini-2.5-flash-lite-preview-09-2025",name:"Google: Gemini 2.5 Flash Lite Preview 09-2025",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65535,cost:{input:0.1,output:0.4,cacheRead:0.01,cacheWrite:0.083333}}},{modelId:"google/gemini-2.5-pro",name:"Google: Gemini 2.5 Pro",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0.375}}},{modelId:"google/gemini-2.5-pro-preview",name:"Google: Gemini 2.5 Pro Preview 06-05",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0.375}}},{modelId:"google/gemini-2.5-pro-preview-05-06",name:"Google: Gemini 2.5 Pro Preview 05-06",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65535,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0.375}}},{modelId:"google/gemini-3-flash-preview",name:"Google: Gemini 3 Flash Preview",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0.083333}}},{modelId:"google/gemini-3.1-flash-lite",name:"Google: Gemini 3.1 Flash Lite",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.25,output:1.5,cacheRead:0.025,cacheWrite:0.083333}}},{modelId:"google/gemini-3.1-flash-lite-preview",name:"Google: Gemini 3.1 Flash Lite Preview",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.25,output:1.5,cacheRead:0.025,cacheWrite:0.083333}}},{modelId:"google/gemini-3.1-pro-preview",name:"Google: Gemini 3.1 Pro Preview",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0.375}}},{modelId:"google/gemini-3.1-pro-preview-customtools",name:"Google: Gemini 3.1 Pro Preview Custom Tools",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048756,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0.375}}},{modelId:"google/gemini-3.5-flash",name:"Google: Gemini 3.5 Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.5,output:9,cacheRead:0.15,cacheWrite:0.083333}}},{modelId:"google/gemma-3-12b-it",name:"Google: Gemma 3 12B",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:131072,maxTokens:16384,cost:{input:0.05,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"google/gemma-3-27b-it",name:"Google: Gemma 3 27B",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:131072,maxTokens:16384,cost:{input:0.08,output:0.16,cacheRead:0,cacheWrite:0}}},{modelId:"google/gemma-4-26b-a4b-it",name:"Google: Gemma 4 26B A4B ",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:4096,cost:{input:0.06,output:0.33,cacheRead:0,cacheWrite:0}}},{modelId:"google/gemma-4-26b-a4b-it:free",name:"Google: Gemma 4 26B A4B (free)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"google/gemma-4-31b-it",name:"Google: Gemma 4 31B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.12,output:0.35,cacheRead:0.09,cacheWrite:0}}},{modelId:"google/gemma-4-31b-it:free",name:"Google: Gemma 4 31B (free)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"ibm-granite/granite-4.1-8b",name:"IBM: Granite 4.1 8B",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.05,output:0.1,cacheRead:0.05,cacheWrite:0}}},{modelId:"inception/mercury-2",name:"Inception: Mercury 2",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:50000,cost:{input:0.25,output:0.75,cacheRead:0.025,cacheWrite:0}}},{modelId:"inclusionai/ling-2.6-1t",name:"inclusionAI: Ling-2.6-1T",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0.075,output:0.625,cacheRead:0.015,cacheWrite:0}}},{modelId:"inclusionai/ling-2.6-flash",name:"inclusionAI: Ling-2.6-flash",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0.01,output:0.03,cacheRead:0.002,cacheWrite:0}}},{modelId:"inclusionai/ring-2.6-1t",name:"inclusionAI: Ring-2.6-1T",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:0.075,output:0.625,cacheRead:0.015,cacheWrite:0}}},{modelId:"kwaipilot/kat-coder-pro-v2",name:"Kwaipilot: KAT-Coder-Pro V2",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:80000,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"meta-llama/llama-3.1-70b-instruct",name:"Meta: Llama 3.1 70B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.4,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"meta-llama/llama-3.1-8b-instruct",name:"Meta: Llama 3.1 8B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.02,output:0.03,cacheRead:0,cacheWrite:0}}},{modelId:"meta-llama/llama-3.3-70b-instruct",name:"Meta: Llama 3.3 70B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.1,output:0.32,cacheRead:0,cacheWrite:0}}},{modelId:"meta-llama/llama-3.3-70b-instruct:free",name:"Meta: Llama 3.3 70B Instruct (free)",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"meta-llama/llama-4-maverick",name:"Meta: Llama 4 Maverick",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:1048576,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"meta-llama/llama-4-scout",name:"Meta: Llama 4 Scout",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:1e7,maxTokens:16384,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"minimax/minimax-m1",name:"MiniMax: MiniMax M1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:40000,cost:{input:0.4,output:2.2,cacheRead:0,cacheWrite:0}}},{modelId:"minimax/minimax-m2",name:"MiniMax: MiniMax M2",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:196608,cost:{input:0.255,output:1,cacheRead:0.03,cacheWrite:0}}},{modelId:"minimax/minimax-m2.1",name:"MiniMax: MiniMax M2.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:196608,cost:{input:0.29,output:0.95,cacheRead:0.03,cacheWrite:0}}},{modelId:"minimax/minimax-m2.5",name:"MiniMax: MiniMax M2.5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:196608,cost:{input:0.15,output:0.9,cacheRead:0.05,cacheWrite:0}}},{modelId:"minimax/minimax-m2.7",name:"MiniMax: MiniMax M2.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.25,output:1,cacheRead:0.05,cacheWrite:0}}},{modelId:"minimax/minimax-m3",name:"MiniMax: MiniMax M3",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:512000,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"mistralai/codestral-2508",name:"Mistral: Codestral 2508",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:4096,cost:{input:0.3,output:0.9,cacheRead:0.03,cacheWrite:0}}},{modelId:"mistralai/devstral-2512",name:"Mistral: Devstral 2 2512",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:4096,cost:{input:0.4,output:2,cacheRead:0.04,cacheWrite:0}}},{modelId:"mistralai/ministral-14b-2512",name:"Mistral: Ministral 3 14B 2512",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:4096,cost:{input:0.2,output:0.2,cacheRead:0.02,cacheWrite:0}}},{modelId:"mistralai/ministral-3b-2512",name:"Mistral: Ministral 3 3B 2512",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:131072,maxTokens:4096,cost:{input:0.1,output:0.1,cacheRead:0.01,cacheWrite:0}}},{modelId:"mistralai/ministral-8b-2512",name:"Mistral: Ministral 3 8B 2512",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:4096,cost:{input:0.15,output:0.15,cacheRead:0.015,cacheWrite:0}}},{modelId:"mistralai/mistral-large",name:"Mistral Large",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:2,output:6,cacheRead:0.2,cacheWrite:0}}},{modelId:"mistralai/mistral-large-2407",name:"Mistral Large 2407",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:4096,cost:{input:2,output:6,cacheRead:0.2,cacheWrite:0}}},{modelId:"mistralai/mistral-large-2512",name:"Mistral: Mistral Large 3 2512",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:4096,cost:{input:0.5,output:1.5,cacheRead:0.05,cacheWrite:0}}},{modelId:"mistralai/mistral-medium-3",name:"Mistral: Mistral Medium 3",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:131072,maxTokens:4096,cost:{input:0.4,output:2,cacheRead:0.04,cacheWrite:0}}},{modelId:"mistralai/mistral-medium-3-5",name:"Mistral: Mistral Medium 3.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:4096,cost:{input:1.5,output:7.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistralai/mistral-medium-3.1",name:"Mistral: Mistral Medium 3.1",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:131072,maxTokens:4096,cost:{input:0.4,output:2,cacheRead:0.04,cacheWrite:0}}},{modelId:"mistralai/mistral-nemo",name:"Mistral: Mistral Nemo",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:4096,cost:{input:0.02,output:0.03,cacheRead:0,cacheWrite:0}}},{modelId:"mistralai/mistral-saba",name:"Mistral: Saba",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32768,maxTokens:4096,cost:{input:0.2,output:0.6,cacheRead:0.02,cacheWrite:0}}},{modelId:"mistralai/mistral-small-2603",name:"Mistral: Mistral Small 4",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:4096,cost:{input:0.15,output:0.6,cacheRead:0.015,cacheWrite:0}}},{modelId:"mistralai/mistral-small-3.2-24b-instruct",name:"Mistral: Mistral Small 3.2 24B",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.075,output:0.2,cacheRead:0,cacheWrite:0}}},{modelId:"mistralai/mixtral-8x22b-instruct",name:"Mistral: Mixtral 8x22B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:65536,maxTokens:4096,cost:{input:2,output:6,cacheRead:0.2,cacheWrite:0}}},{modelId:"mistralai/voxtral-small-24b-2507",name:"Mistral: Voxtral Small 24B 2507",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32000,maxTokens:4096,cost:{input:0.1,output:0.3,cacheRead:0.01,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2",name:"MoonshotAI: Kimi K2 0711",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:32768,cost:{input:0.57,output:2.3,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2-0905",name:"MoonshotAI: Kimi K2 0905",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:2.5,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2-thinking",name:"MoonshotAI: Kimi K2 Thinking",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:2.5,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2.5",name:"MoonshotAI: Kimi K2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:4096,cost:{input:0.41,output:2.06,cacheRead:0.07,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2.6",name:"MoonshotAI: Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262142,cost:{input:0.68,output:3.41,cacheRead:0.34,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2.7-code",name:"MoonshotAI: Kimi K2.7 Code",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.75,output:3.5,cacheRead:0.16,cacheWrite:0}}},{modelId:"nex-agi/nex-n2-pro:free",name:"Nex AGI: Nex-N2-Pro (free)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/llama-3.3-nemotron-super-49b-v1.5",name:"NVIDIA: Llama 3.3 Nemotron Super 49B V1.5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.4,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-nano-30b-a3b",name:"NVIDIA: Nemotron 3 Nano 30B A3B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:228000,cost:{input:0.05,output:0.2,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-nano-30b-a3b:free",name:"NVIDIA: Nemotron 3 Nano 30B A3B (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free",name:"NVIDIA: Nemotron 3 Nano Omni (free)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:65536,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-super-120b-a12b",name:"NVIDIA: Nemotron 3 Super",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:4096,cost:{input:0.09,output:0.45,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-super-120b-a12b:free",name:"NVIDIA: Nemotron 3 Super (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:262144,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-ultra-550b-a55b",name:"NVIDIA: Nemotron 3 Ultra",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:16384,cost:{input:0.5,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-ultra-550b-a55b:free",name:"NVIDIA: Nemotron 3 Ultra (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:65536,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-nano-12b-v2-vl:free",name:"NVIDIA: Nemotron Nano 12B 2 VL (free)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:128000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-nano-9b-v2:free",name:"NVIDIA: Nemotron Nano 9B V2 (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-3.5-turbo",name:"OpenAI: GPT-3.5 Turbo",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:16385,maxTokens:4096,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-3.5-turbo-0613",name:"OpenAI: GPT-3.5 Turbo (older v0613)",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:4095,maxTokens:4096,cost:{input:1,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-3.5-turbo-16k",name:"OpenAI: GPT-3.5 Turbo 16k",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:16385,maxTokens:4096,cost:{input:3,output:4,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4",name:"OpenAI: GPT-4",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:8191,maxTokens:4096,cost:{input:30,output:60,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4-turbo",name:"OpenAI: GPT-4 Turbo",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:10,output:30,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4-turbo-preview",name:"OpenAI: GPT-4 Turbo Preview",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:10,output:30,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4.1",name:"OpenAI: GPT-4.1",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:4096,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/gpt-4.1-mini",name:"OpenAI: GPT-4.1 Mini",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.4,output:1.6,cacheRead:0.1,cacheWrite:0}}},{modelId:"openai/gpt-4.1-nano",name:"OpenAI: GPT-4.1 Nano",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.1,output:0.4,cacheRead:0.025,cacheWrite:0}}},{modelId:"openai/gpt-4o",name:"OpenAI: GPT-4o",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4o-2024-05-13",name:"OpenAI: GPT-4o (2024-05-13)",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:5,output:15,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4o-2024-08-06",name:"OpenAI: GPT-4o (2024-08-06)",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"openai/gpt-4o-2024-11-20",name:"OpenAI: GPT-4o (2024-11-20)",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"openai/gpt-4o-mini",name:"OpenAI: GPT-4o-mini",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0.075,cacheWrite:0}}},{modelId:"openai/gpt-4o-mini-2024-07-18",name:"OpenAI: GPT-4o-mini (2024-07-18)",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0.075,cacheWrite:0}}},{modelId:"openai/gpt-5",name:"OpenAI: GPT-5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5-codex",name:"OpenAI: GPT-5 Codex",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5-mini",name:"OpenAI: GPT-5 Mini",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"openai/gpt-5-nano",name:"OpenAI: GPT-5 Nano",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:4096,cost:{input:0.05,output:0.4,cacheRead:0.01,cacheWrite:0}}},{modelId:"openai/gpt-5-pro",name:"OpenAI: GPT-5 Pro",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:15,output:120,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-5.1",name:"OpenAI: GPT-5.1",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.13,cacheWrite:0}}},{modelId:"openai/gpt-5.1-chat",name:"OpenAI: GPT-5.1 Chat",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:32000,cost:{input:1.25,output:10,cacheRead:0.13,cacheWrite:0}}},{modelId:"openai/gpt-5.1-codex",name:"OpenAI: GPT-5.1-Codex",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.13,cacheWrite:0}}},{modelId:"openai/gpt-5.1-codex-max",name:"OpenAI: GPT-5.1-Codex-Max",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5.1-codex-mini",name:"OpenAI: GPT-5.1-Codex-Mini",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:1e5,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"openai/gpt-5.2",name:"OpenAI: GPT-5.2",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.2-chat",name:"OpenAI: GPT-5.2 Chat",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.2-codex",name:"OpenAI: GPT-5.2-Codex",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.2-pro",name:"OpenAI: GPT-5.2 Pro",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:21,output:168,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-5.3-chat",name:"OpenAI: GPT-5.3 Chat",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.3-codex",name:"OpenAI: GPT-5.3-Codex",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.4",name:"OpenAI: GPT-5.4",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"openai/gpt-5.4-mini",name:"OpenAI: GPT-5.4 Mini",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"openai/gpt-5.4-nano",name:"OpenAI: GPT-5.4 Nano",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.2,output:1.25,cacheRead:0.02,cacheWrite:0}}},{modelId:"openai/gpt-5.4-pro",name:"OpenAI: GPT-5.4 Pro",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-5.5",name:"OpenAI: GPT-5.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/gpt-5.5-pro",name:"OpenAI: GPT-5.5 Pro",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-audio",name:"OpenAI: GPT Audio",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-audio-mini",name:"OpenAI: GPT Audio Mini",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.6,output:2.4,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-chat-latest",name:"OpenAI: GPT Chat Latest",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/gpt-oss-120b",name:"OpenAI: gpt-oss-120b",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:4096,cost:{input:0.039,output:0.18,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-120b:free",name:"OpenAI: gpt-oss-120b (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-20b",name:"OpenAI: gpt-oss-20b",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:4096,cost:{input:0.029,output:0.14,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-20b:free",name:"OpenAI: gpt-oss-20b (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:8192,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-safeguard-20b",name:"OpenAI: gpt-oss-safeguard-20b",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.075,output:0.3,cacheRead:0.037,cacheWrite:0}}},{modelId:"openai/o1",name:"OpenAI: o1",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:15,output:60,cacheRead:7.5,cacheWrite:0}}},{modelId:"openai/o3",name:"OpenAI: o3",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/o3-deep-research",name:"OpenAI: o3 Deep Research",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:10,output:40,cacheRead:2.5,cacheWrite:0}}},{modelId:"openai/o3-mini",name:"OpenAI: o3 Mini",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.55,cacheWrite:0}}},{modelId:"openai/o3-mini-high",name:"OpenAI: o3 Mini High",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.55,cacheWrite:0}}},{modelId:"openai/o3-pro",name:"OpenAI: o3 Pro",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:20,output:80,cacheRead:0,cacheWrite:0}}},{modelId:"openai/o4-mini",name:"OpenAI: o4 Mini",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.275,cacheWrite:0}}},{modelId:"openai/o4-mini-deep-research",name:"OpenAI: o4 Mini Deep Research",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/o4-mini-high",name:"OpenAI: o4 Mini High",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.275,cacheWrite:0}}},{modelId:"openrouter/auto",name:"Auto Router",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:2000000,maxTokens:4096,cost:{input:-1e6,output:-1e6,cacheRead:0,cacheWrite:0}}},{modelId:"openrouter/free",name:"Free Models Router",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"openrouter/owl-alpha",name:"Owl Alpha",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1048756,maxTokens:262144,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"poolside/laguna-m.1:free",name:"Poolside: Laguna M.1 (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"poolside/laguna-xs.2:free",name:"Poolside: Laguna XS.2 (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"prime-intellect/intellect-3",name:"Prime Intellect: INTELLECT-3",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.2,output:1.1,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen-2.5-72b-instruct",name:"Qwen2.5 72B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.36,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen-plus",name:"Qwen: Qwen-Plus",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1e6,maxTokens:32768,cost:{input:0.26,output:0.78,cacheRead:0.052,cacheWrite:0.325}}},{modelId:"qwen/qwen-plus-2025-07-28",name:"Qwen: Qwen Plus 0728",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1e6,maxTokens:32768,cost:{input:0.26,output:0.78,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen-plus-2025-07-28:thinking",name:"Qwen: Qwen Plus 0728 (thinking)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:32768,cost:{input:0.26,output:0.78,cacheRead:0,cacheWrite:0.325}}},{modelId:"qwen/qwen3-14b",name:"Qwen: Qwen3 14B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131702,maxTokens:40960,cost:{input:0.1,output:0.24,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-235b-a22b",name:"Qwen: Qwen3 235B A22B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:8192,cost:{input:0.455,output:1.82,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-235b-a22b-2507",name:"Qwen: Qwen3 235B A22B Instruct 2507",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:16384,cost:{input:0.09,output:0.1,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-235b-a22b-thinking-2507",name:"Qwen: Qwen3 235B A22B Thinking 2507",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.1,output:0.1,cacheRead:0.1,cacheWrite:0}}},{modelId:"qwen/qwen3-30b-a3b",name:"Qwen: Qwen3 30B A3B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.12,output:0.5,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-30b-a3b-instruct-2507",name:"Qwen: Qwen3 30B A3B Instruct 2507",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:32000,cost:{input:0.04815,output:0.19305,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-30b-a3b-thinking-2507",name:"Qwen: Qwen3 30B A3B Thinking 2507",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.08,output:0.4,cacheRead:0.08,cacheWrite:0}}},{modelId:"qwen/qwen3-32b",name:"Qwen: Qwen3 32B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.08,output:0.28,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-8b",name:"Qwen: Qwen3 8B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:8192,cost:{input:0.05,output:0.4,cacheRead:0.05,cacheWrite:0}}},{modelId:"qwen/qwen3-coder",name:"Qwen: Qwen3 Coder 480B A35B",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1048576,maxTokens:65536,cost:{input:0.22,output:1.8,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-coder-30b-a3b-instruct",name:"Qwen: Qwen3 Coder 30B A3B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:160000,maxTokens:32768,cost:{input:0.07,output:0.27,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-coder-flash",name:"Qwen: Qwen3 Coder Flash",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1e6,maxTokens:65536,cost:{input:0.195,output:0.975,cacheRead:0.039,cacheWrite:0.24375}}},{modelId:"qwen/qwen3-coder-next",name:"Qwen: Qwen3 Coder Next",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.11,output:0.8,cacheRead:0.07,cacheWrite:0}}},{modelId:"qwen/qwen3-coder-plus",name:"Qwen: Qwen3 Coder Plus",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1e6,maxTokens:65536,cost:{input:0.65,output:3.25,cacheRead:0.13,cacheWrite:0.8125}}},{modelId:"qwen/qwen3-coder:free",name:"Qwen: Qwen3 Coder 480B A35B (free)",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1048576,maxTokens:262000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-max",name:"Qwen: Qwen3 Max",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0.78,output:3.9,cacheRead:0.156,cacheWrite:0.975}}},{modelId:"qwen/qwen3-max-thinking",name:"Qwen: Qwen3 Max Thinking",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0.78,output:3.9,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-next-80b-a3b-instruct",name:"Qwen: Qwen3 Next 80B A3B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:16384,cost:{input:0.09,output:1.1,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-next-80b-a3b-instruct:free",name:"Qwen: Qwen3 Next 80B A3B Instruct (free)",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-next-80b-a3b-thinking",name:"Qwen: Qwen3 Next 80B A3B Thinking",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0.0975,output:0.78,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-vl-235b-a22b-instruct",name:"Qwen: Qwen3 VL 235B A22B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:16384,cost:{input:0.2,output:0.88,cacheRead:0.11,cacheWrite:0}}},{modelId:"qwen/qwen3-vl-235b-a22b-thinking",name:"Qwen: Qwen3 VL 235B A22B Thinking",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:32768,cost:{input:0.26,output:2.6,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-vl-30b-a3b-instruct",name:"Qwen: Qwen3 VL 30B A3B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0.13,output:0.52,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-vl-30b-a3b-thinking",name:"Qwen: Qwen3 VL 30B A3B Thinking",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:32768,cost:{input:0.13,output:1.56,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-vl-32b-instruct",name:"Qwen: Qwen3 VL 32B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0.104,output:0.416,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-vl-8b-instruct",name:"Qwen: Qwen3 VL 8B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:256000,maxTokens:32768,cost:{input:0.08,output:0.5,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-vl-8b-thinking",name:"Qwen: Qwen3 VL 8B Thinking",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:32768,cost:{input:0.117,output:1.365,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-122b-a10b",name:"Qwen: Qwen3.5-122B-A10B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.26,output:2.08,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-27b",name:"Qwen: Qwen3.5-27B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.195,output:1.56,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-35b-a3b",name:"Qwen: Qwen3.5-35B-A3B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.14,output:1,cacheRead:0.05,cacheWrite:0}}},{modelId:"qwen/qwen3.5-397b-a17b",name:"Qwen: Qwen3.5 397B A17B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.39,output:2.34,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-9b",name:"Qwen: Qwen3.5-9B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.1,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-flash-02-23",name:"Qwen: Qwen3.5-Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.065,output:0.26,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-plus-02-15",name:"Qwen: Qwen3.5 Plus 2026-02-15",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.26,output:1.56,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-plus-20260420",name:"Qwen: Qwen3.5 Plus 2026-04-20",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.3,output:1.8,cacheRead:0,cacheWrite:0.375}}},{modelId:"qwen/qwen3.6-27b",name:"Qwen: Qwen3.6 27B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262140,cost:{input:0.2885,output:3.17,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.6-35b-a3b",name:"Qwen: Qwen3.6 35B A3B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.15,output:1,cacheRead:0.05,cacheWrite:0}}},{modelId:"qwen/qwen3.6-flash",name:"Qwen: Qwen3.6 Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.1875,output:1.125,cacheRead:0,cacheWrite:0.234375}}},{modelId:"qwen/qwen3.6-max-preview",name:"Qwen: Qwen3.6 Max Preview",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:1.04,output:6.24,cacheRead:0,cacheWrite:1.3}}},{modelId:"qwen/qwen3.6-plus",name:"Qwen: Qwen3.6 Plus",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.325,output:1.95,cacheRead:0,cacheWrite:0.40625}}},{modelId:"qwen/qwen3.7-max",name:"Qwen: Qwen3.7 Max",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:65536,cost:{input:1.25,output:3.75,cacheRead:0.25,cacheWrite:1.5625}}},{modelId:"qwen/qwen3.7-plus",name:"Qwen: Qwen3.7 Plus",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.32,output:1.28,cacheRead:0.064,cacheWrite:0.4}}},{modelId:"rekaai/reka-edge",name:"Reka Edge",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:16384,maxTokens:16384,cost:{input:0.1,output:0.1,cacheRead:0,cacheWrite:0}}},{modelId:"relace/relace-search",name:"Relace: Relace Search",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:128000,cost:{input:1,output:3,cacheRead:0,cacheWrite:0}}},{modelId:"sao10k/l3.1-euryale-70b",name:"Sao10K: Llama 3.1 Euryale 70B v2.2",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.85,output:0.85,cacheRead:0,cacheWrite:0}}},{modelId:"stepfun/step-3.5-flash",name:"StepFun: Step 3.5 Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:16384,cost:{input:0.09,output:0.3,cacheRead:0.02,cacheWrite:0}}},{modelId:"stepfun/step-3.7-flash",name:"StepFun: Step 3.7 Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0.2,output:1.15,cacheRead:0.04,cacheWrite:0}}},{modelId:"tencent/hy3-preview",name:"Tencent: Hy3 preview",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:4096,cost:{input:0.063,output:0.21,cacheRead:0.021,cacheWrite:0}}},{modelId:"thedrummer/rocinante-12b",name:"TheDrummer: Rocinante 12B",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32768,maxTokens:32768,cost:{input:0.17,output:0.43,cacheRead:0,cacheWrite:0}}},{modelId:"thedrummer/unslopnemo-12b",name:"TheDrummer: UnslopNemo 12B",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32768,maxTokens:32768,cost:{input:0.4,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"upstage/solar-pro-3",name:"Upstage: Solar Pro 3",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.15,output:0.6,cacheRead:0.015,cacheWrite:0}}},{modelId:"x-ai/grok-4.20",name:"xAI: Grok 4.20",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:2000000,maxTokens:4096,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"x-ai/grok-4.3",name:"xAI: Grok 4.3",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:4096,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"x-ai/grok-build-0.1",name:"xAI: Grok Build 0.1",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:4096,cost:{input:1,output:2,cacheRead:0.2,cacheWrite:0}}},{modelId:"xiaomi/mimo-v2-flash",name:"Xiaomi: MiMo-V2-Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:0.1,output:0.3,cacheRead:0.01,cacheWrite:0}}},{modelId:"xiaomi/mimo-v2.5",name:"Xiaomi: MiMo-V2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:131072,cost:{input:0.14,output:0.28,cacheRead:0.0028,cacheWrite:0}}},{modelId:"xiaomi/mimo-v2.5-pro",name:"Xiaomi: MiMo-V2.5-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:0.435,output:0.87,cacheRead:0.0036,cacheWrite:0}}},{modelId:"z-ai/glm-4.5",name:"Z.ai: GLM 4.5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:98304,cost:{input:0.6,output:2.2,cacheRead:0.11,cacheWrite:0}}},{modelId:"z-ai/glm-4.5-air",name:"Z.ai: GLM 4.5 Air",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131070,cost:{input:0.125,output:0.85,cacheRead:0.06,cacheWrite:0}}},{modelId:"z-ai/glm-4.5v",name:"Z.ai: GLM 4.5V",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:65536,maxTokens:16384,cost:{input:0.6,output:1.8,cacheRead:0.11,cacheWrite:0}}},{modelId:"z-ai/glm-4.6",name:"Z.ai: GLM 4.6",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:131072,cost:{input:0.43,output:1.74,cacheRead:0.08,cacheWrite:0}}},{modelId:"z-ai/glm-4.6v",name:"Z.ai: GLM 4.6V",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:32768,cost:{input:0.3,output:0.9,cacheRead:0.055,cacheWrite:0}}},{modelId:"z-ai/glm-4.7",name:"Z.ai: GLM 4.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:131072,cost:{input:0.4,output:1.75,cacheRead:0.08,cacheWrite:0}}},{modelId:"z-ai/glm-4.7-flash",name:"Z.ai: GLM 4.7 Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:16384,cost:{input:0.06,output:0.4,cacheRead:0.01,cacheWrite:0}}},{modelId:"z-ai/glm-5",name:"Z.ai: GLM 5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:4096,cost:{input:0.6,output:1.9,cacheRead:0.119,cacheWrite:0}}},{modelId:"z-ai/glm-5-turbo",name:"Z.ai: GLM 5 Turbo",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:131072,cost:{input:1.2,output:4,cacheRead:0.24,cacheWrite:0}}},{modelId:"z-ai/glm-5.1",name:"Z.ai: GLM 5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:4096,cost:{input:0.98,output:3.08,cacheRead:0.182,cacheWrite:0}}},{modelId:"~anthropic/claude-fable-latest",name:"Anthropic: Claude Fable Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"~anthropic/claude-haiku-latest",name:"Anthropic Claude Haiku Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"~anthropic/claude-opus-latest",name:"Anthropic: Claude Opus Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"~anthropic/claude-sonnet-latest",name:"Anthropic Claude Sonnet Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"~google/gemini-flash-latest",name:"Google Gemini Flash Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.5,output:9,cacheRead:0.15,cacheWrite:0.083333}}},{modelId:"~google/gemini-pro-latest",name:"Google Gemini Pro Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0.375}}},{modelId:"~moonshotai/kimi-latest",name:"MoonshotAI Kimi Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262142,cost:{input:0.68,output:3.41,cacheRead:0.34,cacheWrite:0}}},{modelId:"~openai/gpt-latest",name:"OpenAI GPT Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"~openai/gpt-mini-latest",name:"OpenAI GPT Mini Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}}]},mistral:{name:"mistral",config:{api:"mistral-conversations",baseUrl:"https://api.mistral.ai",apiKey:"MISTRAL_API_KEY"},models:[{modelId:"codestral-latest",name:"Codestral (latest)",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:4096,cost:{input:0.3,output:0.9,cacheRead:0,cacheWrite:0}}},{modelId:"devstral-2512",name:"Devstral 2",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"devstral-latest",name:"Devstral 2",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"devstral-medium-2507",name:"Devstral Medium",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"devstral-medium-latest",name:"Devstral 2 (latest)",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"devstral-small-2505",name:"Devstral Small 2505",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"devstral-small-2507",name:"Devstral Small",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"labs-devstral-small-2512",name:"Devstral Small 2",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"magistral-medium-latest",name:"Magistral Medium (latest)",config:{api:"mistral-conversations",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:2,output:5,cacheRead:0,cacheWrite:0}}},{modelId:"magistral-small",name:"Magistral Small",config:{api:"mistral-conversations",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"ministral-3b-latest",name:"Ministral 3B (latest)",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.04,output:0.04,cacheRead:0,cacheWrite:0}}},{modelId:"ministral-8b-latest",name:"Ministral 8B (latest)",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.1,output:0.1,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-large-2411",name:"Mistral Large 2.1",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:2,output:6,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-large-2512",name:"Mistral Large 3",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-large-latest",name:"Mistral Large (latest)",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-medium-2505",name:"Mistral Medium 3",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:131072,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-medium-2508",name:"Mistral Medium 3.1",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-medium-2604",name:"Mistral Medium 3.5",config:{api:"mistral-conversations",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:1.5,output:7.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-medium-3.5",name:"Mistral Medium 3.5",config:{api:"mistral-conversations",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:1.5,output:7.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-medium-latest",name:"Mistral Medium (latest)",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-nemo",name:"Mistral Nemo",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-small-2506",name:"Mistral Small 3.2",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-small-2603",name:"Mistral Small 4",config:{api:"mistral-conversations",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-small-latest",name:"Mistral Small (latest)",config:{api:"mistral-conversations",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"open-mistral-7b",name:"Mistral 7B",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:8000,maxTokens:8000,cost:{input:0.25,output:0.25,cacheRead:0,cacheWrite:0}}},{modelId:"open-mistral-nemo",name:"Open Mistral Nemo",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"open-mixtral-8x22b",name:"Mixtral 8x22B",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:64000,maxTokens:64000,cost:{input:2,output:6,cacheRead:0,cacheWrite:0}}},{modelId:"open-mixtral-8x7b",name:"Mixtral 8x7B",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:32000,maxTokens:32000,cost:{input:0.7,output:0.7,cacheRead:0,cacheWrite:0}}},{modelId:"pixtral-12b",name:"Pixtral 12B",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:128000,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"pixtral-large-latest",name:"Pixtral Large (latest)",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:128000,cost:{input:2,output:6,cacheRead:0,cacheWrite:0}}}]},"amazon-bedrock":{name:"amazon-bedrock",config:{api:"bedrock-converse-stream",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",apiKey:""},models:[{modelId:"amazon.nova-2-lite-v1:0",name:"Nova 2 Lite",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:0.33,output:2.75,cacheRead:0,cacheWrite:0}}},{modelId:"amazon.nova-lite-v1:0",name:"Nova Lite",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:300000,maxTokens:8192,cost:{input:0.06,output:0.24,cacheRead:0.015,cacheWrite:0}}},{modelId:"amazon.nova-micro-v1:0",name:"Nova Micro",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:8192,cost:{input:0.035,output:0.14,cacheRead:0.00875,cacheWrite:0}}},{modelId:"amazon.nova-pro-v1:0",name:"Nova Pro",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:300000,maxTokens:8192,cost:{input:0.8,output:3.2,cacheRead:0.2,cacheWrite:0}}},{modelId:"anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"anthropic.claude-opus-4-1-20250805-v1:0",name:"Claude Opus 4.1",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"anthropic.claude-opus-4-5-20251101-v1:0",name:"Claude Opus 4.5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic.claude-opus-4-6-v1",name:"Claude Opus 4.6",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic.claude-opus-4-7",name:"Claude Opus 4.7",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic.claude-opus-4-8",name:"Claude Opus 4.8",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"au.anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5 (AU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"au.anthropic.claude-opus-4-6-v1",name:"AU Anthropic Claude Opus 4.6",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:16.5,output:82.5,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"au.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (AU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"au.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (AU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"au.anthropic.claude-sonnet-4-6",name:"AU Anthropic Claude Sonnet 4.6",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:3.3,output:16.5,cacheRead:0.33,cacheWrite:4.125}}},{modelId:"deepseek.r1-v1:0",name:"DeepSeek-R1",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:32768,cost:{input:1.35,output:5.4,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek.v3-v1:0",name:"DeepSeek-V3.1",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:81920,cost:{input:0.58,output:1.68,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek.v3.2",name:"DeepSeek-V3.2",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:81920,cost:{input:0.62,output:1.85,cacheRead:0,cacheWrite:0}}},{modelId:"eu.anthropic.claude-fable-5",name:"Claude Fable 5 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:11,output:55,cacheRead:1.1,cacheWrite:13.75}}},{modelId:"eu.anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"eu.anthropic.claude-opus-4-5-20251101-v1:0",name:"Claude Opus 4.5 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"eu.anthropic.claude-opus-4-6-v1",name:"Claude Opus 4.6 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5.5,output:27.5,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"eu.anthropic.claude-opus-4-7",name:"Claude Opus 4.7 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5.5,output:27.5,cacheRead:0.55,cacheWrite:6.875}}},{modelId:"eu.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5.5,output:27.5,cacheRead:0.55,cacheWrite:6.875}}},{modelId:"eu.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3.3,output:16.5,cacheRead:0.33,cacheWrite:4.125}}},{modelId:"eu.anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3.3,output:16.5,cacheRead:0.33,cacheWrite:4.125}}},{modelId:"global.anthropic.claude-fable-5",name:"Claude Fable 5 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"global.anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"global.anthropic.claude-opus-4-5-20251101-v1:0",name:"Claude Opus 4.5 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"global.anthropic.claude-opus-4-6-v1",name:"Claude Opus 4.6 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"global.anthropic.claude-opus-4-7",name:"Claude Opus 4.7 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"global.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"global.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"global.anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"google.gemma-3-27b-it",name:"Google Gemma 3 27B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:202752,maxTokens:8192,cost:{input:0.12,output:0.2,cacheRead:0,cacheWrite:0}}},{modelId:"google.gemma-3-4b-it",name:"Gemma 3 4B IT",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:0.04,output:0.08,cacheRead:0,cacheWrite:0}}},{modelId:"jp.anthropic.claude-opus-4-7",name:"Claude Opus 4.7 (JP)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"jp.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (JP)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"jp.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (JP)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"jp.anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6 (JP)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"meta.llama3-1-70b-instruct-v1:0",name:"Llama 3.1 70B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.72,output:0.72,cacheRead:0,cacheWrite:0}}},{modelId:"meta.llama3-1-8b-instruct-v1:0",name:"Llama 3.1 8B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.22,output:0.22,cacheRead:0,cacheWrite:0}}},{modelId:"meta.llama3-3-70b-instruct-v1:0",name:"Llama 3.3 70B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.72,output:0.72,cacheRead:0,cacheWrite:0}}},{modelId:"meta.llama4-maverick-17b-instruct-v1:0",name:"Llama 4 Maverick 17B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:16384,cost:{input:0.24,output:0.97,cacheRead:0,cacheWrite:0}}},{modelId:"meta.llama4-scout-17b-instruct-v1:0",name:"Llama 4 Scout 17B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:3500000,maxTokens:16384,cost:{input:0.17,output:0.66,cacheRead:0,cacheWrite:0}}},{modelId:"minimax.minimax-m2",name:"MiniMax M2",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:204608,maxTokens:128000,cost:{input:0.3,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"minimax.minimax-m2.1",name:"MiniMax M2.1",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"minimax.minimax-m2.5",name:"MiniMax M2.5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:196608,maxTokens:98304,cost:{input:0.3,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.devstral-2-123b",name:"Devstral 2 123B",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:8192,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.magistral-small-2509",name:"Magistral Small 1.2",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:40000,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.ministral-3-14b-instruct",name:"Ministral 14B 3.0",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.2,output:0.2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.ministral-3-3b-instruct",name:"Ministral 3 3B",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:256000,maxTokens:8192,cost:{input:0.1,output:0.1,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.ministral-3-8b-instruct",name:"Ministral 3 8B",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.mistral-large-3-675b-instruct",name:"Mistral Large 3",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:256000,maxTokens:8192,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.pixtral-large-2502-v1:0",name:"Pixtral Large (25.02)",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:8192,cost:{input:2,output:6,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.voxtral-mini-3b-2507",name:"Voxtral Mini 3B 2507",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.04,output:0.04,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.voxtral-small-24b-2507",name:"Voxtral Small 24B 2507",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:32000,maxTokens:8192,cost:{input:0.15,output:0.35,cacheRead:0,cacheWrite:0}}},{modelId:"moonshot.kimi-k2-thinking",name:"Kimi K2 Thinking",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:262143,maxTokens:16000,cost:{input:0.6,output:2.5,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai.kimi-k2.5",name:"Kimi K2.5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:262143,maxTokens:16000,cost:{input:0.6,output:3,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia.nemotron-nano-12b-v2",name:"NVIDIA Nemotron Nano 12B v2 VL BF16",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:0.2,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia.nemotron-nano-3-30b",name:"NVIDIA Nemotron Nano 3 30B",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.06,output:0.24,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia.nemotron-nano-9b-v2",name:"NVIDIA Nemotron Nano 9B v2",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.06,output:0.23,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia.nemotron-super-3-120b",name:"NVIDIA Nemotron 3 Super 120B A12B",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:131072,cost:{input:0.15,output:0.65,cacheRead:0,cacheWrite:0}}},{modelId:"openai.gpt-5.4",name:"GPT-5.4",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:2.75,output:16.5,cacheRead:0.275,cacheWrite:0}}},{modelId:"openai.gpt-5.5",name:"GPT-5.5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:5.5,output:33,cacheRead:0.55,cacheWrite:0}}},{modelId:"openai.gpt-oss-120b",name:"gpt-oss-120b",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"openai.gpt-oss-120b-1:0",name:"gpt-oss-120b",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"openai.gpt-oss-20b",name:"gpt-oss-20b",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.07,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"openai.gpt-oss-20b-1:0",name:"gpt-oss-20b",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.07,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"openai.gpt-oss-safeguard-120b",name:"GPT OSS Safeguard 120B",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"openai.gpt-oss-safeguard-20b",name:"GPT OSS Safeguard 20B",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.07,output:0.2,cacheRead:0,cacheWrite:0}}},{modelId:"qwen.qwen3-235b-a22b-2507-v1:0",name:"Qwen3 235B A22B 2507",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:131072,cost:{input:0.22,output:0.88,cacheRead:0,cacheWrite:0}}},{modelId:"qwen.qwen3-32b-v1:0",name:"Qwen3 32B (dense)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:16384,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"qwen.qwen3-coder-30b-a3b-v1:0",name:"Qwen3 Coder 30B A3B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:131072,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"qwen.qwen3-coder-480b-a35b-v1:0",name:"Qwen3 Coder 480B A35B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.22,output:1.8,cacheRead:0,cacheWrite:0}}},{modelId:"qwen.qwen3-coder-next",name:"Qwen3 Coder Next",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.22,output:1.8,cacheRead:0,cacheWrite:0}}},{modelId:"qwen.qwen3-next-80b-a3b",name:"Qwen/Qwen3-Next-80B-A3B-Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:262000,maxTokens:262000,cost:{input:0.14,output:1.4,cacheRead:0,cacheWrite:0}}},{modelId:"qwen.qwen3-vl-235b-a22b",name:"Qwen/Qwen3-VL-235B-A22B-Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:262000,maxTokens:262000,cost:{input:0.3,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"us.anthropic.claude-fable-5",name:"Claude Fable 5 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"us.anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"us.anthropic.claude-opus-4-1-20250805-v1:0",name:"Claude Opus 4.1 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"us.anthropic.claude-opus-4-5-20251101-v1:0",name:"Claude Opus 4.5 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"us.anthropic.claude-opus-4-6-v1",name:"Claude Opus 4.6 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"us.anthropic.claude-opus-4-7",name:"Claude Opus 4.7 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"us.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"us.anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"us.deepseek.r1-v1:0",name:"DeepSeek-R1 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:32768,cost:{input:1.35,output:5.4,cacheRead:0,cacheWrite:0}}},{modelId:"us.meta.llama4-maverick-17b-instruct-v1:0",name:"Llama 4 Maverick 17B Instruct (US)",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:16384,cost:{input:0.24,output:0.97,cacheRead:0,cacheWrite:0}}},{modelId:"us.meta.llama4-scout-17b-instruct-v1:0",name:"Llama 4 Scout 17B Instruct (US)",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:3500000,maxTokens:16384,cost:{input:0.17,output:0.66,cacheRead:0,cacheWrite:0}}},{modelId:"writer.palmyra-x4-v1:0",name:"Palmyra X4",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:122880,maxTokens:8192,cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0}}},{modelId:"writer.palmyra-x5-v1:0",name:"Palmyra X5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:1040000,maxTokens:8192,cost:{input:0.6,output:6,cacheRead:0,cacheWrite:0}}},{modelId:"zai.glm-4.7",name:"GLM-4.7",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.6,output:2.2,cacheRead:0,cacheWrite:0}}},{modelId:"zai.glm-4.7-flash",name:"GLM-4.7-Flash",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:131072,cost:{input:0.07,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"zai.glm-5",name:"GLM-5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:101376,cost:{input:1,output:3.2,cacheRead:0,cacheWrite:0}}}]},"ant-ling":{name:"ant-ling",config:{api:"openai-completions",baseUrl:"https://api.ant-ling.com/v1",apiKey:""},models:[{modelId:"Ling-2.6-1T",name:"Ling 2.6 1T",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:0.06,output:0.25,cacheRead:0,cacheWrite:0}}},{modelId:"Ling-2.6-flash",name:"Ling 2.6 Flash",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:0.01,output:0.02,cacheRead:0,cacheWrite:0}}},{modelId:"Ring-2.6-1T",name:"Ring 2.6 1T",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:0.06,output:0.25,cacheRead:0,cacheWrite:0}}}]},"azure-openai-responses":{name:"azure-openai-responses",config:{api:"azure-openai-responses",baseUrl:"",apiKey:"AZURE_OPENAI_API_KEY"},models:[{modelId:"gpt-4",name:"GPT-4",config:{api:"azure-openai-responses",reasoning:!1,input:["text"],contextWindow:8192,maxTokens:8192,cost:{input:30,output:60,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4-turbo",name:"GPT-4 Turbo",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:10,output:30,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4.1",name:"GPT-4.1",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"gpt-4.1-mini",name:"GPT-4.1 mini",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.4,output:1.6,cacheRead:0.1,cacheWrite:0}}},{modelId:"gpt-4.1-nano",name:"GPT-4.1 nano",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.1,output:0.4,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-4o",name:"GPT-4o",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"gpt-4o-2024-05-13",name:"GPT-4o (2024-05-13)",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:5,output:15,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4o-2024-08-06",name:"GPT-4o (2024-08-06)",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"gpt-4o-2024-11-20",name:"GPT-4o (2024-11-20)",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"gpt-4o-mini",name:"GPT-4o mini",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0.075,cacheWrite:0}}},{modelId:"gpt-5",name:"GPT-5",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5-chat-latest",name:"GPT-5 Chat Latest",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5-codex",name:"GPT-5-Codex",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5-mini",name:"GPT-5 Mini",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-5-nano",name:"GPT-5 Nano",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.05,output:0.4,cacheRead:0.005,cacheWrite:0}}},{modelId:"gpt-5-pro",name:"GPT-5 Pro",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:15,output:120,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-5.1",name:"GPT-5.1",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-chat-latest",name:"GPT-5.1 Chat",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-codex",name:"GPT-5.1 Codex",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-codex-max",name:"GPT-5.1 Codex Max",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-codex-mini",name:"GPT-5.1 Codex mini",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-5.2",name:"GPT-5.2",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-chat-latest",name:"GPT-5.2 Chat",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-codex",name:"GPT-5.2 Codex",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-pro",name:"GPT-5.2 Pro",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:21,output:168,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-5.3-chat-latest",name:"GPT-5.3 Chat (latest)",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.3-codex",name:"GPT-5.3 Codex",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:32000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.4",name:"GPT-5.4",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"gpt-5.4-mini",name:"GPT-5.4 mini",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"gpt-5.4-nano",name:"GPT-5.4 nano",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.2,output:1.25,cacheRead:0.02,cacheWrite:0}}},{modelId:"gpt-5.4-pro",name:"GPT-5.4 Pro",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-5.5",name:"GPT-5.5",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"gpt-5.5-pro",name:"GPT-5.5 Pro",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"o1",name:"o1",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:15,output:60,cacheRead:7.5,cacheWrite:0}}},{modelId:"o1-pro",name:"o1-pro",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:150,output:600,cacheRead:0,cacheWrite:0}}},{modelId:"o3",name:"o3",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"o3-deep-research",name:"o3-deep-research",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:10,output:40,cacheRead:2.5,cacheWrite:0}}},{modelId:"o3-mini",name:"o3-mini",config:{api:"azure-openai-responses",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.55,cacheWrite:0}}},{modelId:"o3-pro",name:"o3-pro",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:20,output:80,cacheRead:0,cacheWrite:0}}},{modelId:"o4-mini",name:"o4-mini",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.275,cacheWrite:0}}},{modelId:"o4-mini-deep-research",name:"o4-mini-deep-research",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}}]},cerebras:{name:"cerebras",config:{api:"openai-completions",baseUrl:"https://api.cerebras.ai/v1",apiKey:"CEREBRAS_API_KEY"},models:[{modelId:"gpt-oss-120b",name:"GPT OSS 120B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:40960,cost:{input:0.35,output:0.75,cacheRead:0,cacheWrite:0}}},{modelId:"zai-glm-4.7",name:"Z.AI GLM-4.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:40960,cost:{input:2.25,output:2.75,cacheRead:0,cacheWrite:0}}}]},"cloudflare-ai-gateway":{name:"cloudflare-ai-gateway",config:{api:"anthropic-messages",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic",apiKey:"CLOUDFLARE_API_KEY"},models:[{modelId:"claude-3-5-haiku",name:"Claude Haiku 3.5 (latest)",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:0.8,output:4,cacheRead:0.08,cacheWrite:1}}},{modelId:"claude-3-haiku",name:"Claude Haiku 3",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:0.25,output:1.25,cacheRead:0.03,cacheWrite:0.3}}},{modelId:"claude-3-opus",name:"Claude Opus 3",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-3-sonnet",name:"Claude Sonnet 3",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:0.3}}},{modelId:"claude-3.5-haiku",name:"Claude Haiku 3.5 (latest)",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:0.8,output:4,cacheRead:0.08,cacheWrite:1}}},{modelId:"claude-3.5-sonnet",name:"Claude Sonnet 3.5 v2",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-fable-5",name:"Claude Fable 5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"claude-haiku-4-5",name:"Claude Haiku 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"claude-opus-4",name:"Claude Opus 4 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-opus-4-1",name:"Claude Opus 4.1 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-opus-4-5",name:"Claude Opus 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-6",name:"Claude Opus 4.6 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-7",name:"Claude Opus 4.7",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-8",name:"Claude Opus 4.8",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-sonnet-4",name:"Claude Sonnet 4 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-5",name:"Claude Sonnet 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"gpt-4",name:"GPT-4",config:{api:"openai-responses",reasoning:!1,input:["text"],contextWindow:8192,maxTokens:8192,cost:{input:30,output:60,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4-turbo",name:"GPT-4 Turbo",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:10,output:30,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4o",name:"GPT-4o",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"gpt-4o-mini",name:"GPT-4o mini",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0.08,cacheWrite:0}}},{modelId:"gpt-5.1",name:"GPT-5.1",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.13,cacheWrite:0}}},{modelId:"gpt-5.1-codex",name:"GPT-5.1 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.2",name:"GPT-5.2",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-codex",name:"GPT-5.2 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.3-codex",name:"GPT-5.3 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.4",name:"GPT-5.4",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"gpt-5.5",name:"GPT-5.5",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"o1",name:"o1",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:15,output:60,cacheRead:7.5,cacheWrite:0}}},{modelId:"o3",name:"o3",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"o3-mini",name:"o3-mini",config:{api:"openai-responses",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.55,cacheWrite:0}}},{modelId:"o3-pro",name:"o3-pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:20,output:80,cacheRead:0,cacheWrite:0}}},{modelId:"o4-mini",name:"o4-mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.28,cacheWrite:0}}},{modelId:"workers-ai/@cf/moonshotai/kimi-k2.5",name:"Kimi K2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0.6,output:3,cacheRead:0.1,cacheWrite:0}}},{modelId:"workers-ai/@cf/moonshotai/kimi-k2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"workers-ai/@cf/nvidia/nemotron-3-120b-a12b",name:"Nemotron 3 Super 120B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:256000,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"workers-ai/@cf/zai-org/glm-4.7-flash",name:"GLM-4.7-Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.06,output:0.4,cacheRead:0,cacheWrite:0}}}]},"cloudflare-workers-ai":{name:"cloudflare-workers-ai",config:{api:"openai-completions",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",apiKey:"CLOUDFLARE_API_KEY"},models:[{modelId:"@cf/google/gemma-4-26b-a4b-it",name:"Gemma 4 26B A4B IT",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:16384,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/ibm-granite/granite-4.0-h-micro",name:"Granite 4.0 H Micro",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131000,maxTokens:131000,cost:{input:0.017,output:0.112,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/meta/llama-3.3-70b-instruct-fp8-fast",name:"Llama 3.3 70B Instruct fp8 Fast",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:24000,maxTokens:24000,cost:{input:0.293,output:2.253,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/meta/llama-4-scout-17b-16e-instruct",name:"Llama 4 Scout 17B 16E Instruct",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:131000,maxTokens:16384,cost:{input:0.27,output:0.85,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/mistralai/mistral-small-3.1-24b-instruct",name:"Mistral Small 3.1 24B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.351,output:0.555,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/moonshotai/kimi-k2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:256000,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"@cf/moonshotai/kimi-k2.7-code",name:"Kimi K2.7 Code",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.95,output:4,cacheRead:0.19,cacheWrite:0}}},{modelId:"@cf/nvidia/nemotron-3-120b-a12b",name:"Nemotron 3 Super 120B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:256000,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/openai/gpt-oss-120b",name:"GPT OSS 120B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.35,output:0.75,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/openai/gpt-oss-20b",name:"GPT OSS 20B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.2,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/qwen/qwen3-30b-a3b-fp8",name:"Qwen3 30B A3b fp8",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:32768,maxTokens:32768,cost:{input:0.0509,output:0.335,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/zai-org/glm-4.7-flash",name:"GLM-4.7-Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.0605,output:0.4,cacheRead:0,cacheWrite:0}}}]},fireworks:{name:"fireworks",config:{api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",apiKey:"FIREWORKS_API_KEY"},models:[{modelId:"accounts/fireworks/models/deepseek-v4-flash",name:"DeepSeek V4 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:0.14,output:0.28,cacheRead:0.03,cacheWrite:0}}},{modelId:"accounts/fireworks/models/deepseek-v4-pro",name:"DeepSeek V4 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:1.74,output:3.48,cacheRead:0.145,cacheWrite:0}}},{modelId:"accounts/fireworks/models/glm-5p1",name:"GLM 5.1",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:202800,maxTokens:131072,cost:{input:1.4,output:4.4,cacheRead:0.26,cacheWrite:0}}},{modelId:"accounts/fireworks/models/gpt-oss-120b",name:"GPT OSS 120B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:32768,cost:{input:0.15,output:0.6,cacheRead:0.015,cacheWrite:0}}},{modelId:"accounts/fireworks/models/gpt-oss-20b",name:"GPT OSS 20B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:32768,cost:{input:0.07,output:0.3,cacheRead:0.035,cacheWrite:0}}},{modelId:"accounts/fireworks/models/kimi-k2p6",name:"Kimi K2.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262000,maxTokens:262000,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"accounts/fireworks/models/kimi-k2p7-code",name:"Kimi K2.7 Code",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262000,maxTokens:262000,cost:{input:0.95,output:4,cacheRead:0.19,cacheWrite:0}}},{modelId:"accounts/fireworks/models/minimax-m2p7",name:"MiniMax-M2.7",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:196608,maxTokens:196608,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"accounts/fireworks/models/minimax-m3",name:"MiniMax-M3",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:512000,maxTokens:512000,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"accounts/fireworks/models/qwen3p7-plus",name:"Qwen 3.7 Plus",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.4,output:1.6,cacheRead:0.08,cacheWrite:0}}},{modelId:"accounts/fireworks/routers/glm-5p1-fast",name:"GLM 5.1 Fast",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:202800,maxTokens:131072,cost:{input:2.8,output:8.8,cacheRead:0.52,cacheWrite:0}}},{modelId:"accounts/fireworks/routers/kimi-k2p6-fast",name:"Kimi K2.6 Fast",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262000,maxTokens:262000,cost:{input:2,output:8,cacheRead:0.3,cacheWrite:0}}},{modelId:"accounts/fireworks/routers/kimi-k2p6-turbo",name:"Kimi K2.6 Turbo",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262000,maxTokens:262000,cost:{input:2,output:8,cacheRead:0.3,cacheWrite:0}}},{modelId:"accounts/fireworks/routers/kimi-k2p7-code-fast",name:"Kimi K2.7 Code Fast",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262000,maxTokens:262000,cost:{input:2,output:8,cacheRead:0.38,cacheWrite:0}}}]},"github-copilot":{name:"github-copilot",config:{api:"openai-completions",baseUrl:"https://api.individual.githubcopilot.com",apiKey:"COPILOT_GITHUB_TOKEN"},models:[{modelId:"claude-fable-5",name:"Claude Fable 5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"claude-haiku-4.5",name:"Claude Haiku 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"claude-opus-4.5",name:"Claude Opus 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4.6",name:"Claude Opus 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:32000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4.7",name:"Claude Opus 4.7",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4.8",name:"Claude Opus 4.8",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-sonnet-4",name:"Claude Sonnet 4 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:216000,maxTokens:16000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4.5",name:"Claude Sonnet 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4.6",name:"Claude Sonnet 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:32000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"gemini-2.5-pro",name:"Gemini 2.5 Pro",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:64000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:64000,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0}}},{modelId:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"gemini-3.5-flash",name:"Gemini 3.5 Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1.5,output:9,cacheRead:0.15,cacheWrite:0}}},{modelId:"gpt-4.1",name:"GPT-4.1",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"gpt-5-mini",name:"GPT-5 Mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:264000,maxTokens:64000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-5.2",name:"GPT-5.2",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-codex",name:"GPT-5.2 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.3-codex",name:"GPT-5.3 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.4",name:"GPT-5.4",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"gpt-5.4-mini",name:"GPT-5.4 mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"gpt-5.4-nano",name:"GPT-5.4 nano",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.2,output:1.25,cacheRead:0.02,cacheWrite:0}}},{modelId:"gpt-5.5",name:"GPT-5.5",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"raptor-mini",name:"Raptor mini",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}}]},"google-vertex":{name:"google-vertex",config:{api:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",apiKey:"GOOGLE_CLOUD_API_KEY"},models:[{modelId:"gemini-1.5-flash",name:"Gemini 1.5 Flash (Vertex)",config:{api:"google-vertex",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:8192,cost:{input:0.075,output:0.3,cacheRead:0.01875,cacheWrite:0}}},{modelId:"gemini-1.5-flash-8b",name:"Gemini 1.5 Flash-8B (Vertex)",config:{api:"google-vertex",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:8192,cost:{input:0.0375,output:0.15,cacheRead:0.01,cacheWrite:0}}},{modelId:"gemini-1.5-pro",name:"Gemini 1.5 Pro (Vertex)",config:{api:"google-vertex",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:8192,cost:{input:1.25,output:5,cacheRead:0.3125,cacheWrite:0}}},{modelId:"gemini-2.0-flash",name:"Gemini 2.0 Flash (Vertex)",config:{api:"google-vertex",reasoning:!1,input:["text","image"],contextWindow:1048576,maxTokens:8192,cost:{input:0.15,output:0.6,cacheRead:0.0375,cacheWrite:0}}},{modelId:"gemini-2.0-flash-lite",name:"Gemini 2.0 Flash Lite (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.075,output:0.3,cacheRead:0.01875,cacheWrite:0}}},{modelId:"gemini-2.5-flash",name:"Gemini 2.5 Flash (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.3,output:2.5,cacheRead:0.03,cacheWrite:0}}},{modelId:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.1,output:0.4,cacheRead:0.01,cacheWrite:0}}},{modelId:"gemini-2.5-flash-lite-preview-09-2025",name:"Gemini 2.5 Flash Lite Preview 09-25 (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.1,output:0.4,cacheRead:0.01,cacheWrite:0}}},{modelId:"gemini-2.5-pro",name:"Gemini 2.5 Pro (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0}}},{modelId:"gemini-3-pro-preview",name:"Gemini 3 Pro Preview (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"gemini-3.1-pro-preview-customtools",name:"Gemini 3.1 Pro Preview Custom Tools (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}}]},huggingface:{name:"huggingface",config:{api:"openai-completions",baseUrl:"https://router.huggingface.co/v1",apiKey:"HF_TOKEN"},models:[{modelId:"MiniMaxAI/MiniMax-M2.1",name:"MiniMax-M2.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"MiniMaxAI/MiniMax-M2.5",name:"MiniMax-M2.5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.03,cacheWrite:0}}},{modelId:"MiniMaxAI/MiniMax-M2.7",name:"MiniMax-M2.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"Qwen/Qwen3-235B-A22B-Thinking-2507",name:"Qwen3-235B-A22B-Thinking-2507",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:131072,cost:{input:0.3,output:3,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3-Coder-480B-A35B-Instruct",name:"Qwen3-Coder-480B-A35B-Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:66536,cost:{input:2,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3-Coder-Next",name:"Qwen3-Coder-Next",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:0.2,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3-Next-80B-A3B-Instruct",name:"Qwen3-Next-80B-A3B-Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:66536,cost:{input:0.25,output:1,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3-Next-80B-A3B-Thinking",name:"Qwen3-Next-80B-A3B-Thinking",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:131072,cost:{input:0.3,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3.5-397B-A17B",name:"Qwen3.5-397B-A17B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0.6,output:3.6,cacheRead:0,cacheWrite:0}}},{modelId:"XiaomiMiMo/MiMo-V2-Flash",name:"MiMo-V2-Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:4096,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek-ai/DeepSeek-R1-0528",name:"DeepSeek-R1-0528",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:163840,cost:{input:3,output:5,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek-ai/DeepSeek-V3.2",name:"DeepSeek-V3.2",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:65536,cost:{input:0.28,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek-ai/DeepSeek-V4-Pro",name:"DeepSeek V4 Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:393216,cost:{input:0.435,output:0.87,cacheRead:0.003625,cacheWrite:0}}},{modelId:"moonshotai/Kimi-K2-Instruct",name:"Kimi-K2-Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:1,output:3,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/Kimi-K2-Instruct-0905",name:"Kimi-K2-Instruct-0905",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:16384,cost:{input:1,output:3,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/Kimi-K2-Thinking",name:"Kimi-K2-Thinking",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"moonshotai/Kimi-K2.5",name:"Kimi-K2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:3,cacheRead:0.1,cacheWrite:0}}},{modelId:"moonshotai/Kimi-K2.6",name:"Kimi-K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"zai-org/GLM-4.7",name:"GLM-4.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.6,output:2.2,cacheRead:0.11,cacheWrite:0}}},{modelId:"zai-org/GLM-4.7-Flash",name:"GLM-4.7-Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:128000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"zai-org/GLM-5",name:"GLM-5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:131072,cost:{input:1,output:3.2,cacheRead:0.2,cacheWrite:0}}},{modelId:"zai-org/GLM-5.1",name:"GLM-5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:131072,cost:{input:1,output:3.2,cacheRead:0.2,cacheWrite:0}}}]},"kimi-coding":{name:"kimi-coding",config:{api:"anthropic-messages",baseUrl:"https://api.kimi.com/coding",apiKey:"KIMI_API_KEY"},models:[{modelId:"k2p7",name:"Kimi K2.7 Code",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"kimi-for-coding",name:"Kimi For Coding",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"kimi-k2-thinking",name:"Kimi K2 Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}}]},minimax:{name:"minimax",config:{api:"anthropic-messages",baseUrl:"https://api.minimax.io/anthropic",apiKey:"MINIMAX_API_KEY"},models:[{modelId:"MiniMax-M2.7",name:"MiniMax-M2.7",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0.375}}},{modelId:"MiniMax-M2.7-highspeed",name:"MiniMax-M2.7-highspeed",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.6,output:2.4,cacheRead:0.06,cacheWrite:0.375}}},{modelId:"MiniMax-M3",name:"MiniMax-M3",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:512000,maxTokens:128000,cost:{input:0.6,output:2.4,cacheRead:0.12,cacheWrite:0}}}]},"minimax-cn":{name:"minimax-cn",config:{api:"anthropic-messages",baseUrl:"https://api.minimaxi.com/anthropic",apiKey:"MINIMAX_CN_API_KEY"},models:[{modelId:"MiniMax-M2.7",name:"MiniMax-M2.7",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0.375}}},{modelId:"MiniMax-M2.7-highspeed",name:"MiniMax-M2.7-highspeed",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.6,output:2.4,cacheRead:0.06,cacheWrite:0.375}}},{modelId:"MiniMax-M3",name:"MiniMax-M3",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:512000,maxTokens:128000,cost:{input:0.6,output:2.4,cacheRead:0.12,cacheWrite:0}}}]},moonshotai:{name:"moonshotai",config:{api:"openai-completions",baseUrl:"https://api.moonshot.ai/v1",apiKey:"MOONSHOT_API_KEY"},models:[{modelId:"kimi-k2-0711-preview",name:"Kimi K2 0711",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-0905-preview",name:"Kimi K2 0905",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-thinking",name:"Kimi K2 Thinking",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-thinking-turbo",name:"Kimi K2 Thinking Turbo",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:1.15,output:8,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-turbo-preview",name:"Kimi K2 Turbo",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:2.4,output:10,cacheRead:0.6,cacheWrite:0}}},{modelId:"kimi-k2.5",name:"Kimi K2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:3,cacheRead:0.1,cacheWrite:0}}},{modelId:"kimi-k2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"kimi-k2.7-code",name:"Kimi K2.7 Code",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.95,output:4,cacheRead:0.19,cacheWrite:0}}}]},"moonshotai-cn":{name:"moonshotai-cn",config:{api:"openai-completions",baseUrl:"https://api.moonshot.cn/v1",apiKey:"MOONSHOT_API_KEY"},models:[{modelId:"kimi-k2-0711-preview",name:"Kimi K2 0711",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-0905-preview",name:"Kimi K2 0905",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-thinking",name:"Kimi K2 Thinking",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-thinking-turbo",name:"Kimi K2 Thinking Turbo",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:1.15,output:8,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-turbo-preview",name:"Kimi K2 Turbo",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:2.4,output:10,cacheRead:0.6,cacheWrite:0}}},{modelId:"kimi-k2.5",name:"Kimi K2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:3,cacheRead:0.1,cacheWrite:0}}},{modelId:"kimi-k2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}}]},nvidia:{name:"nvidia",config:{api:"openai-completions",baseUrl:"https://integrate.api.nvidia.com/v1",apiKey:""},models:[{modelId:"meta/llama-3.1-70b-instruct",name:"Llama 3.1 70b Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.1-8b-instruct",name:"Llama 3.1 8B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:16000,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.2-11b-vision-instruct",name:"Llama 3.2 11b Vision Instruct",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.2-90b-vision-instruct",name:"Llama-3.2-90B-Vision-Instruct",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:8192,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.3-70b-instruct",name:"Llama 3.3 70b Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"mistralai/mistral-large-3-675b-instruct-2512",name:"Mistral Large 3 675B Instruct 2512",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"mistralai/mistral-small-4-119b-2603",name:"mistral-small-4-119b-2603",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:8192,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-nano-30b-a3b",name:"nemotron-3-nano-30b-a3b",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning",name:"Nemotron 3 Nano Omni",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:65536,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-super-120b-a12b",name:"Nemotron 3 Super",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.2,output:0.8,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra 550B A55B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:65536,cost:{input:0.5,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"nvidia/nvidia-nemotron-nano-9b-v2",name:"nvidia-nemotron-nano-9b-v2",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-120b",name:"GPT-OSS-120B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:8192,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-20b",name:"GPT OSS 20B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-122b-a10b",name:"Qwen3.5 122B-A10B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"stepfun-ai/step-3.5-flash",name:"Step 3.5 Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:16384,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"stepfun-ai/step-3.7-flash",name:"Step 3.7 Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:16384,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"z-ai/glm-5.1",name:"GLM-5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}}]},"openai-codex":{name:"openai-codex",config:{api:"openai-codex-responses",baseUrl:"https://chatgpt.com/backend-api",apiKey:""},models:[{modelId:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",config:{api:"openai-codex-responses",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.4",name:"GPT-5.4",config:{api:"openai-codex-responses",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"gpt-5.4-mini",name:"GPT-5.4 mini",config:{api:"openai-codex-responses",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"gpt-5.5",name:"GPT-5.5",config:{api:"openai-codex-responses",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}}]},opencode:{name:"opencode",config:{api:"openai-completions",baseUrl:"https://opencode.ai/zen/v1",apiKey:"OPENCODE_API_KEY"},models:[{modelId:"big-pickle",name:"Big Pickle",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:32000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"claude-haiku-4-5",name:"Claude Haiku 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"claude-opus-4-1",name:"Claude Opus 4.1",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-opus-4-5",name:"Claude Opus 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-6",name:"Claude Opus 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-7",name:"Claude Opus 4.7",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-8",name:"Claude Opus 4.8",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-sonnet-4",name:"Claude Sonnet 4",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-5",name:"Claude Sonnet 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"deepseek-v4-flash",name:"DeepSeek V4 Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:0.14,output:0.28,cacheRead:0.028,cacheWrite:0}}},{modelId:"deepseek-v4-flash-free",name:"DeepSeek V4 Flash Free",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:128000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek-v4-pro",name:"DeepSeek V4 Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:1.74,output:3.84,cacheRead:0.145,cacheWrite:0}}},{modelId:"gemini-3-flash",name:"Gemini 3 Flash",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0}}},{modelId:"gemini-3.1-pro",name:"Gemini 3.1 Pro Preview",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"gemini-3.5-flash",name:"Gemini 3.5 Flash",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.5,output:9,cacheRead:0.15,cacheWrite:0}}},{modelId:"glm-5",name:"GLM-5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:1,output:3.2,cacheRead:0.2,cacheWrite:0}}},{modelId:"glm-5.1",name:"GLM-5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:1.4,output:4.4,cacheRead:0.26,cacheWrite:0}}},{modelId:"gpt-5",name:"GPT-5",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.07,output:8.5,cacheRead:0.107,cacheWrite:0}}},{modelId:"gpt-5-codex",name:"GPT-5 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.07,output:8.5,cacheRead:0.107,cacheWrite:0}}},{modelId:"gpt-5-nano",name:"GPT-5 Nano",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.05,output:0.4,cacheRead:0.005,cacheWrite:0}}},{modelId:"gpt-5.1",name:"GPT-5.1",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.07,output:8.5,cacheRead:0.107,cacheWrite:0}}},{modelId:"gpt-5.1-codex",name:"GPT-5.1 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.07,output:8.5,cacheRead:0.107,cacheWrite:0}}},{modelId:"gpt-5.1-codex-max",name:"GPT-5.1 Codex Max",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-codex-mini",name:"GPT-5.1 Codex Mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-5.2",name:"GPT-5.2",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-codex",name:"GPT-5.2 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.3-codex",name:"GPT-5.3 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.4",name:"GPT-5.4",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"gpt-5.4-mini",name:"GPT-5.4 Mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"gpt-5.4-nano",name:"GPT-5.4 Nano",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.2,output:1.25,cacheRead:0.02,cacheWrite:0}}},{modelId:"gpt-5.4-pro",name:"GPT-5.4 Pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:30,cacheWrite:0}}},{modelId:"gpt-5.5",name:"GPT-5.5",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"gpt-5.5-pro",name:"GPT-5.5 Pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:30,cacheWrite:0}}},{modelId:"grok-build-0.1",name:"Grok Build 0.1",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:1,output:2,cacheRead:0.2,cacheWrite:0}}},{modelId:"kimi-k2.5",name:"Kimi K2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.6,output:3,cacheRead:0.08,cacheWrite:0}}},{modelId:"kimi-k2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"mimo-v2.5-free",name:"MiMo V2.5 Free",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"minimax-m2.5",name:"MiniMax M2.5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"minimax-m2.7",name:"MiniMax M2.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"nemotron-3-ultra-free",name:"Nemotron 3 Ultra Free",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:128000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"north-mini-code-free",name:"North Mini Code Free",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:64000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"qwen3.5-plus",name:"Qwen3.5 Plus",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.2,output:1.2,cacheRead:0.02,cacheWrite:0.25}}},{modelId:"qwen3.6-plus",name:"Qwen3.6 Plus",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0.625}}}]},"opencode-go":{name:"opencode-go",config:{api:"openai-completions",baseUrl:"https://opencode.ai/zen/go/v1",apiKey:"OPENCODE_API_KEY"},models:[{modelId:"deepseek-v4-flash",name:"DeepSeek V4 Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:0.14,output:0.28,cacheRead:0.0028,cacheWrite:0}}},{modelId:"deepseek-v4-pro",name:"DeepSeek V4 Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:1.74,output:3.48,cacheRead:0.0145,cacheWrite:0}}},{modelId:"glm-5",name:"GLM-5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:32768,cost:{input:1,output:3.2,cacheRead:0.2,cacheWrite:0}}},{modelId:"glm-5.1",name:"GLM-5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:32768,cost:{input:1.4,output:4.4,cacheRead:0.26,cacheWrite:0}}},{modelId:"kimi-k2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"kimi-k2.7-code",name:"Kimi K2.7 Code",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.95,output:4,cacheRead:0.19,cacheWrite:0}}},{modelId:"mimo-v2.5",name:"MiMo V2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:0.14,output:0.28,cacheRead:0.0028,cacheWrite:0}}},{modelId:"mimo-v2.5-pro",name:"MiMo V2.5 Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:128000,cost:{input:1.74,output:3.48,cacheRead:0.0145,cacheWrite:0}}},{modelId:"minimax-m2.7",name:"MiniMax M2.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"minimax-m3",name:"MiniMax M3 (3x usage)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:512000,maxTokens:131072,cost:{input:0.1,output:0.4,cacheRead:0.02,cacheWrite:0}}},{modelId:"qwen3.6-plus",name:"Qwen3.6 Plus",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0.625}}},{modelId:"qwen3.7-max",name:"Qwen3.7 Max",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:65536,cost:{input:2.5,output:7.5,cacheRead:0.5,cacheWrite:3.125}}},{modelId:"qwen3.7-plus",name:"Qwen3.7 Plus",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.4,output:1.6,cacheRead:0.04,cacheWrite:0.5}}}]},together:{name:"together",config:{api:"openai-completions",baseUrl:"https://api.together.ai/v1",apiKey:"TOGETHER_API_KEY"},models:[{modelId:"MiniMaxAI/MiniMax-M2.7",name:"MiniMax-M2.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"MiniMaxAI/MiniMax-M3",name:"MiniMax-M3",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:524288,maxTokens:250000,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"Qwen/Qwen2.5-7B-Instruct-Turbo",name:"Qwen 2.5 7B Instruct Turbo",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32768,maxTokens:32768,cost:{input:0.3,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3-235B-A22B-Instruct-2507-tput",name:"Qwen3 235B A22B Instruct 2507 FP8",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.2,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3.5-397B-A17B",name:"Qwen3.5 397B A17B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:130000,cost:{input:0.6,output:3.6,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3.5-9B",name:"Qwen3.5 9B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.17,output:0.25,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3.6-Plus",name:"Qwen3.6 Plus",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:500000,cost:{input:0.5,output:3,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3.7-Max",name:"Qwen3.7 Max",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1e6,maxTokens:500000,cost:{input:2.5,output:7.5,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek-ai/DeepSeek-V4-Pro",name:"DeepSeek V4 Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:512000,maxTokens:384000,cost:{input:1.74,output:3.48,cacheRead:0.2,cacheWrite:0}}},{modelId:"essentialai/Rnj-1-Instruct",name:"Rnj-1 Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32768,maxTokens:32768,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"google/gemma-4-31B-it",name:"Gemma 4 31B Instruct",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.39,output:0.97,cacheRead:0,cacheWrite:0}}},{modelId:"meta-llama/Llama-3.3-70B-Instruct-Turbo",name:"Llama 3.3 70B",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.88,output:0.88,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/Kimi-K2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131000,cost:{input:1.2,output:4.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"moonshotai/Kimi-K2.7-Code",name:"Kimi K2.7 Code",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:131072,cost:{input:0.95,output:4,cacheRead:0.19,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra 550B A55B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:512300,maxTokens:512300,cost:{input:0.6,output:3.6,cacheRead:0.2,cacheWrite:0}}},{modelId:"openai/gpt-oss-120b",name:"GPT OSS 120B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-20b",name:"GPT OSS 20B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.05,output:0.2,cacheRead:0,cacheWrite:0}}},{modelId:"zai-org/GLM-5",name:"GLM-5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:131072,cost:{input:1,output:3.2,cacheRead:0,cacheWrite:0}}},{modelId:"zai-org/GLM-5.1",name:"GLM-5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:131072,cost:{input:1.4,output:4.4,cacheRead:0,cacheWrite:0}}}]},"vercel-ai-gateway":{name:"vercel-ai-gateway",config:{api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",apiKey:"AI_GATEWAY_API_KEY"},models:[{modelId:"alibaba/qwen-3-14b",name:"Qwen3-14B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:40960,maxTokens:16384,cost:{input:0.12,output:0.24,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen-3-235b",name:"Qwen3 235B A22B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:16384,cost:{input:0.22,output:0.88,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen-3-30b",name:"Qwen3-30B-A3B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:40960,maxTokens:16384,cost:{input:0.12,output:0.5,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen-3-32b",name:"Qwen 3 32B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:8192,cost:{input:0.16,output:0.64,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen-3.6-max-preview",name:"Qwen 3.6 Max Preview",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:240000,maxTokens:64000,cost:{input:1.3,output:7.8,cacheRead:0.26,cacheWrite:1.625}}},{modelId:"alibaba/qwen3-235b-a22b-thinking",name:"Qwen3 VL 235B A22B Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:32768,cost:{input:0.4,output:4,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen3-coder",name:"Qwen3 Coder 480B A35B Instruct",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:1.5,output:7.5,cacheRead:0.3,cacheWrite:0}}},{modelId:"alibaba/qwen3-coder-30b-a3b",name:"Qwen 3 Coder 30B A3B Instruct",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:8192,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen3-coder-next",name:"Qwen3 Coder Next",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:256000,cost:{input:0.5,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen3-coder-plus",name:"Qwen3 Coder Plus",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:1e6,maxTokens:65536,cost:{input:1,output:5,cacheRead:0.2,cacheWrite:0}}},{modelId:"alibaba/qwen3-max",name:"Qwen3 Max",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:1.2,output:6,cacheRead:0.24,cacheWrite:0}}},{modelId:"alibaba/qwen3-max-preview",name:"Qwen3 Max Preview",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:1.2,output:6,cacheRead:0.24,cacheWrite:0}}},{modelId:"alibaba/qwen3-max-thinking",name:"Qwen 3 Max Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:65536,cost:{input:1.2,output:6,cacheRead:0.24,cacheWrite:0}}},{modelId:"alibaba/qwen3-next-80b-a3b-instruct",name:"Qwen3 Next 80B A3B Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:32768,cost:{input:0.15,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen3-next-80b-a3b-thinking",name:"Qwen3 Next 80B A3B Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:32768,cost:{input:0.15,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen3-vl-thinking",name:"Qwen3 VL 235B A22B Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:32768,cost:{input:0.4,output:4,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen3.5-flash",name:"Qwen 3.5 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:0.1,output:0.4,cacheRead:0.001,cacheWrite:0.125}}},{modelId:"alibaba/qwen3.5-plus",name:"Qwen 3.5 Plus",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:0.4,output:2.4,cacheRead:0.04,cacheWrite:0.5}}},{modelId:"alibaba/qwen3.6-27b",name:"Qwen 3.6 27B",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0.6,output:3.6,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen3.6-plus",name:"Qwen 3.6 Plus",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:0.5,output:3,cacheRead:0.1,cacheWrite:0.625}}},{modelId:"alibaba/qwen3.7-max",name:"Qwen 3.7 Max",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:991000,maxTokens:64000,cost:{input:1.25,output:3.75,cacheRead:0.25,cacheWrite:1.5625}}},{modelId:"alibaba/qwen3.7-plus",name:"Qwen 3.7 Plus",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:0.4,output:1.6,cacheRead:0.08,cacheWrite:0.5}}},{modelId:"anthropic/claude-3-haiku",name:"Claude 3 Haiku",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:0.25,output:1.25,cacheRead:0.03,cacheWrite:0.3}}},{modelId:"anthropic/claude-3.5-haiku",name:"Claude 3.5 Haiku",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:0.8,output:4,cacheRead:0.08,cacheWrite:1}}},{modelId:"anthropic/claude-haiku-4.5",name:"Claude Haiku 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"anthropic/claude-opus-4",name:"Claude Opus 4",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"anthropic/claude-opus-4.1",name:"Claude Opus 4.1",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"anthropic/claude-opus-4.5",name:"Claude Opus 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-opus-4.6",name:"Claude Opus 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-opus-4.7",name:"Claude Opus 4.7",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-opus-4.8",name:"Claude Opus 4.8",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-sonnet-4",name:"Claude Sonnet 4",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"anthropic/claude-sonnet-4.5",name:"Claude Sonnet 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"anthropic/claude-sonnet-4.6",name:"Claude Sonnet 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"arcee-ai/trinity-large-preview",name:"Trinity Large Preview",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:131000,maxTokens:131000,cost:{input:0.25,output:1,cacheRead:0,cacheWrite:0}}},{modelId:"arcee-ai/trinity-large-thinking",name:"Trinity Large Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262100,maxTokens:80000,cost:{input:0.25,output:0.9,cacheRead:0,cacheWrite:0}}},{modelId:"bytedance/seed-1.6",name:"Seed 1.6",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:32000,cost:{input:0.25,output:2,cacheRead:0.05,cacheWrite:0}}},{modelId:"cohere/command-a",name:"Command A",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:8000,cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-r1",name:"DeepSeek-R1",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:8192,cost:{input:1.35,output:5.4,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3",name:"DeepSeek V3 0324",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:163840,maxTokens:163840,cost:{input:0.27,output:1.12,cacheRead:0.135,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3.1",name:"DeepSeek V3.1",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:8192,cost:{input:0.56,output:1.68,cacheRead:0.28,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3.1-terminus",name:"DeepSeek V3.1 Terminus",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.27,output:1,cacheRead:0.135,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3.2",name:"DeepSeek V3.2",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:8000,cost:{input:0.28,output:0.42,cacheRead:0.028,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3.2-thinking",name:"DeepSeek V3.2 Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:8000,cost:{input:0.62,output:1.85,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-v4-flash",name:"DeepSeek V4 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:384000,cost:{input:0.14,output:0.28,cacheRead:0.0028,cacheWrite:0}}},{modelId:"deepseek/deepseek-v4-pro",name:"DeepSeek V4 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:0.435,output:0.87,cacheRead:0.0036,cacheWrite:0}}},{modelId:"google/gemini-2.5-flash",name:"Gemini 2.5 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.3,output:2.5,cacheRead:0.03,cacheWrite:0}}},{modelId:"google/gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.1,output:0.4,cacheRead:0.01,cacheWrite:0}}},{modelId:"google/gemini-2.5-pro",name:"Gemini 2.5 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"google/gemini-3-flash",name:"Gemini 3 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65000,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0}}},{modelId:"google/gemini-3-pro-preview",name:"Gemini 3 Pro Preview",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"google/gemini-3.1-flash-lite",name:"Gemini 3.1 Flash Lite",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65000,cost:{input:0.25,output:1.5,cacheRead:0.03,cacheWrite:0}}},{modelId:"google/gemini-3.1-flash-lite-preview",name:"Gemini 3.1 Flash Lite Preview",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65000,cost:{input:0.25,output:1.5,cacheRead:0.03,cacheWrite:0}}},{modelId:"google/gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"google/gemini-3.5-flash",name:"Gemini 3.5 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:1.5,output:9,cacheRead:0.15,cacheWrite:0}}},{modelId:"google/gemma-4-26b-a4b-it",name:"Gemma 4 26B A4B IT",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.15,output:0.6,cacheRead:0.015,cacheWrite:0}}},{modelId:"google/gemma-4-31b-it",name:"Gemma 4 31B IT",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.14,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"inception/mercury-2",name:"Mercury 2",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.25,output:0.75,cacheRead:0.025,cacheWrite:0}}},{modelId:"inception/mercury-coder-small",name:"Mercury Coder Small Beta",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:32000,maxTokens:16384,cost:{input:0.25,output:1,cacheRead:0,cacheWrite:0}}},{modelId:"kwaipilot/kat-coder-pro-v2",name:"Kat Coder Pro V2",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:256000,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"meituan/longcat-flash-chat",name:"LongCat Flash Chat",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:1e5,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.1-70b",name:"Llama 3.1 70B Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:8192,cost:{input:0.72,output:0.72,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.1-8b",name:"Llama 3.1 8B Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:8192,cost:{input:0.22,output:0.22,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.2-11b",name:"Llama 3.2 11B Vision Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:8192,cost:{input:0.16,output:0.16,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.2-90b",name:"Llama 3.2 90B Vision Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:8192,cost:{input:0.72,output:0.72,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.3-70b",name:"Llama 3.3 70B Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:8192,cost:{input:0.72,output:0.72,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-4-maverick",name:"Llama 4 Maverick 17B Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:8192,cost:{input:0.24,output:0.97,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-4-scout",name:"Llama 4 Scout 17B Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:8192,cost:{input:0.17,output:0.66,cacheRead:0,cacheWrite:0}}},{modelId:"minimax/minimax-m2",name:"MiniMax M2",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:205000,maxTokens:205000,cost:{input:0.3,output:1.2,cacheRead:0.03,cacheWrite:0.375}}},{modelId:"minimax/minimax-m2.1",name:"MiniMax M2.1",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.03,cacheWrite:0.375}}},{modelId:"minimax/minimax-m2.1-lightning",name:"MiniMax M2.1 Lightning",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:2.4,cacheRead:0.03,cacheWrite:0.375}}},{modelId:"minimax/minimax-m2.5",name:"MiniMax M2.5",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131000,cost:{input:0.3,output:1.2,cacheRead:0.03,cacheWrite:0.375}}},{modelId:"minimax/minimax-m2.5-highspeed",name:"MiniMax M2.5 High Speed",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131000,cost:{input:0.6,output:2.4,cacheRead:0.03,cacheWrite:0.375}}},{modelId:"minimax/minimax-m2.7",name:"MiniMax M2.7",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131000,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0.375}}},{modelId:"minimax/minimax-m2.7-highspeed",name:"MiniMax M2.7 High Speed",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131100,cost:{input:0.6,output:2.4,cacheRead:0.06,cacheWrite:0.375}}},{modelId:"minimax/minimax-m3",name:"MiniMax M3",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:1e6,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"mistral/codestral",name:"Mistral Codestral",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4000,cost:{input:0.3,output:0.9,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/devstral-2",name:"Devstral 2",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:256000,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/devstral-small",name:"Devstral Small 1.1",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:64000,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/devstral-small-2",name:"Devstral Small 2",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:256000,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/ministral-3b",name:"Ministral 3B",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4000,cost:{input:0.1,output:0.1,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/ministral-8b",name:"Ministral 8B",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4000,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/mistral-medium",name:"Mistral Medium 3.1",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:64000,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/mistral-medium-3.5",name:"Mistral Medium Latest",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:256000,cost:{input:1.5,output:7.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/mistral-nemo",name:"Mistral Nemo 12B",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.02,output:0.04,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/mistral-small",name:"Mistral Small",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:32000,maxTokens:4000,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/pixtral-12b",name:"Pixtral 12B 2409",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4000,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/pixtral-large",name:"Pixtral Large",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4000,cost:{input:2,output:6,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2",name:"Kimi K2 Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.57,output:2.3,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2-thinking",name:"Kimi K2 Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262114,maxTokens:262114,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2.5",name:"Kimi K2.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262114,maxTokens:262114,cost:{input:0.6,output:3,cacheRead:0.1,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2.6",name:"Kimi K2.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262000,maxTokens:262000,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2.7-code",name:"Kimi K2.7 Code",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:32768,cost:{input:0.95,output:4,cacheRead:0.19,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-super-120b-a12b",name:"NVIDIA Nemotron 3 Super 120B A12B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:32000,cost:{input:0.15,output:0.65,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:65000,cost:{input:0.6,output:2.4,cacheRead:0.12,cacheWrite:0}}},{modelId:"nvidia/nemotron-nano-12b-v2-vl",name:"Nvidia Nemotron Nano 12B V2 VL",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:131072,cost:{input:0.2,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-nano-9b-v2",name:"Nvidia Nemotron Nano 9B V2",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.06,output:0.23,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4-turbo",name:"GPT-4 Turbo",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:10,output:30,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4.1",name:"GPT-4.1",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/gpt-4.1-mini",name:"GPT-4.1 mini",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.4,output:1.6,cacheRead:0.1,cacheWrite:0}}},{modelId:"openai/gpt-4.1-nano",name:"GPT-4.1 nano",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.1,output:0.4,cacheRead:0.025,cacheWrite:0}}},{modelId:"openai/gpt-4o",name:"GPT-4o",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"openai/gpt-4o-mini",name:"GPT-4o mini",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0.075,cacheWrite:0}}},{modelId:"openai/gpt-5",name:"GPT-5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5-chat",name:"GPT 5 Chat",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5-codex",name:"GPT-5-Codex",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5-mini",name:"GPT-5 mini",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"openai/gpt-5-nano",name:"GPT-5 nano",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.05,output:0.4,cacheRead:0.005,cacheWrite:0}}},{modelId:"openai/gpt-5-pro",name:"GPT-5 pro",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:272000,cost:{input:15,output:120,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-5.1-codex",name:"GPT-5.1-Codex",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5.1-codex-max",name:"GPT 5.1 Codex Max",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5.1-codex-mini",name:"GPT 5.1 Codex Mini",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"openai/gpt-5.1-instant",name:"GPT-5.1 Instant",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5.1-thinking",name:"GPT 5.1 Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5.2",name:"GPT 5.2",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.2-chat",name:"GPT 5.2 Chat",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.2-codex",name:"GPT 5.2 Codex",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.2-pro",name:"GPT 5.2 ",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:21,output:168,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-5.3-chat",name:"GPT-5.3 Chat",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.3-codex",name:"GPT 5.3 Codex",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.4",name:"GPT 5.4",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"openai/gpt-5.4-mini",name:"GPT 5.4 Mini",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"openai/gpt-5.4-nano",name:"GPT 5.4 Nano",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.2,output:1.25,cacheRead:0.02,cacheWrite:0}}},{modelId:"openai/gpt-5.4-pro",name:"GPT 5.4 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-5.5",name:"GPT 5.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/gpt-5.5-pro",name:"GPT 5.5 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-120b",name:"GPT OSS 120B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131000,cost:{input:0.35,output:0.75,cacheRead:0.25,cacheWrite:0}}},{modelId:"openai/gpt-oss-20b",name:"GPT OSS 20B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:8192,cost:{input:0.05,output:0.2,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-safeguard-20b",name:"GPT OSS Safeguard 20B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.075,output:0.3,cacheRead:0.037,cacheWrite:0}}},{modelId:"openai/o1",name:"o1",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:15,output:60,cacheRead:7.5,cacheWrite:0}}},{modelId:"openai/o3",name:"o3",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/o3-deep-research",name:"o3-deep-research",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:10,output:40,cacheRead:2.5,cacheWrite:0}}},{modelId:"openai/o3-mini",name:"o3-mini",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.55,cacheWrite:0}}},{modelId:"openai/o3-pro",name:"o3 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:20,output:80,cacheRead:0,cacheWrite:0}}},{modelId:"openai/o4-mini",name:"o4-mini",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.275,cacheWrite:0}}},{modelId:"perplexity/sonar",name:"Sonar",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:127000,maxTokens:8000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"perplexity/sonar-pro",name:"Sonar Pro",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"stepfun/step-3.5-flash",name:"StepFun 3.5 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262114,maxTokens:262114,cost:{input:0.09,output:0.3,cacheRead:0,cacheWrite:0.02}}},{modelId:"stepfun/step-3.7-flash",name:"Step 3.7 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0.2,output:1.15,cacheRead:0.04,cacheWrite:0}}},{modelId:"xai/grok-4.1-fast-non-reasoning",name:"Grok 4.1 Fast Non-Reasoning",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:1e6,cost:{input:0.2,output:0.5,cacheRead:0.05,cacheWrite:0}}},{modelId:"xai/grok-4.1-fast-reasoning",name:"Grok 4.1 Fast Reasoning",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:1e6,cost:{input:0.2,output:0.5,cacheRead:0.05,cacheWrite:0}}},{modelId:"xai/grok-4.20-multi-agent",name:"Grok 4.20 Multi-Agent",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:2000000,maxTokens:2000000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"xai/grok-4.20-multi-agent-beta",name:"Grok 4.20 Multi Agent Beta",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:2000000,maxTokens:2000000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"xai/grok-4.20-non-reasoning",name:"Grok 4.20 Non-Reasoning",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:2000000,maxTokens:2000000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"xai/grok-4.20-non-reasoning-beta",name:"Grok 4.20 Beta Non-Reasoning",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:2000000,maxTokens:2000000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"xai/grok-4.20-reasoning",name:"Grok 4.20 Reasoning",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:2000000,maxTokens:2000000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"xai/grok-4.20-reasoning-beta",name:"Grok 4.20 Beta Reasoning",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:2000000,maxTokens:2000000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"xai/grok-4.3",name:"Grok 4.3",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:1e6,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"xai/grok-build-0.1",name:"Grok Build 0.1",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:1,output:2,cacheRead:0.2,cacheWrite:0}}},{modelId:"xiaomi/mimo-v2-flash",name:"MiMo V2 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:32000,cost:{input:0.1,output:0.3,cacheRead:0.01,cacheWrite:0}}},{modelId:"xiaomi/mimo-v2-pro",name:"MiMo V2 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:128000,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"xiaomi/mimo-v2.5",name:"MiMo M2.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:131100,cost:{input:0.14,output:0.28,cacheRead:0.0028,cacheWrite:0}}},{modelId:"xiaomi/mimo-v2.5-pro",name:"MiMo V2.5 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:131000,cost:{input:0.435,output:0.87,cacheRead:0.0036,cacheWrite:0}}},{modelId:"zai/glm-4.5",name:"GLM-4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:96000,cost:{input:0.6,output:2.2,cacheRead:0.11,cacheWrite:0}}},{modelId:"zai/glm-4.5-air",name:"GLM 4.5 Air",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:96000,cost:{input:0.2,output:1.1,cacheRead:0.03,cacheWrite:0}}},{modelId:"zai/glm-4.5v",name:"GLM 4.5V",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:66000,maxTokens:16000,cost:{input:0.6,output:1.8,cacheRead:0.11,cacheWrite:0}}},{modelId:"zai/glm-4.6",name:"GLM 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:96000,cost:{input:0.6,output:2.2,cacheRead:0.11,cacheWrite:0}}},{modelId:"zai/glm-4.6v",name:"GLM-4.6V",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:24000,cost:{input:0.3,output:0.9,cacheRead:0.05,cacheWrite:0}}},{modelId:"zai/glm-4.6v-flash",name:"GLM-4.6V-Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:24000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"zai/glm-4.7",name:"GLM 4.7",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131000,maxTokens:40000,cost:{input:2.25,output:2.75,cacheRead:2.25,cacheWrite:0}}},{modelId:"zai/glm-4.7-flash",name:"GLM 4.7 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:131000,cost:{input:0.07,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"zai/glm-4.7-flashx",name:"GLM 4.7 FlashX",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:128000,cost:{input:0.06,output:0.4,cacheRead:0.01,cacheWrite:0}}},{modelId:"zai/glm-5",name:"GLM 5",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:202800,maxTokens:131100,cost:{input:1,output:3.2,cacheRead:0.2,cacheWrite:0}}},{modelId:"zai/glm-5-turbo",name:"GLM 5 Turbo",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:202800,maxTokens:131100,cost:{input:1.2,output:4,cacheRead:0.24,cacheWrite:0}}},{modelId:"zai/glm-5.1",name:"GLM 5.1",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:202800,maxTokens:64000,cost:{input:1.4,output:4.4,cacheRead:0.26,cacheWrite:0}}},{modelId:"zai/glm-5v-turbo",name:"GLM 5V Turbo",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:128000,cost:{input:1.2,output:4,cacheRead:0.24,cacheWrite:0}}}]},xai:{name:"xai",config:{api:"openai-completions",baseUrl:"https://api.x.ai/v1",apiKey:"XAI_API_KEY"},models:[{modelId:"grok-3",name:"Grok 3",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:8192,cost:{input:3,output:15,cacheRead:0.75,cacheWrite:0}}},{modelId:"grok-3-fast",name:"Grok 3 Fast",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:8192,cost:{input:5,output:25,cacheRead:1.25,cacheWrite:0}}},{modelId:"grok-4.20-0309-non-reasoning",name:"Grok 4.20 (Non-Reasoning)",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:30000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"grok-4.20-0309-reasoning",name:"Grok 4.20 (Reasoning)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:30000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"grok-4.3",name:"Grok 4.3",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:30000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"grok-build-0.1",name:"Grok Build 0.1",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:1,output:2,cacheRead:0.2,cacheWrite:0}}},{modelId:"grok-code-fast-1",name:"Grok Code Fast 1",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32768,maxTokens:8192,cost:{input:0.2,output:1.5,cacheRead:0.02,cacheWrite:0}}}]},xiaomi:{name:"xiaomi",config:{api:"openai-completions",baseUrl:"https://api.xiaomimimo.com/v1",apiKey:"XIAOMI_API_KEY"},models:[{modelId:"mimo-v2-flash",name:"MiMo-V2-Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:0.1,output:0.3,cacheRead:0.01,cacheWrite:0}}},{modelId:"mimo-v2-omni",name:"MiMo-V2-Omni",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2-pro",name:"MiMo-V2-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5",name:"MiMo-V2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5-pro-ultraspeed",name:"MiMo-V2.5-Pro-UltraSpeed",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1.305,output:2.61,cacheRead:0.0108,cacheWrite:0}}}]},"xiaomi-token-plan-ams":{name:"xiaomi-token-plan-ams",config:{api:"openai-completions",baseUrl:"https://token-plan-ams.xiaomimimo.com/v1",apiKey:"XIAOMI_TOKEN_PLAN_AMS_API_KEY"},models:[{modelId:"mimo-v2-omni",name:"MiMo-V2-Omni",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2-pro",name:"MiMo-V2-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5",name:"MiMo-V2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5-pro-ultraspeed",name:"MiMo-V2.5-Pro-UltraSpeed",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1.305,output:2.61,cacheRead:0.0108,cacheWrite:0}}}]},"xiaomi-token-plan-cn":{name:"xiaomi-token-plan-cn",config:{api:"openai-completions",baseUrl:"https://token-plan-cn.xiaomimimo.com/v1",apiKey:"XIAOMI_TOKEN_PLAN_CN_API_KEY"},models:[{modelId:"mimo-v2-omni",name:"MiMo-V2-Omni",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2-pro",name:"MiMo-V2-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5",name:"MiMo-V2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5-pro-ultraspeed",name:"MiMo-V2.5-Pro-UltraSpeed",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1.305,output:2.61,cacheRead:0.0108,cacheWrite:0}}}]},"xiaomi-token-plan-sgp":{name:"xiaomi-token-plan-sgp",config:{api:"openai-completions",baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1",apiKey:"XIAOMI_TOKEN_PLAN_SGP_API_KEY"},models:[{modelId:"mimo-v2-omni",name:"MiMo-V2-Omni",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2-pro",name:"MiMo-V2-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5",name:"MiMo-V2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5-pro-ultraspeed",name:"MiMo-V2.5-Pro-UltraSpeed",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1.305,output:2.61,cacheRead:0.0108,cacheWrite:0}}}]},zai:{name:"zai",config:{api:"openai-completions",baseUrl:"https://api.z.ai/api/coding/paas/v4",apiKey:"ZAI_API_KEY"},models:[{modelId:"glm-4.5-air",name:"GLM-4.5-Air",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:98304,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-4.7",name:"GLM-4.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5-turbo",name:"GLM-5-Turbo",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5.1",name:"GLM-5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5.2",name:"GLM-5.2",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5v-turbo",name:"GLM-5V-Turbo",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}}]},"zai-coding-cn":{name:"zai-coding-cn",config:{api:"openai-completions",baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4",apiKey:""},models:[{modelId:"glm-4.5-air",name:"GLM-4.5-Air",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:98304,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-4.7",name:"GLM-4.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5-turbo",name:"GLM-5-Turbo",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5.1",name:"GLM-5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5.2",name:"GLM-5.2",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5v-turbo",name:"GLM-5V-Turbo",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}}]}};class Qr{prismaClient;constructor(B=VB){this.prismaClient=B}async initBuiltinProviders(B){let Q=await this.prismaClient.team.findUnique({where:{id:B},include:{_count:{select:{providers:!0}}}});if(Q&&Q._count.providers===0){let F=Object.entries(lwQ).reverse();for(let[U,I]of F){let G=I;await this.prismaClient.provider.create({data:{teamId:Q.id,name:U,config:G.config,isBuiltin:!0,models:{create:G.models.map((Z)=>({modelId:Z.modelId,name:Z.name,config:Z.config}))}}})}}}async listByTeam(B){return(await this.prismaClient.provider.findMany({where:{teamId:B},include:{_count:{select:{models:!0}}},orderBy:{id:"desc"}})).map((F)=>({...F,modelsCount:F._count.models,_count:void 0}))}async getById(B){return this.prismaClient.provider.findUnique({where:{id:B}})}async listModelsByProvider(B,Q){return this.prismaClient.model.findMany({where:{providerId:Q,provider:{teamId:B}},orderBy:{id:"asc"}})}async create(B,Q,F,U){return this.prismaClient.provider.create({data:{teamId:B,name:Q,config:F,models:{create:U.map((I)=>({modelId:I.modelId,name:I.name,config:I.config}))}},include:{models:!0}})}async update(B,Q,F,U){return this.prismaClient.$transaction(async(I)=>{return await I.model.deleteMany({where:{providerId:Q}}),I.provider.update({where:{id:Q,teamId:B},data:{config:F,models:{create:U.map((G)=>({modelId:G.modelId,name:G.name,config:G.config}))}},include:{models:!0}})})}async delete(B,Q){if(!await this.prismaClient.provider.findUnique({where:{id:Q,teamId:B}}))throw Error("Provider not found");return this.prismaClient.provider.delete({where:{id:Q,teamId:B}})}}var uwQ=new Qr;class qwQ{async upsertMetadata(B,Q,F,U){return await VB.userMetadata.upsert({where:{userIdTeamIdKey:{userId:B,teamId:Q,key:F}},update:{value:U},create:{userId:B,teamId:Q,key:F,value:U}})}async listMetadata(B,Q){return(await VB.userMetadata.findMany({where:{userId:B,teamId:Q},orderBy:{key:"asc"}})).map((U)=>({key:U.key,value:U.value}))}async getMetadata(B,Q,F){let U=await VB.userMetadata.findUnique({where:{userIdTeamIdKey:{userId:B,teamId:Q,key:F}}});if(!U)return null;return{key:U.key,value:U.value}}}var jwQ=new qwQ;var u6F=/<@([^>]+)>/g;class nwQ{async create(B){this.createAsync(B).catch((Q)=>{console.error("Failed to create notification asynchronously:",Q)})}async createAsync(B){let Q=B.projectId;if(!Q&&B.assetId){let U=await VB.asset.findUnique({where:{id:B.assetId},include:{project:!0}});if(U?.projectId)Q=U.projectId}if(Q){let U=await VB.project.findUnique({where:{id:Q}});if(U&&!U.enableNotification)return}let F=async(U,I)=>{try{await VB.notification.create({data:{type:U,teamId:B.teamId,projectId:Q,creatorId:B.creatorId,assetId:B.assetId,taskId:B.taskId,userId:I}})}catch(G){console.error("Failed to save notification",{type:U,err:G})}};if(await F(B.type,B.userId),(B.type===eV.comment_created||B.type===eV.reply_created)&&B.commentMessage){let U=[...B.commentMessage.matchAll(u6F)],I=new Set;for(let G of U)if(G.length>1){let Z=G[1];if(I.has(Z))continue;if(I.add(Z),B.creatorId===Z)continue;await F(eV.mention,Z)}}}async getListWhere(B,Q,F,U){let I=[];if(F.scope==="project")I=(await VB.projectMember.findMany({where:{teamMemberId:F.id},include:{project:!0}})).filter((b)=>b.project).map((b)=>b.projectId);let G=await jwQ.getMetadata(Q,B,"notification_settings"),Z=G?G.value:{comments:!0,replies:!0,mentions:!0,yourUploads:!1,otherUploads:!0,statusUpdates:!0},W=[];if(Z.comments)W.push({type:eV.comment_created,userId:null});if(Z.replies)W.push({type:eV.reply_created,userId:Q}),W.push({type:eV.reply_created,userId:null});if(Z.mentions)W.push({type:eV.mention,userId:Q});if(Z.yourUploads&&Z.otherUploads)W.push({type:eV.successful_file_uploaded});else if(Z.yourUploads)W.push({type:eV.successful_file_uploaded,creatorId:Q});else if(Z.otherUploads)W.push({type:eV.successful_file_uploaded,creatorId:{not:Q}});if(Z.statusUpdates)W.push({type:eV.metadata_field_updated_status});W.push({type:eV.new_user_join_team}),W.push({type:eV.new_user_join_project});let g={teamId:B,OR:W,AND:[{OR:[...Z.yourUploads?[{type:eV.successful_file_uploaded,creatorId:Q}]:[],{creatorId:null},{creatorId:{not:Q}}]}]};if(F.scope==="project"){let V=Array.isArray(g.AND)?g.AND:g.AND?[g.AND]:[];g.AND=[...V,{OR:[{type:eV.mention},{projectId:{in:I}}]}]}if(U&&F.lastReadNotification){let V=Array.isArray(g.AND)?g.AND:g.AND?[g.AND]:[];g.AND=[...V,{id:{gt:F.lastReadNotification.id}}]}return g}async getUnreadCount(B,Q){let F=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B,userId:Q}},include:{lastReadNotification:!0}});if(!F)return 0;let U=await this.getListWhere(B,Q,F,!0);return VB.notification.count({where:U})}async list(B,Q,F){let U=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B,userId:Q}},include:{lastReadNotification:!0}});if(!U)throw Error("failed to get team member");let I=await this.getListWhere(B,Q,U,!!F.unreadOnly);return $V(async(G,Z)=>{let W=await VB.notification.findMany({where:I,orderBy:{id:"desc"},skip:G,take:Z,include:{creator:!0,team:!0,project:!0,asset:!0,user:!0}});return Promise.all(W.map(async(g)=>{return this.toNotificationInfo(g,U.lastReadNotification)}))},null,{after:F.after,first:F.pageSize})}async markRead(B,Q,F){let U=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B,userId:Q}},include:{lastReadNotification:!0}});if(!U)throw Error("failed to get team member");if(!await VB.notification.findUnique({where:{id:F}}))throw Error("notification not found");let G=!0;if(U.lastReadNotification){if(F<=U.lastReadNotification.id)G=!1}if(G)await VB.teamMember.update({where:{id:U.id},data:{lastReadNotificationId:F}})}async toNotificationInfo(B,Q){let F={id:B.id,type:B.type||void 0,createdAt:B.createdAt.toISOString(),isRead:Q!==null&&B.id<=Q.id};if(B.creator)F.creator={id:B.creator.id,name:B.creator.name};if(B.team)F.team={id:B.team.id,name:B.team.name};if(B.project)F.project={id:B.project.id,name:B.project.name};if(B.user)F.user={id:B.user.id,name:B.user.name};if(B.asset){let U=B.asset,I="",G="",Z=0,W=0,g=U.media;if(g){let V=process.env.S3_BUCKET||"shumai";try{if(g.sprite){if(I=await yF.presign(V,g.sprite.key,"GET"),g.poster)G=await yF.presign(V,g.poster.key||"","GET");if(g.metadata)Z=g.metadata.originalWidth,W=g.metadata.originalHeight}else if(g.thumbnail)I=await yF.presign(V,g.thumbnail.key||"","GET"),G=I}catch(b){console.error("Failed to generate presigned url for notification asset preview:",b)}}F.asset={id:U.id,name:U.name,mediaType:U.mediaType||void 0,preview:I||void 0,thumbnailUrl:G||void 0,originalWidth:Z||void 0,originalHeight:W||void 0}}return F}}var iwQ=new nwQ;var YI=class extends Error{res;status;constructor(B=500,Q){super(Q?.message,{cause:Q?.cause});this.res=Q?.res,this.status=B}getResponse(){if(this.res)return new Response(this.res.body,{status:this.status,headers:this.res.headers});return new Response(this.message,{status:this.status})}};class pwQ{async ensureDefaultTeam(){let B=await VB.team.findFirst({where:{name:"Default Team"}});if(!B)B=await VB.team.create({data:{name:"Default Team",settings:{transcode:{videoStrategy:"best_match"}},sandbox:{create:{}}}}),await uwQ.initBuiltinProviders(B.id);return B}async createTeam(B,Q){return await VB.$transaction(async(F)=>{let U=await F.team.create({data:{name:Q.name,settings:{},sandbox:{create:{}}}}),I=await F.asset.create({data:{name:"root",type:"root",status:"processed"}}),G=await F.team.update({where:{id:U.id},data:{rootFolderId:I.id},include:{rootFolder:!0}});return await F.teamMember.create({data:{teamId:U.id,userId:B.id,role:"owner",scope:"team"}}),await new Qr(F).initBuiltinProviders(U.id),this.toTeamInfo(G)})}async getUserTeams(B){let Q={members:{some:{userId:B.userId}}};return await $V(async(F,U)=>{return(await VB.team.findMany({where:Q,skip:F,take:U,orderBy:{id:"desc"},include:{rootFolder:!0}})).map(this.toTeamInfo)},null,B.pagination)}async joinTeam(B){if(!await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B.teamId,userId:B.userId}}}))await VB.teamMember.create({data:{teamId:B.teamId,userId:B.userId,role:"reviewer",scope:"team"}})}async getMe(B){let Q=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B.teamId,userId:B.user.id}},include:{user:!0}});if(!Q)throw new YI(403,{message:"user is not a team member"});let F=await iwQ.getUnreadCount(B.teamId,B.user.id);return{id:Q.user.id,name:Q.user.name,email:Q.user.email||void 0,role:Q.role,image:await MX(Q.user.image),unreadNotificationCount:F}}async updateMe(B,Q){let F={};if(Q.name!==void 0)F.name=Q.name;if(Q.imageKey!==void 0)F.image=Q.imageKey;await VB.user.update({where:{id:B},data:F})}async getTeamMembers(B){let Q=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B.teamId,userId:B.userId}}});if(!Q)throw new YI(403,{message:"Requester is not a team member"});let F=await VB.teamMember.findMany({where:{teamId:B.teamId,...B.includeAgents?{user:{OR:[{type:"human"},{type:"agent",agent:{type:"chat",enabled:!0}}]}}:{user:{type:{not:"agent"}}}},include:{user:!0,projectMembers:!0}}),U=F;if(Q.scope==="project"){let I=await VB.projectMember.findMany({where:{teamMemberId:Q.id},select:{projectId:!0}}).then((G)=>G.map((Z)=>Z.projectId));U=F.filter((G)=>{if(G.scope==="team")return!0;return G.projectMembers.some((Z)=>I.includes(Z.projectId))})}return Promise.all(U.map(async(I)=>({id:I.user.id,name:I.user.name,email:void 0,role:I.role,type:I.user.type||void 0,image:await MX(I.user.image),scope:I.scope})))}async updateMemberRole(B){let Q=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B.teamId,userId:B.userId}}});if(!Q)throw new YI(404,{message:"Member not found"});if(Q.role==="owner")throw new YI(403,{message:"Cannot change the role of an owner"});await VB.teamMember.update({where:{id:Q.id},data:{role:B.role}})}async removeMember(B,Q){let F=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B,userId:Q}}});if(!F)throw new YI(404,{message:"Member not found"});if(F.role==="owner")throw new YI(403,{message:"Cannot remove an owner"});await VB.teamMember.delete({where:{id:F.id}})}async getSettings(B){let Q=await VB.team.findUnique({where:{id:B}});if(!Q)throw new YI(404,{message:"team not found"});let F=Q.settings||{},U=await VB.agent.findFirst({where:{teamId:B,type:"embedding",enabled:!0}});return F.semanticSearchEnabled=!!U,F}async updateSettings(B,Q,F){let U=await VB.team.findUnique({where:{id:B}});if(!U)throw new YI(404,{message:"team not found"});let I=U.settings||{};return I[Q]=F,(await VB.team.update({where:{id:B},data:{settings:I}})).settings||{}}async getSandboxSettings(B){let Q=await VB.sandbox.findUnique({where:{teamId:B}});return{allowedDomains:Q?.allowedDomains||[],pendingDomains:Q?.pendingDomains||[]}}async updateSandboxSettings(B,Q){let F=await VB.sandbox.upsert({where:{teamId:B},create:{teamId:B,allowedDomains:Q.allowedDomains,pendingDomains:Q.pendingDomains},update:{allowedDomains:Q.allowedDomains,pendingDomains:Q.pendingDomains}});return{allowedDomains:F.allowedDomains,pendingDomains:F.pendingDomains}}async getSignupInfo(){let B=await VB.user.count();return{initialized:B>0,userCount:B,demoMode:process.env.SHUMAI_DEMO_MODE==="1"}}toTeamInfo(B){return{id:B.id,name:B.name,rootFolder:B.rootFolder?.id||B.rootFolderId||void 0,updatedAt:B.updatedAt}}}var Fr=new pwQ;class awQ{async createTeamInvite(B){let Q=NG(),F=await VB.invite.create({data:{code:Q,teamId:B.teamId,inviterId:B.inviterId,role:B.role}});return this.getInvite(F.code)}async createProjectInvite(B){let Q=await VB.project.findUniqueOrThrow({where:{id:B.projectId},include:{team:!0}}),F=NG(),U=await VB.invite.create({data:{code:F,teamId:Q.teamId,projectId:Q.id,inviterId:B.inviterId,role:B.role}});return this.getInvite(U.code)}async getInvite(B){return await VB.invite.findUniqueOrThrow({where:{code:B},include:{team:!0,project:!0,inviter:!0}})}async validateInvite(B){let Q=await VB.invite.findUnique({where:{code:B}});if(!Q)return!1;if(Q.used)return!1;return!0}async consumeInvite(B,Q){await VB.$transaction(async(F)=>{let U=await F.invite.findUniqueOrThrow({where:{code:B},include:{team:!0,project:!0}});if(U.used)throw Error("invite code already used");let I=await F.user.findUniqueOrThrow({where:{id:Q}}),G=await F.teamMember.findUnique({where:{teamIdUserId:{teamId:U.teamId,userId:I.id}}});if(!U.projectId)if(G){if(G.scope==="project")await F.teamMember.update({where:{id:G.id},data:{scope:"team",role:U.role}})}else await F.teamMember.create({data:{teamId:U.teamId,userId:I.id,role:U.role,scope:"team"}});else{if(!G)G=await F.teamMember.create({data:{teamId:U.teamId,userId:I.id,role:"reviewer",scope:"project"}});if(!await F.projectMember.findUnique({where:{projectIdTeamMemberId:{projectId:U.projectId,teamMemberId:G.id}}}))await F.projectMember.create({data:{projectId:U.projectId,teamMemberId:G.id,role:U.role}})}await F.invite.update({where:{id:U.id},data:{used:!0}})})}}var Ur=new awQ;var FXG=ULB({database:fwQ(VB,{provider:"postgresql"}),emailAndPassword:{enabled:!0,minPasswordLength:3},secret:process.env.BETTER_AUTH_SECRET,baseURL:process.env.BETTER_AUTH_URL||`http://localhost:${process.env.SHUMAI_SERVER_PORT||"3000"}`,basePath:"/api/auth",trustedOrigins:[`http://localhost:${process.env.SHUMAI_SERVER_PORT||"3000"}`,`http://127.0.0.1:${process.env.SHUMAI_SERVER_PORT||"3000"}`],advanced:{disableCSRFCheck:!0},hooks:{before:I2(async(B)=>{if(B.path==="/sign-up/email"){let F=B.body?.inviteCode;if((await Fr.getSignupInfo()).initialized){if(!F)return console.log("[Better Auth Hook] Public signup is disabled"),B.json({error:"Public signup is disabled"},{status:403});if(!await Ur.validateInvite(F))return B.json({error:"Invalid or expired invite code"},{status:400})}}}),after:I2(async(B)=>{if(B.path==="/sign-up/email"){let Q=B.context.returned;if(Q&&Q.user&&Q.user.id){let F=Q.user,I=B.body?.inviteCode;try{let G=await Fr.getSignupInfo(),Z=await Fr.ensureDefaultTeam();if(G.userCount===1)await VB.teamMember.create({data:{teamId:Z.id,userId:F.id,role:"owner",scope:"team"}});else if(!I)await VB.teamMember.create({data:{teamId:Z.id,userId:F.id,role:"editor",scope:"team"}});if(I)await Ur.consumeInvite(I,F.id)}catch(G){console.error(`[Better Auth Hook] Error in after hook: ${G}`)}}}})}});class owQ{async hasPermission(B){if(!B.user)throw new YI(401,{message:"User is required"});let{teamId:Q,projectId:F}=await this.resolveContext(B.type,B.id),U=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:Q,userId:B.user.id}}});if(!U)throw new YI(403,{message:"User is not a member of the team"});if(F){let I=await VB.projectMember.findUnique({where:{projectIdTeamMemberId:{projectId:F,teamMemberId:U.id}}});if(I)return this.checkRole(I.role,B.permission)}if(U.scope==="team")return this.checkRole(U.role,B.permission);if(!F){if(B.permission==="Read")return}throw new YI(403,{message:"User has only project scope"})}async resolveContext(B,Q){switch(B){case"team":return{teamId:Q};case"project":{let F=await VB.project.findUnique({where:{id:Q},select:{teamId:!0}});if(!F)throw new YI(404,{message:"Project not found"});return{teamId:F.teamId,projectId:Q}}case"asset":{let F=await VB.asset.findUnique({where:{id:Q},select:{parentId:!0,teamRootFolder:{select:{id:!0}},project:{select:{id:!0,teamId:!0}}}});if(!F)throw new YI(404,{message:"Asset not found"});if(F.project)return{teamId:F.project.teamId,projectId:F.project.id};if(F.teamRootFolder)return{teamId:F.teamRootFolder.id};if(F.parentId)return this.resolveContext("asset",F.parentId);throw new YI(403,{message:"Could not resolve context for asset"})}case"collection":{let F=await VB.collection.findUnique({where:{id:Q},include:{project:!0}});if(!F)throw new YI(404,{message:"Collection not found"});return{teamId:F.project.teamId,projectId:F.projectId}}case"agent":{let F=await VB.agent.findUnique({where:{id:Q},select:{teamId:!0}});if(!F)throw new YI(404,{message:"Agent not found"});return{teamId:F.teamId}}case"agentSession":{let F=await VB.agentSession.findUnique({where:{id:Q},include:{agent:!0}});if(!F)throw new YI(404,{message:"Agent session not found"});return{teamId:F.agent.teamId}}case"share":{let F=await VB.shareLink.findUnique({where:{id:Q},include:{project:!0}});if(!F)throw new YI(404,{message:"Share not found"});return{teamId:F.project.teamId,projectId:F.projectId}}case"metadataField":{let F=await VB.metadataField.findUnique({where:{key:Q},select:{teamId:!0,projectId:!0}});if(!F)throw new YI(404,{message:"Metadata field not found"});if(F.projectId)return{teamId:(await VB.project.findUnique({where:{id:F.projectId},select:{teamId:!0}})).teamId,projectId:F.projectId};if(!F.teamId)throw new YI(403,{message:"Metadata field has no context"});return{teamId:F.teamId}}case"skill":{let F=await VB.skill.findUnique({where:{id:Q},select:{teamId:!0}});if(!F)throw new YI(404,{message:"Skill not found"});return{teamId:F.teamId}}case"provider":{let F=await VB.provider.findUnique({where:{id:Q},select:{teamId:!0}});if(!F)throw new YI(404,{message:"Provider not found"});return{teamId:F.teamId}}case"invite":{let F=await VB.invite.findUnique({where:{id:Q},select:{teamId:!0,projectId:!0}});if(!F)throw new YI(404,{message:"Invite not found"});return{teamId:F.teamId,projectId:F.projectId??void 0}}case"comment":{let F=await VB.assetComment.findUnique({where:{id:Q},include:{asset:{include:{project:!0}}}});if(!F)throw new YI(404,{message:"Comment not found"});if(!F.asset.project)throw new YI(403,{message:"Comment asset has no project"});return{teamId:F.asset.project.teamId,projectId:F.asset.projectId}}default:throw new YI(403,{message:`Unsupported resource type: ${B}`})}}checkRole(B,Q){switch(Q){case"Read":return;case"Edit":if(B==="owner"||B==="editor")return;break;case"Admin":if(B==="owner")return;break}throw new YI(403,{message:"Permission denied"})}}var rd=new owQ;class rwQ{async createCollection(B,Q,F){return await VB.collection.create({data:{name:Q.name,filter:Q.filter,projectId:B,creatorId:F},include:{creator:!0}})}async updateCollection(B,Q){return await VB.collection.update({where:{id:B},data:{...Q.name&&{name:Q.name},...Q.filter&&{filter:Q.filter}},include:{creator:!0}})}async deleteCollection(B){return await VB.collection.delete({where:{id:B}})}async getCollection(B){return await VB.collection.findUnique({where:{id:B},include:{creator:!0}})}async listCollections(B,Q){return await $V((F,U)=>VB.collection.findMany({where:{projectId:B},include:{creator:!0},orderBy:{id:"desc"},skip:F,take:U}),()=>VB.collection.count({where:{projectId:B}}),Q)}}var VXG=new rwQ;var swQ=[{key:"file_size",scope:"SYSTEM",readOnly:!0,config:{name:"File Size",type:"number",number:{scale:0}}},{key:"resolution_width",scope:"SYSTEM",readOnly:!0,config:{name:"Resolution Width",type:"number",number:{scale:0}}},{key:"resolution_height",scope:"SYSTEM",readOnly:!0,config:{name:"Resolution Height",type:"number",number:{scale:0}}},{key:"name",scope:"SYSTEM",readOnly:!0,config:{name:"Name",type:"text",text:{}}},{key:"rating",scope:"SYSTEM",readOnly:!1,config:{name:"Rating",type:"rating",rating:{maxValue:5}}},{key:"duration",scope:"SYSTEM",readOnly:!0,config:{name:"Duration",type:"number",number:{scale:0}}},{key:"bitRate",scope:"SYSTEM",readOnly:!0,config:{name:"Bit Rate",type:"number",number:{scale:1}}},{key:"frame_rate",scope:"SYSTEM",readOnly:!0,config:{name:"Frame Rate",type:"number",number:{scale:3}}},{key:"keywords",scope:"SYSTEM",readOnly:!1,config:{name:"Keywords",type:"selectMulti",selectMulti:{options:[]}}},{key:"file_type",scope:"SYSTEM",readOnly:!0,config:{name:"File Type",type:"select",select:{options:[{id:"video",displayName:"Video",color:"system"},{id:"audio",displayName:"Audio",color:"system"},{id:"image",displayName:"Image",color:"system"},{id:"document",displayName:"Document",color:"system"},{id:"file",displayName:"File",color:"system"}]}}},{key:"audio_bit_depth",scope:"SYSTEM",readOnly:!0,config:{name:"Audio Bit Depth",type:"number",number:{scale:0}}},{key:"audio_channels",scope:"SYSTEM",readOnly:!0,config:{name:"Audio Channels",type:"number",number:{scale:0}}},{key:"audio_codec",scope:"SYSTEM",readOnly:!0,config:{name:"Audio Codec",type:"text",text:{}}},{key:"audio_sample_rate",scope:"SYSTEM",readOnly:!0,config:{name:"Audio Sample Rate",type:"number",number:{scale:0}}},{key:"video_codec",scope:"SYSTEM",readOnly:!0,config:{name:"Video Codec",type:"text",text:{}}},{key:"format",scope:"SYSTEM",readOnly:!0,config:{name:"Format",type:"text",text:{}}},{key:"status",scope:"SYSTEM",readOnly:!1,config:{name:"Status",type:"select",select:{options:[{id:"needs_review",displayName:"Needs Review",color:"red"},{id:"in_progress",displayName:"In Progress",color:"yellow"},{id:"approved",displayName:"Approved",color:"green"}]}}}];class twQ{client;constructor(B=VB){this.client=B}async syncSystemFields(){await this.client.$transaction(async(B)=>{for(let Q of swQ)await B.metadataField.upsert({where:{key:Q.key},update:{scope:Q.scope,readOnly:Q.readOnly,config:Q.config},create:{key:Q.key,scope:Q.scope,readOnly:Q.readOnly??!1,config:Q.config}})})}async createTeamField(B,Q){return await this.client.metadataField.create({data:{key:NG(),scope:"TEAM",teamId:B,config:Q.config,aiAutofill:Q.aiAutofill,description:Q.description}})}async listTeamFields(B){return await this.client.metadataField.findMany({where:{OR:[{scope:"SYSTEM"},{AND:[{scope:"TEAM"},{teamId:B}]}]}})}async getFieldByKey(B){return this.client.metadataField.findUnique({where:{key:B}})}async updateTeamField(B,Q,F){let U=await this.client.metadataField.findUnique({where:{key:Q}});if(!U)throw Error("Field not found");if(U.teamId!==B)throw Error("Field does not belong to this team");return await this.client.metadataField.update({where:{id:U.id},data:{config:F.config,aiAutofill:F.aiAutofill??U.aiAutofill,description:F.description??U.description}})}async deleteTeamField(B,Q){let F=await this.client.metadataField.findUnique({where:{key:Q}});if(!F)throw Error("Field not found");if(F.teamId!==B)throw Error("Field does not belong to this team");await this.client.metadataField.delete({where:{key:Q}})}async createProjectField(B,Q){let F=await this.client.project.findUnique({where:{id:B},select:{teamId:!0}});if(!F)throw Error("Project not found");return await this.client.metadataField.create({data:{key:NG(),scope:"PROJECT",projectId:B,teamId:F.teamId,config:Q.config,aiAutofill:Q.aiAutofill,description:Q.description}})}async listProjectFields(B,Q){let F=await this.client.project.findUnique({where:{id:Q},select:{teamId:!0}});if(!F)throw Error("Project not found");let U=await this.client.metadataField.findMany({where:{OR:[{scope:"SYSTEM"},{AND:[{scope:"TEAM"},{teamId:F.teamId}]},{AND:[{scope:"PROJECT"},{projectId:Q}]}]}}),I=B?await this.getProjectFieldsOrder(B,Q):[],G=new Map;I.forEach((g,V)=>{G.set(g.fieldId,V)});let Z=new Map;I.forEach((g)=>{Z.set(g.fieldId,g.visible)});let W=U.map((g)=>({field:g,visible:Z.has(g.key)?Z.get(g.key):B===null}));return W.sort((g,V)=>{let b=G.get(g.field.key),X=G.get(V.field.key);if(b!==void 0&&X!==void 0)return b-X;if(b!==void 0)return-1;if(X!==void 0)return 1;let C=g.field.config?.name||"",N=V.field.config?.name||"";return C.localeCompare(N)}),W}async getProjectFieldsOrder(B,Q){let F=this.getProjectFieldOrderKey(B,Q),U=await this.client.systemSettings.findUnique({where:{key:F}});if(!U||!U.value)return[];return U.value}async updateProjectFieldsOrder(B,Q,F){let U=this.getProjectFieldOrderKey(B,Q);await this.client.systemSettings.upsert({where:{key:U},create:{key:U,value:F},update:{value:F}})}getProjectFieldOrderKey(B,Q){return`project_field_order:${B}:${Q}`}async updateProjectField(B,Q,F){let U=await this.client.metadataField.findUnique({where:{key:Q}});if(!U)throw Error("Field not found");if(U.projectId!==B)throw Error("Field does not belong to this project");return await this.client.metadataField.update({where:{id:U.id},data:{config:F.config,aiAutofill:F.aiAutofill??U.aiAutofill,description:F.description??U.description}})}async deleteProjectField(B,Q){let F=await this.client.metadataField.findUnique({where:{key:Q}});if(!F)throw Error("Field not found");if(F.projectId!==B)throw Error("Field does not belong to this project");await this.client.metadataField.delete({where:{key:Q}})}async updateAssetMetadata(B,Q,F=!1){let U=await TX.resolveLatestVersionId(B);await this.client.$transaction(async(I)=>{for(let G of Q){let Z=await I.metadataField.findUnique({where:{key:G.key}});if(Z?.readOnly&&!F)throw Error(`Field ${Z.key} is read-only`);let W=G.value,g=null,V=null,b=null,X=null,C=null;if(typeof W==="string"){let N=new Date(W);if(!isNaN(N.getTime())&&W.includes("T")&&W.includes("-"))C=N;else g=W}else if(typeof W==="number")V=W;else if(typeof W==="boolean")b=W;else if(W instanceof Date)C=W;else if(Array.isArray(W))X=W;else if(W===null);else if(typeof W==="object")X=W;else g=String(W);await I.assetMetadataValue.upsert({where:{assetId_fieldKey:{assetId:U,fieldKey:G.key}},create:{assetId:U,fieldKey:G.key,stringValue:g,numberValue:V,booleanValue:b,jsonValue:X,dateValue:C},update:{stringValue:g,numberValue:V,booleanValue:b,jsonValue:X,dateValue:C}})}await I.asset.update({where:{id:U},data:{updatedAt:new Date}})})}}var Ir=new twQ;class ewQ{async createProject(B,Q){if(!await VB.team.findUnique({where:{id:Q.teamId}}))throw Error("Team not found");let U=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:Q.teamId,userId:B.id}}});if(!U)throw Error("creator is not a team member");let I=await VB.$transaction(async(G)=>{let Z=await G.project.create({data:{name:Q.name,teamId:Q.teamId,enableNotification:Q.enableNotification??!0,coverImageKey:Q.coverImageKey}}),W=await G.asset.create({data:{name:"root",type:"root",status:"processed",projectId:Z.id}}),g=await G.asset.create({data:{name:"share_root",type:"share_root",status:"processed",projectId:Z.id}}),V=await G.project.update({where:{id:Z.id},data:{rootFolderId:W.id,shareRootId:g.id},include:{rootFolder:!0}});return await G.projectMember.create({data:{projectId:Z.id,teamMemberId:U.id,role:"owner"}}),V});return this.toProjectInfo(I)}async getProject(B){let Q=await VB.project.findUnique({where:{id:B},include:{rootFolder:!0}});if(!Q)throw Error("Project not found");return this.toProjectInfo(Q)}async updateProject(B){let Q=await VB.project.findUnique({where:{id:B.projectId},include:{team:!0}});if(!Q)throw Error("Project not found");if(!Q.team)throw Error("Project has no team");let F=await VB.project.update({where:{id:B.projectId},data:{name:B.name,coverImageKey:B.coverImageKey,enableNotification:B.enableNotification},include:{rootFolder:!0}});return this.toProjectInfo(F)}async listProjects(B){let Q=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B.teamId,userId:B.userId}}});if(!Q)throw Error("failed to get team member");let F={teamId:B.teamId};if(Q.scope==="project")F.members={some:{teamMemberId:Q.id}};let U={},I=B.sortDirection==="desc"?"desc":"asc";if(B.sortBy)if(B.sortBy==="created_at")U.createdAt=I;else if(B.sortBy==="updated_at")U.updatedAt=I;else U.name=I;else U.name="asc";return await $V(async(Z,W)=>{let g=await VB.project.findMany({where:F,orderBy:U,skip:Z,take:W,include:{rootFolder:!0}});return await Promise.all(g.map((b)=>this.toProjectInfo(b)))},null,B.pagination)}async addProjectMember(B){if(!await VB.user.findUnique({where:{id:B.userId}}))throw Error("User not found");let F=await VB.project.findUnique({where:{id:B.projectId},include:{team:!0}});if(!F)throw Error("Project not found");let U=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:F.teamId,userId:B.userId}}});if(!U)throw Error("user is not a team member");await VB.projectMember.create({data:{projectId:B.projectId,teamMemberId:U.id,role:B.role}})}async listProjectMembers(B){let Q=await VB.projectMember.findMany({where:{projectId:B.projectId,...B.includeAgents?{teamMember:{user:{OR:[{type:"human"},{type:"agent",agent:{type:"chat",enabled:!0}}]}}}:{teamMember:{user:{type:{not:"agent"}}}}},include:{teamMember:{include:{user:!0}}}});return Promise.all(Q.filter((F)=>F.teamMember&&F.teamMember.user).map(async(F)=>({id:F.teamMember.user.id,name:F.teamMember.user.name,role:F.role,image:await MX(F.teamMember.user.image),scope:F.teamMember.scope})))}async deleteProject(B){let Q=await VB.project.findUnique({where:{id:B}});if(!Q)throw Error("Project not found");let F=new Date(0);if(await VB.$transaction(async(U)=>{await U.asset.updateMany({where:{projectId:B},data:{isDeleted:!0,projectId:null}});let I=[Q.rootFolderId,Q.shareRootId].filter((G)=>G!==null);if(I.length>0)await U.asset.updateMany({where:{id:{in:I}},data:{status:"trashed",deletedAt:F}});await U.project.update({where:{id:B},data:{rootFolderId:null,shareRootId:null}}),await U.project.delete({where:{id:B}})}),Q.coverImageKey){let U=process.env.S3_BUCKET||"shumai";try{await yF.deleteObject(U,Q.coverImageKey)}catch(I){console.error(`Failed to delete project cover image ${Q.coverImageKey}:`,I)}}}async getProjectRootFolder(B){let Q=await VB.project.findUnique({where:{id:B},include:{rootFolder:!0}});if(!Q)throw Error("Project not found");if(!Q.rootFolderId)return"";return Q.rootFolderId}async getProjectTeam(B){let Q=await VB.project.findUnique({where:{id:B}});if(!Q)throw Error("Project not found");return Q.teamId}async updateMemberRole(B){let Q=await VB.projectMember.findFirst({where:{projectId:B.projectId,teamMember:{userId:B.userId}}});if(!Q)throw Error("Member not found");if(Q.role==="owner")throw Error("Cannot change the role of an owner");await VB.projectMember.update({where:{id:Q.id},data:{role:B.role}})}async removeMember(B,Q){let F=await VB.projectMember.findFirst({where:{projectId:B,teamMember:{userId:Q}}});if(!F)throw Error("Member not found");if(F.role==="owner")throw Error("Cannot remove an owner");await VB.projectMember.delete({where:{id:F.id}})}async getProjectMe(B,Q){let F=await VB.user.findUnique({where:{id:Q}});if(!F)throw Error("User not found");let U=await VB.project.findUnique({where:{id:B}});if(!U)throw Error("Project not found");let I=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:U.teamId,userId:Q}}});if(!I)throw Error("User is not a team member");let G=await VB.projectMember.findFirst({where:{projectId:B,teamMemberId:I.id}}),Z=G?G.role:I.role;return{id:F.id,name:F.name,role:Z,image:await MX(F.image)}}async toProjectInfo(B){let Q={id:B.id,name:B.name,teamId:B.teamId,enableNotification:B.enableNotification??!0,coverImageKey:B.coverImageKey||void 0,updatedAt:B.updatedAt};if(B.rootFolderId)Q.rootFolder=B.rootFolderId;else if(B.rootFolder)Q.rootFolder=B.rootFolder.id;if(B.coverImageKey)try{let F=process.env.S3_BUCKET||"shumai",U=await yF.presign(F,B.coverImageKey,"GET");Q.coverImage=U}catch(F){let U=F}return Q}}var zXG=new ewQ;function Gr(B){if(!B)return[];let Q=B.toLowerCase(),F=new Set,U=Array.from(Q),I=U.length;if(I>=3)for(let G=0;G<=I-3;G++)F.add(U[G]+U[G+1]+U[G+2]);else if(I===2)F.add(U[0]+U[1]);else if(I===1)F.add(U[0]);return Array.from(F)}class tE{selectSql=gQ.sql`*`;fromSql=null;wheres=[];orderSql=null;limitCount=null;offsetCount=null;select(B){return this.selectSql=B,this}from(B){return this.fromSql=B,this}addWhere(B){return this.wheres.push(B),this}orderBy(B){return this.orderSql=B,this}limit(B){return this.limitCount=B,this}offset(B){return this.offsetCount=B,this}addSearchConditions(B,Q,F){if(!Q||Q.length===0)return this;let U=[];for(let I of Q){if(F?.skipNameContains&&I.field==="name"&&I.operator==="contains")continue;let G=this.buildSqlCondition(I.field,I.operator,I.value);if(G)U.push(G)}if(U.length>0){let I=B==="OR"?" OR ":" AND ";this.addWhere(gQ.sql`(${gQ.join(U,I)})`)}return this}build(){if(!this.fromSql)throw Error("FROM clause is required in SqlQueryBuilder");let B=[gQ.sql`SELECT`,this.selectSql,gQ.sql`FROM`,this.fromSql];if(this.wheres.length>0)B.push(gQ.sql`WHERE`),B.push(gQ.join(this.wheres," AND "));if(this.orderSql)B.push(gQ.sql`ORDER BY`),B.push(this.orderSql);if(this.limitCount!==null)B.push(gQ.sql`LIMIT ${this.limitCount}`);if(this.offsetCount!==null)B.push(gQ.sql`OFFSET ${this.offsetCount}`);return gQ.join(B," ")}isDate(B){if(B instanceof Date)return!0;if(typeof B!=="string")return!1;let Q=B.toLowerCase();if(["today","yesterday","tomorrow","one week ago","one week from now","one month ago","one month from now"].includes(Q)||Q.match(/\d+\s+days?\s+(ago|from\s+now)/))return!0;let U=new Date(B);return!isNaN(U.getTime())&&B.includes("-")}toDate(B){return this.toDateBound(B,"start")}toDateBound(B,Q){let F=this.parseRelativeDate(B);if(F instanceof Date)return F;if(F&&"gte"in F&&"lte"in F)return Q==="start"?F.gte:F.lte;return new Date(B)}parseDateRange(B){let Q=this.parseRelativeDate(B);if(Q&&"gte"in Q&&"lte"in Q)return{start:Q.gte,end:Q.lte};let F=Q instanceof Date?Q:new Date(B),U=new Date(F);U.setHours(0,0,0,0);let I=new Date(F);return I.setHours(23,59,59,999),{start:U,end:I}}parseRelativeDate(B){if(B instanceof Date)return B;let Q=String(B).toLowerCase(),F=new Date,U=(g)=>{let V=new Date(g);return V.setHours(0,0,0,0),V},I=(g)=>{let V=new Date(g);return V.setHours(23,59,59,999),V};if(Q==="today")return{gte:U(F),lte:I(F)};if(Q==="yesterday"){let g=new Date(F);return g.setDate(g.getDate()-1),{gte:U(g),lte:I(g)}}if(Q==="tomorrow"){let g=new Date(F);return g.setDate(g.getDate()+1),{gte:U(g),lte:I(g)}}if(Q==="one week ago"){let g=new Date(F);return g.setDate(g.getDate()-7),g}if(Q==="one week from now"){let g=new Date(F);return g.setDate(g.getDate()+7),g}if(Q==="one month ago"){let g=new Date(F);return g.setMonth(g.getMonth()-1),g}if(Q==="one month from now"){let g=new Date(F);return g.setMonth(g.getMonth()+1),g}let G=Q.match(/(\d+)\s+days?\s+ago/);if(G){let g=new Date(F);return g.setDate(g.getDate()-parseInt(G[1])),g}let Z=Q.match(/(\d+)\s+days?\s+from\s+now/);if(Z){let g=new Date(F);return g.setDate(g.getDate()+parseInt(Z[1])),g}let W=new Date(B);return isNaN(W.getTime())?null:W}buildEavValueMatch(B){if(typeof B==="string"){let Q=String(B);if(this.isDate(Q)){let F=this.parseRelativeDate(Q);if(F instanceof Date)return gQ.sql`date_value = ${F}`;else if(F&&"gte"in F)return gQ.sql`date_value >= ${F.gte} AND date_value <= ${F.lte}`}return gQ.sql`string_value = ${Q}`}if(typeof B==="number")return gQ.sql`number_value = ${Number(B)}`;if(typeof B==="boolean")return gQ.sql`boolean_value = ${Boolean(B)}`;if(B instanceof Date)return gQ.sql`date_value = ${B}`;if(Array.isArray(B)||typeof B==="object"&&B!==null)return gQ.sql`json_value = ${JSON.stringify(B)}::jsonb`;return gQ.sql`string_value = ${String(B)}`}buildSqlCondition(B,Q,F){let U=B==="sizeByte"||B==="size_byte"?"size_byte":B==="createdAt"||B==="created_at"?"created_at":B==="updatedAt"||B==="updated_at"?"updated_at":B,I=gQ.raw(`a."${U}"`);if(B==="name"){let G=String(F);switch(Q){case"eq":return gQ.sql`${I} = ${G}`;case"neq":return gQ.sql`${I} != ${G}`;case"contains":return gQ.sql`${I} ILIKE ${"%"+G+"%"}`;case"notContains":return gQ.sql`${I} NOT ILIKE ${"%"+G+"%"}`;case"isEmpty":return gQ.sql`${I} = ''`;case"isNotEmpty":return gQ.sql`${I} != ''`;default:throw Error(`Unsupported operator for name field: ${Q}`)}}if(B==="sizeByte"||B==="size_byte"){let G=Number(F);switch(Q){case"eq":return gQ.sql`${I} = ${G}`;case"neq":return gQ.sql`${I} != ${G}`;case"gt":return gQ.sql`${I} > ${G}`;case"gte":return gQ.sql`${I} >= ${G}`;case"lt":return gQ.sql`${I} < ${G}`;case"lte":return gQ.sql`${I} <= ${G}`;default:throw Error(`Unsupported operator for sizeByte field: ${Q}`)}}if(B==="createdAt"||B==="updatedAt"||B==="created_at"||B==="updated_at"){let G=this.toDate(F);switch(Q){case"eq":return gQ.sql`${I} = ${G}`;case"neq":return gQ.sql`${I} != ${G}`;case"gt":return gQ.sql`${I} > ${this.toDateBound(F,"end")}`;case"gte":return gQ.sql`${I} >= ${this.toDateBound(F,"start")}`;case"lt":return gQ.sql`${I} < ${this.toDateBound(F,"start")}`;case"lte":return gQ.sql`${I} <= ${this.toDateBound(F,"end")}`;case"isWithin":{let Z=this.parseDateRange(F);return gQ.sql`${I} >= ${Z.start} AND ${I} <= ${Z.end}`}default:throw Error(`Unsupported operator for date field: ${Q}`)}}switch(Q){case"isEmpty":return gQ.sql`a.id NOT IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B})`;case"isNotEmpty":return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B})`;case"eq":{let G=this.buildEavValueMatch(F);return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND ${G})`}case"neq":{let G=this.buildEavValueMatch(F);return gQ.sql`a.id NOT IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B}) OR a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND NOT (${G}))`}case"gt":return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND (number_value > ${Number(F)} OR date_value > ${this.toDateBound(F,"end")}))`;case"gte":return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND (number_value >= ${Number(F)} OR date_value >= ${this.toDateBound(F,"start")}))`;case"lt":return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND (number_value < ${Number(F)} OR date_value < ${this.toDateBound(F,"start")}))`;case"lte":return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND (number_value <= ${Number(F)} OR date_value <= ${this.toDateBound(F,"end")}))`;case"contains":return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND string_value ILIKE ${"%"+String(F)+"%"})`;case"notContains":return gQ.sql`a.id NOT IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND string_value ILIKE ${"%"+String(F)+"%"})`;case"in":{let G=Array.isArray(F)?F:[F],Z=G.map((W)=>Number(W)).filter((W)=>!isNaN(W));return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND (string_value = ANY(${G}) OR number_value = ANY(${Z}::double precision[])))`}case"notIn":{let G=Array.isArray(F)?F:[F],Z=G.map((W)=>Number(W)).filter((W)=>!isNaN(W));return gQ.sql`a.id NOT IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND (string_value = ANY(${G}) OR number_value = ANY(${Z}::double precision[])))`}case"hasAll":return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND json_value @> ${JSON.stringify(F)}::jsonb)`;case"hasAny":{let G=(Array.isArray(F)?F:[F]).map(String);return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND jsonb_exists_any(json_value, ${G}::text[]))`}case"hasNone":{let G=(Array.isArray(F)?F:[F]).map(String);return gQ.sql`a.id NOT IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND jsonb_exists_any(json_value, ${G}::text[]))`}case"isWithin":{let G=this.parseDateRange(F);return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND date_value >= ${G.start} AND date_value <= ${G.end})`}default:throw Error(`Unsupported operator for metadata field: ${Q}`)}}}class B4Q{prismaClient;assetSvc;constructor(B=VB,Q=TX){this.prismaClient=B;this.assetSvc=Q}async search(B,Q){let F=Q.recursively===!1?[B]:await this.assetSvc.getDescendantFolderIds(B),U=Q.assetType==="folder"?[AF.folder]:[AF.file,AF.version_stack];if(Q.query&&Q.isSemantic){let c=(await this.prismaClient.asset.findUnique({where:{id:B},select:{project:{select:{teamId:!0}}}}))?.project?.teamId;if(!c)throw Error("Team ID not found for folder");if(!await this.prismaClient.agent.findFirst({where:{teamId:c,type:"embedding",enabled:!0}}))throw new YI(422,{message:"Embedding agent not configured or disabled for this team."});let d=await this.prismaClient.workflowTask.create({data:{type:e0.query_embedding_for_search,teamId:c,assetId:B,payload:{projectId:"",queryEmbeddingForSearch:{text:Q.query}},status:"pending"}}),bB=(await oN.executeWait(d)).output?.embedding;if(!bB)throw Error("Failed to generate query embedding");let CB=JSON.stringify(bB),IB=new tE().select(gQ.sql`a.id as "assetId", ae.start_time as "startTime", ae.end_time as "endTime", (ae.embedding <=> ${CB}::vector) as "distance"`).from(gQ.sql`assets a JOIN asset_embeddings ae ON a.id = ae.asset_id`).addWhere(gQ.sql`a.is_deleted = false`);if(F.length>0)IB.addWhere(gQ.sql`a.parent_id = ANY(${F})`);if(Q.showSymlink)IB.addWhere(gQ.sql`
|
|
13869
|
+
Most of the features of Better Auth will not work correctly.`);let g=Q.secrets??wwQ(T0.BETTER_AUTH_SECRETS),V=Q.secret||T0.BETTER_AUTH_SECRET||T0.AUTH_SECRET||"",b,X;if(g)SwQ(g,G),b=g[0].value,X=ywQ(g,V);else b=V||"better-auth-secret-12345678901234567890",l6F(b,G),X=b;Q={...Q,secret:b,baseURL:Z?Q.baseURL:W?new URL(W).origin:"",basePath:Q.basePath||"/api/auth",plugins:U.concat(I)},EwQ(Q,G);let C=mo(Q),N=mX(Q),R=(await Promise.all(Object.entries(Q.socialProviders||{}).map(async([c,k])=>{let d=typeof k==="function"?await k():k;if(d==null)return null;if(d.enabled===!1)return null;if(!d.clientId)G.warn(`Social provider ${c} is missing clientId or clientSecret`);let $=rYB[c](d);return $.disableImplicitSignUp=d.disableImplicitSignUp,$}))).filter((c)=>c!==null),A=({model:c,size:k})=>{if(typeof Q.advanced?.generateId==="function")return Q.advanced.generateId({model:c,size:k});let d=Q?.advanced?.database?.generateId;if(typeof d==="function")return d({model:c,size:k});if(d==="uuid")return crypto.randomUUID();if(d==="serial"||d===!1)return!1;return vN(k)},{publish:Y}=await $wQ(Q,{adapter:B.id,database:typeof Q.database==="function"?"adapter":F(Q.database)}),L=new Set(Q.plugins.map((c)=>c.id)),H=(c)=>Q.plugins.find((k)=>k.id===c)??null,J=(c)=>L.has(c),w=await jd(Q),M=await nd(Q),y={appName:Q.appName||"Better Auth",baseURL:W||"",version:gYB(),socialProviders:R,options:Q,oauthConfig:{storeStateStrategy:Q.account?.storeStateStrategy||(Q.database?"database":"cookie"),skipStateCookieCheck:!!Q.account?.skipStateCookieCheck},tables:N,trustedOrigins:w,trustedProviders:M,isTrustedOrigin(c,k){return this.trustedOrigins.some((d)=>ea(c,d,k))},sessionConfig:{updateAge:Q.session?.updateAge!==void 0?Q.session.updateAge:86400,expiresIn:Q.session?.expiresIn||604800,freshAge:Q.session?.freshAge===void 0?86400:Q.session.freshAge,cookieRefreshCache:(()=>{let c=Q.session?.cookieCache?.refreshCache,k=Q.session?.cookieCache?.maxAge||300;if((!!Q.database||!!Q.secondaryStorage)&&c)return G.warn("[better-auth] `session.cookieCache.refreshCache` is enabled while `database` or `secondaryStorage` is configured. `refreshCache` is meant for stateless (DB-less) setups. Disabling `refreshCache` \u2014 remove it from your config to silence this warning."),!1;if(c===!1||c===void 0)return!1;if(c===!0)return{enabled:!0,updateAge:Math.floor(k*0.2)};return{enabled:!0,updateAge:c.updateAge!==void 0?c.updateAge:Math.floor(k*0.2)}})()},secret:b,secretConfig:X,rateLimit:{...Q.rateLimit,enabled:Q.rateLimit?.enabled??VE,window:Q.rateLimit?.window||10,max:Q.rateLimit?.max||100,storage:Q.rateLimit?.storage||(Q.secondaryStorage?"secondary-storage":"memory")},authCookies:C,logger:G,generateId:A,session:null,secondaryStorage:Q.secondaryStorage,password:{hash:Q.emailAndPassword?.password?.hash||YEQ,verify:Q.emailAndPassword?.password?.verify||LEQ,config:{minPasswordLength:Q.emailAndPassword?.minPasswordLength||8,maxPasswordLength:Q.emailAndPassword?.maxPasswordLength||128},checkPassword:Q3Q},setNewSession(c){this.newSession=c},newSession:null,adapter:B,internalAdapter:ko(B,{options:Q,logger:G,hooks:Q.databaseHooks?[{source:"user",hooks:Q.databaseHooks}]:[],generateId:A}),createAuthCookie:_d(Q),async runMigrations(){throw new OQ("runMigrations will be set by the specific init implementation")},publishTelemetry:Y,skipCSRFCheck:!!Q.advanced?.disableCSRFCheck,skipOriginCheck:Q.advanced?.disableOriginCheck!==void 0?Q.advanced.disableOriginCheck:HJ()?!0:!1,runInBackground:Q.advanced?.backgroundTasks?.handler??((c)=>{c.catch(()=>{})}),async runInBackgroundOrAwait(c){try{if(Q.advanced?.backgroundTasks?.handler){if(c instanceof Promise)Q.advanced.backgroundTasks.handler(c.catch((k)=>{G.error("Failed to run background task:",k)}))}else await c}catch(k){G.error("Failed to run background task:",k)}},getPlugin:H,hasPlugin:J},m=sDQ(y);if(_7(m))await m;return y}PU();ta();var vwQ=async(B)=>{let Q=await GEQ(B),U=await _wQ(Q,B,(I)=>Ld(I)||"unknown");return U.runMigrations=async function(){if(!B.database||"updateMany"in B.database)throw new OQ("Database is not provided or it's an adapter. Migrations are only supported with a database instance.");let{runMigrations:I}=await WEQ(B);await I()},U};PU();var PwQ=(B,Q)=>{let F=Q(B),{api:U}=BLB(F,B);return{handler:async(I)=>{let G=await F,Z=G.options.basePath||"/api/auth",W;if(Q2(B.baseURL))W=await vo(G,I,_o(G.options));else{if(W=G,!G.options.baseURL){let V=_J(void 0,Z,I,void 0,G.options.advanced?.trustedProxyHeaders);if(V)G.baseURL=V,G.options.baseURL=OE(G.baseURL)||void 0;else throw new OQ("Could not get base URL from request. Please provide a valid base URL.")}W.trustedOrigins=await jd(G.options,I),W.trustedProviders=await nd(G.options,I)}let{handler:g}=DwQ(W,B);return RYB(W.adapter,()=>g(I))},api:U,options:B,$context:F,$ERROR_CODES:{...B.plugins?.reduce((I,G)=>{if(G.$ERROR_CODES)return{...I,...G.$ERROR_CODES};return I},{}),...LQ}}};var ULB=(B)=>{return PwQ(B,vwQ)};Tb();PU();J2B();pz();XE();wk();PU();function ILB(B){return B?.code==="P2025"||B?.meta?.cause==="Record to delete does not exist."}var fwQ=(B,Q)=>{let F=null,U=(Z,W=!1)=>({getFieldName:g,getModelName:V,getFieldAttributes:b,getDefaultModelName:X,schema:C})=>{let N=Z,R=(J,w,M)=>{if(!J&&!M)return;let y={};if(J)for(let m of J)y[g({model:w,field:m})]=!0;if(M){if(!J){let m=C[X(w)]?.fields||{};m.id={type:"string"};for(let c of Object.keys(m))y[g({model:w,field:c})]=!0}for(let[m,c]of Object.entries(M)){let k=A(w,V(m),C);if(c.relation==="one-to-one")y[k]=!0;else y[k]={take:c.limit}}}return y},A=(J,w,M)=>{try{let y=X(J),m=X(w),c=V(w).toLowerCase(),k=Object.entries(M[m]?.fields||{}).filter(([d,$])=>$.references&&X($.references.model)===y);if(k.length>0){let[d,$]=k[0];return $?.unique===!0||Q.usePlural===!0?c:`${c}s`}if(k=Object.entries(M[y]?.fields||{}).filter(([d,$])=>$.references&&X($.references.model)===m),k.length>0)return c}catch{}return`${V(w).toLowerCase()}s`};function Y(J){switch(J){case"starts_with":return"startsWith";case"ends_with":return"endsWith";case"ne":return"not";case"not_in":return"notIn";default:return J}}let L=(J,w)=>{if(!w?.length)return!1;return w.some((M)=>{if(M.connector==="OR")return!1;if(M.operator&&M.operator!=="eq")return!1;if(M.mode==="insensitive"){let y=Q.provider==="postgresql"||Q.provider==="mongodb",m=typeof M.value==="string"||Array.isArray(M.value)&&M.value.every((c)=>typeof c==="string");if(y&&m)return!1}if(M.field==="id")return!0;return b({model:J,field:M.field})?.unique===!0})},H=({action:J,model:w,where:M})=>{if(!M||!M.length)return{};let y=($)=>{let FB=g({model:w,field:$.field}),bB=($.mode??"sensitive")==="insensitive"&&(typeof $.value==="string"||Array.isArray($.value)&&$.value.every((LB)=>typeof LB==="string")),CB=Q.provider==="postgresql"||Q.provider==="mongodb",IB=bB&&CB?"insensitive":void 0,t=IB?{mode:IB}:{};if($.operator==="ne"&&$.value===null)return b({model:w,field:$.field})?.required!==!0?{[FB]:{not:null}}:{};if(($.operator==="in"||$.operator==="not_in")&&Array.isArray($.value)){let LB=$.value.filter((HQ)=>HQ!=null);if(LB.length===0)if($.operator==="in")return{AND:[{[FB]:{equals:"__never__"}},{[FB]:{not:"__never__"}}]};else return{};let NQ=Y($.operator);return{[FB]:{[NQ]:LB,...t}}}if($.operator==="eq"||!$.operator)return{[FB]:{equals:$.value,...t}};if($.operator==="ne")return{[FB]:{not:{equals:$.value},...t}};let ZB=Y($.operator);return{[FB]:{[ZB]:$.value,...t}}};if(J==="update"){let $=M.filter((ZB)=>ZB.connector==="AND"||!ZB.connector),FB=M.filter((ZB)=>ZB.connector==="OR"),bB=$.filter((ZB)=>ZB.operator==="eq"||!ZB.operator),CB=$.filter((ZB)=>ZB.operator!=="eq"&&ZB.operator!==void 0).map((ZB)=>y(ZB)),IB=FB.map((ZB)=>y(ZB)),t={};for(let ZB of bB){let LB=g({model:w,field:ZB.field});t[LB]=ZB.value}if(CB.length>0)t.AND=CB;if(IB.length>0)t.OR=IB;return t}if(J==="delete"){let $=M.find((FB)=>FB.field==="id");if($){let FB=g({model:w,field:"id"}),bB=M.filter((NQ)=>NQ.field!=="id");if(bB.length===0)return{[FB]:$.value};let CB=bB.filter((NQ)=>NQ.connector==="AND"||!NQ.connector),IB=bB.filter((NQ)=>NQ.connector==="OR"),t=CB.map((NQ)=>y(NQ)),ZB=IB.map((NQ)=>y(NQ)),LB={[FB]:$.value};if(t.length>0)LB.AND=t;if(ZB.length>0)LB.OR=ZB;return LB}}if(M.length===1){let $=M[0];if(!$)return;return y($)}let m=M.filter(($)=>$.connector==="AND"||!$.connector),c=M.filter(($)=>$.connector==="OR"),k=m.map(($)=>y($)),d=c.map(($)=>y($));return{...k.length?{AND:k}:{},...d.length?{OR:d}:{}}};return{async create({model:J,data:w,select:M}){if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);return await N[J].create({data:w,select:R(M,J)})},async findOne({model:J,where:w,select:M,join:y}){let m=H({model:J,where:w,action:"findOne"});if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);let c=new Map;for(let $ of Object.keys(y??{})){let FB=A(J,$,C);c.set(FB,V($))}let k=R(M,J,y),d=await N[J].findFirst({where:m,select:k});if(y&&d)for(let[$,FB]of c.entries()){if($===FB)continue;if($ in d)d[FB]=d[$],delete d[$]}return d},async findMany({model:J,where:w,limit:M,select:y,offset:m,sortBy:c,join:k}){let d=H({model:J,where:w,action:"findMany"});if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);let $=new Map;if(k)for(let[CB,IB]of Object.entries(k)){let t=A(J,CB,C);$.set(t,V(CB))}let FB=R(y,J,k),bB=await N[J].findMany({where:d,take:M||100,skip:m||0,...c?.field?{orderBy:{[g({model:J,field:c.field})]:c.direction==="desc"?"desc":"asc"}}:{},select:FB});if(k&&Array.isArray(bB))for(let CB of bB)for(let[IB,t]of $.entries()){if(IB===t)continue;if(IB in CB)CB[t]=CB[IB],delete CB[IB]}return bB},async count({model:J,where:w}){let M=H({model:J,where:w,action:"count"});if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);return await N[J].count({where:M})},async update({model:J,where:w,update:M}){if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);if(!L(J,w)){let m=H({model:J,where:w,action:"updateMany"});if(!(await N[J].updateMany({where:m,data:M}))?.count)return null;return await N[J].findFirst({where:m})}let y=H({model:J,where:w,action:"update"});return await N[J].update({where:y,data:M})},async updateMany({model:J,where:w,update:M}){if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);let y=H({model:J,where:w,action:"updateMany"}),m=await N[J].updateMany({where:y,data:M});return m?m.count:0},async delete({model:J,where:w}){if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);if(!w?.some((y)=>y.field==="id")){let y=H({model:J,where:w,action:"deleteMany"});await N[J].deleteMany({where:y});return}let M=H({model:J,where:w,action:"delete"});try{await N[J].delete({where:M})}catch(y){if(ILB(y))return;console.log(y)}},async deleteMany({model:J,where:w}){let M=H({model:J,where:w,action:"deleteMany"}),y=await N[J].deleteMany({where:M});return y?y.count:0},async consumeOne({model:J,where:w}){if(!N[J])throw new OQ(`Model ${J} does not exist in the database. If you haven't generated the Prisma client, you need to run 'npx prisma generate'`);if(w?.some((m)=>m.field==="id")){let m=H({model:J,where:w,action:"delete"});try{return await N[J].delete({where:m})??null}catch(c){if(ILB(c))return null;throw c}}let M=H({model:J,where:w,action:"findOne"}),y=async(m)=>{let c=await m[J].findFirst({where:M});if(!c)return null;try{return(await m[J].deleteMany({where:H({model:J,where:[...w??[],{field:"id",value:c.id,operator:"eq",connector:"AND",mode:"sensitive"}],action:"deleteMany"})}))?.count>0?c:null}catch(k){if(ILB(k))return null;throw k}};return W||typeof N.$transaction!=="function"?y(N):N.$transaction(y)},options:Q}},I=null;I={config:{adapterId:"prisma",adapterName:"Prisma Adapter",usePlural:Q.usePlural??!1,debugLogs:Q.debugLogs??!1,supportsUUIDs:Q.provider==="postgresql"?!0:!1,supportsArrays:Q.provider==="postgresql"||Q.provider==="mongodb"?!0:!1,transaction:Q.transaction??!1?(Z)=>B.$transaction((W)=>{return Z(EJ({config:{...I.config,transaction:!1},adapter:U(W,!0)})(F))}):!1},adapter:U(B)};let G=EJ(I);return(Z)=>{return F=Z,G(Z)}};var lwQ={openai:{name:"openai",config:{api:"openai-responses",baseUrl:"https://api.openai.com/v1",apiKey:"OPENAI_API_KEY"},models:[{modelId:"gpt-4",name:"GPT-4",config:{api:"openai-responses",reasoning:!1,input:["text"],contextWindow:8192,maxTokens:8192,cost:{input:30,output:60,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4-turbo",name:"GPT-4 Turbo",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:10,output:30,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4.1",name:"GPT-4.1",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"gpt-4.1-mini",name:"GPT-4.1 mini",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.4,output:1.6,cacheRead:0.1,cacheWrite:0}}},{modelId:"gpt-4.1-nano",name:"GPT-4.1 nano",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.1,output:0.4,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-4o",name:"GPT-4o",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"gpt-4o-2024-05-13",name:"GPT-4o (2024-05-13)",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:5,output:15,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4o-2024-08-06",name:"GPT-4o (2024-08-06)",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"gpt-4o-2024-11-20",name:"GPT-4o (2024-11-20)",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"gpt-4o-mini",name:"GPT-4o mini",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0.075,cacheWrite:0}}},{modelId:"gpt-5",name:"GPT-5",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5-chat-latest",name:"GPT-5 Chat Latest",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5-codex",name:"GPT-5-Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5-mini",name:"GPT-5 Mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-5-nano",name:"GPT-5 Nano",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.05,output:0.4,cacheRead:0.005,cacheWrite:0}}},{modelId:"gpt-5-pro",name:"GPT-5 Pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:15,output:120,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-5.1",name:"GPT-5.1",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-chat-latest",name:"GPT-5.1 Chat",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-codex",name:"GPT-5.1 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-codex-max",name:"GPT-5.1 Codex Max",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-codex-mini",name:"GPT-5.1 Codex mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-5.2",name:"GPT-5.2",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-chat-latest",name:"GPT-5.2 Chat",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-codex",name:"GPT-5.2 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-pro",name:"GPT-5.2 Pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:21,output:168,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-5.3-chat-latest",name:"GPT-5.3 Chat (latest)",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.3-codex",name:"GPT-5.3 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:32000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.4",name:"GPT-5.4",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"gpt-5.4-mini",name:"GPT-5.4 mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"gpt-5.4-nano",name:"GPT-5.4 nano",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.2,output:1.25,cacheRead:0.02,cacheWrite:0}}},{modelId:"gpt-5.4-pro",name:"GPT-5.4 Pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-5.5",name:"GPT-5.5",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"gpt-5.5-pro",name:"GPT-5.5 Pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"o1",name:"o1",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:15,output:60,cacheRead:7.5,cacheWrite:0}}},{modelId:"o1-pro",name:"o1-pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:150,output:600,cacheRead:0,cacheWrite:0}}},{modelId:"o3",name:"o3",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"o3-deep-research",name:"o3-deep-research",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:10,output:40,cacheRead:2.5,cacheWrite:0}}},{modelId:"o3-mini",name:"o3-mini",config:{api:"openai-responses",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.55,cacheWrite:0}}},{modelId:"o3-pro",name:"o3-pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:20,output:80,cacheRead:0,cacheWrite:0}}},{modelId:"o4-mini",name:"o4-mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.275,cacheWrite:0}}},{modelId:"o4-mini-deep-research",name:"o4-mini-deep-research",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}}]},anthropic:{name:"anthropic",config:{api:"anthropic-messages",baseUrl:"https://api.anthropic.com",apiKey:"ANTHROPIC_API_KEY"},models:[{modelId:"claude-3-5-haiku-20241022",name:"Claude Haiku 3.5",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:0.8,output:4,cacheRead:0.08,cacheWrite:1}}},{modelId:"claude-3-5-haiku-latest",name:"Claude Haiku 3.5 (latest)",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:0.8,output:4,cacheRead:0.08,cacheWrite:1}}},{modelId:"claude-3-5-sonnet-20240620",name:"Claude Sonnet 3.5",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-3-5-sonnet-20241022",name:"Claude Sonnet 3.5 v2",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-3-7-sonnet-20250219",name:"Claude Sonnet 3.7",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-3-haiku-20240307",name:"Claude Haiku 3",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:0.25,output:1.25,cacheRead:0.03,cacheWrite:0.3}}},{modelId:"claude-3-opus-20240229",name:"Claude Opus 3",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-3-sonnet-20240229",name:"Claude Sonnet 3",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:0.3}}},{modelId:"claude-fable-5",name:"Claude Fable 5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"claude-haiku-4-5",name:"Claude Haiku 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"claude-haiku-4-5-20251001",name:"Claude Haiku 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"claude-opus-4-0",name:"Claude Opus 4 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-opus-4-1",name:"Claude Opus 4.1 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-opus-4-1-20250805",name:"Claude Opus 4.1",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-opus-4-20250514",name:"Claude Opus 4",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-opus-4-5",name:"Claude Opus 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-5-20251101",name:"Claude Opus 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-6",name:"Claude Opus 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-7",name:"Claude Opus 4.7",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-8",name:"Claude Opus 4.8",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-sonnet-4-0",name:"Claude Sonnet 4 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-20250514",name:"Claude Sonnet 4",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-5",name:"Claude Sonnet 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-5-20250929",name:"Claude Sonnet 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}}]},google:{name:"google",config:{api:"google-generative-ai",baseUrl:"https://generativelanguage.googleapis.com/v1beta",apiKey:"GEMINI_API_KEY"},models:[{modelId:"gemini-2.0-flash",name:"Gemini 2.0 Flash",config:{api:"google-generative-ai",reasoning:!1,input:["text","image"],contextWindow:1048576,maxTokens:8192,cost:{input:0.1,output:0.4,cacheRead:0.025,cacheWrite:0}}},{modelId:"gemini-2.0-flash-lite",name:"Gemini 2.0 Flash-Lite",config:{api:"google-generative-ai",reasoning:!1,input:["text","image"],contextWindow:1048576,maxTokens:8192,cost:{input:0.075,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"gemini-2.5-flash",name:"Gemini 2.5 Flash",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.3,output:2.5,cacheRead:0.03,cacheWrite:0}}},{modelId:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash-Lite",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.1,output:0.4,cacheRead:0.01,cacheWrite:0}}},{modelId:"gemini-2.5-pro",name:"Gemini 2.5 Pro",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0}}},{modelId:"gemini-3-pro-preview",name:"Gemini 3 Pro Preview",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"gemini-3.1-flash-lite",name:"Gemini 3.1 Flash Lite",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.25,output:1.5,cacheRead:0.025,cacheWrite:0}}},{modelId:"gemini-3.1-flash-lite-preview",name:"Gemini 3.1 Flash Lite Preview",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.25,output:1.5,cacheRead:0.025,cacheWrite:0}}},{modelId:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"gemini-3.1-pro-preview-customtools",name:"Gemini 3.1 Pro Preview Custom Tools",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"gemini-3.5-flash",name:"Gemini 3.5 Flash",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.5,output:9,cacheRead:0.15,cacheWrite:0}}},{modelId:"gemini-flash-latest",name:"Gemini Flash Latest",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.3,output:2.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"gemini-flash-lite-latest",name:"Gemini Flash-Lite Latest",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.1,output:0.4,cacheRead:0.025,cacheWrite:0}}},{modelId:"gemma-4-26b-a4b-it",name:"Gemma 4 26B A4B IT",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"gemma-4-31b-it",name:"Gemma 4 31B IT",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"gemma-4-E2B-it",name:"Gemma 4 E2B IT",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:8192,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"gemma-4-E4B-it",name:"Gemma 4 E4B IT",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:8192,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}}]},deepseek:{name:"deepseek",config:{api:"openai-completions",baseUrl:"https://api.deepseek.com",apiKey:"DEEPSEEK_API_KEY"},models:[{modelId:"deepseek-v4-flash",name:"DeepSeek V4 Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:0.14,output:0.28,cacheRead:0.0028,cacheWrite:0}}},{modelId:"deepseek-v4-pro",name:"DeepSeek V4 Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:0.435,output:0.87,cacheRead:0.003625,cacheWrite:0}}}]},groq:{name:"groq",config:{api:"openai-completions",baseUrl:"https://api.groq.com/openai/v1",apiKey:"GROQ_API_KEY"},models:[{modelId:"llama-3.1-8b-instant",name:"Llama 3.1 8B",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.05,output:0.08,cacheRead:0,cacheWrite:0}}},{modelId:"llama-3.3-70b-versatile",name:"Llama 3.3 70B",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:32768,cost:{input:0.59,output:0.79,cacheRead:0,cacheWrite:0}}},{modelId:"meta-llama/llama-4-scout-17b-16e-instruct",name:"Llama 4 Scout 17B 16E",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:131072,maxTokens:8192,cost:{input:0.11,output:0.34,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-120b",name:"GPT OSS 120B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.15,output:0.6,cacheRead:0.075,cacheWrite:0}}},{modelId:"openai/gpt-oss-20b",name:"GPT OSS 20B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.075,output:0.3,cacheRead:0.0375,cacheWrite:0}}},{modelId:"openai/gpt-oss-safeguard-20b",name:"Safety GPT OSS 20B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.075,output:0.3,cacheRead:0.037,cacheWrite:0}}},{modelId:"qwen/qwen3-32b",name:"Qwen3-32B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:40960,cost:{input:0.29,output:0.59,cacheRead:0,cacheWrite:0}}}]},openrouter:{name:"openrouter",config:{api:"openai-completions",baseUrl:"https://openrouter.ai/api/v1",apiKey:"OPENROUTER_API_KEY"},models:[{modelId:"ai21/jamba-large-1.7",name:"AI21: Jamba Large 1.7",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:4096,cost:{input:2,output:8,cacheRead:0,cacheWrite:0}}},{modelId:"amazon/nova-2-lite-v1",name:"Amazon: Nova 2 Lite",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65535,cost:{input:0.3,output:2.5,cacheRead:0,cacheWrite:0}}},{modelId:"amazon/nova-lite-v1",name:"Amazon: Nova Lite 1.0",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:300000,maxTokens:5120,cost:{input:0.06,output:0.24,cacheRead:0,cacheWrite:0}}},{modelId:"amazon/nova-micro-v1",name:"Amazon: Nova Micro 1.0",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:5120,cost:{input:0.035,output:0.14,cacheRead:0,cacheWrite:0}}},{modelId:"amazon/nova-premier-v1",name:"Amazon: Nova Premier 1.0",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:32000,cost:{input:2.5,output:12.5,cacheRead:0.625,cacheWrite:0}}},{modelId:"amazon/nova-pro-v1",name:"Amazon: Nova Pro 1.0",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:300000,maxTokens:5120,cost:{input:0.8,output:3.2,cacheRead:0,cacheWrite:0}}},{modelId:"anthropic/claude-3-haiku",name:"Anthropic: Claude 3 Haiku",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:0.25,output:1.25,cacheRead:0.03,cacheWrite:0.3}}},{modelId:"anthropic/claude-3.5-haiku",name:"Anthropic: Claude 3.5 Haiku",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:0.8,output:4,cacheRead:0.08,cacheWrite:1}}},{modelId:"anthropic/claude-fable-5",name:"Anthropic: Claude Fable 5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"anthropic/claude-haiku-4.5",name:"Anthropic: Claude Haiku 4.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"anthropic/claude-opus-4",name:"Anthropic: Claude Opus 4",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"anthropic/claude-opus-4.1",name:"Anthropic: Claude Opus 4.1",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"anthropic/claude-opus-4.5",name:"Anthropic: Claude Opus 4.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-opus-4.6",name:"Anthropic: Claude Opus 4.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-opus-4.6-fast",name:"Anthropic: Claude Opus 4.6 (Fast)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:30,output:150,cacheRead:3,cacheWrite:37.5}}},{modelId:"anthropic/claude-opus-4.7",name:"Anthropic: Claude Opus 4.7",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-opus-4.7-fast",name:"Anthropic: Claude Opus 4.7 (Fast)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:30,output:150,cacheRead:3,cacheWrite:37.5}}},{modelId:"anthropic/claude-opus-4.8",name:"Anthropic: Claude Opus 4.8",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-opus-4.8-fast",name:"Anthropic: Claude Opus 4.8 (Fast)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"anthropic/claude-sonnet-4",name:"Anthropic: Claude Sonnet 4",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"anthropic/claude-sonnet-4.5",name:"Anthropic: Claude Sonnet 4.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"anthropic/claude-sonnet-4.6",name:"Anthropic: Claude Sonnet 4.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"arcee-ai/trinity-large-thinking",name:"Arcee AI: Trinity Large Thinking",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.22,output:0.85,cacheRead:0.06,cacheWrite:0}}},{modelId:"arcee-ai/trinity-mini",name:"Arcee AI: Trinity Mini",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.045,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"arcee-ai/virtuoso-large",name:"Arcee AI: Virtuoso Large",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:64000,cost:{input:0.75,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"auto",name:"Auto",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:2000000,maxTokens:30000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"bytedance-seed/seed-1.6",name:"ByteDance Seed: Seed 1.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0.25,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"bytedance-seed/seed-1.6-flash",name:"ByteDance Seed: Seed 1.6 Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0.075,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"bytedance-seed/seed-2.0-lite",name:"ByteDance Seed: Seed-2.0-Lite",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.25,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"bytedance-seed/seed-2.0-mini",name:"ByteDance Seed: Seed-2.0-Mini",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.1,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"cohere/command-r-08-2024",name:"Cohere: Command R (08-2024)",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4000,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"cohere/command-r-plus-08-2024",name:"Cohere: Command R+ (08-2024)",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4000,cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-chat",name:"DeepSeek: DeepSeek V3",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16000,cost:{input:0.2002,output:0.8001,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-chat-v3-0324",name:"DeepSeek: DeepSeek V3 0324",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:163840,maxTokens:16384,cost:{input:0.2,output:0.77,cacheRead:0.135,cacheWrite:0}}},{modelId:"deepseek/deepseek-chat-v3.1",name:"DeepSeek: DeepSeek V3.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:32768,cost:{input:0.21,output:0.79,cacheRead:0.13,cacheWrite:0}}},{modelId:"deepseek/deepseek-r1",name:"DeepSeek: R1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:16000,cost:{input:0.7,output:2.5,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-r1-0528",name:"DeepSeek: R1 0528",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:32768,cost:{input:0.5,output:2.15,cacheRead:0.35,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3.1-terminus",name:"DeepSeek: DeepSeek V3.1 Terminus",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:32768,cost:{input:0.27,output:0.95,cacheRead:0.13,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3.2",name:"DeepSeek: DeepSeek V3.2",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:64000,cost:{input:0.2288,output:0.3432,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3.2-exp",name:"DeepSeek: DeepSeek V3.2 Exp",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:65536,cost:{input:0.27,output:0.41,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-v4-flash",name:"DeepSeek: DeepSeek V4 Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:65536,cost:{input:0.09,output:0.18,cacheRead:0.02,cacheWrite:0}}},{modelId:"deepseek/deepseek-v4-pro",name:"DeepSeek: DeepSeek V4 Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:384000,cost:{input:0.435,output:0.87,cacheRead:0.003625,cacheWrite:0}}},{modelId:"essentialai/rnj-1-instruct",name:"EssentialAI: Rnj 1 Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32768,maxTokens:4096,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"google/gemini-2.5-flash",name:"Google: Gemini 2.5 Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65535,cost:{input:0.3,output:2.5,cacheRead:0.03,cacheWrite:0.083333}}},{modelId:"google/gemini-2.5-flash-lite",name:"Google: Gemini 2.5 Flash Lite",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65535,cost:{input:0.1,output:0.4,cacheRead:0.01,cacheWrite:0.083333}}},{modelId:"google/gemini-2.5-flash-lite-preview-09-2025",name:"Google: Gemini 2.5 Flash Lite Preview 09-2025",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65535,cost:{input:0.1,output:0.4,cacheRead:0.01,cacheWrite:0.083333}}},{modelId:"google/gemini-2.5-pro",name:"Google: Gemini 2.5 Pro",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0.375}}},{modelId:"google/gemini-2.5-pro-preview",name:"Google: Gemini 2.5 Pro Preview 06-05",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0.375}}},{modelId:"google/gemini-2.5-pro-preview-05-06",name:"Google: Gemini 2.5 Pro Preview 05-06",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65535,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0.375}}},{modelId:"google/gemini-3-flash-preview",name:"Google: Gemini 3 Flash Preview",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0.083333}}},{modelId:"google/gemini-3.1-flash-lite",name:"Google: Gemini 3.1 Flash Lite",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.25,output:1.5,cacheRead:0.025,cacheWrite:0.083333}}},{modelId:"google/gemini-3.1-flash-lite-preview",name:"Google: Gemini 3.1 Flash Lite Preview",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.25,output:1.5,cacheRead:0.025,cacheWrite:0.083333}}},{modelId:"google/gemini-3.1-pro-preview",name:"Google: Gemini 3.1 Pro Preview",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0.375}}},{modelId:"google/gemini-3.1-pro-preview-customtools",name:"Google: Gemini 3.1 Pro Preview Custom Tools",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048756,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0.375}}},{modelId:"google/gemini-3.5-flash",name:"Google: Gemini 3.5 Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.5,output:9,cacheRead:0.15,cacheWrite:0.083333}}},{modelId:"google/gemma-3-12b-it",name:"Google: Gemma 3 12B",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:131072,maxTokens:16384,cost:{input:0.05,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"google/gemma-3-27b-it",name:"Google: Gemma 3 27B",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:131072,maxTokens:16384,cost:{input:0.08,output:0.16,cacheRead:0,cacheWrite:0}}},{modelId:"google/gemma-4-26b-a4b-it",name:"Google: Gemma 4 26B A4B ",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:4096,cost:{input:0.06,output:0.33,cacheRead:0,cacheWrite:0}}},{modelId:"google/gemma-4-26b-a4b-it:free",name:"Google: Gemma 4 26B A4B (free)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"google/gemma-4-31b-it",name:"Google: Gemma 4 31B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.12,output:0.35,cacheRead:0.09,cacheWrite:0}}},{modelId:"google/gemma-4-31b-it:free",name:"Google: Gemma 4 31B (free)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"ibm-granite/granite-4.1-8b",name:"IBM: Granite 4.1 8B",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.05,output:0.1,cacheRead:0.05,cacheWrite:0}}},{modelId:"inception/mercury-2",name:"Inception: Mercury 2",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:50000,cost:{input:0.25,output:0.75,cacheRead:0.025,cacheWrite:0}}},{modelId:"inclusionai/ling-2.6-1t",name:"inclusionAI: Ling-2.6-1T",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0.075,output:0.625,cacheRead:0.015,cacheWrite:0}}},{modelId:"inclusionai/ling-2.6-flash",name:"inclusionAI: Ling-2.6-flash",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0.01,output:0.03,cacheRead:0.002,cacheWrite:0}}},{modelId:"inclusionai/ring-2.6-1t",name:"inclusionAI: Ring-2.6-1T",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:0.075,output:0.625,cacheRead:0.015,cacheWrite:0}}},{modelId:"kwaipilot/kat-coder-pro-v2",name:"Kwaipilot: KAT-Coder-Pro V2",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:80000,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"meta-llama/llama-3.1-70b-instruct",name:"Meta: Llama 3.1 70B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.4,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"meta-llama/llama-3.1-8b-instruct",name:"Meta: Llama 3.1 8B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.02,output:0.03,cacheRead:0,cacheWrite:0}}},{modelId:"meta-llama/llama-3.3-70b-instruct",name:"Meta: Llama 3.3 70B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.1,output:0.32,cacheRead:0,cacheWrite:0}}},{modelId:"meta-llama/llama-3.3-70b-instruct:free",name:"Meta: Llama 3.3 70B Instruct (free)",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"meta-llama/llama-4-maverick",name:"Meta: Llama 4 Maverick",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:1048576,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"meta-llama/llama-4-scout",name:"Meta: Llama 4 Scout",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:1e7,maxTokens:16384,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"minimax/minimax-m1",name:"MiniMax: MiniMax M1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:40000,cost:{input:0.4,output:2.2,cacheRead:0,cacheWrite:0}}},{modelId:"minimax/minimax-m2",name:"MiniMax: MiniMax M2",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:196608,cost:{input:0.255,output:1,cacheRead:0.03,cacheWrite:0}}},{modelId:"minimax/minimax-m2.1",name:"MiniMax: MiniMax M2.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:196608,cost:{input:0.29,output:0.95,cacheRead:0.03,cacheWrite:0}}},{modelId:"minimax/minimax-m2.5",name:"MiniMax: MiniMax M2.5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:196608,cost:{input:0.15,output:0.9,cacheRead:0.05,cacheWrite:0}}},{modelId:"minimax/minimax-m2.7",name:"MiniMax: MiniMax M2.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.25,output:1,cacheRead:0.05,cacheWrite:0}}},{modelId:"minimax/minimax-m3",name:"MiniMax: MiniMax M3",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:512000,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"mistralai/codestral-2508",name:"Mistral: Codestral 2508",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:4096,cost:{input:0.3,output:0.9,cacheRead:0.03,cacheWrite:0}}},{modelId:"mistralai/devstral-2512",name:"Mistral: Devstral 2 2512",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:4096,cost:{input:0.4,output:2,cacheRead:0.04,cacheWrite:0}}},{modelId:"mistralai/ministral-14b-2512",name:"Mistral: Ministral 3 14B 2512",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:4096,cost:{input:0.2,output:0.2,cacheRead:0.02,cacheWrite:0}}},{modelId:"mistralai/ministral-3b-2512",name:"Mistral: Ministral 3 3B 2512",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:131072,maxTokens:4096,cost:{input:0.1,output:0.1,cacheRead:0.01,cacheWrite:0}}},{modelId:"mistralai/ministral-8b-2512",name:"Mistral: Ministral 3 8B 2512",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:4096,cost:{input:0.15,output:0.15,cacheRead:0.015,cacheWrite:0}}},{modelId:"mistralai/mistral-large",name:"Mistral Large",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:2,output:6,cacheRead:0.2,cacheWrite:0}}},{modelId:"mistralai/mistral-large-2407",name:"Mistral Large 2407",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:4096,cost:{input:2,output:6,cacheRead:0.2,cacheWrite:0}}},{modelId:"mistralai/mistral-large-2512",name:"Mistral: Mistral Large 3 2512",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:4096,cost:{input:0.5,output:1.5,cacheRead:0.05,cacheWrite:0}}},{modelId:"mistralai/mistral-medium-3",name:"Mistral: Mistral Medium 3",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:131072,maxTokens:4096,cost:{input:0.4,output:2,cacheRead:0.04,cacheWrite:0}}},{modelId:"mistralai/mistral-medium-3-5",name:"Mistral: Mistral Medium 3.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:4096,cost:{input:1.5,output:7.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistralai/mistral-medium-3.1",name:"Mistral: Mistral Medium 3.1",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:131072,maxTokens:4096,cost:{input:0.4,output:2,cacheRead:0.04,cacheWrite:0}}},{modelId:"mistralai/mistral-nemo",name:"Mistral: Mistral Nemo",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:4096,cost:{input:0.02,output:0.03,cacheRead:0,cacheWrite:0}}},{modelId:"mistralai/mistral-saba",name:"Mistral: Saba",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32768,maxTokens:4096,cost:{input:0.2,output:0.6,cacheRead:0.02,cacheWrite:0}}},{modelId:"mistralai/mistral-small-2603",name:"Mistral: Mistral Small 4",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:4096,cost:{input:0.15,output:0.6,cacheRead:0.015,cacheWrite:0}}},{modelId:"mistralai/mistral-small-3.2-24b-instruct",name:"Mistral: Mistral Small 3.2 24B",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.075,output:0.2,cacheRead:0,cacheWrite:0}}},{modelId:"mistralai/mixtral-8x22b-instruct",name:"Mistral: Mixtral 8x22B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:65536,maxTokens:4096,cost:{input:2,output:6,cacheRead:0.2,cacheWrite:0}}},{modelId:"mistralai/voxtral-small-24b-2507",name:"Mistral: Voxtral Small 24B 2507",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32000,maxTokens:4096,cost:{input:0.1,output:0.3,cacheRead:0.01,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2",name:"MoonshotAI: Kimi K2 0711",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:32768,cost:{input:0.57,output:2.3,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2-0905",name:"MoonshotAI: Kimi K2 0905",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:2.5,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2-thinking",name:"MoonshotAI: Kimi K2 Thinking",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:2.5,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2.5",name:"MoonshotAI: Kimi K2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:4096,cost:{input:0.41,output:2.06,cacheRead:0.07,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2.6",name:"MoonshotAI: Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262142,cost:{input:0.68,output:3.41,cacheRead:0.34,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2.7-code",name:"MoonshotAI: Kimi K2.7 Code",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.75,output:3.5,cacheRead:0.16,cacheWrite:0}}},{modelId:"nex-agi/nex-n2-pro:free",name:"Nex AGI: Nex-N2-Pro (free)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/llama-3.3-nemotron-super-49b-v1.5",name:"NVIDIA: Llama 3.3 Nemotron Super 49B V1.5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.4,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-nano-30b-a3b",name:"NVIDIA: Nemotron 3 Nano 30B A3B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:228000,cost:{input:0.05,output:0.2,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-nano-30b-a3b:free",name:"NVIDIA: Nemotron 3 Nano 30B A3B (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free",name:"NVIDIA: Nemotron 3 Nano Omni (free)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:65536,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-super-120b-a12b",name:"NVIDIA: Nemotron 3 Super",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:4096,cost:{input:0.09,output:0.45,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-super-120b-a12b:free",name:"NVIDIA: Nemotron 3 Super (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:262144,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-ultra-550b-a55b",name:"NVIDIA: Nemotron 3 Ultra",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:16384,cost:{input:0.5,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-ultra-550b-a55b:free",name:"NVIDIA: Nemotron 3 Ultra (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:65536,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-nano-12b-v2-vl:free",name:"NVIDIA: Nemotron Nano 12B 2 VL (free)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:128000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-nano-9b-v2:free",name:"NVIDIA: Nemotron Nano 9B V2 (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-3.5-turbo",name:"OpenAI: GPT-3.5 Turbo",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:16385,maxTokens:4096,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-3.5-turbo-0613",name:"OpenAI: GPT-3.5 Turbo (older v0613)",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:4095,maxTokens:4096,cost:{input:1,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-3.5-turbo-16k",name:"OpenAI: GPT-3.5 Turbo 16k",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:16385,maxTokens:4096,cost:{input:3,output:4,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4",name:"OpenAI: GPT-4",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:8191,maxTokens:4096,cost:{input:30,output:60,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4-turbo",name:"OpenAI: GPT-4 Turbo",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:10,output:30,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4-turbo-preview",name:"OpenAI: GPT-4 Turbo Preview",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:10,output:30,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4.1",name:"OpenAI: GPT-4.1",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:4096,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/gpt-4.1-mini",name:"OpenAI: GPT-4.1 Mini",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.4,output:1.6,cacheRead:0.1,cacheWrite:0}}},{modelId:"openai/gpt-4.1-nano",name:"OpenAI: GPT-4.1 Nano",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.1,output:0.4,cacheRead:0.025,cacheWrite:0}}},{modelId:"openai/gpt-4o",name:"OpenAI: GPT-4o",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4o-2024-05-13",name:"OpenAI: GPT-4o (2024-05-13)",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:5,output:15,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4o-2024-08-06",name:"OpenAI: GPT-4o (2024-08-06)",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"openai/gpt-4o-2024-11-20",name:"OpenAI: GPT-4o (2024-11-20)",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"openai/gpt-4o-mini",name:"OpenAI: GPT-4o-mini",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0.075,cacheWrite:0}}},{modelId:"openai/gpt-4o-mini-2024-07-18",name:"OpenAI: GPT-4o-mini (2024-07-18)",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0.075,cacheWrite:0}}},{modelId:"openai/gpt-5",name:"OpenAI: GPT-5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5-codex",name:"OpenAI: GPT-5 Codex",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5-mini",name:"OpenAI: GPT-5 Mini",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"openai/gpt-5-nano",name:"OpenAI: GPT-5 Nano",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:4096,cost:{input:0.05,output:0.4,cacheRead:0.01,cacheWrite:0}}},{modelId:"openai/gpt-5-pro",name:"OpenAI: GPT-5 Pro",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:15,output:120,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-5.1",name:"OpenAI: GPT-5.1",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.13,cacheWrite:0}}},{modelId:"openai/gpt-5.1-chat",name:"OpenAI: GPT-5.1 Chat",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:32000,cost:{input:1.25,output:10,cacheRead:0.13,cacheWrite:0}}},{modelId:"openai/gpt-5.1-codex",name:"OpenAI: GPT-5.1-Codex",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.13,cacheWrite:0}}},{modelId:"openai/gpt-5.1-codex-max",name:"OpenAI: GPT-5.1-Codex-Max",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5.1-codex-mini",name:"OpenAI: GPT-5.1-Codex-Mini",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:1e5,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"openai/gpt-5.2",name:"OpenAI: GPT-5.2",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.2-chat",name:"OpenAI: GPT-5.2 Chat",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.2-codex",name:"OpenAI: GPT-5.2-Codex",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.2-pro",name:"OpenAI: GPT-5.2 Pro",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:21,output:168,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-5.3-chat",name:"OpenAI: GPT-5.3 Chat",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.3-codex",name:"OpenAI: GPT-5.3-Codex",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.4",name:"OpenAI: GPT-5.4",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"openai/gpt-5.4-mini",name:"OpenAI: GPT-5.4 Mini",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"openai/gpt-5.4-nano",name:"OpenAI: GPT-5.4 Nano",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.2,output:1.25,cacheRead:0.02,cacheWrite:0}}},{modelId:"openai/gpt-5.4-pro",name:"OpenAI: GPT-5.4 Pro",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-5.5",name:"OpenAI: GPT-5.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/gpt-5.5-pro",name:"OpenAI: GPT-5.5 Pro",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-audio",name:"OpenAI: GPT Audio",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-audio-mini",name:"OpenAI: GPT Audio Mini",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.6,output:2.4,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-chat-latest",name:"OpenAI: GPT Chat Latest",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/gpt-oss-120b",name:"OpenAI: gpt-oss-120b",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:4096,cost:{input:0.039,output:0.18,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-120b:free",name:"OpenAI: gpt-oss-120b (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-20b",name:"OpenAI: gpt-oss-20b",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:4096,cost:{input:0.029,output:0.14,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-20b:free",name:"OpenAI: gpt-oss-20b (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:8192,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-safeguard-20b",name:"OpenAI: gpt-oss-safeguard-20b",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.075,output:0.3,cacheRead:0.037,cacheWrite:0}}},{modelId:"openai/o1",name:"OpenAI: o1",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:15,output:60,cacheRead:7.5,cacheWrite:0}}},{modelId:"openai/o3",name:"OpenAI: o3",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/o3-deep-research",name:"OpenAI: o3 Deep Research",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:10,output:40,cacheRead:2.5,cacheWrite:0}}},{modelId:"openai/o3-mini",name:"OpenAI: o3 Mini",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.55,cacheWrite:0}}},{modelId:"openai/o3-mini-high",name:"OpenAI: o3 Mini High",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.55,cacheWrite:0}}},{modelId:"openai/o3-pro",name:"OpenAI: o3 Pro",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:20,output:80,cacheRead:0,cacheWrite:0}}},{modelId:"openai/o4-mini",name:"OpenAI: o4 Mini",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.275,cacheWrite:0}}},{modelId:"openai/o4-mini-deep-research",name:"OpenAI: o4 Mini Deep Research",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/o4-mini-high",name:"OpenAI: o4 Mini High",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.275,cacheWrite:0}}},{modelId:"openrouter/auto",name:"Auto Router",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:2000000,maxTokens:4096,cost:{input:-1e6,output:-1e6,cacheRead:0,cacheWrite:0}}},{modelId:"openrouter/free",name:"Free Models Router",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"openrouter/owl-alpha",name:"Owl Alpha",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1048756,maxTokens:262144,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"poolside/laguna-m.1:free",name:"Poolside: Laguna M.1 (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"poolside/laguna-xs.2:free",name:"Poolside: Laguna XS.2 (free)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"prime-intellect/intellect-3",name:"Prime Intellect: INTELLECT-3",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.2,output:1.1,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen-2.5-72b-instruct",name:"Qwen2.5 72B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.36,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen-plus",name:"Qwen: Qwen-Plus",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1e6,maxTokens:32768,cost:{input:0.26,output:0.78,cacheRead:0.052,cacheWrite:0.325}}},{modelId:"qwen/qwen-plus-2025-07-28",name:"Qwen: Qwen Plus 0728",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1e6,maxTokens:32768,cost:{input:0.26,output:0.78,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen-plus-2025-07-28:thinking",name:"Qwen: Qwen Plus 0728 (thinking)",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:32768,cost:{input:0.26,output:0.78,cacheRead:0,cacheWrite:0.325}}},{modelId:"qwen/qwen3-14b",name:"Qwen: Qwen3 14B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131702,maxTokens:40960,cost:{input:0.1,output:0.24,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-235b-a22b",name:"Qwen: Qwen3 235B A22B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:8192,cost:{input:0.455,output:1.82,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-235b-a22b-2507",name:"Qwen: Qwen3 235B A22B Instruct 2507",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:16384,cost:{input:0.09,output:0.1,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-235b-a22b-thinking-2507",name:"Qwen: Qwen3 235B A22B Thinking 2507",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.1,output:0.1,cacheRead:0.1,cacheWrite:0}}},{modelId:"qwen/qwen3-30b-a3b",name:"Qwen: Qwen3 30B A3B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.12,output:0.5,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-30b-a3b-instruct-2507",name:"Qwen: Qwen3 30B A3B Instruct 2507",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:32000,cost:{input:0.04815,output:0.19305,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-30b-a3b-thinking-2507",name:"Qwen: Qwen3 30B A3B Thinking 2507",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.08,output:0.4,cacheRead:0.08,cacheWrite:0}}},{modelId:"qwen/qwen3-32b",name:"Qwen: Qwen3 32B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.08,output:0.28,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-8b",name:"Qwen: Qwen3 8B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:8192,cost:{input:0.05,output:0.4,cacheRead:0.05,cacheWrite:0}}},{modelId:"qwen/qwen3-coder",name:"Qwen: Qwen3 Coder 480B A35B",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1048576,maxTokens:65536,cost:{input:0.22,output:1.8,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-coder-30b-a3b-instruct",name:"Qwen: Qwen3 Coder 30B A3B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:160000,maxTokens:32768,cost:{input:0.07,output:0.27,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-coder-flash",name:"Qwen: Qwen3 Coder Flash",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1e6,maxTokens:65536,cost:{input:0.195,output:0.975,cacheRead:0.039,cacheWrite:0.24375}}},{modelId:"qwen/qwen3-coder-next",name:"Qwen: Qwen3 Coder Next",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.11,output:0.8,cacheRead:0.07,cacheWrite:0}}},{modelId:"qwen/qwen3-coder-plus",name:"Qwen: Qwen3 Coder Plus",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1e6,maxTokens:65536,cost:{input:0.65,output:3.25,cacheRead:0.13,cacheWrite:0.8125}}},{modelId:"qwen/qwen3-coder:free",name:"Qwen: Qwen3 Coder 480B A35B (free)",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1048576,maxTokens:262000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-max",name:"Qwen: Qwen3 Max",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0.78,output:3.9,cacheRead:0.156,cacheWrite:0.975}}},{modelId:"qwen/qwen3-max-thinking",name:"Qwen: Qwen3 Max Thinking",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0.78,output:3.9,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-next-80b-a3b-instruct",name:"Qwen: Qwen3 Next 80B A3B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:16384,cost:{input:0.09,output:1.1,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-next-80b-a3b-instruct:free",name:"Qwen: Qwen3 Next 80B A3B Instruct (free)",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-next-80b-a3b-thinking",name:"Qwen: Qwen3 Next 80B A3B Thinking",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0.0975,output:0.78,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-vl-235b-a22b-instruct",name:"Qwen: Qwen3 VL 235B A22B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:16384,cost:{input:0.2,output:0.88,cacheRead:0.11,cacheWrite:0}}},{modelId:"qwen/qwen3-vl-235b-a22b-thinking",name:"Qwen: Qwen3 VL 235B A22B Thinking",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:32768,cost:{input:0.26,output:2.6,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-vl-30b-a3b-instruct",name:"Qwen: Qwen3 VL 30B A3B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0.13,output:0.52,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-vl-30b-a3b-thinking",name:"Qwen: Qwen3 VL 30B A3B Thinking",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:32768,cost:{input:0.13,output:1.56,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-vl-32b-instruct",name:"Qwen: Qwen3 VL 32B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0.104,output:0.416,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-vl-8b-instruct",name:"Qwen: Qwen3 VL 8B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:256000,maxTokens:32768,cost:{input:0.08,output:0.5,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3-vl-8b-thinking",name:"Qwen: Qwen3 VL 8B Thinking",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:32768,cost:{input:0.117,output:1.365,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-122b-a10b",name:"Qwen: Qwen3.5-122B-A10B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.26,output:2.08,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-27b",name:"Qwen: Qwen3.5-27B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.195,output:1.56,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-35b-a3b",name:"Qwen: Qwen3.5-35B-A3B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.14,output:1,cacheRead:0.05,cacheWrite:0}}},{modelId:"qwen/qwen3.5-397b-a17b",name:"Qwen: Qwen3.5 397B A17B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.39,output:2.34,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-9b",name:"Qwen: Qwen3.5-9B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.1,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-flash-02-23",name:"Qwen: Qwen3.5-Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.065,output:0.26,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-plus-02-15",name:"Qwen: Qwen3.5 Plus 2026-02-15",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.26,output:1.56,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-plus-20260420",name:"Qwen: Qwen3.5 Plus 2026-04-20",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.3,output:1.8,cacheRead:0,cacheWrite:0.375}}},{modelId:"qwen/qwen3.6-27b",name:"Qwen: Qwen3.6 27B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262140,cost:{input:0.2885,output:3.17,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.6-35b-a3b",name:"Qwen: Qwen3.6 35B A3B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.15,output:1,cacheRead:0.05,cacheWrite:0}}},{modelId:"qwen/qwen3.6-flash",name:"Qwen: Qwen3.6 Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.1875,output:1.125,cacheRead:0,cacheWrite:0.234375}}},{modelId:"qwen/qwen3.6-max-preview",name:"Qwen: Qwen3.6 Max Preview",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:1.04,output:6.24,cacheRead:0,cacheWrite:1.3}}},{modelId:"qwen/qwen3.6-plus",name:"Qwen: Qwen3.6 Plus",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.325,output:1.95,cacheRead:0,cacheWrite:0.40625}}},{modelId:"qwen/qwen3.7-max",name:"Qwen: Qwen3.7 Max",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:65536,cost:{input:1.25,output:3.75,cacheRead:0.25,cacheWrite:1.5625}}},{modelId:"qwen/qwen3.7-plus",name:"Qwen: Qwen3.7 Plus",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.32,output:1.28,cacheRead:0.064,cacheWrite:0.4}}},{modelId:"rekaai/reka-edge",name:"Reka Edge",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:16384,maxTokens:16384,cost:{input:0.1,output:0.1,cacheRead:0,cacheWrite:0}}},{modelId:"relace/relace-search",name:"Relace: Relace Search",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:128000,cost:{input:1,output:3,cacheRead:0,cacheWrite:0}}},{modelId:"sao10k/l3.1-euryale-70b",name:"Sao10K: Llama 3.1 Euryale 70B v2.2",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.85,output:0.85,cacheRead:0,cacheWrite:0}}},{modelId:"stepfun/step-3.5-flash",name:"StepFun: Step 3.5 Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:16384,cost:{input:0.09,output:0.3,cacheRead:0.02,cacheWrite:0}}},{modelId:"stepfun/step-3.7-flash",name:"StepFun: Step 3.7 Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0.2,output:1.15,cacheRead:0.04,cacheWrite:0}}},{modelId:"tencent/hy3-preview",name:"Tencent: Hy3 preview",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:4096,cost:{input:0.063,output:0.21,cacheRead:0.021,cacheWrite:0}}},{modelId:"thedrummer/rocinante-12b",name:"TheDrummer: Rocinante 12B",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32768,maxTokens:32768,cost:{input:0.17,output:0.43,cacheRead:0,cacheWrite:0}}},{modelId:"thedrummer/unslopnemo-12b",name:"TheDrummer: UnslopNemo 12B",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32768,maxTokens:32768,cost:{input:0.4,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"upstage/solar-pro-3",name:"Upstage: Solar Pro 3",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.15,output:0.6,cacheRead:0.015,cacheWrite:0}}},{modelId:"x-ai/grok-4.20",name:"xAI: Grok 4.20",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:2000000,maxTokens:4096,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"x-ai/grok-4.3",name:"xAI: Grok 4.3",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:4096,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"x-ai/grok-build-0.1",name:"xAI: Grok Build 0.1",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:4096,cost:{input:1,output:2,cacheRead:0.2,cacheWrite:0}}},{modelId:"xiaomi/mimo-v2-flash",name:"Xiaomi: MiMo-V2-Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:0.1,output:0.3,cacheRead:0.01,cacheWrite:0}}},{modelId:"xiaomi/mimo-v2.5",name:"Xiaomi: MiMo-V2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:131072,cost:{input:0.14,output:0.28,cacheRead:0.0028,cacheWrite:0}}},{modelId:"xiaomi/mimo-v2.5-pro",name:"Xiaomi: MiMo-V2.5-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:0.435,output:0.87,cacheRead:0.0036,cacheWrite:0}}},{modelId:"z-ai/glm-4.5",name:"Z.ai: GLM 4.5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:98304,cost:{input:0.6,output:2.2,cacheRead:0.11,cacheWrite:0}}},{modelId:"z-ai/glm-4.5-air",name:"Z.ai: GLM 4.5 Air",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131070,cost:{input:0.125,output:0.85,cacheRead:0.06,cacheWrite:0}}},{modelId:"z-ai/glm-4.5v",name:"Z.ai: GLM 4.5V",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:65536,maxTokens:16384,cost:{input:0.6,output:1.8,cacheRead:0.11,cacheWrite:0}}},{modelId:"z-ai/glm-4.6",name:"Z.ai: GLM 4.6",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:131072,cost:{input:0.43,output:1.74,cacheRead:0.08,cacheWrite:0}}},{modelId:"z-ai/glm-4.6v",name:"Z.ai: GLM 4.6V",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:32768,cost:{input:0.3,output:0.9,cacheRead:0.055,cacheWrite:0}}},{modelId:"z-ai/glm-4.7",name:"Z.ai: GLM 4.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:131072,cost:{input:0.4,output:1.75,cacheRead:0.08,cacheWrite:0}}},{modelId:"z-ai/glm-4.7-flash",name:"Z.ai: GLM 4.7 Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:16384,cost:{input:0.06,output:0.4,cacheRead:0.01,cacheWrite:0}}},{modelId:"z-ai/glm-5",name:"Z.ai: GLM 5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:4096,cost:{input:0.6,output:1.9,cacheRead:0.119,cacheWrite:0}}},{modelId:"z-ai/glm-5-turbo",name:"Z.ai: GLM 5 Turbo",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:131072,cost:{input:1.2,output:4,cacheRead:0.24,cacheWrite:0}}},{modelId:"z-ai/glm-5.1",name:"Z.ai: GLM 5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:4096,cost:{input:0.98,output:3.08,cacheRead:0.182,cacheWrite:0}}},{modelId:"~anthropic/claude-fable-latest",name:"Anthropic: Claude Fable Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"~anthropic/claude-haiku-latest",name:"Anthropic Claude Haiku Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"~anthropic/claude-opus-latest",name:"Anthropic: Claude Opus Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"~anthropic/claude-sonnet-latest",name:"Anthropic Claude Sonnet Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"~google/gemini-flash-latest",name:"Google Gemini Flash Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.5,output:9,cacheRead:0.15,cacheWrite:0.083333}}},{modelId:"~google/gemini-pro-latest",name:"Google Gemini Pro Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0.375}}},{modelId:"~moonshotai/kimi-latest",name:"MoonshotAI Kimi Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262142,cost:{input:0.68,output:3.41,cacheRead:0.34,cacheWrite:0}}},{modelId:"~openai/gpt-latest",name:"OpenAI GPT Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"~openai/gpt-mini-latest",name:"OpenAI GPT Mini Latest",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}}]},mistral:{name:"mistral",config:{api:"mistral-conversations",baseUrl:"https://api.mistral.ai",apiKey:"MISTRAL_API_KEY"},models:[{modelId:"codestral-latest",name:"Codestral (latest)",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:4096,cost:{input:0.3,output:0.9,cacheRead:0,cacheWrite:0}}},{modelId:"devstral-2512",name:"Devstral 2",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"devstral-latest",name:"Devstral 2",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"devstral-medium-2507",name:"Devstral Medium",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"devstral-medium-latest",name:"Devstral 2 (latest)",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"devstral-small-2505",name:"Devstral Small 2505",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"devstral-small-2507",name:"Devstral Small",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"labs-devstral-small-2512",name:"Devstral Small 2",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"magistral-medium-latest",name:"Magistral Medium (latest)",config:{api:"mistral-conversations",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:2,output:5,cacheRead:0,cacheWrite:0}}},{modelId:"magistral-small",name:"Magistral Small",config:{api:"mistral-conversations",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"ministral-3b-latest",name:"Ministral 3B (latest)",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.04,output:0.04,cacheRead:0,cacheWrite:0}}},{modelId:"ministral-8b-latest",name:"Ministral 8B (latest)",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.1,output:0.1,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-large-2411",name:"Mistral Large 2.1",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:2,output:6,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-large-2512",name:"Mistral Large 3",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-large-latest",name:"Mistral Large (latest)",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-medium-2505",name:"Mistral Medium 3",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:131072,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-medium-2508",name:"Mistral Medium 3.1",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-medium-2604",name:"Mistral Medium 3.5",config:{api:"mistral-conversations",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:1.5,output:7.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-medium-3.5",name:"Mistral Medium 3.5",config:{api:"mistral-conversations",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:1.5,output:7.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-medium-latest",name:"Mistral Medium (latest)",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-nemo",name:"Mistral Nemo",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-small-2506",name:"Mistral Small 3.2",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-small-2603",name:"Mistral Small 4",config:{api:"mistral-conversations",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"mistral-small-latest",name:"Mistral Small (latest)",config:{api:"mistral-conversations",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"open-mistral-7b",name:"Mistral 7B",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:8000,maxTokens:8000,cost:{input:0.25,output:0.25,cacheRead:0,cacheWrite:0}}},{modelId:"open-mistral-nemo",name:"Open Mistral Nemo",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"open-mixtral-8x22b",name:"Mixtral 8x22B",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:64000,maxTokens:64000,cost:{input:2,output:6,cacheRead:0,cacheWrite:0}}},{modelId:"open-mixtral-8x7b",name:"Mixtral 8x7B",config:{api:"mistral-conversations",reasoning:!1,input:["text"],contextWindow:32000,maxTokens:32000,cost:{input:0.7,output:0.7,cacheRead:0,cacheWrite:0}}},{modelId:"pixtral-12b",name:"Pixtral 12B",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:128000,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"pixtral-large-latest",name:"Pixtral Large (latest)",config:{api:"mistral-conversations",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:128000,cost:{input:2,output:6,cacheRead:0,cacheWrite:0}}}]},"amazon-bedrock":{name:"amazon-bedrock",config:{api:"bedrock-converse-stream",baseUrl:"https://bedrock-runtime.us-east-1.amazonaws.com",apiKey:""},models:[{modelId:"amazon.nova-2-lite-v1:0",name:"Nova 2 Lite",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:0.33,output:2.75,cacheRead:0,cacheWrite:0}}},{modelId:"amazon.nova-lite-v1:0",name:"Nova Lite",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:300000,maxTokens:8192,cost:{input:0.06,output:0.24,cacheRead:0.015,cacheWrite:0}}},{modelId:"amazon.nova-micro-v1:0",name:"Nova Micro",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:8192,cost:{input:0.035,output:0.14,cacheRead:0.00875,cacheWrite:0}}},{modelId:"amazon.nova-pro-v1:0",name:"Nova Pro",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:300000,maxTokens:8192,cost:{input:0.8,output:3.2,cacheRead:0.2,cacheWrite:0}}},{modelId:"anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"anthropic.claude-opus-4-1-20250805-v1:0",name:"Claude Opus 4.1",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"anthropic.claude-opus-4-5-20251101-v1:0",name:"Claude Opus 4.5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic.claude-opus-4-6-v1",name:"Claude Opus 4.6",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic.claude-opus-4-7",name:"Claude Opus 4.7",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic.claude-opus-4-8",name:"Claude Opus 4.8",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"au.anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5 (AU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"au.anthropic.claude-opus-4-6-v1",name:"AU Anthropic Claude Opus 4.6",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:16.5,output:82.5,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"au.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (AU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"au.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (AU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"au.anthropic.claude-sonnet-4-6",name:"AU Anthropic Claude Sonnet 4.6",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:3.3,output:16.5,cacheRead:0.33,cacheWrite:4.125}}},{modelId:"deepseek.r1-v1:0",name:"DeepSeek-R1",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:32768,cost:{input:1.35,output:5.4,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek.v3-v1:0",name:"DeepSeek-V3.1",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:81920,cost:{input:0.58,output:1.68,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek.v3.2",name:"DeepSeek-V3.2",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:81920,cost:{input:0.62,output:1.85,cacheRead:0,cacheWrite:0}}},{modelId:"eu.anthropic.claude-fable-5",name:"Claude Fable 5 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:11,output:55,cacheRead:1.1,cacheWrite:13.75}}},{modelId:"eu.anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"eu.anthropic.claude-opus-4-5-20251101-v1:0",name:"Claude Opus 4.5 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"eu.anthropic.claude-opus-4-6-v1",name:"Claude Opus 4.6 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5.5,output:27.5,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"eu.anthropic.claude-opus-4-7",name:"Claude Opus 4.7 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5.5,output:27.5,cacheRead:0.55,cacheWrite:6.875}}},{modelId:"eu.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5.5,output:27.5,cacheRead:0.55,cacheWrite:6.875}}},{modelId:"eu.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3.3,output:16.5,cacheRead:0.33,cacheWrite:4.125}}},{modelId:"eu.anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6 (EU)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3.3,output:16.5,cacheRead:0.33,cacheWrite:4.125}}},{modelId:"global.anthropic.claude-fable-5",name:"Claude Fable 5 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"global.anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"global.anthropic.claude-opus-4-5-20251101-v1:0",name:"Claude Opus 4.5 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"global.anthropic.claude-opus-4-6-v1",name:"Claude Opus 4.6 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"global.anthropic.claude-opus-4-7",name:"Claude Opus 4.7 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"global.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"global.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"global.anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6 (Global)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"google.gemma-3-27b-it",name:"Google Gemma 3 27B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:202752,maxTokens:8192,cost:{input:0.12,output:0.2,cacheRead:0,cacheWrite:0}}},{modelId:"google.gemma-3-4b-it",name:"Gemma 3 4B IT",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:0.04,output:0.08,cacheRead:0,cacheWrite:0}}},{modelId:"jp.anthropic.claude-opus-4-7",name:"Claude Opus 4.7 (JP)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"jp.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (JP)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"jp.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (JP)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"jp.anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6 (JP)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"meta.llama3-1-70b-instruct-v1:0",name:"Llama 3.1 70B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.72,output:0.72,cacheRead:0,cacheWrite:0}}},{modelId:"meta.llama3-1-8b-instruct-v1:0",name:"Llama 3.1 8B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.22,output:0.22,cacheRead:0,cacheWrite:0}}},{modelId:"meta.llama3-3-70b-instruct-v1:0",name:"Llama 3.3 70B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.72,output:0.72,cacheRead:0,cacheWrite:0}}},{modelId:"meta.llama4-maverick-17b-instruct-v1:0",name:"Llama 4 Maverick 17B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:16384,cost:{input:0.24,output:0.97,cacheRead:0,cacheWrite:0}}},{modelId:"meta.llama4-scout-17b-instruct-v1:0",name:"Llama 4 Scout 17B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:3500000,maxTokens:16384,cost:{input:0.17,output:0.66,cacheRead:0,cacheWrite:0}}},{modelId:"minimax.minimax-m2",name:"MiniMax M2",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:204608,maxTokens:128000,cost:{input:0.3,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"minimax.minimax-m2.1",name:"MiniMax M2.1",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"minimax.minimax-m2.5",name:"MiniMax M2.5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:196608,maxTokens:98304,cost:{input:0.3,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.devstral-2-123b",name:"Devstral 2 123B",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:8192,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.magistral-small-2509",name:"Magistral Small 1.2",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:40000,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.ministral-3-14b-instruct",name:"Ministral 14B 3.0",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.2,output:0.2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.ministral-3-3b-instruct",name:"Ministral 3 3B",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:256000,maxTokens:8192,cost:{input:0.1,output:0.1,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.ministral-3-8b-instruct",name:"Ministral 3 8B",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.mistral-large-3-675b-instruct",name:"Mistral Large 3",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:256000,maxTokens:8192,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.pixtral-large-2502-v1:0",name:"Pixtral Large (25.02)",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:8192,cost:{input:2,output:6,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.voxtral-mini-3b-2507",name:"Voxtral Mini 3B 2507",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.04,output:0.04,cacheRead:0,cacheWrite:0}}},{modelId:"mistral.voxtral-small-24b-2507",name:"Voxtral Small 24B 2507",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:32000,maxTokens:8192,cost:{input:0.15,output:0.35,cacheRead:0,cacheWrite:0}}},{modelId:"moonshot.kimi-k2-thinking",name:"Kimi K2 Thinking",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:262143,maxTokens:16000,cost:{input:0.6,output:2.5,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai.kimi-k2.5",name:"Kimi K2.5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:262143,maxTokens:16000,cost:{input:0.6,output:3,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia.nemotron-nano-12b-v2",name:"NVIDIA Nemotron Nano 12B v2 VL BF16",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:0.2,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia.nemotron-nano-3-30b",name:"NVIDIA Nemotron Nano 3 30B",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.06,output:0.24,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia.nemotron-nano-9b-v2",name:"NVIDIA Nemotron Nano 9B v2",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0.06,output:0.23,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia.nemotron-super-3-120b",name:"NVIDIA Nemotron 3 Super 120B A12B",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:131072,cost:{input:0.15,output:0.65,cacheRead:0,cacheWrite:0}}},{modelId:"openai.gpt-5.4",name:"GPT-5.4",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:2.75,output:16.5,cacheRead:0.275,cacheWrite:0}}},{modelId:"openai.gpt-5.5",name:"GPT-5.5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:5.5,output:33,cacheRead:0.55,cacheWrite:0}}},{modelId:"openai.gpt-oss-120b",name:"gpt-oss-120b",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"openai.gpt-oss-120b-1:0",name:"gpt-oss-120b",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"openai.gpt-oss-20b",name:"gpt-oss-20b",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.07,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"openai.gpt-oss-20b-1:0",name:"gpt-oss-20b",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.07,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"openai.gpt-oss-safeguard-120b",name:"GPT OSS Safeguard 120B",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"openai.gpt-oss-safeguard-20b",name:"GPT OSS Safeguard 20B",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.07,output:0.2,cacheRead:0,cacheWrite:0}}},{modelId:"qwen.qwen3-235b-a22b-2507-v1:0",name:"Qwen3 235B A22B 2507",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:131072,cost:{input:0.22,output:0.88,cacheRead:0,cacheWrite:0}}},{modelId:"qwen.qwen3-32b-v1:0",name:"Qwen3 32B (dense)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:16384,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"qwen.qwen3-coder-30b-a3b-v1:0",name:"Qwen3 Coder 30B A3B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:131072,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"qwen.qwen3-coder-480b-a35b-v1:0",name:"Qwen3 Coder 480B A35B Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.22,output:1.8,cacheRead:0,cacheWrite:0}}},{modelId:"qwen.qwen3-coder-next",name:"Qwen3 Coder Next",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.22,output:1.8,cacheRead:0,cacheWrite:0}}},{modelId:"qwen.qwen3-next-80b-a3b",name:"Qwen/Qwen3-Next-80B-A3B-Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text"],contextWindow:262000,maxTokens:262000,cost:{input:0.14,output:1.4,cacheRead:0,cacheWrite:0}}},{modelId:"qwen.qwen3-vl-235b-a22b",name:"Qwen/Qwen3-VL-235B-A22B-Instruct",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:262000,maxTokens:262000,cost:{input:0.3,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"us.anthropic.claude-fable-5",name:"Claude Fable 5 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"us.anthropic.claude-haiku-4-5-20251001-v1:0",name:"Claude Haiku 4.5 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"us.anthropic.claude-opus-4-1-20250805-v1:0",name:"Claude Opus 4.1 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"us.anthropic.claude-opus-4-5-20251101-v1:0",name:"Claude Opus 4.5 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"us.anthropic.claude-opus-4-6-v1",name:"Claude Opus 4.6 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"us.anthropic.claude-opus-4-7",name:"Claude Opus 4.7 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"us.anthropic.claude-opus-4-8",name:"Claude Opus 4.8 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",name:"Claude Sonnet 4.5 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"us.anthropic.claude-sonnet-4-6",name:"Claude Sonnet 4.6 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"us.deepseek.r1-v1:0",name:"DeepSeek-R1 (US)",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:32768,cost:{input:1.35,output:5.4,cacheRead:0,cacheWrite:0}}},{modelId:"us.meta.llama4-maverick-17b-instruct-v1:0",name:"Llama 4 Maverick 17B Instruct (US)",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:16384,cost:{input:0.24,output:0.97,cacheRead:0,cacheWrite:0}}},{modelId:"us.meta.llama4-scout-17b-instruct-v1:0",name:"Llama 4 Scout 17B Instruct (US)",config:{api:"bedrock-converse-stream",reasoning:!1,input:["text","image"],contextWindow:3500000,maxTokens:16384,cost:{input:0.17,output:0.66,cacheRead:0,cacheWrite:0}}},{modelId:"writer.palmyra-x4-v1:0",name:"Palmyra X4",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:122880,maxTokens:8192,cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0}}},{modelId:"writer.palmyra-x5-v1:0",name:"Palmyra X5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:1040000,maxTokens:8192,cost:{input:0.6,output:6,cacheRead:0,cacheWrite:0}}},{modelId:"zai.glm-4.7",name:"GLM-4.7",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.6,output:2.2,cacheRead:0,cacheWrite:0}}},{modelId:"zai.glm-4.7-flash",name:"GLM-4.7-Flash",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:131072,cost:{input:0.07,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"zai.glm-5",name:"GLM-5",config:{api:"bedrock-converse-stream",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:101376,cost:{input:1,output:3.2,cacheRead:0,cacheWrite:0}}}]},"ant-ling":{name:"ant-ling",config:{api:"openai-completions",baseUrl:"https://api.ant-ling.com/v1",apiKey:""},models:[{modelId:"Ling-2.6-1T",name:"Ling 2.6 1T",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:0.06,output:0.25,cacheRead:0,cacheWrite:0}}},{modelId:"Ling-2.6-flash",name:"Ling 2.6 Flash",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:0.01,output:0.02,cacheRead:0,cacheWrite:0}}},{modelId:"Ring-2.6-1T",name:"Ring 2.6 1T",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:0.06,output:0.25,cacheRead:0,cacheWrite:0}}}]},"azure-openai-responses":{name:"azure-openai-responses",config:{api:"azure-openai-responses",baseUrl:"",apiKey:"AZURE_OPENAI_API_KEY"},models:[{modelId:"gpt-4",name:"GPT-4",config:{api:"azure-openai-responses",reasoning:!1,input:["text"],contextWindow:8192,maxTokens:8192,cost:{input:30,output:60,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4-turbo",name:"GPT-4 Turbo",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:10,output:30,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4.1",name:"GPT-4.1",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"gpt-4.1-mini",name:"GPT-4.1 mini",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.4,output:1.6,cacheRead:0.1,cacheWrite:0}}},{modelId:"gpt-4.1-nano",name:"GPT-4.1 nano",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.1,output:0.4,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-4o",name:"GPT-4o",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"gpt-4o-2024-05-13",name:"GPT-4o (2024-05-13)",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:5,output:15,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4o-2024-08-06",name:"GPT-4o (2024-08-06)",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"gpt-4o-2024-11-20",name:"GPT-4o (2024-11-20)",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"gpt-4o-mini",name:"GPT-4o mini",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0.075,cacheWrite:0}}},{modelId:"gpt-5",name:"GPT-5",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5-chat-latest",name:"GPT-5 Chat Latest",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5-codex",name:"GPT-5-Codex",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5-mini",name:"GPT-5 Mini",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-5-nano",name:"GPT-5 Nano",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.05,output:0.4,cacheRead:0.005,cacheWrite:0}}},{modelId:"gpt-5-pro",name:"GPT-5 Pro",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:15,output:120,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-5.1",name:"GPT-5.1",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-chat-latest",name:"GPT-5.1 Chat",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-codex",name:"GPT-5.1 Codex",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-codex-max",name:"GPT-5.1 Codex Max",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-codex-mini",name:"GPT-5.1 Codex mini",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-5.2",name:"GPT-5.2",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-chat-latest",name:"GPT-5.2 Chat",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-codex",name:"GPT-5.2 Codex",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-pro",name:"GPT-5.2 Pro",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:21,output:168,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-5.3-chat-latest",name:"GPT-5.3 Chat (latest)",config:{api:"azure-openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.3-codex",name:"GPT-5.3 Codex",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:32000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.4",name:"GPT-5.4",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"gpt-5.4-mini",name:"GPT-5.4 mini",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"gpt-5.4-nano",name:"GPT-5.4 nano",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.2,output:1.25,cacheRead:0.02,cacheWrite:0}}},{modelId:"gpt-5.4-pro",name:"GPT-5.4 Pro",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-5.5",name:"GPT-5.5",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"gpt-5.5-pro",name:"GPT-5.5 Pro",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"o1",name:"o1",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:15,output:60,cacheRead:7.5,cacheWrite:0}}},{modelId:"o1-pro",name:"o1-pro",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:150,output:600,cacheRead:0,cacheWrite:0}}},{modelId:"o3",name:"o3",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"o3-deep-research",name:"o3-deep-research",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:10,output:40,cacheRead:2.5,cacheWrite:0}}},{modelId:"o3-mini",name:"o3-mini",config:{api:"azure-openai-responses",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.55,cacheWrite:0}}},{modelId:"o3-pro",name:"o3-pro",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:20,output:80,cacheRead:0,cacheWrite:0}}},{modelId:"o4-mini",name:"o4-mini",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.275,cacheWrite:0}}},{modelId:"o4-mini-deep-research",name:"o4-mini-deep-research",config:{api:"azure-openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}}]},cerebras:{name:"cerebras",config:{api:"openai-completions",baseUrl:"https://api.cerebras.ai/v1",apiKey:"CEREBRAS_API_KEY"},models:[{modelId:"gpt-oss-120b",name:"GPT OSS 120B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:40960,cost:{input:0.35,output:0.75,cacheRead:0,cacheWrite:0}}},{modelId:"zai-glm-4.7",name:"Z.AI GLM-4.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:40960,cost:{input:2.25,output:2.75,cacheRead:0,cacheWrite:0}}}]},"cloudflare-ai-gateway":{name:"cloudflare-ai-gateway",config:{api:"anthropic-messages",baseUrl:"https://gateway.ai.cloudflare.com/v1/{CLOUDFLARE_ACCOUNT_ID}/{CLOUDFLARE_GATEWAY_ID}/anthropic",apiKey:"CLOUDFLARE_API_KEY"},models:[{modelId:"claude-3-5-haiku",name:"Claude Haiku 3.5 (latest)",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:0.8,output:4,cacheRead:0.08,cacheWrite:1}}},{modelId:"claude-3-haiku",name:"Claude Haiku 3",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:0.25,output:1.25,cacheRead:0.03,cacheWrite:0.3}}},{modelId:"claude-3-opus",name:"Claude Opus 3",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-3-sonnet",name:"Claude Sonnet 3",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:0.3}}},{modelId:"claude-3.5-haiku",name:"Claude Haiku 3.5 (latest)",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:0.8,output:4,cacheRead:0.08,cacheWrite:1}}},{modelId:"claude-3.5-sonnet",name:"Claude Sonnet 3.5 v2",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-fable-5",name:"Claude Fable 5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"claude-haiku-4-5",name:"Claude Haiku 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"claude-opus-4",name:"Claude Opus 4 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-opus-4-1",name:"Claude Opus 4.1 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-opus-4-5",name:"Claude Opus 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-6",name:"Claude Opus 4.6 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-7",name:"Claude Opus 4.7",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-8",name:"Claude Opus 4.8",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-sonnet-4",name:"Claude Sonnet 4 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-5",name:"Claude Sonnet 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"gpt-4",name:"GPT-4",config:{api:"openai-responses",reasoning:!1,input:["text"],contextWindow:8192,maxTokens:8192,cost:{input:30,output:60,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4-turbo",name:"GPT-4 Turbo",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:10,output:30,cacheRead:0,cacheWrite:0}}},{modelId:"gpt-4o",name:"GPT-4o",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"gpt-4o-mini",name:"GPT-4o mini",config:{api:"openai-responses",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0.08,cacheWrite:0}}},{modelId:"gpt-5.1",name:"GPT-5.1",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.13,cacheWrite:0}}},{modelId:"gpt-5.1-codex",name:"GPT-5.1 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.2",name:"GPT-5.2",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-codex",name:"GPT-5.2 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.3-codex",name:"GPT-5.3 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.4",name:"GPT-5.4",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"gpt-5.5",name:"GPT-5.5",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"o1",name:"o1",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:15,output:60,cacheRead:7.5,cacheWrite:0}}},{modelId:"o3",name:"o3",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"o3-mini",name:"o3-mini",config:{api:"openai-responses",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.55,cacheWrite:0}}},{modelId:"o3-pro",name:"o3-pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:20,output:80,cacheRead:0,cacheWrite:0}}},{modelId:"o4-mini",name:"o4-mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.28,cacheWrite:0}}},{modelId:"workers-ai/@cf/moonshotai/kimi-k2.5",name:"Kimi K2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0.6,output:3,cacheRead:0.1,cacheWrite:0}}},{modelId:"workers-ai/@cf/moonshotai/kimi-k2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"workers-ai/@cf/nvidia/nemotron-3-120b-a12b",name:"Nemotron 3 Super 120B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:256000,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"workers-ai/@cf/zai-org/glm-4.7-flash",name:"GLM-4.7-Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.06,output:0.4,cacheRead:0,cacheWrite:0}}}]},"cloudflare-workers-ai":{name:"cloudflare-workers-ai",config:{api:"openai-completions",baseUrl:"https://api.cloudflare.com/client/v4/accounts/{CLOUDFLARE_ACCOUNT_ID}/ai/v1",apiKey:"CLOUDFLARE_API_KEY"},models:[{modelId:"@cf/google/gemma-4-26b-a4b-it",name:"Gemma 4 26B A4B IT",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:16384,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/ibm-granite/granite-4.0-h-micro",name:"Granite 4.0 H Micro",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131000,maxTokens:131000,cost:{input:0.017,output:0.112,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/meta/llama-3.3-70b-instruct-fp8-fast",name:"Llama 3.3 70B Instruct fp8 Fast",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:24000,maxTokens:24000,cost:{input:0.293,output:2.253,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/meta/llama-4-scout-17b-16e-instruct",name:"Llama 4 Scout 17B 16E Instruct",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:131000,maxTokens:16384,cost:{input:0.27,output:0.85,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/mistralai/mistral-small-3.1-24b-instruct",name:"Mistral Small 3.1 24B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.351,output:0.555,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/moonshotai/kimi-k2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:256000,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"@cf/moonshotai/kimi-k2.7-code",name:"Kimi K2.7 Code",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.95,output:4,cacheRead:0.19,cacheWrite:0}}},{modelId:"@cf/nvidia/nemotron-3-120b-a12b",name:"Nemotron 3 Super 120B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:256000,cost:{input:0.5,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/openai/gpt-oss-120b",name:"GPT OSS 120B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.35,output:0.75,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/openai/gpt-oss-20b",name:"GPT OSS 20B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:16384,cost:{input:0.2,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/qwen/qwen3-30b-a3b-fp8",name:"Qwen3 30B A3b fp8",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:32768,maxTokens:32768,cost:{input:0.0509,output:0.335,cacheRead:0,cacheWrite:0}}},{modelId:"@cf/zai-org/glm-4.7-flash",name:"GLM-4.7-Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.0605,output:0.4,cacheRead:0,cacheWrite:0}}}]},fireworks:{name:"fireworks",config:{api:"anthropic-messages",baseUrl:"https://api.fireworks.ai/inference",apiKey:"FIREWORKS_API_KEY"},models:[{modelId:"accounts/fireworks/models/deepseek-v4-flash",name:"DeepSeek V4 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:0.14,output:0.28,cacheRead:0.03,cacheWrite:0}}},{modelId:"accounts/fireworks/models/deepseek-v4-pro",name:"DeepSeek V4 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:1.74,output:3.48,cacheRead:0.145,cacheWrite:0}}},{modelId:"accounts/fireworks/models/glm-5p1",name:"GLM 5.1",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:202800,maxTokens:131072,cost:{input:1.4,output:4.4,cacheRead:0.26,cacheWrite:0}}},{modelId:"accounts/fireworks/models/gpt-oss-120b",name:"GPT OSS 120B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:32768,cost:{input:0.15,output:0.6,cacheRead:0.015,cacheWrite:0}}},{modelId:"accounts/fireworks/models/gpt-oss-20b",name:"GPT OSS 20B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:32768,cost:{input:0.07,output:0.3,cacheRead:0.035,cacheWrite:0}}},{modelId:"accounts/fireworks/models/kimi-k2p6",name:"Kimi K2.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262000,maxTokens:262000,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"accounts/fireworks/models/kimi-k2p7-code",name:"Kimi K2.7 Code",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262000,maxTokens:262000,cost:{input:0.95,output:4,cacheRead:0.19,cacheWrite:0}}},{modelId:"accounts/fireworks/models/minimax-m2p7",name:"MiniMax-M2.7",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:196608,maxTokens:196608,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"accounts/fireworks/models/minimax-m3",name:"MiniMax-M3",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:512000,maxTokens:512000,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"accounts/fireworks/models/qwen3p7-plus",name:"Qwen 3.7 Plus",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.4,output:1.6,cacheRead:0.08,cacheWrite:0}}},{modelId:"accounts/fireworks/routers/glm-5p1-fast",name:"GLM 5.1 Fast",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:202800,maxTokens:131072,cost:{input:2.8,output:8.8,cacheRead:0.52,cacheWrite:0}}},{modelId:"accounts/fireworks/routers/kimi-k2p6-fast",name:"Kimi K2.6 Fast",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262000,maxTokens:262000,cost:{input:2,output:8,cacheRead:0.3,cacheWrite:0}}},{modelId:"accounts/fireworks/routers/kimi-k2p6-turbo",name:"Kimi K2.6 Turbo",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262000,maxTokens:262000,cost:{input:2,output:8,cacheRead:0.3,cacheWrite:0}}},{modelId:"accounts/fireworks/routers/kimi-k2p7-code-fast",name:"Kimi K2.7 Code Fast",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262000,maxTokens:262000,cost:{input:2,output:8,cacheRead:0.38,cacheWrite:0}}}]},"github-copilot":{name:"github-copilot",config:{api:"openai-completions",baseUrl:"https://api.individual.githubcopilot.com",apiKey:"COPILOT_GITHUB_TOKEN"},models:[{modelId:"claude-fable-5",name:"Claude Fable 5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:10,output:50,cacheRead:1,cacheWrite:12.5}}},{modelId:"claude-haiku-4.5",name:"Claude Haiku 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"claude-opus-4.5",name:"Claude Opus 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4.6",name:"Claude Opus 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:32000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4.7",name:"Claude Opus 4.7",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4.8",name:"Claude Opus 4.8",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-sonnet-4",name:"Claude Sonnet 4 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:216000,maxTokens:16000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4.5",name:"Claude Sonnet 4.5 (latest)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4.6",name:"Claude Sonnet 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:32000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"gemini-2.5-pro",name:"Gemini 2.5 Pro",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:64000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:64000,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0}}},{modelId:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"gemini-3.5-flash",name:"Gemini 3.5 Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1.5,output:9,cacheRead:0.15,cacheWrite:0}}},{modelId:"gpt-4.1",name:"GPT-4.1",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"gpt-5-mini",name:"GPT-5 Mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:264000,maxTokens:64000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-5.2",name:"GPT-5.2",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-codex",name:"GPT-5.2 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.3-codex",name:"GPT-5.3 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.4",name:"GPT-5.4",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"gpt-5.4-mini",name:"GPT-5.4 mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"gpt-5.4-nano",name:"GPT-5.4 nano",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.2,output:1.25,cacheRead:0.02,cacheWrite:0}}},{modelId:"gpt-5.5",name:"GPT-5.5",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"raptor-mini",name:"Raptor mini",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}}]},"google-vertex":{name:"google-vertex",config:{api:"google-vertex",baseUrl:"https://{location}-aiplatform.googleapis.com",apiKey:"GOOGLE_CLOUD_API_KEY"},models:[{modelId:"gemini-1.5-flash",name:"Gemini 1.5 Flash (Vertex)",config:{api:"google-vertex",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:8192,cost:{input:0.075,output:0.3,cacheRead:0.01875,cacheWrite:0}}},{modelId:"gemini-1.5-flash-8b",name:"Gemini 1.5 Flash-8B (Vertex)",config:{api:"google-vertex",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:8192,cost:{input:0.0375,output:0.15,cacheRead:0.01,cacheWrite:0}}},{modelId:"gemini-1.5-pro",name:"Gemini 1.5 Pro (Vertex)",config:{api:"google-vertex",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:8192,cost:{input:1.25,output:5,cacheRead:0.3125,cacheWrite:0}}},{modelId:"gemini-2.0-flash",name:"Gemini 2.0 Flash (Vertex)",config:{api:"google-vertex",reasoning:!1,input:["text","image"],contextWindow:1048576,maxTokens:8192,cost:{input:0.15,output:0.6,cacheRead:0.0375,cacheWrite:0}}},{modelId:"gemini-2.0-flash-lite",name:"Gemini 2.0 Flash Lite (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.075,output:0.3,cacheRead:0.01875,cacheWrite:0}}},{modelId:"gemini-2.5-flash",name:"Gemini 2.5 Flash (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.3,output:2.5,cacheRead:0.03,cacheWrite:0}}},{modelId:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.1,output:0.4,cacheRead:0.01,cacheWrite:0}}},{modelId:"gemini-2.5-flash-lite-preview-09-2025",name:"Gemini 2.5 Flash Lite Preview 09-25 (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.1,output:0.4,cacheRead:0.01,cacheWrite:0}}},{modelId:"gemini-2.5-pro",name:"Gemini 2.5 Pro (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gemini-3-flash-preview",name:"Gemini 3 Flash Preview (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0}}},{modelId:"gemini-3-pro-preview",name:"Gemini 3 Pro Preview (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"gemini-3.1-pro-preview-customtools",name:"Gemini 3.1 Pro Preview Custom Tools (Vertex)",config:{api:"google-vertex",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}}]},huggingface:{name:"huggingface",config:{api:"openai-completions",baseUrl:"https://router.huggingface.co/v1",apiKey:"HF_TOKEN"},models:[{modelId:"MiniMaxAI/MiniMax-M2.1",name:"MiniMax-M2.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"MiniMaxAI/MiniMax-M2.5",name:"MiniMax-M2.5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.03,cacheWrite:0}}},{modelId:"MiniMaxAI/MiniMax-M2.7",name:"MiniMax-M2.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"Qwen/Qwen3-235B-A22B-Thinking-2507",name:"Qwen3-235B-A22B-Thinking-2507",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:131072,cost:{input:0.3,output:3,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3-Coder-480B-A35B-Instruct",name:"Qwen3-Coder-480B-A35B-Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:66536,cost:{input:2,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3-Coder-Next",name:"Qwen3-Coder-Next",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:0.2,output:1.5,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3-Next-80B-A3B-Instruct",name:"Qwen3-Next-80B-A3B-Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:66536,cost:{input:0.25,output:1,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3-Next-80B-A3B-Thinking",name:"Qwen3-Next-80B-A3B-Thinking",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:131072,cost:{input:0.3,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3.5-397B-A17B",name:"Qwen3.5-397B-A17B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0.6,output:3.6,cacheRead:0,cacheWrite:0}}},{modelId:"XiaomiMiMo/MiMo-V2-Flash",name:"MiMo-V2-Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:4096,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek-ai/DeepSeek-R1-0528",name:"DeepSeek-R1-0528",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:163840,cost:{input:3,output:5,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek-ai/DeepSeek-V3.2",name:"DeepSeek-V3.2",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:65536,cost:{input:0.28,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek-ai/DeepSeek-V4-Pro",name:"DeepSeek V4 Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:393216,cost:{input:0.435,output:0.87,cacheRead:0.003625,cacheWrite:0}}},{modelId:"moonshotai/Kimi-K2-Instruct",name:"Kimi-K2-Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:1,output:3,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/Kimi-K2-Instruct-0905",name:"Kimi-K2-Instruct-0905",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:16384,cost:{input:1,output:3,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/Kimi-K2-Thinking",name:"Kimi-K2-Thinking",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"moonshotai/Kimi-K2.5",name:"Kimi-K2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:3,cacheRead:0.1,cacheWrite:0}}},{modelId:"moonshotai/Kimi-K2.6",name:"Kimi-K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"zai-org/GLM-4.7",name:"GLM-4.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.6,output:2.2,cacheRead:0.11,cacheWrite:0}}},{modelId:"zai-org/GLM-4.7-Flash",name:"GLM-4.7-Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:128000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"zai-org/GLM-5",name:"GLM-5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:131072,cost:{input:1,output:3.2,cacheRead:0.2,cacheWrite:0}}},{modelId:"zai-org/GLM-5.1",name:"GLM-5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:131072,cost:{input:1,output:3.2,cacheRead:0.2,cacheWrite:0}}}]},"kimi-coding":{name:"kimi-coding",config:{api:"anthropic-messages",baseUrl:"https://api.kimi.com/coding",apiKey:"KIMI_API_KEY"},models:[{modelId:"k2p7",name:"Kimi K2.7 Code",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"kimi-for-coding",name:"Kimi For Coding",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"kimi-k2-thinking",name:"Kimi K2 Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}}]},minimax:{name:"minimax",config:{api:"anthropic-messages",baseUrl:"https://api.minimax.io/anthropic",apiKey:"MINIMAX_API_KEY"},models:[{modelId:"MiniMax-M2.7",name:"MiniMax-M2.7",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0.375}}},{modelId:"MiniMax-M2.7-highspeed",name:"MiniMax-M2.7-highspeed",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.6,output:2.4,cacheRead:0.06,cacheWrite:0.375}}},{modelId:"MiniMax-M3",name:"MiniMax-M3",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:512000,maxTokens:128000,cost:{input:0.6,output:2.4,cacheRead:0.12,cacheWrite:0}}}]},"minimax-cn":{name:"minimax-cn",config:{api:"anthropic-messages",baseUrl:"https://api.minimaxi.com/anthropic",apiKey:"MINIMAX_CN_API_KEY"},models:[{modelId:"MiniMax-M2.7",name:"MiniMax-M2.7",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0.375}}},{modelId:"MiniMax-M2.7-highspeed",name:"MiniMax-M2.7-highspeed",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.6,output:2.4,cacheRead:0.06,cacheWrite:0.375}}},{modelId:"MiniMax-M3",name:"MiniMax-M3",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:512000,maxTokens:128000,cost:{input:0.6,output:2.4,cacheRead:0.12,cacheWrite:0}}}]},moonshotai:{name:"moonshotai",config:{api:"openai-completions",baseUrl:"https://api.moonshot.ai/v1",apiKey:"MOONSHOT_API_KEY"},models:[{modelId:"kimi-k2-0711-preview",name:"Kimi K2 0711",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-0905-preview",name:"Kimi K2 0905",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-thinking",name:"Kimi K2 Thinking",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-thinking-turbo",name:"Kimi K2 Thinking Turbo",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:1.15,output:8,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-turbo-preview",name:"Kimi K2 Turbo",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:2.4,output:10,cacheRead:0.6,cacheWrite:0}}},{modelId:"kimi-k2.5",name:"Kimi K2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:3,cacheRead:0.1,cacheWrite:0}}},{modelId:"kimi-k2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"kimi-k2.7-code",name:"Kimi K2.7 Code",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.95,output:4,cacheRead:0.19,cacheWrite:0}}}]},"moonshotai-cn":{name:"moonshotai-cn",config:{api:"openai-completions",baseUrl:"https://api.moonshot.cn/v1",apiKey:"MOONSHOT_API_KEY"},models:[{modelId:"kimi-k2-0711-preview",name:"Kimi K2 0711",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:16384,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-0905-preview",name:"Kimi K2 0905",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-thinking",name:"Kimi K2 Thinking",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-thinking-turbo",name:"Kimi K2 Thinking Turbo",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:1.15,output:8,cacheRead:0.15,cacheWrite:0}}},{modelId:"kimi-k2-turbo-preview",name:"Kimi K2 Turbo",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:2.4,output:10,cacheRead:0.6,cacheWrite:0}}},{modelId:"kimi-k2.5",name:"Kimi K2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.6,output:3,cacheRead:0.1,cacheWrite:0}}},{modelId:"kimi-k2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}}]},nvidia:{name:"nvidia",config:{api:"openai-completions",baseUrl:"https://integrate.api.nvidia.com/v1",apiKey:""},models:[{modelId:"meta/llama-3.1-70b-instruct",name:"Llama 3.1 70b Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.1-8b-instruct",name:"Llama 3.1 8B Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:16000,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.2-11b-vision-instruct",name:"Llama 3.2 11b Vision Instruct",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.2-90b-vision-instruct",name:"Llama-3.2-90B-Vision-Instruct",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:8192,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.3-70b-instruct",name:"Llama 3.3 70b Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4096,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"mistralai/mistral-large-3-675b-instruct-2512",name:"Mistral Large 3 675B Instruct 2512",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"mistralai/mistral-small-4-119b-2603",name:"mistral-small-4-119b-2603",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:8192,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-nano-30b-a3b",name:"nemotron-3-nano-30b-a3b",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning",name:"Nemotron 3 Nano Omni",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:65536,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-super-120b-a12b",name:"Nemotron 3 Super",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.2,output:0.8,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra 550B A55B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:65536,cost:{input:0.5,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"nvidia/nvidia-nemotron-nano-9b-v2",name:"nvidia-nemotron-nano-9b-v2",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-120b",name:"GPT-OSS-120B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:8192,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-20b",name:"GPT OSS 20B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:32768,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"qwen/qwen3.5-122b-a10b",name:"Qwen3.5 122B-A10B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"stepfun-ai/step-3.5-flash",name:"Step 3.5 Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:16384,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"stepfun-ai/step-3.7-flash",name:"Step 3.7 Flash",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:16384,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"z-ai/glm-5.1",name:"GLM-5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}}]},"openai-codex":{name:"openai-codex",config:{api:"openai-codex-responses",baseUrl:"https://chatgpt.com/backend-api",apiKey:""},models:[{modelId:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",config:{api:"openai-codex-responses",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.4",name:"GPT-5.4",config:{api:"openai-codex-responses",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"gpt-5.4-mini",name:"GPT-5.4 mini",config:{api:"openai-codex-responses",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"gpt-5.5",name:"GPT-5.5",config:{api:"openai-codex-responses",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}}]},opencode:{name:"opencode",config:{api:"openai-completions",baseUrl:"https://opencode.ai/zen/v1",apiKey:"OPENCODE_API_KEY"},models:[{modelId:"big-pickle",name:"Big Pickle",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:32000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"claude-haiku-4-5",name:"Claude Haiku 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"claude-opus-4-1",name:"Claude Opus 4.1",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"claude-opus-4-5",name:"Claude Opus 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-6",name:"Claude Opus 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-7",name:"Claude Opus 4.7",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-opus-4-8",name:"Claude Opus 4.8",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"claude-sonnet-4",name:"Claude Sonnet 4",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-5",name:"Claude Sonnet 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"deepseek-v4-flash",name:"DeepSeek V4 Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:0.14,output:0.28,cacheRead:0.028,cacheWrite:0}}},{modelId:"deepseek-v4-flash-free",name:"DeepSeek V4 Flash Free",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:128000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek-v4-pro",name:"DeepSeek V4 Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:1.74,output:3.84,cacheRead:0.145,cacheWrite:0}}},{modelId:"gemini-3-flash",name:"Gemini 3 Flash",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0}}},{modelId:"gemini-3.1-pro",name:"Gemini 3.1 Pro Preview",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"gemini-3.5-flash",name:"Gemini 3.5 Flash",config:{api:"google-generative-ai",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.5,output:9,cacheRead:0.15,cacheWrite:0}}},{modelId:"glm-5",name:"GLM-5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:1,output:3.2,cacheRead:0.2,cacheWrite:0}}},{modelId:"glm-5.1",name:"GLM-5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:1.4,output:4.4,cacheRead:0.26,cacheWrite:0}}},{modelId:"gpt-5",name:"GPT-5",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.07,output:8.5,cacheRead:0.107,cacheWrite:0}}},{modelId:"gpt-5-codex",name:"GPT-5 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.07,output:8.5,cacheRead:0.107,cacheWrite:0}}},{modelId:"gpt-5-nano",name:"GPT-5 Nano",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.05,output:0.4,cacheRead:0.005,cacheWrite:0}}},{modelId:"gpt-5.1",name:"GPT-5.1",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.07,output:8.5,cacheRead:0.107,cacheWrite:0}}},{modelId:"gpt-5.1-codex",name:"GPT-5.1 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.07,output:8.5,cacheRead:0.107,cacheWrite:0}}},{modelId:"gpt-5.1-codex-max",name:"GPT-5.1 Codex Max",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"gpt-5.1-codex-mini",name:"GPT-5.1 Codex Mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"gpt-5.2",name:"GPT-5.2",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.2-codex",name:"GPT-5.2 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.3-codex",name:"GPT-5.3 Codex",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"gpt-5.4",name:"GPT-5.4",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:272000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"gpt-5.4-mini",name:"GPT-5.4 Mini",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"gpt-5.4-nano",name:"GPT-5.4 Nano",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.2,output:1.25,cacheRead:0.02,cacheWrite:0}}},{modelId:"gpt-5.4-pro",name:"GPT-5.4 Pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:30,cacheWrite:0}}},{modelId:"gpt-5.5",name:"GPT-5.5",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"gpt-5.5-pro",name:"GPT-5.5 Pro",config:{api:"openai-responses",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:30,cacheWrite:0}}},{modelId:"grok-build-0.1",name:"Grok Build 0.1",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:1,output:2,cacheRead:0.2,cacheWrite:0}}},{modelId:"kimi-k2.5",name:"Kimi K2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.6,output:3,cacheRead:0.08,cacheWrite:0}}},{modelId:"kimi-k2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"mimo-v2.5-free",name:"MiMo V2.5 Free",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"minimax-m2.5",name:"MiniMax M2.5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"minimax-m2.7",name:"MiniMax M2.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"nemotron-3-ultra-free",name:"Nemotron 3 Ultra Free",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:128000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"north-mini-code-free",name:"North Mini Code Free",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:64000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"qwen3.5-plus",name:"Qwen3.5 Plus",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.2,output:1.2,cacheRead:0.02,cacheWrite:0.25}}},{modelId:"qwen3.6-plus",name:"Qwen3.6 Plus",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0.625}}}]},"opencode-go":{name:"opencode-go",config:{api:"openai-completions",baseUrl:"https://opencode.ai/zen/go/v1",apiKey:"OPENCODE_API_KEY"},models:[{modelId:"deepseek-v4-flash",name:"DeepSeek V4 Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:0.14,output:0.28,cacheRead:0.0028,cacheWrite:0}}},{modelId:"deepseek-v4-pro",name:"DeepSeek V4 Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:1.74,output:3.48,cacheRead:0.0145,cacheWrite:0}}},{modelId:"glm-5",name:"GLM-5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:32768,cost:{input:1,output:3.2,cacheRead:0.2,cacheWrite:0}}},{modelId:"glm-5.1",name:"GLM-5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:32768,cost:{input:1.4,output:4.4,cacheRead:0.26,cacheWrite:0}}},{modelId:"kimi-k2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"kimi-k2.7-code",name:"Kimi K2.7 Code",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:262144,cost:{input:0.95,output:4,cacheRead:0.19,cacheWrite:0}}},{modelId:"mimo-v2.5",name:"MiMo V2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:0.14,output:0.28,cacheRead:0.0028,cacheWrite:0}}},{modelId:"mimo-v2.5-pro",name:"MiMo V2.5 Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:128000,cost:{input:1.74,output:3.48,cacheRead:0.0145,cacheWrite:0}}},{modelId:"minimax-m2.7",name:"MiniMax M2.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"minimax-m3",name:"MiniMax M3 (3x usage)",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:512000,maxTokens:131072,cost:{input:0.1,output:0.4,cacheRead:0.02,cacheWrite:0}}},{modelId:"qwen3.6-plus",name:"Qwen3.6 Plus",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0.625}}},{modelId:"qwen3.7-max",name:"Qwen3.7 Max",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:65536,cost:{input:2.5,output:7.5,cacheRead:0.5,cacheWrite:3.125}}},{modelId:"qwen3.7-plus",name:"Qwen3.7 Plus",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.4,output:1.6,cacheRead:0.04,cacheWrite:0.5}}}]},together:{name:"together",config:{api:"openai-completions",baseUrl:"https://api.together.ai/v1",apiKey:"TOGETHER_API_KEY"},models:[{modelId:"MiniMaxAI/MiniMax-M2.7",name:"MiniMax-M2.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"MiniMaxAI/MiniMax-M3",name:"MiniMax-M3",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:524288,maxTokens:250000,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"Qwen/Qwen2.5-7B-Instruct-Turbo",name:"Qwen 2.5 7B Instruct Turbo",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32768,maxTokens:32768,cost:{input:0.3,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3-235B-A22B-Instruct-2507-tput",name:"Qwen3 235B A22B Instruct 2507 FP8",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:262144,cost:{input:0.2,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3.5-397B-A17B",name:"Qwen3.5 397B A17B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:130000,cost:{input:0.6,output:3.6,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3.5-9B",name:"Qwen3.5 9B",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:65536,cost:{input:0.17,output:0.25,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3.6-Plus",name:"Qwen3.6 Plus",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:500000,cost:{input:0.5,output:3,cacheRead:0,cacheWrite:0}}},{modelId:"Qwen/Qwen3.7-Max",name:"Qwen3.7 Max",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:1e6,maxTokens:500000,cost:{input:2.5,output:7.5,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek-ai/DeepSeek-V4-Pro",name:"DeepSeek V4 Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:512000,maxTokens:384000,cost:{input:1.74,output:3.48,cacheRead:0.2,cacheWrite:0}}},{modelId:"essentialai/Rnj-1-Instruct",name:"Rnj-1 Instruct",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32768,maxTokens:32768,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"google/gemma-4-31B-it",name:"Gemma 4 31B Instruct",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.39,output:0.97,cacheRead:0,cacheWrite:0}}},{modelId:"meta-llama/Llama-3.3-70B-Instruct-Turbo",name:"Llama 3.3 70B",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.88,output:0.88,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/Kimi-K2.6",name:"Kimi K2.6",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131000,cost:{input:1.2,output:4.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"moonshotai/Kimi-K2.7-Code",name:"Kimi K2.7 Code",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:131072,cost:{input:0.95,output:4,cacheRead:0.19,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra 550B A55B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:512300,maxTokens:512300,cost:{input:0.6,output:3.6,cacheRead:0.2,cacheWrite:0}}},{modelId:"openai/gpt-oss-120b",name:"GPT OSS 120B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-20b",name:"GPT OSS 20B",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.05,output:0.2,cacheRead:0,cacheWrite:0}}},{modelId:"zai-org/GLM-5",name:"GLM-5",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:131072,cost:{input:1,output:3.2,cacheRead:0,cacheWrite:0}}},{modelId:"zai-org/GLM-5.1",name:"GLM-5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:202752,maxTokens:131072,cost:{input:1.4,output:4.4,cacheRead:0,cacheWrite:0}}}]},"vercel-ai-gateway":{name:"vercel-ai-gateway",config:{api:"anthropic-messages",baseUrl:"https://ai-gateway.vercel.sh",apiKey:"AI_GATEWAY_API_KEY"},models:[{modelId:"alibaba/qwen-3-14b",name:"Qwen3-14B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:40960,maxTokens:16384,cost:{input:0.12,output:0.24,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen-3-235b",name:"Qwen3 235B A22B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:16384,cost:{input:0.22,output:0.88,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen-3-30b",name:"Qwen3-30B-A3B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:40960,maxTokens:16384,cost:{input:0.12,output:0.5,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen-3-32b",name:"Qwen 3 32B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:8192,cost:{input:0.16,output:0.64,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen-3.6-max-preview",name:"Qwen 3.6 Max Preview",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:240000,maxTokens:64000,cost:{input:1.3,output:7.8,cacheRead:0.26,cacheWrite:1.625}}},{modelId:"alibaba/qwen3-235b-a22b-thinking",name:"Qwen3 VL 235B A22B Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:32768,cost:{input:0.4,output:4,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen3-coder",name:"Qwen3 Coder 480B A35B Instruct",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:1.5,output:7.5,cacheRead:0.3,cacheWrite:0}}},{modelId:"alibaba/qwen3-coder-30b-a3b",name:"Qwen 3 Coder 30B A3B Instruct",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:8192,cost:{input:0.15,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen3-coder-next",name:"Qwen3 Coder Next",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:256000,cost:{input:0.5,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen3-coder-plus",name:"Qwen3 Coder Plus",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:1e6,maxTokens:65536,cost:{input:1,output:5,cacheRead:0.2,cacheWrite:0}}},{modelId:"alibaba/qwen3-max",name:"Qwen3 Max",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:1.2,output:6,cacheRead:0.24,cacheWrite:0}}},{modelId:"alibaba/qwen3-max-preview",name:"Qwen3 Max Preview",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:262144,maxTokens:32768,cost:{input:1.2,output:6,cacheRead:0.24,cacheWrite:0}}},{modelId:"alibaba/qwen3-max-thinking",name:"Qwen 3 Max Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:65536,cost:{input:1.2,output:6,cacheRead:0.24,cacheWrite:0}}},{modelId:"alibaba/qwen3-next-80b-a3b-instruct",name:"Qwen3 Next 80B A3B Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:32768,cost:{input:0.15,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen3-next-80b-a3b-thinking",name:"Qwen3 Next 80B A3B Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:32768,cost:{input:0.15,output:1.2,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen3-vl-thinking",name:"Qwen3 VL 235B A22B Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:32768,cost:{input:0.4,output:4,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen3.5-flash",name:"Qwen 3.5 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:0.1,output:0.4,cacheRead:0.001,cacheWrite:0.125}}},{modelId:"alibaba/qwen3.5-plus",name:"Qwen 3.5 Plus",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:0.4,output:2.4,cacheRead:0.04,cacheWrite:0.5}}},{modelId:"alibaba/qwen3.6-27b",name:"Qwen 3.6 27B",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0.6,output:3.6,cacheRead:0,cacheWrite:0}}},{modelId:"alibaba/qwen3.6-plus",name:"Qwen 3.6 Plus",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:0.5,output:3,cacheRead:0.1,cacheWrite:0.625}}},{modelId:"alibaba/qwen3.7-max",name:"Qwen 3.7 Max",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:991000,maxTokens:64000,cost:{input:1.25,output:3.75,cacheRead:0.25,cacheWrite:1.5625}}},{modelId:"alibaba/qwen3.7-plus",name:"Qwen 3.7 Plus",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:0.4,output:1.6,cacheRead:0.08,cacheWrite:0.5}}},{modelId:"anthropic/claude-3-haiku",name:"Claude 3 Haiku",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:4096,cost:{input:0.25,output:1.25,cacheRead:0.03,cacheWrite:0.3}}},{modelId:"anthropic/claude-3.5-haiku",name:"Claude 3.5 Haiku",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8192,cost:{input:0.8,output:4,cacheRead:0.08,cacheWrite:1}}},{modelId:"anthropic/claude-haiku-4.5",name:"Claude Haiku 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:1,output:5,cacheRead:0.1,cacheWrite:1.25}}},{modelId:"anthropic/claude-opus-4",name:"Claude Opus 4",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"anthropic/claude-opus-4.1",name:"Claude Opus 4.1",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:32000,cost:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}}},{modelId:"anthropic/claude-opus-4.5",name:"Claude Opus 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:64000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-opus-4.6",name:"Claude Opus 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-opus-4.7",name:"Claude Opus 4.7",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-opus-4.8",name:"Claude Opus 4.8",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:25,cacheRead:0.5,cacheWrite:6.25}}},{modelId:"anthropic/claude-sonnet-4",name:"Claude Sonnet 4",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"anthropic/claude-sonnet-4.5",name:"Claude Sonnet 4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"anthropic/claude-sonnet-4.6",name:"Claude Sonnet 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:3,output:15,cacheRead:0.3,cacheWrite:3.75}}},{modelId:"arcee-ai/trinity-large-preview",name:"Trinity Large Preview",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:131000,maxTokens:131000,cost:{input:0.25,output:1,cacheRead:0,cacheWrite:0}}},{modelId:"arcee-ai/trinity-large-thinking",name:"Trinity Large Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262100,maxTokens:80000,cost:{input:0.25,output:0.9,cacheRead:0,cacheWrite:0}}},{modelId:"bytedance/seed-1.6",name:"Seed 1.6",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:32000,cost:{input:0.25,output:2,cacheRead:0.05,cacheWrite:0}}},{modelId:"cohere/command-a",name:"Command A",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:8000,cost:{input:2.5,output:10,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-r1",name:"DeepSeek-R1",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:8192,cost:{input:1.35,output:5.4,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3",name:"DeepSeek V3 0324",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:163840,maxTokens:163840,cost:{input:0.27,output:1.12,cacheRead:0.135,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3.1",name:"DeepSeek V3.1",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:163840,maxTokens:8192,cost:{input:0.56,output:1.68,cacheRead:0.28,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3.1-terminus",name:"DeepSeek V3.1 Terminus",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.27,output:1,cacheRead:0.135,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3.2",name:"DeepSeek V3.2",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:8000,cost:{input:0.28,output:0.42,cacheRead:0.028,cacheWrite:0}}},{modelId:"deepseek/deepseek-v3.2-thinking",name:"DeepSeek V3.2 Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:8000,cost:{input:0.62,output:1.85,cacheRead:0,cacheWrite:0}}},{modelId:"deepseek/deepseek-v4-flash",name:"DeepSeek V4 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:384000,cost:{input:0.14,output:0.28,cacheRead:0.0028,cacheWrite:0}}},{modelId:"deepseek/deepseek-v4-pro",name:"DeepSeek V4 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:384000,cost:{input:0.435,output:0.87,cacheRead:0.0036,cacheWrite:0}}},{modelId:"google/gemini-2.5-flash",name:"Gemini 2.5 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65536,cost:{input:0.3,output:2.5,cacheRead:0.03,cacheWrite:0}}},{modelId:"google/gemini-2.5-flash-lite",name:"Gemini 2.5 Flash Lite",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:0.1,output:0.4,cacheRead:0.01,cacheWrite:0}}},{modelId:"google/gemini-2.5-pro",name:"Gemini 2.5 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:65536,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"google/gemini-3-flash",name:"Gemini 3 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65000,cost:{input:0.5,output:3,cacheRead:0.05,cacheWrite:0}}},{modelId:"google/gemini-3-pro-preview",name:"Gemini 3 Pro Preview",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"google/gemini-3.1-flash-lite",name:"Gemini 3.1 Flash Lite",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65000,cost:{input:0.25,output:1.5,cacheRead:0.03,cacheWrite:0}}},{modelId:"google/gemini-3.1-flash-lite-preview",name:"Gemini 3.1 Flash Lite Preview",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:65000,cost:{input:0.25,output:1.5,cacheRead:0.03,cacheWrite:0}}},{modelId:"google/gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:2,output:12,cacheRead:0.2,cacheWrite:0}}},{modelId:"google/gemini-3.5-flash",name:"Gemini 3.5 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:64000,cost:{input:1.5,output:9,cacheRead:0.15,cacheWrite:0}}},{modelId:"google/gemma-4-26b-a4b-it",name:"Gemma 4 26B A4B IT",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.15,output:0.6,cacheRead:0.015,cacheWrite:0}}},{modelId:"google/gemma-4-31b-it",name:"Gemma 4 31B IT",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.14,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"inception/mercury-2",name:"Mercury 2",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:128000,cost:{input:0.25,output:0.75,cacheRead:0.025,cacheWrite:0}}},{modelId:"inception/mercury-coder-small",name:"Mercury Coder Small Beta",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:32000,maxTokens:16384,cost:{input:0.25,output:1,cacheRead:0,cacheWrite:0}}},{modelId:"kwaipilot/kat-coder-pro-v2",name:"Kat Coder Pro V2",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:256000,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"meituan/longcat-flash-chat",name:"LongCat Flash Chat",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:1e5,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.1-70b",name:"Llama 3.1 70B Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:8192,cost:{input:0.72,output:0.72,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.1-8b",name:"Llama 3.1 8B Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:8192,cost:{input:0.22,output:0.22,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.2-11b",name:"Llama 3.2 11B Vision Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:8192,cost:{input:0.16,output:0.16,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.2-90b",name:"Llama 3.2 90B Vision Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:8192,cost:{input:0.72,output:0.72,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-3.3-70b",name:"Llama 3.3 70B Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:8192,cost:{input:0.72,output:0.72,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-4-maverick",name:"Llama 4 Maverick 17B Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:8192,cost:{input:0.24,output:0.97,cacheRead:0,cacheWrite:0}}},{modelId:"meta/llama-4-scout",name:"Llama 4 Scout 17B Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:8192,cost:{input:0.17,output:0.66,cacheRead:0,cacheWrite:0}}},{modelId:"minimax/minimax-m2",name:"MiniMax M2",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:205000,maxTokens:205000,cost:{input:0.3,output:1.2,cacheRead:0.03,cacheWrite:0.375}}},{modelId:"minimax/minimax-m2.1",name:"MiniMax M2.1",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:1.2,cacheRead:0.03,cacheWrite:0.375}}},{modelId:"minimax/minimax-m2.1-lightning",name:"MiniMax M2.1 Lightning",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0.3,output:2.4,cacheRead:0.03,cacheWrite:0.375}}},{modelId:"minimax/minimax-m2.5",name:"MiniMax M2.5",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131000,cost:{input:0.3,output:1.2,cacheRead:0.03,cacheWrite:0.375}}},{modelId:"minimax/minimax-m2.5-highspeed",name:"MiniMax M2.5 High Speed",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131000,cost:{input:0.6,output:2.4,cacheRead:0.03,cacheWrite:0.375}}},{modelId:"minimax/minimax-m2.7",name:"MiniMax M2.7",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131000,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0.375}}},{modelId:"minimax/minimax-m2.7-highspeed",name:"MiniMax M2.7 High Speed",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131100,cost:{input:0.6,output:2.4,cacheRead:0.06,cacheWrite:0.375}}},{modelId:"minimax/minimax-m3",name:"MiniMax M3",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:1e6,cost:{input:0.3,output:1.2,cacheRead:0.06,cacheWrite:0}}},{modelId:"mistral/codestral",name:"Mistral Codestral",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4000,cost:{input:0.3,output:0.9,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/devstral-2",name:"Devstral 2",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:256000,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/devstral-small",name:"Devstral Small 1.1",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:64000,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/devstral-small-2",name:"Devstral Small 2",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:256000,maxTokens:256000,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/ministral-3b",name:"Ministral 3B",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4000,cost:{input:0.1,output:0.1,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/ministral-8b",name:"Ministral 8B",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:128000,maxTokens:4000,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/mistral-medium",name:"Mistral Medium 3.1",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:64000,cost:{input:0.4,output:2,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/mistral-medium-3.5",name:"Mistral Medium Latest",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:256000,cost:{input:1.5,output:7.5,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/mistral-nemo",name:"Mistral Nemo 12B",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.02,output:0.04,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/mistral-small",name:"Mistral Small",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:32000,maxTokens:4000,cost:{input:0.1,output:0.3,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/pixtral-12b",name:"Pixtral 12B 2409",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4000,cost:{input:0.15,output:0.15,cacheRead:0,cacheWrite:0}}},{modelId:"mistral/pixtral-large",name:"Pixtral Large",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4000,cost:{input:2,output:6,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2",name:"Kimi K2 Instruct",config:{api:"anthropic-messages",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.57,output:2.3,cacheRead:0,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2-thinking",name:"Kimi K2 Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262114,maxTokens:262114,cost:{input:0.6,output:2.5,cacheRead:0.15,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2.5",name:"Kimi K2.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262114,maxTokens:262114,cost:{input:0.6,output:3,cacheRead:0.1,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2.6",name:"Kimi K2.6",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:262000,maxTokens:262000,cost:{input:0.95,output:4,cacheRead:0.16,cacheWrite:0}}},{modelId:"moonshotai/kimi-k2.7-code",name:"Kimi K2.7 Code",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:32768,cost:{input:0.95,output:4,cacheRead:0.19,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-super-120b-a12b",name:"NVIDIA Nemotron 3 Super 120B A12B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:256000,maxTokens:32000,cost:{input:0.15,output:0.65,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-3-ultra-550b-a55b",name:"Nemotron 3 Ultra",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:65000,cost:{input:0.6,output:2.4,cacheRead:0.12,cacheWrite:0}}},{modelId:"nvidia/nemotron-nano-12b-v2-vl",name:"Nvidia Nemotron Nano 12B V2 VL",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:131072,maxTokens:131072,cost:{input:0.2,output:0.6,cacheRead:0,cacheWrite:0}}},{modelId:"nvidia/nemotron-nano-9b-v2",name:"Nvidia Nemotron Nano 9B V2",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131072,cost:{input:0.06,output:0.23,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4-turbo",name:"GPT-4 Turbo",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:4096,cost:{input:10,output:30,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-4.1",name:"GPT-4.1",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/gpt-4.1-mini",name:"GPT-4.1 mini",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.4,output:1.6,cacheRead:0.1,cacheWrite:0}}},{modelId:"openai/gpt-4.1-nano",name:"GPT-4.1 nano",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,cost:{input:0.1,output:0.4,cacheRead:0.025,cacheWrite:0}}},{modelId:"openai/gpt-4o",name:"GPT-4o",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:2.5,output:10,cacheRead:1.25,cacheWrite:0}}},{modelId:"openai/gpt-4o-mini",name:"GPT-4o mini",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:0.15,output:0.6,cacheRead:0.075,cacheWrite:0}}},{modelId:"openai/gpt-5",name:"GPT-5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5-chat",name:"GPT 5 Chat",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5-codex",name:"GPT-5-Codex",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5-mini",name:"GPT-5 mini",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"openai/gpt-5-nano",name:"GPT-5 nano",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.05,output:0.4,cacheRead:0.005,cacheWrite:0}}},{modelId:"openai/gpt-5-pro",name:"GPT-5 pro",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:272000,cost:{input:15,output:120,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-5.1-codex",name:"GPT-5.1-Codex",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5.1-codex-max",name:"GPT 5.1 Codex Max",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5.1-codex-mini",name:"GPT 5.1 Codex Mini",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.25,output:2,cacheRead:0.025,cacheWrite:0}}},{modelId:"openai/gpt-5.1-instant",name:"GPT-5.1 Instant",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5.1-thinking",name:"GPT 5.1 Thinking",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.25,output:10,cacheRead:0.125,cacheWrite:0}}},{modelId:"openai/gpt-5.2",name:"GPT 5.2",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.2-chat",name:"GPT 5.2 Chat",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.2-codex",name:"GPT 5.2 Codex",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.2-pro",name:"GPT 5.2 ",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:21,output:168,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-5.3-chat",name:"GPT-5.3 Chat",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:16384,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.3-codex",name:"GPT 5.3 Codex",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:1.75,output:14,cacheRead:0.175,cacheWrite:0}}},{modelId:"openai/gpt-5.4",name:"GPT 5.4",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:2.5,output:15,cacheRead:0.25,cacheWrite:0}}},{modelId:"openai/gpt-5.4-mini",name:"GPT 5.4 Mini",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.75,output:4.5,cacheRead:0.075,cacheWrite:0}}},{modelId:"openai/gpt-5.4-nano",name:"GPT 5.4 Nano",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:400000,maxTokens:128000,cost:{input:0.2,output:1.25,cacheRead:0.02,cacheWrite:0}}},{modelId:"openai/gpt-5.4-pro",name:"GPT 5.4 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-5.5",name:"GPT 5.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:5,output:30,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/gpt-5.5-pro",name:"GPT 5.5 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:128000,cost:{input:30,output:180,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-120b",name:"GPT OSS 120B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:131000,cost:{input:0.35,output:0.75,cacheRead:0.25,cacheWrite:0}}},{modelId:"openai/gpt-oss-20b",name:"GPT OSS 20B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:8192,cost:{input:0.05,output:0.2,cacheRead:0,cacheWrite:0}}},{modelId:"openai/gpt-oss-safeguard-20b",name:"GPT OSS Safeguard 20B",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:65536,cost:{input:0.075,output:0.3,cacheRead:0.037,cacheWrite:0}}},{modelId:"openai/o1",name:"o1",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:15,output:60,cacheRead:7.5,cacheWrite:0}}},{modelId:"openai/o3",name:"o3",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:2,output:8,cacheRead:0.5,cacheWrite:0}}},{modelId:"openai/o3-deep-research",name:"o3-deep-research",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:10,output:40,cacheRead:2.5,cacheWrite:0}}},{modelId:"openai/o3-mini",name:"o3-mini",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.55,cacheWrite:0}}},{modelId:"openai/o3-pro",name:"o3 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:20,output:80,cacheRead:0,cacheWrite:0}}},{modelId:"openai/o4-mini",name:"o4-mini",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:1e5,cost:{input:1.1,output:4.4,cacheRead:0.275,cacheWrite:0}}},{modelId:"perplexity/sonar",name:"Sonar",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:127000,maxTokens:8000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"perplexity/sonar-pro",name:"Sonar Pro",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:200000,maxTokens:8000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"stepfun/step-3.5-flash",name:"StepFun 3.5 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262114,maxTokens:262114,cost:{input:0.09,output:0.3,cacheRead:0,cacheWrite:0.02}}},{modelId:"stepfun/step-3.7-flash",name:"Step 3.7 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:0.2,output:1.15,cacheRead:0.04,cacheWrite:0}}},{modelId:"xai/grok-4.1-fast-non-reasoning",name:"Grok 4.1 Fast Non-Reasoning",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:1e6,cost:{input:0.2,output:0.5,cacheRead:0.05,cacheWrite:0}}},{modelId:"xai/grok-4.1-fast-reasoning",name:"Grok 4.1 Fast Reasoning",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:1e6,cost:{input:0.2,output:0.5,cacheRead:0.05,cacheWrite:0}}},{modelId:"xai/grok-4.20-multi-agent",name:"Grok 4.20 Multi-Agent",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:2000000,maxTokens:2000000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"xai/grok-4.20-multi-agent-beta",name:"Grok 4.20 Multi Agent Beta",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:2000000,maxTokens:2000000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"xai/grok-4.20-non-reasoning",name:"Grok 4.20 Non-Reasoning",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:2000000,maxTokens:2000000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"xai/grok-4.20-non-reasoning-beta",name:"Grok 4.20 Beta Non-Reasoning",config:{api:"anthropic-messages",reasoning:!1,input:["text","image"],contextWindow:2000000,maxTokens:2000000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"xai/grok-4.20-reasoning",name:"Grok 4.20 Reasoning",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:2000000,maxTokens:2000000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"xai/grok-4.20-reasoning-beta",name:"Grok 4.20 Beta Reasoning",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:2000000,maxTokens:2000000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"xai/grok-4.3",name:"Grok 4.3",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:1e6,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"xai/grok-build-0.1",name:"Grok Build 0.1",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:1,output:2,cacheRead:0.2,cacheWrite:0}}},{modelId:"xiaomi/mimo-v2-flash",name:"MiMo V2 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:32000,cost:{input:0.1,output:0.3,cacheRead:0.01,cacheWrite:0}}},{modelId:"xiaomi/mimo-v2-pro",name:"MiMo V2 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:128000,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"xiaomi/mimo-v2.5",name:"MiMo M2.5",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:131100,cost:{input:0.14,output:0.28,cacheRead:0.0028,cacheWrite:0}}},{modelId:"xiaomi/mimo-v2.5-pro",name:"MiMo V2.5 Pro",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:1050000,maxTokens:131000,cost:{input:0.435,output:0.87,cacheRead:0.0036,cacheWrite:0}}},{modelId:"zai/glm-4.5",name:"GLM-4.5",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:96000,cost:{input:0.6,output:2.2,cacheRead:0.11,cacheWrite:0}}},{modelId:"zai/glm-4.5-air",name:"GLM 4.5 Air",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:128000,maxTokens:96000,cost:{input:0.2,output:1.1,cacheRead:0.03,cacheWrite:0}}},{modelId:"zai/glm-4.5v",name:"GLM 4.5V",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:66000,maxTokens:16000,cost:{input:0.6,output:1.8,cacheRead:0.11,cacheWrite:0}}},{modelId:"zai/glm-4.6",name:"GLM 4.6",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:96000,cost:{input:0.6,output:2.2,cacheRead:0.11,cacheWrite:0}}},{modelId:"zai/glm-4.6v",name:"GLM-4.6V",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:24000,cost:{input:0.3,output:0.9,cacheRead:0.05,cacheWrite:0}}},{modelId:"zai/glm-4.6v-flash",name:"GLM-4.6V-Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:128000,maxTokens:24000,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"zai/glm-4.7",name:"GLM 4.7",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:131000,maxTokens:40000,cost:{input:2.25,output:2.75,cacheRead:2.25,cacheWrite:0}}},{modelId:"zai/glm-4.7-flash",name:"GLM 4.7 Flash",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:131000,cost:{input:0.07,output:0.4,cacheRead:0,cacheWrite:0}}},{modelId:"zai/glm-4.7-flashx",name:"GLM 4.7 FlashX",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:128000,cost:{input:0.06,output:0.4,cacheRead:0.01,cacheWrite:0}}},{modelId:"zai/glm-5",name:"GLM 5",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:202800,maxTokens:131100,cost:{input:1,output:3.2,cacheRead:0.2,cacheWrite:0}}},{modelId:"zai/glm-5-turbo",name:"GLM 5 Turbo",config:{api:"anthropic-messages",reasoning:!0,input:["text"],contextWindow:202800,maxTokens:131100,cost:{input:1.2,output:4,cacheRead:0.24,cacheWrite:0}}},{modelId:"zai/glm-5.1",name:"GLM 5.1",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:202800,maxTokens:64000,cost:{input:1.4,output:4.4,cacheRead:0.26,cacheWrite:0}}},{modelId:"zai/glm-5v-turbo",name:"GLM 5V Turbo",config:{api:"anthropic-messages",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:128000,cost:{input:1.2,output:4,cacheRead:0.24,cacheWrite:0}}}]},xai:{name:"xai",config:{api:"openai-completions",baseUrl:"https://api.x.ai/v1",apiKey:"XAI_API_KEY"},models:[{modelId:"grok-3",name:"Grok 3",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:8192,cost:{input:3,output:15,cacheRead:0.75,cacheWrite:0}}},{modelId:"grok-3-fast",name:"Grok 3 Fast",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:131072,maxTokens:8192,cost:{input:5,output:25,cacheRead:1.25,cacheWrite:0}}},{modelId:"grok-4.20-0309-non-reasoning",name:"Grok 4.20 (Non-Reasoning)",config:{api:"openai-completions",reasoning:!1,input:["text","image"],contextWindow:1e6,maxTokens:30000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"grok-4.20-0309-reasoning",name:"Grok 4.20 (Reasoning)",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:30000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"grok-4.3",name:"Grok 4.3",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1e6,maxTokens:30000,cost:{input:1.25,output:2.5,cacheRead:0.2,cacheWrite:0}}},{modelId:"grok-build-0.1",name:"Grok Build 0.1",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:256000,maxTokens:256000,cost:{input:1,output:2,cacheRead:0.2,cacheWrite:0}}},{modelId:"grok-code-fast-1",name:"Grok Code Fast 1",config:{api:"openai-completions",reasoning:!1,input:["text"],contextWindow:32768,maxTokens:8192,cost:{input:0.2,output:1.5,cacheRead:0.02,cacheWrite:0}}}]},xiaomi:{name:"xiaomi",config:{api:"openai-completions",baseUrl:"https://api.xiaomimimo.com/v1",apiKey:"XIAOMI_API_KEY"},models:[{modelId:"mimo-v2-flash",name:"MiMo-V2-Flash",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:262144,maxTokens:65536,cost:{input:0.1,output:0.3,cacheRead:0.01,cacheWrite:0}}},{modelId:"mimo-v2-omni",name:"MiMo-V2-Omni",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2-pro",name:"MiMo-V2-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5",name:"MiMo-V2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5-pro-ultraspeed",name:"MiMo-V2.5-Pro-UltraSpeed",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1.305,output:2.61,cacheRead:0.0108,cacheWrite:0}}}]},"xiaomi-token-plan-ams":{name:"xiaomi-token-plan-ams",config:{api:"openai-completions",baseUrl:"https://token-plan-ams.xiaomimimo.com/v1",apiKey:"XIAOMI_TOKEN_PLAN_AMS_API_KEY"},models:[{modelId:"mimo-v2-omni",name:"MiMo-V2-Omni",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2-pro",name:"MiMo-V2-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5",name:"MiMo-V2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5-pro-ultraspeed",name:"MiMo-V2.5-Pro-UltraSpeed",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1.305,output:2.61,cacheRead:0.0108,cacheWrite:0}}}]},"xiaomi-token-plan-cn":{name:"xiaomi-token-plan-cn",config:{api:"openai-completions",baseUrl:"https://token-plan-cn.xiaomimimo.com/v1",apiKey:"XIAOMI_TOKEN_PLAN_CN_API_KEY"},models:[{modelId:"mimo-v2-omni",name:"MiMo-V2-Omni",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2-pro",name:"MiMo-V2-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5",name:"MiMo-V2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5-pro-ultraspeed",name:"MiMo-V2.5-Pro-UltraSpeed",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1.305,output:2.61,cacheRead:0.0108,cacheWrite:0}}}]},"xiaomi-token-plan-sgp":{name:"xiaomi-token-plan-sgp",config:{api:"openai-completions",baseUrl:"https://token-plan-sgp.xiaomimimo.com/v1",apiKey:"XIAOMI_TOKEN_PLAN_SGP_API_KEY"},models:[{modelId:"mimo-v2-omni",name:"MiMo-V2-Omni",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:262144,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2-pro",name:"MiMo-V2-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5",name:"MiMo-V2.5",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:1048576,maxTokens:131072,cost:{input:0.4,output:2,cacheRead:0.08,cacheWrite:0}}},{modelId:"mimo-v2.5-pro",name:"MiMo-V2.5-Pro",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1,output:3,cacheRead:0.2,cacheWrite:0}}},{modelId:"mimo-v2.5-pro-ultraspeed",name:"MiMo-V2.5-Pro-UltraSpeed",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1048576,maxTokens:131072,cost:{input:1.305,output:2.61,cacheRead:0.0108,cacheWrite:0}}}]},zai:{name:"zai",config:{api:"openai-completions",baseUrl:"https://api.z.ai/api/coding/paas/v4",apiKey:"ZAI_API_KEY"},models:[{modelId:"glm-4.5-air",name:"GLM-4.5-Air",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:98304,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-4.7",name:"GLM-4.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5-turbo",name:"GLM-5-Turbo",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5.1",name:"GLM-5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5.2",name:"GLM-5.2",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5v-turbo",name:"GLM-5V-Turbo",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}}]},"zai-coding-cn":{name:"zai-coding-cn",config:{api:"openai-completions",baseUrl:"https://open.bigmodel.cn/api/coding/paas/v4",apiKey:""},models:[{modelId:"glm-4.5-air",name:"GLM-4.5-Air",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:131072,maxTokens:98304,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-4.7",name:"GLM-4.7",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:204800,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5-turbo",name:"GLM-5-Turbo",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5.1",name:"GLM-5.1",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:200000,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5.2",name:"GLM-5.2",config:{api:"openai-completions",reasoning:!0,input:["text"],contextWindow:1e6,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}},{modelId:"glm-5v-turbo",name:"GLM-5V-Turbo",config:{api:"openai-completions",reasoning:!0,input:["text","image"],contextWindow:200000,maxTokens:131072,cost:{input:0,output:0,cacheRead:0,cacheWrite:0}}}]}};class Qr{prismaClient;constructor(B=VB){this.prismaClient=B}async initBuiltinProviders(B){let Q=await this.prismaClient.team.findUnique({where:{id:B},include:{_count:{select:{providers:!0}}}});if(Q&&Q._count.providers===0){let F=Object.entries(lwQ).reverse();for(let[U,I]of F){let G=I;await this.prismaClient.provider.create({data:{teamId:Q.id,name:U,config:G.config,isBuiltin:!0,models:{create:G.models.map((Z)=>({modelId:Z.modelId,name:Z.name,config:Z.config}))}}})}}}async listByTeam(B){return(await this.prismaClient.provider.findMany({where:{teamId:B},include:{_count:{select:{models:!0}}},orderBy:{id:"desc"}})).map((F)=>({...F,modelsCount:F._count.models,_count:void 0}))}async getById(B){return this.prismaClient.provider.findUnique({where:{id:B}})}async listModelsByProvider(B,Q){return this.prismaClient.model.findMany({where:{providerId:Q,provider:{teamId:B}},orderBy:{id:"asc"}})}async create(B,Q,F,U){return this.prismaClient.provider.create({data:{teamId:B,name:Q,config:F,models:{create:U.map((I)=>({modelId:I.modelId,name:I.name,config:I.config}))}},include:{models:!0}})}async update(B,Q,F,U){return this.prismaClient.$transaction(async(I)=>{return await I.model.deleteMany({where:{providerId:Q}}),I.provider.update({where:{id:Q,teamId:B},data:{config:F,models:{create:U.map((G)=>({modelId:G.modelId,name:G.name,config:G.config}))}},include:{models:!0}})})}async delete(B,Q){if(!await this.prismaClient.provider.findUnique({where:{id:Q,teamId:B}}))throw Error("Provider not found");return this.prismaClient.provider.delete({where:{id:Q,teamId:B}})}}var uwQ=new Qr;class qwQ{async upsertMetadata(B,Q,F,U){return await VB.userMetadata.upsert({where:{userIdTeamIdKey:{userId:B,teamId:Q,key:F}},update:{value:U},create:{userId:B,teamId:Q,key:F,value:U}})}async listMetadata(B,Q){return(await VB.userMetadata.findMany({where:{userId:B,teamId:Q},orderBy:{key:"asc"}})).map((U)=>({key:U.key,value:U.value}))}async getMetadata(B,Q,F){let U=await VB.userMetadata.findUnique({where:{userIdTeamIdKey:{userId:B,teamId:Q,key:F}}});if(!U)return null;return{key:U.key,value:U.value}}}var jwQ=new qwQ;var u6F=/<@([^>]+)>/g;class nwQ{async create(B){this.createAsync(B).catch((Q)=>{console.error("Failed to create notification asynchronously:",Q)})}async createAsync(B){let Q=B.projectId;if(!Q&&B.assetId){let U=await VB.asset.findUnique({where:{id:B.assetId},include:{project:!0}});if(U?.projectId)Q=U.projectId}if(Q){let U=await VB.project.findUnique({where:{id:Q}});if(U&&!U.enableNotification)return}let F=async(U,I)=>{try{await VB.notification.create({data:{type:U,teamId:B.teamId,projectId:Q,creatorId:B.creatorId,assetId:B.assetId,taskId:B.taskId,userId:I}})}catch(G){console.error("Failed to save notification",{type:U,err:G})}};if(await F(B.type,B.userId),(B.type===eV.comment_created||B.type===eV.reply_created)&&B.commentMessage){let U=[...B.commentMessage.matchAll(u6F)],I=new Set;for(let G of U)if(G.length>1){let Z=G[1];if(I.has(Z))continue;if(I.add(Z),B.creatorId===Z)continue;await F(eV.mention,Z)}}}async getListWhere(B,Q,F,U){let I=[];if(F.scope==="project")I=(await VB.projectMember.findMany({where:{teamMemberId:F.id},include:{project:!0}})).filter((b)=>b.project).map((b)=>b.projectId);let G=await jwQ.getMetadata(Q,B,"notification_settings"),Z=G?G.value:{comments:!0,replies:!0,mentions:!0,yourUploads:!1,otherUploads:!0,statusUpdates:!0},W=[];if(Z.comments)W.push({type:eV.comment_created,userId:null});if(Z.replies)W.push({type:eV.reply_created,userId:Q}),W.push({type:eV.reply_created,userId:null});if(Z.mentions)W.push({type:eV.mention,userId:Q});if(Z.yourUploads&&Z.otherUploads)W.push({type:eV.successful_file_uploaded});else if(Z.yourUploads)W.push({type:eV.successful_file_uploaded,creatorId:Q});else if(Z.otherUploads)W.push({type:eV.successful_file_uploaded,creatorId:{not:Q}});if(Z.statusUpdates)W.push({type:eV.metadata_field_updated_status});W.push({type:eV.new_user_join_team}),W.push({type:eV.new_user_join_project});let g={teamId:B,OR:W,AND:[{OR:[...Z.yourUploads?[{type:eV.successful_file_uploaded,creatorId:Q}]:[],{creatorId:null},{creatorId:{not:Q}}]}]};if(F.scope==="project"){let V=Array.isArray(g.AND)?g.AND:g.AND?[g.AND]:[];g.AND=[...V,{OR:[{type:eV.mention},{projectId:{in:I}}]}]}if(U&&F.lastReadNotification){let V=Array.isArray(g.AND)?g.AND:g.AND?[g.AND]:[];g.AND=[...V,{id:{gt:F.lastReadNotification.id}}]}return g}async getUnreadCount(B,Q){let F=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B,userId:Q}},include:{lastReadNotification:!0}});if(!F)return 0;let U=await this.getListWhere(B,Q,F,!0);return VB.notification.count({where:U})}async list(B,Q,F){let U=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B,userId:Q}},include:{lastReadNotification:!0}});if(!U)throw Error("failed to get team member");let I=await this.getListWhere(B,Q,U,!!F.unreadOnly);return $V(async(G,Z)=>{let W=await VB.notification.findMany({where:I,orderBy:{id:"desc"},skip:G,take:Z,include:{creator:!0,team:!0,project:!0,asset:!0,user:!0}});return Promise.all(W.map(async(g)=>{return this.toNotificationInfo(g,U.lastReadNotification)}))},null,{after:F.after,first:F.pageSize})}async markRead(B,Q,F){let U=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B,userId:Q}},include:{lastReadNotification:!0}});if(!U)throw Error("failed to get team member");if(!await VB.notification.findUnique({where:{id:F}}))throw Error("notification not found");let G=!0;if(U.lastReadNotification){if(F<=U.lastReadNotification.id)G=!1}if(G)await VB.teamMember.update({where:{id:U.id},data:{lastReadNotificationId:F}})}async toNotificationInfo(B,Q){let F={id:B.id,type:B.type||void 0,createdAt:B.createdAt.toISOString(),isRead:Q!==null&&B.id<=Q.id};if(B.creator)F.creator={id:B.creator.id,name:B.creator.name};if(B.team)F.team={id:B.team.id,name:B.team.name};if(B.project)F.project={id:B.project.id,name:B.project.name};if(B.user)F.user={id:B.user.id,name:B.user.name};if(B.asset){let U=B.asset,I="",G="",Z=0,W=0,g=U.media;if(g){let V=process.env.S3_BUCKET||"shumai";try{if(g.sprite){if(I=await yF.presign(V,g.sprite.key,"GET"),g.poster)G=await yF.presign(V,g.poster.key||"","GET");if(g.metadata)Z=g.metadata.originalWidth,W=g.metadata.originalHeight}else if(g.thumbnail)I=await yF.presign(V,g.thumbnail.key||"","GET"),G=I}catch(b){console.error("Failed to generate presigned url for notification asset preview:",b)}}F.asset={id:U.id,name:U.name,mediaType:U.mediaType||void 0,preview:I||void 0,thumbnailUrl:G||void 0,originalWidth:Z||void 0,originalHeight:W||void 0}}return F}}var iwQ=new nwQ;var YI=class extends Error{res;status;constructor(B=500,Q){super(Q?.message,{cause:Q?.cause});this.res=Q?.res,this.status=B}getResponse(){if(this.res)return new Response(this.res.body,{status:this.status,headers:this.res.headers});return new Response(this.message,{status:this.status})}};class pwQ{async ensureDefaultTeam(){let B=await VB.team.findFirst({where:{name:"Default Team"}});if(!B)B=await VB.team.create({data:{name:"Default Team",settings:{transcode:{videoStrategy:"best_match"}},sandbox:{create:{}}}}),await uwQ.initBuiltinProviders(B.id);return B}async createTeam(B,Q){return await VB.$transaction(async(F)=>{let U=await F.team.create({data:{name:Q.name,settings:{},sandbox:{create:{}}}}),I=await F.asset.create({data:{name:"root",type:"root",status:"processed"}}),G=await F.team.update({where:{id:U.id},data:{rootFolderId:I.id},include:{rootFolder:!0}});return await F.teamMember.create({data:{teamId:U.id,userId:B.id,role:"owner",scope:"team"}}),await new Qr(F).initBuiltinProviders(U.id),this.toTeamInfo(G)})}async getUserTeams(B){let Q={members:{some:{userId:B.userId}}};return await $V(async(F,U)=>{return(await VB.team.findMany({where:Q,skip:F,take:U,orderBy:{id:"desc"},include:{rootFolder:!0}})).map(this.toTeamInfo)},null,B.pagination)}async joinTeam(B){if(!await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B.teamId,userId:B.userId}}}))await VB.teamMember.create({data:{teamId:B.teamId,userId:B.userId,role:"reviewer",scope:"team"}})}async getMe(B){let Q=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B.teamId,userId:B.user.id}},include:{user:!0}});if(!Q)throw new YI(403,{message:"user is not a team member"});let F=await iwQ.getUnreadCount(B.teamId,B.user.id);return{id:Q.user.id,name:Q.user.name,email:Q.user.email||void 0,role:Q.role,image:await MX(Q.user.image),unreadNotificationCount:F}}async updateMe(B,Q){let F={};if(Q.name!==void 0)F.name=Q.name;if(Q.imageKey!==void 0)F.image=Q.imageKey;await VB.user.update({where:{id:B},data:F})}async getTeamMembers(B){let Q=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B.teamId,userId:B.userId}}});if(!Q)throw new YI(403,{message:"Requester is not a team member"});let F=await VB.teamMember.findMany({where:{teamId:B.teamId,...B.includeAgents?{user:{OR:[{type:"human"},{type:"agent",agent:{type:"chat",enabled:!0}}]}}:{user:{type:{not:"agent"}}}},include:{user:!0,projectMembers:!0}}),U=F;if(Q.scope==="project"){let I=await VB.projectMember.findMany({where:{teamMemberId:Q.id},select:{projectId:!0}}).then((G)=>G.map((Z)=>Z.projectId));U=F.filter((G)=>{if(G.scope==="team")return!0;return G.projectMembers.some((Z)=>I.includes(Z.projectId))})}return Promise.all(U.map(async(I)=>({id:I.user.id,name:I.user.name,email:void 0,role:I.role,type:I.user.type||void 0,image:await MX(I.user.image),scope:I.scope})))}async updateMemberRole(B){let Q=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B.teamId,userId:B.userId}}});if(!Q)throw new YI(404,{message:"Member not found"});if(Q.role==="owner")throw new YI(403,{message:"Cannot change the role of an owner"});await VB.teamMember.update({where:{id:Q.id},data:{role:B.role}})}async removeMember(B,Q){let F=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B,userId:Q}}});if(!F)throw new YI(404,{message:"Member not found"});if(F.role==="owner")throw new YI(403,{message:"Cannot remove an owner"});await VB.teamMember.delete({where:{id:F.id}})}async getSettings(B){let Q=await VB.team.findUnique({where:{id:B}});if(!Q)throw new YI(404,{message:"team not found"});let F=Q.settings||{},U=await VB.agent.findFirst({where:{teamId:B,type:"embedding",enabled:!0}});return F.semanticSearchEnabled=!!U,F}async updateSettings(B,Q,F){let U=await VB.team.findUnique({where:{id:B}});if(!U)throw new YI(404,{message:"team not found"});let I=U.settings||{};if(Q==="transcode.videoStrategy"){if(!I.transcode)I.transcode={};I.transcode.videoStrategy=F,delete I["transcode.videoStrategy"]}else I[Q]=F;return(await VB.team.update({where:{id:B},data:{settings:I}})).settings||{}}async getSandboxSettings(B){let Q=await VB.sandbox.findUnique({where:{teamId:B}});return{allowedDomains:Q?.allowedDomains||[],pendingDomains:Q?.pendingDomains||[]}}async updateSandboxSettings(B,Q){let F=await VB.sandbox.upsert({where:{teamId:B},create:{teamId:B,allowedDomains:Q.allowedDomains,pendingDomains:Q.pendingDomains},update:{allowedDomains:Q.allowedDomains,pendingDomains:Q.pendingDomains}});return{allowedDomains:F.allowedDomains,pendingDomains:F.pendingDomains}}async getSignupInfo(){let B=await VB.user.count();return{initialized:B>0,userCount:B,demoMode:process.env.SHUMAI_DEMO_MODE==="1"}}toTeamInfo(B){return{id:B.id,name:B.name,rootFolder:B.rootFolder?.id||B.rootFolderId||void 0,updatedAt:B.updatedAt}}}var Fr=new pwQ;class awQ{async createTeamInvite(B){let Q=NG(),F=await VB.invite.create({data:{code:Q,teamId:B.teamId,inviterId:B.inviterId,role:B.role}});return this.getInvite(F.code)}async createProjectInvite(B){let Q=await VB.project.findUniqueOrThrow({where:{id:B.projectId},include:{team:!0}}),F=NG(),U=await VB.invite.create({data:{code:F,teamId:Q.teamId,projectId:Q.id,inviterId:B.inviterId,role:B.role}});return this.getInvite(U.code)}async getInvite(B){return await VB.invite.findUniqueOrThrow({where:{code:B},include:{team:!0,project:!0,inviter:!0}})}async validateInvite(B){let Q=await VB.invite.findUnique({where:{code:B}});if(!Q)return!1;if(Q.used)return!1;return!0}async consumeInvite(B,Q){await VB.$transaction(async(F)=>{let U=await F.invite.findUniqueOrThrow({where:{code:B},include:{team:!0,project:!0}});if(U.used)throw Error("invite code already used");let I=await F.user.findUniqueOrThrow({where:{id:Q}}),G=await F.teamMember.findUnique({where:{teamIdUserId:{teamId:U.teamId,userId:I.id}}});if(!U.projectId)if(G){if(G.scope==="project")await F.teamMember.update({where:{id:G.id},data:{scope:"team",role:U.role}})}else await F.teamMember.create({data:{teamId:U.teamId,userId:I.id,role:U.role,scope:"team"}});else{if(!G)G=await F.teamMember.create({data:{teamId:U.teamId,userId:I.id,role:"reviewer",scope:"project"}});if(!await F.projectMember.findUnique({where:{projectIdTeamMemberId:{projectId:U.projectId,teamMemberId:G.id}}}))await F.projectMember.create({data:{projectId:U.projectId,teamMemberId:G.id,role:U.role}})}await F.invite.update({where:{id:U.id},data:{used:!0}})})}}var Ur=new awQ;var FXG=ULB({database:fwQ(VB,{provider:"postgresql"}),emailAndPassword:{enabled:!0,minPasswordLength:3},secret:process.env.BETTER_AUTH_SECRET,baseURL:process.env.BETTER_AUTH_URL||`http://localhost:${process.env.SHUMAI_SERVER_PORT||"3000"}`,basePath:"/api/auth",trustedOrigins:[`http://localhost:${process.env.SHUMAI_SERVER_PORT||"3000"}`,`http://127.0.0.1:${process.env.SHUMAI_SERVER_PORT||"3000"}`],advanced:{disableCSRFCheck:!0},hooks:{before:I2(async(B)=>{if(B.path==="/sign-up/email"){let F=B.body?.inviteCode;if((await Fr.getSignupInfo()).initialized){if(!F)return console.log("[Better Auth Hook] Public signup is disabled"),B.json({error:"Public signup is disabled"},{status:403});if(!await Ur.validateInvite(F))return B.json({error:"Invalid or expired invite code"},{status:400})}}}),after:I2(async(B)=>{if(B.path==="/sign-up/email"){let Q=B.context.returned;if(Q&&Q.user&&Q.user.id){let F=Q.user,I=B.body?.inviteCode;try{let G=await Fr.getSignupInfo(),Z=await Fr.ensureDefaultTeam();if(G.userCount===1)await VB.teamMember.create({data:{teamId:Z.id,userId:F.id,role:"owner",scope:"team"}});else if(!I)await VB.teamMember.create({data:{teamId:Z.id,userId:F.id,role:"editor",scope:"team"}});if(I)await Ur.consumeInvite(I,F.id)}catch(G){console.error(`[Better Auth Hook] Error in after hook: ${G}`)}}}})}});class owQ{async hasPermission(B){if(!B.user)throw new YI(401,{message:"User is required"});let{teamId:Q,projectId:F}=await this.resolveContext(B.type,B.id),U=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:Q,userId:B.user.id}}});if(!U)throw new YI(403,{message:"User is not a member of the team"});if(F){let I=await VB.projectMember.findUnique({where:{projectIdTeamMemberId:{projectId:F,teamMemberId:U.id}}});if(I)return this.checkRole(I.role,B.permission)}if(U.scope==="team")return this.checkRole(U.role,B.permission);if(!F){if(B.permission==="Read")return}throw new YI(403,{message:"User has only project scope"})}async resolveContext(B,Q){switch(B){case"team":return{teamId:Q};case"project":{let F=await VB.project.findUnique({where:{id:Q},select:{teamId:!0}});if(!F)throw new YI(404,{message:"Project not found"});return{teamId:F.teamId,projectId:Q}}case"asset":{let F=await VB.asset.findUnique({where:{id:Q},select:{parentId:!0,teamRootFolder:{select:{id:!0}},project:{select:{id:!0,teamId:!0}}}});if(!F)throw new YI(404,{message:"Asset not found"});if(F.project)return{teamId:F.project.teamId,projectId:F.project.id};if(F.teamRootFolder)return{teamId:F.teamRootFolder.id};if(F.parentId)return this.resolveContext("asset",F.parentId);throw new YI(403,{message:"Could not resolve context for asset"})}case"collection":{let F=await VB.collection.findUnique({where:{id:Q},include:{project:!0}});if(!F)throw new YI(404,{message:"Collection not found"});return{teamId:F.project.teamId,projectId:F.projectId}}case"agent":{let F=await VB.agent.findUnique({where:{id:Q},select:{teamId:!0}});if(!F)throw new YI(404,{message:"Agent not found"});return{teamId:F.teamId}}case"agentSession":{let F=await VB.agentSession.findUnique({where:{id:Q},include:{agent:!0}});if(!F)throw new YI(404,{message:"Agent session not found"});return{teamId:F.agent.teamId}}case"share":{let F=await VB.shareLink.findUnique({where:{id:Q},include:{project:!0}});if(!F)throw new YI(404,{message:"Share not found"});return{teamId:F.project.teamId,projectId:F.projectId}}case"metadataField":{let F=await VB.metadataField.findUnique({where:{key:Q},select:{teamId:!0,projectId:!0}});if(!F)throw new YI(404,{message:"Metadata field not found"});if(F.projectId)return{teamId:(await VB.project.findUnique({where:{id:F.projectId},select:{teamId:!0}})).teamId,projectId:F.projectId};if(!F.teamId)throw new YI(403,{message:"Metadata field has no context"});return{teamId:F.teamId}}case"skill":{let F=await VB.skill.findUnique({where:{id:Q},select:{teamId:!0}});if(!F)throw new YI(404,{message:"Skill not found"});return{teamId:F.teamId}}case"provider":{let F=await VB.provider.findUnique({where:{id:Q},select:{teamId:!0}});if(!F)throw new YI(404,{message:"Provider not found"});return{teamId:F.teamId}}case"invite":{let F=await VB.invite.findUnique({where:{id:Q},select:{teamId:!0,projectId:!0}});if(!F)throw new YI(404,{message:"Invite not found"});return{teamId:F.teamId,projectId:F.projectId??void 0}}case"comment":{let F=await VB.assetComment.findUnique({where:{id:Q},include:{asset:{include:{project:!0}}}});if(!F)throw new YI(404,{message:"Comment not found"});if(!F.asset.project)throw new YI(403,{message:"Comment asset has no project"});return{teamId:F.asset.project.teamId,projectId:F.asset.projectId}}default:throw new YI(403,{message:`Unsupported resource type: ${B}`})}}checkRole(B,Q){switch(Q){case"Read":return;case"Edit":if(B==="owner"||B==="editor")return;break;case"Admin":if(B==="owner")return;break}throw new YI(403,{message:"Permission denied"})}}var rd=new owQ;class rwQ{async createCollection(B,Q,F){return await VB.collection.create({data:{name:Q.name,filter:Q.filter,projectId:B,creatorId:F},include:{creator:!0}})}async updateCollection(B,Q){return await VB.collection.update({where:{id:B},data:{...Q.name&&{name:Q.name},...Q.filter&&{filter:Q.filter}},include:{creator:!0}})}async deleteCollection(B){return await VB.collection.delete({where:{id:B}})}async getCollection(B){return await VB.collection.findUnique({where:{id:B},include:{creator:!0}})}async listCollections(B,Q){return await $V((F,U)=>VB.collection.findMany({where:{projectId:B},include:{creator:!0},orderBy:{id:"desc"},skip:F,take:U}),()=>VB.collection.count({where:{projectId:B}}),Q)}}var VXG=new rwQ;var swQ=[{key:"file_size",scope:"SYSTEM",readOnly:!0,config:{name:"File Size",type:"number",number:{scale:0}}},{key:"resolution_width",scope:"SYSTEM",readOnly:!0,config:{name:"Resolution Width",type:"number",number:{scale:0}}},{key:"resolution_height",scope:"SYSTEM",readOnly:!0,config:{name:"Resolution Height",type:"number",number:{scale:0}}},{key:"name",scope:"SYSTEM",readOnly:!0,config:{name:"Name",type:"text",text:{}}},{key:"rating",scope:"SYSTEM",readOnly:!1,config:{name:"Rating",type:"rating",rating:{maxValue:5}}},{key:"duration",scope:"SYSTEM",readOnly:!0,config:{name:"Duration",type:"number",number:{scale:0}}},{key:"bitRate",scope:"SYSTEM",readOnly:!0,config:{name:"Bit Rate",type:"number",number:{scale:1}}},{key:"frame_rate",scope:"SYSTEM",readOnly:!0,config:{name:"Frame Rate",type:"number",number:{scale:3}}},{key:"keywords",scope:"SYSTEM",readOnly:!1,config:{name:"Keywords",type:"selectMulti",selectMulti:{options:[]}}},{key:"file_type",scope:"SYSTEM",readOnly:!0,config:{name:"File Type",type:"select",select:{options:[{id:"video",displayName:"Video",color:"system"},{id:"audio",displayName:"Audio",color:"system"},{id:"image",displayName:"Image",color:"system"},{id:"document",displayName:"Document",color:"system"},{id:"file",displayName:"File",color:"system"}]}}},{key:"audio_bit_depth",scope:"SYSTEM",readOnly:!0,config:{name:"Audio Bit Depth",type:"number",number:{scale:0}}},{key:"audio_channels",scope:"SYSTEM",readOnly:!0,config:{name:"Audio Channels",type:"number",number:{scale:0}}},{key:"audio_codec",scope:"SYSTEM",readOnly:!0,config:{name:"Audio Codec",type:"text",text:{}}},{key:"audio_sample_rate",scope:"SYSTEM",readOnly:!0,config:{name:"Audio Sample Rate",type:"number",number:{scale:0}}},{key:"video_codec",scope:"SYSTEM",readOnly:!0,config:{name:"Video Codec",type:"text",text:{}}},{key:"format",scope:"SYSTEM",readOnly:!0,config:{name:"Format",type:"text",text:{}}},{key:"status",scope:"SYSTEM",readOnly:!1,config:{name:"Status",type:"select",select:{options:[{id:"needs_review",displayName:"Needs Review",color:"red"},{id:"in_progress",displayName:"In Progress",color:"yellow"},{id:"approved",displayName:"Approved",color:"green"}]}}}];class twQ{client;constructor(B=VB){this.client=B}async syncSystemFields(){await this.client.$transaction(async(B)=>{for(let Q of swQ)await B.metadataField.upsert({where:{key:Q.key},update:{scope:Q.scope,readOnly:Q.readOnly,config:Q.config},create:{key:Q.key,scope:Q.scope,readOnly:Q.readOnly??!1,config:Q.config}})})}async createTeamField(B,Q){return await this.client.metadataField.create({data:{key:NG(),scope:"TEAM",teamId:B,config:Q.config,aiAutofill:Q.aiAutofill,description:Q.description}})}async listTeamFields(B){return await this.client.metadataField.findMany({where:{OR:[{scope:"SYSTEM"},{AND:[{scope:"TEAM"},{teamId:B}]}]}})}async getFieldByKey(B){return this.client.metadataField.findUnique({where:{key:B}})}async updateTeamField(B,Q,F){let U=await this.client.metadataField.findUnique({where:{key:Q}});if(!U)throw Error("Field not found");if(U.teamId!==B)throw Error("Field does not belong to this team");return await this.client.metadataField.update({where:{id:U.id},data:{config:F.config,aiAutofill:F.aiAutofill??U.aiAutofill,description:F.description??U.description}})}async deleteTeamField(B,Q){let F=await this.client.metadataField.findUnique({where:{key:Q}});if(!F)throw Error("Field not found");if(F.teamId!==B)throw Error("Field does not belong to this team");await this.client.metadataField.delete({where:{key:Q}})}async createProjectField(B,Q){let F=await this.client.project.findUnique({where:{id:B},select:{teamId:!0}});if(!F)throw Error("Project not found");return await this.client.metadataField.create({data:{key:NG(),scope:"PROJECT",projectId:B,teamId:F.teamId,config:Q.config,aiAutofill:Q.aiAutofill,description:Q.description}})}async listProjectFields(B,Q){let F=await this.client.project.findUnique({where:{id:Q},select:{teamId:!0}});if(!F)throw Error("Project not found");let U=await this.client.metadataField.findMany({where:{OR:[{scope:"SYSTEM"},{AND:[{scope:"TEAM"},{teamId:F.teamId}]},{AND:[{scope:"PROJECT"},{projectId:Q}]}]}}),I=B?await this.getProjectFieldsOrder(B,Q):[],G=new Map;I.forEach((g,V)=>{G.set(g.fieldId,V)});let Z=new Map;I.forEach((g)=>{Z.set(g.fieldId,g.visible)});let W=U.map((g)=>({field:g,visible:Z.has(g.key)?Z.get(g.key):B===null}));return W.sort((g,V)=>{let b=G.get(g.field.key),X=G.get(V.field.key);if(b!==void 0&&X!==void 0)return b-X;if(b!==void 0)return-1;if(X!==void 0)return 1;let C=g.field.config?.name||"",N=V.field.config?.name||"";return C.localeCompare(N)}),W}async getProjectFieldsOrder(B,Q){let F=this.getProjectFieldOrderKey(B,Q),U=await this.client.systemSettings.findUnique({where:{key:F}});if(!U||!U.value)return[];return U.value}async updateProjectFieldsOrder(B,Q,F){let U=this.getProjectFieldOrderKey(B,Q);await this.client.systemSettings.upsert({where:{key:U},create:{key:U,value:F},update:{value:F}})}getProjectFieldOrderKey(B,Q){return`project_field_order:${B}:${Q}`}async updateProjectField(B,Q,F){let U=await this.client.metadataField.findUnique({where:{key:Q}});if(!U)throw Error("Field not found");if(U.projectId!==B)throw Error("Field does not belong to this project");return await this.client.metadataField.update({where:{id:U.id},data:{config:F.config,aiAutofill:F.aiAutofill??U.aiAutofill,description:F.description??U.description}})}async deleteProjectField(B,Q){let F=await this.client.metadataField.findUnique({where:{key:Q}});if(!F)throw Error("Field not found");if(F.projectId!==B)throw Error("Field does not belong to this project");await this.client.metadataField.delete({where:{key:Q}})}async updateAssetMetadata(B,Q,F=!1){let U=await TX.resolveLatestVersionId(B);await this.client.$transaction(async(I)=>{for(let G of Q){let Z=await I.metadataField.findUnique({where:{key:G.key}});if(Z?.readOnly&&!F)throw Error(`Field ${Z.key} is read-only`);let W=G.value,g=null,V=null,b=null,X=null,C=null;if(typeof W==="string"){let N=new Date(W);if(!isNaN(N.getTime())&&W.includes("T")&&W.includes("-"))C=N;else g=W}else if(typeof W==="number")V=W;else if(typeof W==="boolean")b=W;else if(W instanceof Date)C=W;else if(Array.isArray(W))X=W;else if(W===null);else if(typeof W==="object")X=W;else g=String(W);await I.assetMetadataValue.upsert({where:{assetId_fieldKey:{assetId:U,fieldKey:G.key}},create:{assetId:U,fieldKey:G.key,stringValue:g,numberValue:V,booleanValue:b,jsonValue:X,dateValue:C},update:{stringValue:g,numberValue:V,booleanValue:b,jsonValue:X,dateValue:C}})}await I.asset.update({where:{id:U},data:{updatedAt:new Date}})})}}var Ir=new twQ;class ewQ{async createProject(B,Q){if(!await VB.team.findUnique({where:{id:Q.teamId}}))throw Error("Team not found");let U=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:Q.teamId,userId:B.id}}});if(!U)throw Error("creator is not a team member");let I=await VB.$transaction(async(G)=>{let Z=await G.project.create({data:{name:Q.name,teamId:Q.teamId,enableNotification:Q.enableNotification??!0,coverImageKey:Q.coverImageKey}}),W=await G.asset.create({data:{name:"root",type:"root",status:"processed",projectId:Z.id}}),g=await G.asset.create({data:{name:"share_root",type:"share_root",status:"processed",projectId:Z.id}}),V=await G.project.update({where:{id:Z.id},data:{rootFolderId:W.id,shareRootId:g.id},include:{rootFolder:!0}});return await G.projectMember.create({data:{projectId:Z.id,teamMemberId:U.id,role:"owner"}}),V});return this.toProjectInfo(I)}async getProject(B){let Q=await VB.project.findUnique({where:{id:B},include:{rootFolder:!0}});if(!Q)throw Error("Project not found");return this.toProjectInfo(Q)}async updateProject(B){let Q=await VB.project.findUnique({where:{id:B.projectId},include:{team:!0}});if(!Q)throw Error("Project not found");if(!Q.team)throw Error("Project has no team");let F=await VB.project.update({where:{id:B.projectId},data:{name:B.name,coverImageKey:B.coverImageKey,enableNotification:B.enableNotification},include:{rootFolder:!0}});return this.toProjectInfo(F)}async listProjects(B){let Q=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:B.teamId,userId:B.userId}}});if(!Q)throw Error("failed to get team member");let F={teamId:B.teamId};if(Q.scope==="project")F.members={some:{teamMemberId:Q.id}};let U={},I=B.sortDirection==="desc"?"desc":"asc";if(B.sortBy)if(B.sortBy==="created_at")U.createdAt=I;else if(B.sortBy==="updated_at")U.updatedAt=I;else U.name=I;else U.name="asc";return await $V(async(Z,W)=>{let g=await VB.project.findMany({where:F,orderBy:U,skip:Z,take:W,include:{rootFolder:!0}});return await Promise.all(g.map((b)=>this.toProjectInfo(b)))},null,B.pagination)}async addProjectMember(B){if(!await VB.user.findUnique({where:{id:B.userId}}))throw Error("User not found");let F=await VB.project.findUnique({where:{id:B.projectId},include:{team:!0}});if(!F)throw Error("Project not found");let U=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:F.teamId,userId:B.userId}}});if(!U)throw Error("user is not a team member");await VB.projectMember.create({data:{projectId:B.projectId,teamMemberId:U.id,role:B.role}})}async listProjectMembers(B){let Q=await VB.projectMember.findMany({where:{projectId:B.projectId,...B.includeAgents?{teamMember:{user:{OR:[{type:"human"},{type:"agent",agent:{type:"chat",enabled:!0}}]}}}:{teamMember:{user:{type:{not:"agent"}}}}},include:{teamMember:{include:{user:!0}}}});return Promise.all(Q.filter((F)=>F.teamMember&&F.teamMember.user).map(async(F)=>({id:F.teamMember.user.id,name:F.teamMember.user.name,role:F.role,image:await MX(F.teamMember.user.image),scope:F.teamMember.scope})))}async deleteProject(B){let Q=await VB.project.findUnique({where:{id:B}});if(!Q)throw Error("Project not found");let F=new Date(0);if(await VB.$transaction(async(U)=>{await U.asset.updateMany({where:{projectId:B},data:{isDeleted:!0,projectId:null}});let I=[Q.rootFolderId,Q.shareRootId].filter((G)=>G!==null);if(I.length>0)await U.asset.updateMany({where:{id:{in:I}},data:{status:"trashed",deletedAt:F}});await U.project.update({where:{id:B},data:{rootFolderId:null,shareRootId:null}}),await U.project.delete({where:{id:B}})}),Q.coverImageKey){let U=process.env.S3_BUCKET||"shumai";try{await yF.deleteObject(U,Q.coverImageKey)}catch(I){console.error(`Failed to delete project cover image ${Q.coverImageKey}:`,I)}}}async getProjectRootFolder(B){let Q=await VB.project.findUnique({where:{id:B},include:{rootFolder:!0}});if(!Q)throw Error("Project not found");if(!Q.rootFolderId)return"";return Q.rootFolderId}async getProjectTeam(B){let Q=await VB.project.findUnique({where:{id:B}});if(!Q)throw Error("Project not found");return Q.teamId}async updateMemberRole(B){let Q=await VB.projectMember.findFirst({where:{projectId:B.projectId,teamMember:{userId:B.userId}}});if(!Q)throw Error("Member not found");if(Q.role==="owner")throw Error("Cannot change the role of an owner");await VB.projectMember.update({where:{id:Q.id},data:{role:B.role}})}async removeMember(B,Q){let F=await VB.projectMember.findFirst({where:{projectId:B,teamMember:{userId:Q}}});if(!F)throw Error("Member not found");if(F.role==="owner")throw Error("Cannot remove an owner");await VB.projectMember.delete({where:{id:F.id}})}async getProjectMe(B,Q){let F=await VB.user.findUnique({where:{id:Q}});if(!F)throw Error("User not found");let U=await VB.project.findUnique({where:{id:B}});if(!U)throw Error("Project not found");let I=await VB.teamMember.findUnique({where:{teamIdUserId:{teamId:U.teamId,userId:Q}}});if(!I)throw Error("User is not a team member");let G=await VB.projectMember.findFirst({where:{projectId:B,teamMemberId:I.id}}),Z=G?G.role:I.role;return{id:F.id,name:F.name,role:Z,image:await MX(F.image)}}async toProjectInfo(B){let Q={id:B.id,name:B.name,teamId:B.teamId,enableNotification:B.enableNotification??!0,coverImageKey:B.coverImageKey||void 0,updatedAt:B.updatedAt};if(B.rootFolderId)Q.rootFolder=B.rootFolderId;else if(B.rootFolder)Q.rootFolder=B.rootFolder.id;if(B.coverImageKey)try{let F=process.env.S3_BUCKET||"shumai",U=await yF.presign(F,B.coverImageKey,"GET");Q.coverImage=U}catch(F){let U=F}return Q}}var zXG=new ewQ;function Gr(B){if(!B)return[];let Q=B.toLowerCase(),F=new Set,U=Array.from(Q),I=U.length;if(I>=3)for(let G=0;G<=I-3;G++)F.add(U[G]+U[G+1]+U[G+2]);else if(I===2)F.add(U[0]+U[1]);else if(I===1)F.add(U[0]);return Array.from(F)}class tE{selectSql=gQ.sql`*`;fromSql=null;wheres=[];orderSql=null;limitCount=null;offsetCount=null;select(B){return this.selectSql=B,this}from(B){return this.fromSql=B,this}addWhere(B){return this.wheres.push(B),this}orderBy(B){return this.orderSql=B,this}limit(B){return this.limitCount=B,this}offset(B){return this.offsetCount=B,this}addSearchConditions(B,Q,F){if(!Q||Q.length===0)return this;let U=[];for(let I of Q){if(F?.skipNameContains&&I.field==="name"&&I.operator==="contains")continue;let G=this.buildSqlCondition(I.field,I.operator,I.value);if(G)U.push(G)}if(U.length>0){let I=B==="OR"?" OR ":" AND ";this.addWhere(gQ.sql`(${gQ.join(U,I)})`)}return this}build(){if(!this.fromSql)throw Error("FROM clause is required in SqlQueryBuilder");let B=[gQ.sql`SELECT`,this.selectSql,gQ.sql`FROM`,this.fromSql];if(this.wheres.length>0)B.push(gQ.sql`WHERE`),B.push(gQ.join(this.wheres," AND "));if(this.orderSql)B.push(gQ.sql`ORDER BY`),B.push(this.orderSql);if(this.limitCount!==null)B.push(gQ.sql`LIMIT ${this.limitCount}`);if(this.offsetCount!==null)B.push(gQ.sql`OFFSET ${this.offsetCount}`);return gQ.join(B," ")}isDate(B){if(B instanceof Date)return!0;if(typeof B!=="string")return!1;let Q=B.toLowerCase();if(["today","yesterday","tomorrow","one week ago","one week from now","one month ago","one month from now"].includes(Q)||Q.match(/\d+\s+days?\s+(ago|from\s+now)/))return!0;let U=new Date(B);return!isNaN(U.getTime())&&B.includes("-")}toDate(B){return this.toDateBound(B,"start")}toDateBound(B,Q){let F=this.parseRelativeDate(B);if(F instanceof Date)return F;if(F&&"gte"in F&&"lte"in F)return Q==="start"?F.gte:F.lte;return new Date(B)}parseDateRange(B){let Q=this.parseRelativeDate(B);if(Q&&"gte"in Q&&"lte"in Q)return{start:Q.gte,end:Q.lte};let F=Q instanceof Date?Q:new Date(B),U=new Date(F);U.setHours(0,0,0,0);let I=new Date(F);return I.setHours(23,59,59,999),{start:U,end:I}}parseRelativeDate(B){if(B instanceof Date)return B;let Q=String(B).toLowerCase(),F=new Date,U=(g)=>{let V=new Date(g);return V.setHours(0,0,0,0),V},I=(g)=>{let V=new Date(g);return V.setHours(23,59,59,999),V};if(Q==="today")return{gte:U(F),lte:I(F)};if(Q==="yesterday"){let g=new Date(F);return g.setDate(g.getDate()-1),{gte:U(g),lte:I(g)}}if(Q==="tomorrow"){let g=new Date(F);return g.setDate(g.getDate()+1),{gte:U(g),lte:I(g)}}if(Q==="one week ago"){let g=new Date(F);return g.setDate(g.getDate()-7),g}if(Q==="one week from now"){let g=new Date(F);return g.setDate(g.getDate()+7),g}if(Q==="one month ago"){let g=new Date(F);return g.setMonth(g.getMonth()-1),g}if(Q==="one month from now"){let g=new Date(F);return g.setMonth(g.getMonth()+1),g}let G=Q.match(/(\d+)\s+days?\s+ago/);if(G){let g=new Date(F);return g.setDate(g.getDate()-parseInt(G[1])),g}let Z=Q.match(/(\d+)\s+days?\s+from\s+now/);if(Z){let g=new Date(F);return g.setDate(g.getDate()+parseInt(Z[1])),g}let W=new Date(B);return isNaN(W.getTime())?null:W}buildEavValueMatch(B){if(typeof B==="string"){let Q=String(B);if(this.isDate(Q)){let F=this.parseRelativeDate(Q);if(F instanceof Date)return gQ.sql`date_value = ${F}`;else if(F&&"gte"in F)return gQ.sql`date_value >= ${F.gte} AND date_value <= ${F.lte}`}return gQ.sql`string_value = ${Q}`}if(typeof B==="number")return gQ.sql`number_value = ${Number(B)}`;if(typeof B==="boolean")return gQ.sql`boolean_value = ${Boolean(B)}`;if(B instanceof Date)return gQ.sql`date_value = ${B}`;if(Array.isArray(B)||typeof B==="object"&&B!==null)return gQ.sql`json_value = ${JSON.stringify(B)}::jsonb`;return gQ.sql`string_value = ${String(B)}`}buildSqlCondition(B,Q,F){let U=B==="sizeByte"||B==="size_byte"?"size_byte":B==="createdAt"||B==="created_at"?"created_at":B==="updatedAt"||B==="updated_at"?"updated_at":B,I=gQ.raw(`a."${U}"`);if(B==="name"){let G=String(F);switch(Q){case"eq":return gQ.sql`${I} = ${G}`;case"neq":return gQ.sql`${I} != ${G}`;case"contains":return gQ.sql`${I} ILIKE ${"%"+G+"%"}`;case"notContains":return gQ.sql`${I} NOT ILIKE ${"%"+G+"%"}`;case"isEmpty":return gQ.sql`${I} = ''`;case"isNotEmpty":return gQ.sql`${I} != ''`;default:throw Error(`Unsupported operator for name field: ${Q}`)}}if(B==="sizeByte"||B==="size_byte"){let G=Number(F);switch(Q){case"eq":return gQ.sql`${I} = ${G}`;case"neq":return gQ.sql`${I} != ${G}`;case"gt":return gQ.sql`${I} > ${G}`;case"gte":return gQ.sql`${I} >= ${G}`;case"lt":return gQ.sql`${I} < ${G}`;case"lte":return gQ.sql`${I} <= ${G}`;default:throw Error(`Unsupported operator for sizeByte field: ${Q}`)}}if(B==="createdAt"||B==="updatedAt"||B==="created_at"||B==="updated_at"){let G=this.toDate(F);switch(Q){case"eq":return gQ.sql`${I} = ${G}`;case"neq":return gQ.sql`${I} != ${G}`;case"gt":return gQ.sql`${I} > ${this.toDateBound(F,"end")}`;case"gte":return gQ.sql`${I} >= ${this.toDateBound(F,"start")}`;case"lt":return gQ.sql`${I} < ${this.toDateBound(F,"start")}`;case"lte":return gQ.sql`${I} <= ${this.toDateBound(F,"end")}`;case"isWithin":{let Z=this.parseDateRange(F);return gQ.sql`${I} >= ${Z.start} AND ${I} <= ${Z.end}`}default:throw Error(`Unsupported operator for date field: ${Q}`)}}switch(Q){case"isEmpty":return gQ.sql`a.id NOT IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B})`;case"isNotEmpty":return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B})`;case"eq":{let G=this.buildEavValueMatch(F);return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND ${G})`}case"neq":{let G=this.buildEavValueMatch(F);return gQ.sql`a.id NOT IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B}) OR a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND NOT (${G}))`}case"gt":return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND (number_value > ${Number(F)} OR date_value > ${this.toDateBound(F,"end")}))`;case"gte":return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND (number_value >= ${Number(F)} OR date_value >= ${this.toDateBound(F,"start")}))`;case"lt":return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND (number_value < ${Number(F)} OR date_value < ${this.toDateBound(F,"start")}))`;case"lte":return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND (number_value <= ${Number(F)} OR date_value <= ${this.toDateBound(F,"end")}))`;case"contains":return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND string_value ILIKE ${"%"+String(F)+"%"})`;case"notContains":return gQ.sql`a.id NOT IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND string_value ILIKE ${"%"+String(F)+"%"})`;case"in":{let G=Array.isArray(F)?F:[F],Z=G.map((W)=>Number(W)).filter((W)=>!isNaN(W));return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND (string_value = ANY(${G}) OR number_value = ANY(${Z}::double precision[])))`}case"notIn":{let G=Array.isArray(F)?F:[F],Z=G.map((W)=>Number(W)).filter((W)=>!isNaN(W));return gQ.sql`a.id NOT IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND (string_value = ANY(${G}) OR number_value = ANY(${Z}::double precision[])))`}case"hasAll":return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND json_value @> ${JSON.stringify(F)}::jsonb)`;case"hasAny":{let G=(Array.isArray(F)?F:[F]).map(String);return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND jsonb_exists_any(json_value, ${G}::text[]))`}case"hasNone":{let G=(Array.isArray(F)?F:[F]).map(String);return gQ.sql`a.id NOT IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND jsonb_exists_any(json_value, ${G}::text[]))`}case"isWithin":{let G=this.parseDateRange(F);return gQ.sql`a.id IN (SELECT asset_id FROM asset_metadata_values WHERE field_key = ${B} AND date_value >= ${G.start} AND date_value <= ${G.end})`}default:throw Error(`Unsupported operator for metadata field: ${Q}`)}}}class B4Q{prismaClient;assetSvc;constructor(B=VB,Q=TX){this.prismaClient=B;this.assetSvc=Q}async search(B,Q){let F=Q.recursively===!1?[B]:await this.assetSvc.getDescendantFolderIds(B),U=Q.assetType==="folder"?[AF.folder]:[AF.file,AF.version_stack];if(Q.query&&Q.isSemantic){let c=(await this.prismaClient.asset.findUnique({where:{id:B},select:{project:{select:{teamId:!0}}}}))?.project?.teamId;if(!c)throw Error("Team ID not found for folder");if(!await this.prismaClient.agent.findFirst({where:{teamId:c,type:"embedding",enabled:!0}}))throw new YI(422,{message:"Embedding agent not configured or disabled for this team."});let d=await this.prismaClient.workflowTask.create({data:{type:e0.query_embedding_for_search,teamId:c,assetId:B,payload:{projectId:"",queryEmbeddingForSearch:{text:Q.query}},status:"pending"}}),bB=(await oN.executeWait(d)).output?.embedding;if(!bB)throw Error("Failed to generate query embedding");let CB=JSON.stringify(bB),IB=new tE().select(gQ.sql`a.id as "assetId", ae.start_time as "startTime", ae.end_time as "endTime", (ae.embedding <=> ${CB}::vector) as "distance"`).from(gQ.sql`assets a JOIN asset_embeddings ae ON a.id = ae.asset_id`).addWhere(gQ.sql`a.is_deleted = false`);if(F.length>0)IB.addWhere(gQ.sql`a.parent_id = ANY(${F})`);if(Q.showSymlink)IB.addWhere(gQ.sql`
|
|
13870
13870
|
(a.type = ANY(${U}::"AssetType"[]) OR (a.type = 'symlink' AND a.target_id IN (SELECT id FROM assets WHERE type = ANY(${U}::"AssetType"[]))))
|
|
13871
13871
|
`);else IB.addWhere(gQ.sql`a.type = ANY(${U}::"AssetType"[])`);if(Q.conditions&&Q.conditions.length>0)IB.addSearchConditions(Q.operator,Q.conditions,{skipNameContains:!0});let t=Q.conditions?.find((gB)=>gB.field==="name"&&gB.operator==="contains");if(t){let gB=String(t.value),OB=Gr(gB);if(OB.length>0)IB.addWhere(gQ.sql`a.name_ngram @> ${OB}::text[]`),IB.addWhere(gQ.sql`a.name ILIKE ${"%"+gB+"%"}`);else IB.addWhere(gQ.sql`a.name ILIKE ${"%"+gB+"%"}`)}IB.orderBy(gQ.sql`distance ASC`);let ZB=Q.first||20;if(ZB<=0||ZB>200)ZB=20;let LB=0;if(Q.after)LB=Dp(Q.after);IB.limit(ZB+1).offset(LB);let NQ=IB.build(),HQ=await this.prismaClient.$queryRaw(NQ),wQ=HQ.length>ZB,hQ=wQ?HQ.slice(0,ZB):HQ,jB=Array.from(new Set(hQ.map((gB)=>gB.assetId))),lQ=await this.assetSvc.listAssetsByIds(jB),oF=new Map;for(let gB of lQ)oF.set(gB.id,gB);let E0=[];for(let gB of hQ){let OB=oF.get(gB.assetId);if(OB)E0.push({...OB,startTime:gB.startTime,endTime:gB.endTime})}let gU={},jF=new tE().select(gQ.sql`COUNT(*)`).from(gQ.sql`assets a JOIN asset_embeddings ae ON a.id = ae.asset_id`).addWhere(gQ.sql`a.is_deleted = false`);if(F.length>0)jF.addWhere(gQ.sql`a.parent_id = ANY(${F})`);if(Q.showSymlink)jF.addWhere(gQ.sql`
|
|
13872
13872
|
(a.type = ANY(${U}::"AssetType"[]) OR (a.type = 'symlink' AND a.target_id IN (SELECT id FROM assets WHERE type = ANY(${U}::"AssetType"[]))))
|
|
@@ -13910,7 +13910,7 @@ Most of the features of Better Auth will not work correctly.`);let g=Q.secrets??
|
|
|
13910
13910
|
`;if(F.length===0)throw new bm("Asset is not shared");let U=F[0].shareRootId,I=await VB.shareLink.findUnique({where:{rootFolderId:U}});if(!I)throw new bm("Share link not found for this asset");if(I.isDisabled)throw new Zr("Share link is disabled");if(I.expireAt&&I.expireAt<new Date)throw new Wr("Share link has expired");if(I.password&&I.password!==Q)throw new gr("Invalid password for share link");return I}async toShareLinkInfo(B){let Q=B.expireAt?new Date(B.expireAt)<new Date:!1,F=B.creator?await MX(B.creator.image):void 0;return{id:B.id,name:B.name,expireAt:B.expireAt?.toISOString(),isDisabled:B.isDisabled,hasPassword:!!B.password,password:B.password,defaultSortOrder:B.defaultSortOrder,viewMode:B.viewMode,fieldVisibility:B.fieldVisibility,rootFolderId:B.rootFolderId,projectId:B.projectId,isExpired:Q,createdAt:B.createdAt.toISOString(),updatedAt:B.updatedAt.toISOString(),creator:B.creator?{id:B.creator.id,name:B.creator.name,image:F}:null}}}var oXG=new Q4Q;var GLB=Pb(V2B(),1);import*as U4Q from"crypto";var q6F=(B)=>B.replace(/\r\n/g,`
|
|
13911
13911
|
`).replace(/\r/g,`
|
|
13912
13912
|
`),j6F=(B)=>{let Q=q6F(B);if(!Q.startsWith("---"))return{yamlString:null,body:Q};let F=Q.indexOf(`
|
|
13913
|
-
---`,3);if(F===-1)return{yamlString:null,body:Q};return{yamlString:Q.slice(4,F),body:Q.slice(F+4).trim()}},F4Q=(B)=>{let{yamlString:Q,body:F}=j6F(B);if(!Q)return{frontmatter:{},body:F};return{frontmatter:lh(Q)??{},body:F}};class I4Q{prismaClient;constructor(B=VB){this.prismaClient=B}async upsertSkill(B,Q){let F,U;if(Q.githubUrl){let{downloadUrl:C,path:N}=this.parseGithubUrl(Q.githubUrl);U=N,F=await this.downloadGithubZip(C)}else if(Q.assetId){let C=await this.prismaClient.asset.findUnique({where:{id:Q.assetId},include:{storageKey:!0}}),N=C?.storageKey?.key;if(!C||!N)throw Error("Asset not found or has no key");let{buffer:R}=await yF.getObject(process.env.S3_BUCKET||"shumai",N);F=R}else throw Error("Either assetId or githubUrl must be provided");let{name:I,description:G,repackedZip:Z}=await this.processSkillZip(F,U);if(await this.prismaClient.skill.findUnique({where:{teamId_name:{teamId:B,name:I}}})&&!Q.override){let C=Error(`Skill with name "${I}" already exists.`);throw C.name="ConflictError",C}let g=U4Q.createHash("sha256").update(Z).digest("hex"),V=`skills/${NG()}.zip`;await yF.putObject(process.env.S3_BUCKET||"shumai",V,Z,Z.length,"application/zip");let b=await this.prismaClient.asset.create({data:{name:`${I}.zip`,storageKey:{create:{key:V}},type:"file",mediaType:"application/zip",sizeByte:Z.length,status:"uploaded"}}),X=await this.prismaClient.skill.upsert({where:{teamId_name:{teamId:B,name:I}},update:{description:G,assetId:b.id,hash:g},create:{name:I,description:G,assetId:b.id,hash:g,teamId:B}});return this.toSkillInfo(X)}async deleteSkill(B){if(!await this.prismaClient.skill.findUnique({where:{id:B}}))return;await this.prismaClient.skill.delete({where:{id:B}})}async updateSkillConfig(B,Q){let F=await this.prismaClient.skill.update({where:{id:B},data:{config:Q}});return this.toSkillInfo(F)}async listSkills(B){return(await this.prismaClient.skill.findMany({where:{teamId:B},orderBy:{id:"desc"}})).map((F)=>this.toSkillInfo(F))}parseGithubUrl(B){let F=new URL(B).pathname.split("/").filter(Boolean);if(F.length<2)throw Error("Invalid GitHub URL: missing owner or repo");let U=F[0],I=F[1],G="main",Z;if(F.length>2)if(F[2]==="tree"||F[2]==="blob"){if(F.length<4)throw Error("Invalid GitHub URL: missing ref or path");G=F[3],Z=F.slice(4).join("/")}else Z=F.slice(2).join("/");return{downloadUrl:`https://codeload.github.com/${U}/${I}/zip/refs/heads/${G}`,path:Z}}async downloadGithubZip(B){let Q=await fetch(B);if(!Q.ok){if(B.endsWith("/refs/heads/main")){let F=B.replace("/refs/heads/main","/refs/heads/master"),U=await fetch(F);if(U.ok)return Buffer.from(await U.arrayBuffer())}throw Error(`Failed to download GitHub ZIP from ${B}`)}return Buffer.from(await Q.arrayBuffer())}async processSkillZip(B,Q){let U=new GLB.default(B).getEntries();if(U.length===0)throw Error("The provided ZIP file is empty");let G=U[0].entryName.split("/")[0],Z=U.every((A)=>A.entryName.startsWith(`${G}/`)),W=Q||"";if(W.toLowerCase().endsWith("skill.md"))W=W.substring(0,W.toLowerCase().lastIndexOf("skill.md"));let g="";if(Z)g=W?`${G}/${W.replace(/\/$/,"")}/`:`${G}/`;else g=W?`${W.replace(/\/$/,"")}/`:"";let V=U.find((A)=>{let Y=A.entryName.toLowerCase(),L=g.toLowerCase();return Y.startsWith(L)&&Y.endsWith("skill.md")});if(!V)throw Error(`SKILL.md not found in ${Q||"root"}`);let b=V.getData().toString("utf8"),{name:X,description:C}=this.parseSkillMd(b),N=new GLB.default,R=V.entryName.substring(0,V.entryName.toLowerCase().lastIndexOf("skill.md"));for(let A of U){if(A.isDirectory)continue;if(A.entryName.startsWith(R)){let Y=A.entryName.substring(R.length);N.addFile(Y,A.getData())}}return{name:X,description:C,repackedZip:N.toBuffer()}}parseSkillMd(B){let{frontmatter:Q}=F4Q(B),F=Q.name||"Unnamed Skill",U=Q.description||"";return{name:F,description:U}}toSkillInfo(B){return{id:B.id,name:B.name,description:B.description,config:B.config,assetId:B.assetId,hash:B.hash,createdAt:B.createdAt.toISOString(),updatedAt:B.updatedAt.toISOString()}}}var UCG=new I4Q;import{execFile as n6F}from"child_process";import*as qA from"fs";import*as Z4Q from"os";import*as uX from"path";import Xm from"sharp";import{promisify as i6F}from"util";var ZLB={apch:"Apple ProRes 422 High Quality",apcn:"Apple ProRes 422 Standard Definition",apcs:"Apple ProRes 422 LT",apco:"Apple ProRes 422 Proxy",ap4h:"Apple ProRes 4444",jpeg:"JPEG Image","3gvo":"3GPP Video Orientation",a3d1:"Multiview Video Coding",a3d2:"Multiview Video Coding",a3d3:"Multiview Video Coding",a3d4:"Multiview Video Coding",a3ds:"Auro-Cx 3D audio","ac-3":"AC-3 audio","ac-4":"AC-4 audio",alac:"Apple lossless audio codec",alaw:"a-Law",av01:"AV1 video",avc1:"Advanced Video Coding",avc2:"Advanced Video Coding",avc3:"Advanced Video Coding",avc4:"Advanced Video Coding",avcp:"Advanced Video Coding Parameters",dra1:"DRA Audio",drac:"Dirac Video Coder","dts-":"Dependent base layer for DTS layered audio","dts+":"Enhancement layer for DTS layered audio",dtsc:"DTS Coherent Acoustics audio",dtse:"DTS Express low bit rate audio, also known as DTS LBR",dtsh:"DTS-HD High Resolution Audio",dtsl:"DTS-HD Master Audio",dtsx:"DTS:X",dvav:"AVC-based \u201CDolby Vision\u201D",dvhe:"HEVC-based \u201CDolby Vision\u201D","ec-3":"Enhanced AC-3 audio",enca:"Encrypted/Protected audio",encf:"Encrypted/Protected font",encm:"Encrypted/Protected metadata stream",encs:"Encrypted Systems stream",enct:"Encrypted Text",encv:"Encrypted/protected video",fdp:"File delivery hints",fLaC:"Fres Lossless Audio Codec",g719:"ITU-T Recommendation G.719 (2008)",g726:"ITU-T Recommendation G.726 (1990)",hev1:"High Efficiency Video Coding",hvc1:"High Efficiency Video Coding",hvt1:"High Efficiency Video Coding",ixse:"DVB Track Level Index Track",lhe1:"Layered High Efficiency Video Coding",lht1:"Layered High Efficiency Video Coding",lhv1:"Layered High Efficiency Video Coding",m2ts:"MPEG-2 transport stream for DMB",m4ae:"MPEG-4 Audio Enhancement MP4v1/2",mett:"Text timed metadata that is not XML",metx:"XML timed metadata",mha1:"MPEG-H Audio (single stream, uncapsulated)",mha2:"MPEG-H Audio (multi-stream, unencapsulated)",mhm1:"MPEG-H Audio (single stream, MHAS encapsulated)",mhm2:"MPEG-H Audio (multi-stream, MHAS encapsulated)",mjp2:"Motion JPEG 2000",mlix:"DVB Movie level index track",mlpa:"MLP Audio",mp4a:"MPEG-4 Audio",mp4s:"MPEG-4 Systems",mp4v:"MPEG-4 Visual",mvc1:"Multiview coding",mvc2:"Multiview coding",mvc3:"Multiview coding",mvc4:"Multiview coding",mvd1:"Multiview coding",mvd2:"Multiview coding",mvd3:"Multiview coding",mvd4:"Multiview coding",oksd:"OMA Keys",Opus:"Opus audio coding",pm2t:"Protected MPEG-2 Transport",prtp:"Protected RTP Reception",raw:"Uncompressed audio",resv:"Restricted Video",rm2t:"MPEG-2 Transport Reception",rrtp:"RTP reception",rsrp:"SRTP Reception",rtmd:"Real Time Metadata Sample Entry(XAVC Format)",rtp:"RTP Hints",s263:"ITU H.263 video (3GPP format)",samr:"Narrowband AMR voice",sawb:"Wideband AMR voice",sawp:"Extended AMR-WB (AMR-WB+)",sevc:"EVRC Voice",sm2t:"MPEG-2 Transport Server",sqcp:"13K Voice",srtp:"SRTP Hints",ssmv:"SMV Voice",STGS:"Subtitle Sample Entry (HMMP)",stpp:"Subtitles (Timed Text)",svc1:"Scalable Video Coding",svc2:"Scalable Video Coding",svcM:"SVC Metadata",tc64:"64 bit timecode samples",tmcd:"32 bit timecode samples",twos:"Uncompressed 16-bit audio",tx3g:"Timed Text stream",ulaw:"Samples have been compressed using uLaw 2:1.",unid:"Dynamic Range Control (DRC) data",urim:"Binary timed metadata identified by URI","vc-1":"SMPTE VC-1",vp08:"VP8 video",vp09:"VP9 video",wvtt:"WebVTT"};var Cm=i6F(n6F);class W4Q{prismaClient;constructor(B=VB){this.prismaClient=B}resolveCodecName(B){let Q=B.mime_codec_string||B.tags?.mime_codec_string;if(Q&&typeof Q==="string"){let F=Q.split(".")[0];if(ZLB[F])return ZLB[F]}return B.codec_name}safeParseInt(B){if(B===void 0||B===null)return;let Q=typeof B==="string"?parseInt(B,10):B;return Number.isFinite(Q)?Q:void 0}async getVideoInfo(B){let{stdout:Q}=await Cm("ffprobe",["-v","quiet","-print_format","json","-show_format","-show_streams",B]),F=JSON.parse(Q),U=F.streams.find((W)=>W.codec_type==="video"),I=F.streams.find((W)=>W.codec_type==="audio");if(!U)throw Error("No video stream found");let G=U.r_frame_rate.split("/"),Z=parseFloat(G[0])/parseFloat(G[1]);return{originalWidth:U.width,originalHeight:U.height,duration:parseFloat(F.format.duration),bitRate:parseFloat(F.format.bit_rate),frameRate:Z,hasAudio:!!I,videoCodec:this.resolveCodecName(U),audioCodec:I?this.resolveCodecName(I):void 0,audioChannels:I?.channels,audioSampleRate:this.safeParseInt(I?.sample_rate),audioBitDepth:this.safeParseInt(I?.bits_per_raw_sample)??this.safeParseInt(I?.bits_per_sample),mimeType:""}}async getImageInfo(B){let Q=B;if(B.startsWith("http")){let U=await fetch(B);if(!U.ok)throw Error(`Failed to fetch image from ${B}: ${U.statusText}`);Q=Buffer.from(await U.arrayBuffer())}let F=await Xm(Q,{limitInputPixels:!1}).metadata();return{originalWidth:F.width||0,originalHeight:F.height||0,duration:0,bitRate:0,frameRate:0,hasAudio:!1,mimeType:F.format||""}}async transcodeVideo(B){let Q=`[0:v]scale=w=${B.width}:h=${B.height}:force_original_aspect_ratio=decrease,scale=w='trunc(iw/2)*2':h='trunc(ih/2)*2'`;if(B.frameRate)Q+=`,fps=${B.frameRate}`;Q+="[vout]";let F=["-i",B.inputFile,"-filter_complex",Q,"-map","[vout]"];if(!B.disableAudio)F.push("-map","0:a?");if(F.push("-c:v","libx264","-preset","fast","-crf","23"),!B.disableAudio)F.push("-c:a","aac","-b:a","128k");F.push("-movflags","+faststart","-max_muxing_queue_size","1024",B.outputFile),await Cm("ffmpeg",["-y","-loglevel","warning",...F])}async transcodeImage(B,Q,F,U,I=null){let G=B;if(typeof B==="string"&&B.startsWith("http")){let b=await fetch(B);if(!b.ok)throw Error(`Failed to fetch image from ${B}: ${b.statusText}`);G=Buffer.from(await b.arrayBuffer())}let Z=Xm(G,{limitInputPixels:!1}),W=7680,g=F>0?Math.min(F,W):W,V=I&&I>0?Math.min(I,W):W;Z.resize(g,V,{withoutEnlargement:!0,fit:"inside"}),await Z.webp({quality:U}).toFile(Q)}async generateSprite(B,Q,F,U){let G=`[0:v]fps=${100/U},scale=w=480:h=-2,tile=10x10[sprite_out];[0:v]scale=-2:720:force_original_aspect_ratio=decrease,select='eq(n\\,0)'[thumb_out]`;await Cm("ffmpeg",["-y","-loglevel","warning",...["-i",B,"-filter_complex",G,"-map","[sprite_out]","-frames:v","1","-c:v","libwebp","-q:v","75",Q,"-map","[thumb_out]","-c:v","libwebp","-q:v","75","-frames:v","1","-max_muxing_queue_size","1024",F]])}async extractAudio(B,Q,F){await Cm("ffmpeg",["-y","-loglevel","warning",...["-i",B,"-vn","-acodec","libmp3lame","-b:a",F,Q]])}async extractVideoFrames(B){if(B.isImage){let Z=uX.join(B.outputDir,"1.webp");return await this.transcodeImage(B.inputFile,Z,-1,80,B.frameHeight),[Z]}let Q=await this.getVideoInfo(B.inputFile),F=B.numFrames/Q.duration,U=uX.join(B.outputDir,"%d.webp"),I=["-i",B.inputFile,"-vf",`fps=${F},scale=-2:${B.frameHeight}`,"-c:v","libwebp","-q:v","80",U];return await Cm("ffmpeg",["-y","-loglevel","warning",...I]),qA.readdirSync(B.outputDir).filter((Z)=>Z.endsWith(".webp")).sort((Z,W)=>{let g=parseInt(uX.basename(Z,".webp")),V=parseInt(uX.basename(W,".webp"));return g-V}).map((Z)=>uX.join(B.outputDir,Z))}createTempDir(B){return qA.mkdtempSync(uX.join(Z4Q.tmpdir(),B))}removeDir(B){qA.rmSync(B,{recursive:!0,force:!0})}async createVideoTranscodeTask(B,Q,F){return this.prismaClient.workflowTask.create({data:{assetId:B,projectId:Q,type:e0.transcode,status:$I.pending,payload:{projectId:Q,transcode:F}}})}async createImageTranscodeTask(B,Q,F){return this.prismaClient.workflowTask.create({data:{assetId:B,projectId:Q,type:e0.transcode,status:$I.pending,payload:{projectId:Q,transcode:F}}})}async takeScreenshots(B){let Q=process.env.S3_BUCKET||"shumai",F=this.createTempDir("screenshot-"),U=uX.join(F,uX.basename(B.assetKey));try{await yF.downloadToFile(Q,B.assetKey,U);let I=[];if(B.count<=1)I=[B.start];else{let W=(B.end-B.start)/B.count;I=Array.from({length:B.count},(g,V)=>B.start+V*W)}let G=B.commentTimestamp;if(G!==void 0&&G!==null){if(G>=B.start&&G<=B.end){let W=0,g=Math.abs(I[0]-G);for(let V=1;V<I.length;V++){let b=Math.abs(I[V]-G);if(b<g)g=b,W=V}I[W]=G}}let Z=[];for(let W of I){let g=`shot-${W.toFixed(3)}-${NG()}.webp`,V=uX.join(F,g),b=["-ss",W.toFixed(3),"-i",U,"-vframes","1","-vf","scale=-2:720","-c:v","libwebp","-q:v","80",V];if(await Cm("ffmpeg",["-y","-loglevel","warning",...b]),G!==void 0&&G!==null&&W===G&&B.annotations&&B.annotations.length>0){let N=await Xm(V,{limitInputPixels:!1}).metadata(),R=N.width||1280,A=N.height||720,Y=G4Q(R,A,B.annotations),L=uX.join(F,`composite-${g}`);await Xm(V,{limitInputPixels:!1}).composite([{input:Buffer.from(Y),top:0,left:0}]).toFile(L),qA.renameSync(L,V)}let X=`files/${B.assetId}/screenshots/${g}`,C=qA.readFileSync(V);await yF.putObject(Q,X,C,C.length,"image/webp"),Z.push({key:X,timestamp:W})}return Z}finally{this.removeDir(F)}}async overlayAnnotations(B){let Q=process.env.S3_BUCKET||"shumai",F=this.createTempDir("annotation-"),U=uX.join(F,uX.basename(B.assetKey));try{await yF.downloadToFile(Q,B.assetKey,U);let I=await Xm(U,{limitInputPixels:!1}).metadata(),G=I.width||1920,Z=I.height||1080,W=G4Q(G,Z,B.annotations),g=`annotation-${NG()}.webp`,V=uX.join(F,g);await Xm(U,{limitInputPixels:!1}).composite([{input:Buffer.from(W),top:0,left:0}]).resize(16383,16383,{fit:"inside",withoutEnlargement:!0}).webp({quality:90}).toFile(V);let b=`files/${B.assetId}/annotations/${g}`,X=qA.readFileSync(V);return await yF.putObject(Q,b,X,X.length,"image/webp"),b}finally{this.removeDir(F)}}}function G4Q(B,Q,F){let U=Math.max(2,Math.round(Math.max(B,Q)*0.004)),I=[];for(let G of F){let Z=G.color||"#ff0000";switch(G.type){case"box":{if(G.points.length<2)continue;let[g,V]=G.points,b=Math.min(g[0],V[0])*B,X=Math.min(g[1],V[1])*Q,C=Math.abs(V[0]-g[0])*B,N=Math.abs(V[1]-g[1])*Q;I.push(`<rect x="${b}" y="${X}" width="${C}" height="${N}" stroke="${Z}" stroke-width="${U}" fill="none" />`);break}case"line":case"freehand":{if(G.points.length<2)continue;let g=G.points.map(([V,b])=>`${V*B},${b*Q}`).join(" ");I.push(`<polyline points="${g}" stroke="${Z}" stroke-width="${U}" stroke-linecap="round" stroke-linejoin="round" fill="none" />`);break}case"arrow":{if(G.points.length<2)continue;let g=G.points.map(([w,M])=>[w*B,M*Q]),V=g.map(([w,M])=>`${w},${M}`).join(" ");I.push(`<polyline points="${V}" stroke="${Z}" stroke-width="${U}" stroke-linecap="round" stroke-linejoin="round" fill="none" />`);let b=g[g.length-1],X=g[g.length-2],C=b[0]-X[0],N=b[1]-X[1],R=Math.atan2(N,C),A=Math.max(12,Math.max(B,Q)*0.015),Y=b[0]-A*Math.cos(R-Math.PI/6),L=b[1]-A*Math.sin(R-Math.PI/6),H=b[0]-A*Math.cos(R+Math.PI/6),J=b[1]-A*Math.sin(R+Math.PI/6);I.push(`<polygon points="${b[0]},${b[1]} ${Y},${L} ${H},${J}" fill="${Z}" />`);break}}}return`<svg width="${B}" height="${Q}" viewBox="0 0 ${B} ${Q}" xmlns="http://www.w3.org/2000/svg">${I.join(`
|
|
13913
|
+
---`,3);if(F===-1)return{yamlString:null,body:Q};return{yamlString:Q.slice(4,F),body:Q.slice(F+4).trim()}},F4Q=(B)=>{let{yamlString:Q,body:F}=j6F(B);if(!Q)return{frontmatter:{},body:F};return{frontmatter:lh(Q)??{},body:F}};class I4Q{prismaClient;constructor(B=VB){this.prismaClient=B}async upsertSkill(B,Q){let F,U;if(Q.githubUrl){let{downloadUrl:C,path:N}=this.parseGithubUrl(Q.githubUrl);U=N,F=await this.downloadGithubZip(C)}else if(Q.assetId){let C=await this.prismaClient.asset.findUnique({where:{id:Q.assetId},include:{storageKey:!0}}),N=C?.storageKey?.key;if(!C||!N)throw Error("Asset not found or has no key");let{buffer:R}=await yF.getObject(process.env.S3_BUCKET||"shumai",N);F=R}else throw Error("Either assetId or githubUrl must be provided");let{name:I,description:G,repackedZip:Z}=await this.processSkillZip(F,U);if(await this.prismaClient.skill.findUnique({where:{teamId_name:{teamId:B,name:I}}})&&!Q.override){let C=Error(`Skill with name "${I}" already exists.`);throw C.name="ConflictError",C}let g=U4Q.createHash("sha256").update(Z).digest("hex"),V=`skills/${NG()}.zip`;await yF.putObject(process.env.S3_BUCKET||"shumai",V,Z,Z.length,"application/zip");let b=await this.prismaClient.asset.create({data:{name:`${I}.zip`,storageKey:{create:{key:V}},type:"file",mediaType:"application/zip",sizeByte:Z.length,status:"uploaded"}}),X=await this.prismaClient.skill.upsert({where:{teamId_name:{teamId:B,name:I}},update:{description:G,assetId:b.id,hash:g},create:{name:I,description:G,assetId:b.id,hash:g,teamId:B}});return this.toSkillInfo(X)}async deleteSkill(B){if(!await this.prismaClient.skill.findUnique({where:{id:B}}))return;await this.prismaClient.skill.delete({where:{id:B}})}async updateSkillConfig(B,Q){let F=await this.prismaClient.skill.update({where:{id:B},data:{config:Q}});return this.toSkillInfo(F)}async listSkills(B){return(await this.prismaClient.skill.findMany({where:{teamId:B},orderBy:{id:"desc"}})).map((F)=>this.toSkillInfo(F))}parseGithubUrl(B){let F=new URL(B).pathname.split("/").filter(Boolean);if(F.length<2)throw Error("Invalid GitHub URL: missing owner or repo");let U=F[0],I=F[1],G="main",Z;if(F.length>2)if(F[2]==="tree"||F[2]==="blob"){if(F.length<4)throw Error("Invalid GitHub URL: missing ref or path");G=F[3],Z=F.slice(4).join("/")}else Z=F.slice(2).join("/");return{downloadUrl:`https://codeload.github.com/${U}/${I}/zip/refs/heads/${G}`,path:Z}}async downloadGithubZip(B){let Q=await fetch(B);if(!Q.ok){if(B.endsWith("/refs/heads/main")){let F=B.replace("/refs/heads/main","/refs/heads/master"),U=await fetch(F);if(U.ok)return Buffer.from(await U.arrayBuffer())}throw Error(`Failed to download GitHub ZIP from ${B}`)}return Buffer.from(await Q.arrayBuffer())}async processSkillZip(B,Q){let U=new GLB.default(B).getEntries();if(U.length===0)throw Error("The provided ZIP file is empty");let G=U[0].entryName.split("/")[0],Z=U.every((A)=>A.entryName.startsWith(`${G}/`)),W=Q||"";if(W.toLowerCase().endsWith("skill.md"))W=W.substring(0,W.toLowerCase().lastIndexOf("skill.md"));let g="";if(Z)g=W?`${G}/${W.replace(/\/$/,"")}/`:`${G}/`;else g=W?`${W.replace(/\/$/,"")}/`:"";let V=U.find((A)=>{let Y=A.entryName.toLowerCase(),L=g.toLowerCase();return Y.startsWith(L)&&Y.endsWith("skill.md")});if(!V)throw Error(`SKILL.md not found in ${Q||"root"}`);let b=V.getData().toString("utf8"),{name:X,description:C}=this.parseSkillMd(b),N=new GLB.default,R=V.entryName.substring(0,V.entryName.toLowerCase().lastIndexOf("skill.md"));for(let A of U){if(A.isDirectory)continue;if(A.entryName.startsWith(R)){let Y=A.entryName.substring(R.length);N.addFile(Y,A.getData())}}return{name:X,description:C,repackedZip:N.toBuffer()}}parseSkillMd(B){let{frontmatter:Q}=F4Q(B),F=Q.name||"Unnamed Skill",U=Q.description||"";return{name:F,description:U}}toSkillInfo(B){return{id:B.id,name:B.name,description:B.description,config:B.config,assetId:B.assetId,hash:B.hash,createdAt:B.createdAt.toISOString(),updatedAt:B.updatedAt.toISOString()}}}var UCG=new I4Q;import{execFile as n6F}from"child_process";import*as qA from"fs";import*as Z4Q from"os";import*as uX from"path";import Xm from"sharp";import{promisify as i6F}from"util";var ZLB={apch:"Apple ProRes 422 High Quality",apcn:"Apple ProRes 422 Standard Definition",apcs:"Apple ProRes 422 LT",apco:"Apple ProRes 422 Proxy",ap4h:"Apple ProRes 4444",jpeg:"JPEG Image","3gvo":"3GPP Video Orientation",a3d1:"Multiview Video Coding",a3d2:"Multiview Video Coding",a3d3:"Multiview Video Coding",a3d4:"Multiview Video Coding",a3ds:"Auro-Cx 3D audio","ac-3":"AC-3 audio","ac-4":"AC-4 audio",alac:"Apple lossless audio codec",alaw:"a-Law",av01:"AV1 video",avc1:"Advanced Video Coding",avc2:"Advanced Video Coding",avc3:"Advanced Video Coding",avc4:"Advanced Video Coding",avcp:"Advanced Video Coding Parameters",dra1:"DRA Audio",drac:"Dirac Video Coder","dts-":"Dependent base layer for DTS layered audio","dts+":"Enhancement layer for DTS layered audio",dtsc:"DTS Coherent Acoustics audio",dtse:"DTS Express low bit rate audio, also known as DTS LBR",dtsh:"DTS-HD High Resolution Audio",dtsl:"DTS-HD Master Audio",dtsx:"DTS:X",dvav:"AVC-based \u201CDolby Vision\u201D",dvhe:"HEVC-based \u201CDolby Vision\u201D","ec-3":"Enhanced AC-3 audio",enca:"Encrypted/Protected audio",encf:"Encrypted/Protected font",encm:"Encrypted/Protected metadata stream",encs:"Encrypted Systems stream",enct:"Encrypted Text",encv:"Encrypted/protected video",fdp:"File delivery hints",fLaC:"Fres Lossless Audio Codec",g719:"ITU-T Recommendation G.719 (2008)",g726:"ITU-T Recommendation G.726 (1990)",hev1:"High Efficiency Video Coding",hvc1:"High Efficiency Video Coding",hvt1:"High Efficiency Video Coding",ixse:"DVB Track Level Index Track",lhe1:"Layered High Efficiency Video Coding",lht1:"Layered High Efficiency Video Coding",lhv1:"Layered High Efficiency Video Coding",m2ts:"MPEG-2 transport stream for DMB",m4ae:"MPEG-4 Audio Enhancement MP4v1/2",mett:"Text timed metadata that is not XML",metx:"XML timed metadata",mha1:"MPEG-H Audio (single stream, uncapsulated)",mha2:"MPEG-H Audio (multi-stream, unencapsulated)",mhm1:"MPEG-H Audio (single stream, MHAS encapsulated)",mhm2:"MPEG-H Audio (multi-stream, MHAS encapsulated)",mjp2:"Motion JPEG 2000",mlix:"DVB Movie level index track",mlpa:"MLP Audio",mp4a:"MPEG-4 Audio",mp4s:"MPEG-4 Systems",mp4v:"MPEG-4 Visual",mvc1:"Multiview coding",mvc2:"Multiview coding",mvc3:"Multiview coding",mvc4:"Multiview coding",mvd1:"Multiview coding",mvd2:"Multiview coding",mvd3:"Multiview coding",mvd4:"Multiview coding",oksd:"OMA Keys",Opus:"Opus audio coding",pm2t:"Protected MPEG-2 Transport",prtp:"Protected RTP Reception",raw:"Uncompressed audio",resv:"Restricted Video",rm2t:"MPEG-2 Transport Reception",rrtp:"RTP reception",rsrp:"SRTP Reception",rtmd:"Real Time Metadata Sample Entry(XAVC Format)",rtp:"RTP Hints",s263:"ITU H.263 video (3GPP format)",samr:"Narrowband AMR voice",sawb:"Wideband AMR voice",sawp:"Extended AMR-WB (AMR-WB+)",sevc:"EVRC Voice",sm2t:"MPEG-2 Transport Server",sqcp:"13K Voice",srtp:"SRTP Hints",ssmv:"SMV Voice",STGS:"Subtitle Sample Entry (HMMP)",stpp:"Subtitles (Timed Text)",svc1:"Scalable Video Coding",svc2:"Scalable Video Coding",svcM:"SVC Metadata",tc64:"64 bit timecode samples",tmcd:"32 bit timecode samples",twos:"Uncompressed 16-bit audio",tx3g:"Timed Text stream",ulaw:"Samples have been compressed using uLaw 2:1.",unid:"Dynamic Range Control (DRC) data",urim:"Binary timed metadata identified by URI","vc-1":"SMPTE VC-1",vp08:"VP8 video",vp09:"VP9 video",wvtt:"WebVTT"};var Cm=i6F(n6F);class W4Q{prismaClient;constructor(B=VB){this.prismaClient=B}resolveCodecName(B){let Q=B.mime_codec_string||B.tags?.mime_codec_string;if(Q&&typeof Q==="string"){let F=Q.split(".")[0];if(ZLB[F])return ZLB[F]}return B.codec_name}safeParseInt(B){if(B===void 0||B===null)return;let Q=typeof B==="string"?parseInt(B,10):B;return Number.isFinite(Q)?Q:void 0}async getVideoInfo(B){let{stdout:Q}=await Cm("ffprobe",["-v","quiet","-print_format","json","-show_format","-show_streams",B]),F=JSON.parse(Q),U=F.streams.find((V)=>V.codec_type==="video"),I=F.streams.find((V)=>V.codec_type==="audio");if(!U)throw Error("No video stream found");let G=0;if(U.avg_frame_rate){let V=U.avg_frame_rate.split("/");if(V.length===2){let b=parseFloat(V[0]),X=parseFloat(V[1]);if(X>0)G=b/X}}if(G===0&&U.r_frame_rate){let V=U.r_frame_rate.split("/");if(V.length===2){let b=parseFloat(V[0]),X=parseFloat(V[1]);if(X>0)G=b/X}}let Z=parseFloat(F.format.duration),W=0;if(U.nb_frames)W=parseInt(U.nb_frames,10);if(!W&&G>0&&!isNaN(Z))W=Math.round(Z*G);let g=U.tags?.timecode||F.format?.tags?.timecode;return{originalWidth:U.width,originalHeight:U.height,duration:Z,bitRate:parseFloat(F.format.bit_rate),frameRate:G||30,totalFrames:W||0,startTimecode:g,hasAudio:!!I,videoCodec:this.resolveCodecName(U),audioCodec:I?this.resolveCodecName(I):void 0,audioChannels:I?.channels,audioSampleRate:this.safeParseInt(I?.sample_rate),audioBitDepth:this.safeParseInt(I?.bits_per_raw_sample)??this.safeParseInt(I?.bits_per_sample),mimeType:""}}async getImageInfo(B){let Q=B;if(B.startsWith("http")){let U=await fetch(B);if(!U.ok)throw Error(`Failed to fetch image from ${B}: ${U.statusText}`);Q=Buffer.from(await U.arrayBuffer())}let F=await Xm(Q,{limitInputPixels:!1}).metadata();return{originalWidth:F.width||0,originalHeight:F.height||0,duration:0,bitRate:0,frameRate:0,totalFrames:0,startTimecode:void 0,hasAudio:!1,mimeType:F.format||""}}async transcodeVideo(B){let Q=`[0:v]scale=w=${B.width}:h=${B.height}:force_original_aspect_ratio=decrease,scale=w='trunc(iw/2)*2':h='trunc(ih/2)*2'`;if(B.frameRate)Q+=`,fps=${B.frameRate}`;Q+="[vout]";let F=["-i",B.inputFile,"-filter_complex",Q,"-map","[vout]"];if(B.frameRate){let U;if(typeof B.frameRate==="number")U=B.frameRate;else{let I=B.frameRate.split("/");if(I.length===2)U=parseFloat(I[0])/parseFloat(I[1]);else U=parseFloat(B.frameRate)}if(Number.isFinite(U)&&U>0){let I=Math.max(1,Math.round(U));F.push("-r",U.toString(),"-g",I.toString(),"-force_key_frames","expr:gte(t,n_forced*1)")}}if(!B.disableAudio)F.push("-map","0:a?");if(F.push("-c:v","libx264","-preset","fast","-crf","26"),!B.disableAudio)F.push("-c:a","aac","-b:a","128k");F.push("-movflags","+faststart","-max_muxing_queue_size","1024",B.outputFile),await Cm("ffmpeg",["-y","-loglevel","warning",...F])}async transcodeImage(B,Q,F,U,I=null){let G=B;if(typeof B==="string"&&B.startsWith("http")){let b=await fetch(B);if(!b.ok)throw Error(`Failed to fetch image from ${B}: ${b.statusText}`);G=Buffer.from(await b.arrayBuffer())}let Z=Xm(G,{limitInputPixels:!1}),W=7680,g=F>0?Math.min(F,W):W,V=I&&I>0?Math.min(I,W):W;Z.resize(g,V,{withoutEnlargement:!0,fit:"inside"}),await Z.webp({quality:U}).toFile(Q)}async generateSprite(B,Q,F,U){let G=`[0:v]fps=${100/U},scale=w=480:h=-2,tile=10x10[sprite_out];[0:v]scale=-2:720:force_original_aspect_ratio=decrease,select='eq(n\\,0)'[thumb_out]`;await Cm("ffmpeg",["-y","-loglevel","warning",...["-i",B,"-filter_complex",G,"-map","[sprite_out]","-frames:v","1","-c:v","libwebp","-q:v","75",Q,"-map","[thumb_out]","-c:v","libwebp","-q:v","75","-frames:v","1","-max_muxing_queue_size","1024",F]])}async extractAudio(B,Q,F){await Cm("ffmpeg",["-y","-loglevel","warning",...["-i",B,"-vn","-acodec","libmp3lame","-b:a",F,Q]])}async extractVideoFrames(B){if(B.isImage){let Z=uX.join(B.outputDir,"1.webp");return await this.transcodeImage(B.inputFile,Z,-1,80,B.frameHeight),[Z]}let Q=await this.getVideoInfo(B.inputFile),F=B.numFrames/Q.duration,U=uX.join(B.outputDir,"%d.webp"),I=["-i",B.inputFile,"-vf",`fps=${F},scale=-2:${B.frameHeight}`,"-c:v","libwebp","-q:v","80",U];return await Cm("ffmpeg",["-y","-loglevel","warning",...I]),qA.readdirSync(B.outputDir).filter((Z)=>Z.endsWith(".webp")).sort((Z,W)=>{let g=parseInt(uX.basename(Z,".webp")),V=parseInt(uX.basename(W,".webp"));return g-V}).map((Z)=>uX.join(B.outputDir,Z))}createTempDir(B){return qA.mkdtempSync(uX.join(Z4Q.tmpdir(),B))}removeDir(B){qA.rmSync(B,{recursive:!0,force:!0})}async createVideoTranscodeTask(B,Q,F){return this.prismaClient.workflowTask.create({data:{assetId:B,projectId:Q,type:e0.transcode,status:$I.pending,payload:{projectId:Q,transcode:F}}})}async createImageTranscodeTask(B,Q,F){return this.prismaClient.workflowTask.create({data:{assetId:B,projectId:Q,type:e0.transcode,status:$I.pending,payload:{projectId:Q,transcode:F}}})}async takeScreenshots(B){let Q=process.env.S3_BUCKET||"shumai",F=this.createTempDir("screenshot-"),U=uX.join(F,uX.basename(B.assetKey));try{await yF.downloadToFile(Q,B.assetKey,U);let I=[];if(B.count<=1)I=[B.start];else{let W=(B.end-B.start)/B.count;I=Array.from({length:B.count},(g,V)=>B.start+V*W)}let G=B.commentTimestamp;if(G!==void 0&&G!==null){if(G>=B.start&&G<=B.end){let W=0,g=Math.abs(I[0]-G);for(let V=1;V<I.length;V++){let b=Math.abs(I[V]-G);if(b<g)g=b,W=V}I[W]=G}}let Z=[];for(let W of I){let g=`shot-${W.toFixed(3)}-${NG()}.webp`,V=uX.join(F,g),b=["-ss",W.toFixed(3),"-i",U,"-vframes","1","-vf","scale=-2:720","-c:v","libwebp","-q:v","80",V];if(await Cm("ffmpeg",["-y","-loglevel","warning",...b]),G!==void 0&&G!==null&&W===G&&B.annotations&&B.annotations.length>0){let N=await Xm(V,{limitInputPixels:!1}).metadata(),R=N.width||1280,A=N.height||720,Y=G4Q(R,A,B.annotations),L=uX.join(F,`composite-${g}`);await Xm(V,{limitInputPixels:!1}).composite([{input:Buffer.from(Y),top:0,left:0}]).toFile(L),qA.renameSync(L,V)}let X=`files/${B.assetId}/screenshots/${g}`,C=qA.readFileSync(V);await yF.putObject(Q,X,C,C.length,"image/webp"),Z.push({key:X,timestamp:W})}return Z}finally{this.removeDir(F)}}async overlayAnnotations(B){let Q=process.env.S3_BUCKET||"shumai",F=this.createTempDir("annotation-"),U=uX.join(F,uX.basename(B.assetKey));try{await yF.downloadToFile(Q,B.assetKey,U);let I=await Xm(U,{limitInputPixels:!1}).metadata(),G=I.width||1920,Z=I.height||1080,W=G4Q(G,Z,B.annotations),g=`annotation-${NG()}.webp`,V=uX.join(F,g);await Xm(U,{limitInputPixels:!1}).composite([{input:Buffer.from(W),top:0,left:0}]).resize(16383,16383,{fit:"inside",withoutEnlargement:!0}).webp({quality:90}).toFile(V);let b=`files/${B.assetId}/annotations/${g}`,X=qA.readFileSync(V);return await yF.putObject(Q,b,X,X.length,"image/webp"),b}finally{this.removeDir(F)}}}function G4Q(B,Q,F){let U=Math.max(2,Math.round(Math.max(B,Q)*0.004)),I=[];for(let G of F){let Z=G.color||"#ff0000";switch(G.type){case"box":{if(G.points.length<2)continue;let[g,V]=G.points,b=Math.min(g[0],V[0])*B,X=Math.min(g[1],V[1])*Q,C=Math.abs(V[0]-g[0])*B,N=Math.abs(V[1]-g[1])*Q;I.push(`<rect x="${b}" y="${X}" width="${C}" height="${N}" stroke="${Z}" stroke-width="${U}" fill="none" />`);break}case"line":case"freehand":{if(G.points.length<2)continue;let g=G.points.map(([V,b])=>`${V*B},${b*Q}`).join(" ");I.push(`<polyline points="${g}" stroke="${Z}" stroke-width="${U}" stroke-linecap="round" stroke-linejoin="round" fill="none" />`);break}case"arrow":{if(G.points.length<2)continue;let g=G.points.map(([w,M])=>[w*B,M*Q]),V=g.map(([w,M])=>`${w},${M}`).join(" ");I.push(`<polyline points="${V}" stroke="${Z}" stroke-width="${U}" stroke-linecap="round" stroke-linejoin="round" fill="none" />`);let b=g[g.length-1],X=g[g.length-2],C=b[0]-X[0],N=b[1]-X[1],R=Math.atan2(N,C),A=Math.max(12,Math.max(B,Q)*0.015),Y=b[0]-A*Math.cos(R-Math.PI/6),L=b[1]-A*Math.sin(R-Math.PI/6),H=b[0]-A*Math.cos(R+Math.PI/6),J=b[1]-A*Math.sin(R+Math.PI/6);I.push(`<polygon points="${b[0]},${b[1]} ${Y},${L} ${H},${J}" fill="${Z}" />`);break}}}return`<svg width="${B}" height="${Q}" viewBox="0 0 ${B} ${Q}" xmlns="http://www.w3.org/2000/svg">${I.join(`
|
|
13914
13914
|
`)}</svg>`}var WLB=new W4Q;import{ApplicationFailure as qCG}from"@temporalio/activity";import{execFile as p6F}from"child_process";import{promisify as a6F}from"util";var iCG=a6F(p6F);import{ApplicationFailure as oCG}from"@temporalio/workflow";class gLB{db;assetId;teamId;projectId;spec={};constructor(B,Q,F,U){this.db=B;this.assetId=Q;this.teamId=F;this.projectId=U}setStrategy(B){return this.spec.videoStrategy=B,this}withSprite(){return this.spec.sprite=!0,this}withPoster(){return this.spec.poster=!0,this}async submit(){return(await this.db.workflowTask.create({data:{assetId:this.assetId,teamId:this.teamId,projectId:this.projectId,type:e0.transcode,status:$I.pending,payload:{projectId:this.projectId,transcode:this.spec}}})).id}}class VLB{db;assetId;teamId;projectId;spec={};constructor(B,Q,F,U){this.db=B;this.assetId=Q;this.teamId=F;this.projectId=U}withThumbnail(){return this.spec.thumbnail=!0,this}async submit(){return(await this.db.workflowTask.create({data:{assetId:this.assetId,teamId:this.teamId,projectId:this.projectId,type:e0.transcode,status:$I.pending,payload:{projectId:this.projectId,transcode:this.spec}}})).id}}class g4Q{prismaClient;constructor(B=VB){this.prismaClient=B}async createUploadTask(B,Q){let F=Q.files.filter((C)=>!C.name.startsWith(".")),U=F.length===1?F[0].name:`${F.length} Items`,I=0,G=(C)=>{for(let N of C){if(N.name.startsWith("."))continue;if(N.type==="file")I++;else G(N.children)}};G(Q.files);let Z=await this.prismaClient.task.create({data:{creatorId:B,type:"upload",name:U,total:I,status:I6.pending}}),W=await this.prismaClient.asset.findUnique({where:{id:Q.parentId},include:{project:!0}});if(!W)throw Error("Parent asset not found");if(!W.projectId)throw Error("Parent asset has no project");let g=[],V=W.type===AF.file,b=V?W.parentId:W.id,X=[];return await this.prismaClient.$transaction(async(C)=>{let N=await this.createAssetsRecursively(C,B,Z.id,W.projectId,b,Q.files,g,X);if(V&&N.length>0)for(let R of N)await TX.reparentAssets({assetIds:[R],newParentId:W.id,creatorId:B},C);return N}),{taskId:Z.id,presignedUrls:g,createdAssets:X}}async createAssetsRecursively(B,Q,F,U,I,G,Z,W){let V=(await B.asset.findFirst({where:{parentId:I},orderBy:{sortIndex:"asc"}}))?.sortIndex||void 0,b=[];for(let X of G){if(X.name.startsWith("."))continue;let C=yX(null,V||null);V=C;let N=X.type==="folder"?AF.folder:AF.file,R=null;if(N===AF.file)R=`files/${NG()}/raw`;let A=await B.asset.create({data:{name:X.name,type:N,storageKey:R?{create:{key:R}}:void 0,sortIndex:C,mediaType:X.mediaType,status:N===AF.folder?UD.uploaded:UD.uploading,sizeByte:X.size,creator:Q?{connect:{id:Q}}:void 0,parent:I?{connect:{id:I}}:void 0,project:{connect:{id:U}},task:{connect:{id:F}}}});if(b.push(A.id),W.push({tempId:X.id,assetId:A.id}),N===AF.folder&&I)await B.asset.update({where:{id:I},data:{fileCount:{increment:1}}});if(X.children&&X.children.length>0)await this.createAssetsRecursively(B,Q,F,U,A.id,X.children,Z,W);else if(N===AF.file&&R){let Y=await yF.presign(process.env.S3_BUCKET||"shumai",R,"PUT");Z.push({id:X.id,fileId:A.id,url:Y})}}return b}async confirmFileUpload(B,Q,F){let U=await this.prismaClient.asset.findUnique({where:{id:F.fileId},include:{storageKey:!0,project:{include:{team:!0}}}});if(!U)throw Error("Asset not found");if(!U.project)throw Error("Project not found for asset");let I=U.storageKey?.key;if(!I)throw Error("Asset has no key");if(F.errorMessage){if(await this.prismaClient.asset.delete({where:{id:U.id}}),await this.prismaClient.task.findUnique({where:{id:Q}})){let g=await this.prismaClient.task.update({where:{id:Q},data:{uploaded:{increment:1}}});if(g.uploaded===g.total)await this.prismaClient.task.update({where:{id:Q},data:{status:I6.completed}})}return}let G=await yF.getObjectSize(process.env.S3_BUCKET||"shumai",I),Z=U.project;await this.prismaClient.$transaction(async(W)=>{let g=await W.asset.update({where:{id:U.id},data:{status:UD.uploaded,sizeByte:G}});if(U.parentId)await W.asset.update({where:{id:U.parentId},data:{fileCount:{increment:1}}}),await TX.updateAncestorsSize(W,U.parentId,g.sizeByte);let V=await W.task.update({where:{id:Q},data:{uploaded:{increment:1}}});if(V.uploaded===(V.total||0))await W.task.update({where:{id:Q},data:{status:I6.completed}});let b=Z.team;if(!b)return;if(!U.projectId)throw Error("Asset project ID is missing");await this.triggerPostUploadWorkflows(W,U.id,b.id,U.projectId)})}async triggerPostUploadWorkflows(B,Q,F,U){let I=await B.asset.findUnique({where:{id:Q}});if(!I)throw Error("Asset not found");let G=await B.team.findUnique({where:{id:F}});if(!G)throw Error("Team not found");let Z=await B.agent.findFirst({where:{type:"autofill",enabled:!0,user:{teamMembers:{some:{teamId:G.id}}}}});if(Z)await B.workflowTask.create({data:{assetId:I.id,type:e0.ai_metadata_autofill,status:$I.pending,teamId:G.id,projectId:U,payload:{projectId:U,agent:{agentId:Z.id}}}});let W=I.mediaType?.startsWith("video/"),g=I.mediaType?.startsWith("image/");if(!W&&!g)await B.asset.update({where:{id:I.id},data:{status:UD.processed}});else{let V=G.settings;if(W){let b=V?.transcode?.videoStrategy||"best_match";await new gLB(B,I.id,G.id,U).setStrategy(b).withSprite().withPoster().submit()}else if(g)await new VLB(B,I.id,G.id,U).withThumbnail().submit()}}async listUploadTasks(B,Q){let F={creatorId:B,type:"upload"},{data:U,pageInfo:I}=await $V(async(Z,W)=>{return this.prismaClient.task.findMany({where:F,orderBy:{id:"desc"},skip:Z,take:W})},async()=>this.prismaClient.task.count({where:F}),Q);return{data:U.map((Z)=>({id:Z.id,name:Z.name||"",total:Z.total||0,uploaded:Z.uploaded,createdAt:Z.createdAt.toISOString()})),pageInfo:I}}}var Vr=new g4Q;async function V4Q(B){let{agent:Q,dbProviders:F,teamSkills:U,allowedDomains:I}=B.context;if(!Q.provider)throw YZ.create({message:"agent has no provider configured",nonRetryable:!0});if(!Q.modelRef)throw YZ.create({message:"agent has no model configured",nonRetryable:!0});let G=Q.provider.name,Z=Q.modelRef.modelId,W=`You are the AI assistant for shumai.
|
|
13915
13915
|
shumai is a professional creative collaboration platform similar to frame.io, where users can upload creative files, manage projects, assign tasks, get precise feedback, and share their work. As the agent, your role is to help users use and manage this platform.
|
|
13916
13916
|
|