@@ -34,6 +34,7 @@ import { createDataDumper } from "./dataDumper"
3434import { createTrialLimiter } from "./trialLimiter"
3535import { createStickyTracker } from "./stickyProviderTracker"
3636import { LiteData } from "@opencode-ai/console-core/lite.js"
37+ import { Resource } from "@opencode-ai/console-resource"
3738
3839type ZenData = Awaited < ReturnType < typeof ZenData . list > >
3940type RetryOptions = {
@@ -59,7 +60,7 @@ export async function handler(
5960
6061 const MAX_FAILOVER_RETRIES = 3
6162 const MAX_429_RETRIES = 3
62- const FREE_WORKSPACES = [
63+ const ADMIN_WORKSPACES = [
6364 "wrk_01K46JDFR0E75SG2Q8K172KF3Y" , // frank
6465 "wrk_01K6W1A3VE0KMNVSCQT43BG2SX" , // opencode bench
6566 ]
@@ -520,6 +521,13 @@ export async function handler(
520521 )
521522
522523 if ( ! data ) throw new AuthError ( "Invalid API key." )
524+ if (
525+ modelInfo . id . startsWith ( "alpha-" ) &&
526+ Resource . App . stage === "production" &&
527+ ! ADMIN_WORKSPACES . includes ( data . workspaceID )
528+ )
529+ throw new AuthError ( `Model ${ modelInfo . id } not supported` )
530+
523531 logger . metric ( {
524532 api_key : data . apiKey ,
525533 workspace : data . workspaceID ,
@@ -546,7 +554,7 @@ export async function handler(
546554 black : data . black ,
547555 lite : data . lite ,
548556 provider : data . provider ,
549- isFree : FREE_WORKSPACES . includes ( data . workspaceID ) ,
557+ isFree : ADMIN_WORKSPACES . includes ( data . workspaceID ) ,
550558 isDisabled : ! ! data . timeDisabled ,
551559 }
552560 }
0 commit comments