Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/api/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ export const maxDuration = 60;
const zen = (sessionId: string) =>
createOpenAICompatible({
name: 'zen',
baseURL: 'https://opencode.ai/zen/v1',
baseURL: 'https://opencode.ai/zen/go/v1',
headers: {
Authorization: `Bearer ${process.env.OPENCODE_API_KEY}`,
'x-opencode-session': sessionId,
},
});

const MODEL_ID = 'mimo-v2.5-free';
const MODEL_ID = 'glm-5.3-flash';

const model = (sessionId: string) => zen(sessionId).chatModel(MODEL_ID);

Expand Down
2 changes: 1 addition & 1 deletion src/lib/abuse/cost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

export const MAX_TOKENS_PER_REQUEST = 4000;
const MAX_COST_PER_HOUR_USD = 0.5; // ~$0.50/hour budget
const TOKEN_COST_PER_1M = 0.28; // mimo-v2.5 on OpenCode Go
const TOKEN_COST_PER_1M = 0.28; // glm-5.3-flash on OpenCode Go (conservative upper bound)
const USAGE_WINDOW_MS = 60 * 60 * 1000; // 1 hour
const CLEANUP_INTERVAL_MS = 300_000; // 5 min

Expand Down
Loading