GeezerVison is showing github.com — wip: gateway · Verdagon/opencode@40036ab
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: bun.lock +26-5Lines changed: 26 additions & 5 deletions Collapse file Copy file name to clipboardExpand all lines: infra/app.ts +12Lines changed: 12 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -46,3 +46,15 @@ new sst.cloudflare.x.Astro("Web", { | 46 | 46 | VITE_API_URL: api.url, | 47 | 47 | }, | 48 | 48 | }) | | 49 | + | | 50 | +const OPENCODE_API_KEY = new sst.Secret("OPENCODE_API_KEY") | | 51 | +const ANTHROPIC_API_KEY = new sst.Secret("ANTHROPIC_API_KEY") | | 52 | +const OPENAI_API_KEY = new sst.Secret("OPENAI_API_KEY") | | 53 | +const ZHIPU_API_KEY = new sst.Secret("ZHIPU_API_KEY") | | 54 | + | | 55 | +export const gateway = new sst.cloudflare.Worker("GatewayApi", { | | 56 | + domain: `api.gateway.${domain}`, | | 57 | + handler: "packages/function/src/gateway.ts", | | 58 | + url: true, | | 59 | + link: [OPENCODE_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, ZHIPU_API_KEY], | | 60 | +}) |
Collapse file Copy file name to clipboardExpand all lines: opencode.json +15Lines changed: 15 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | { | 2 | 2 | "$schema": "https://opencode.ai/config.json", | | 3 | + "model": "opencode/anthropic/claude-sonnet-4", | | 4 | + "provider": { | | 5 | + "opencode": { | | 6 | + "name": "opencode", | | 7 | + "npm": "@ai-sdk/openai-compatible", | | 8 | + "options": { | | 9 | + "baseURL": "https://api.gateway.frank.dev.opencode.ai/v1" | | 10 | + }, | | 11 | + "models": { | | 12 | + "anthropic/claude-sonnet-4": {}, | | 13 | + "openai/gpt-4.1": {}, | | 14 | + "zhipu/glm-4.5-flash": {} | | 15 | + } | | 16 | + } | | 17 | + }, | 3 | 18 | "mcp": { | 4 | 19 | "context7": { | 5 | 20 | "type": "remote", | |
Collapse file Copy file name to clipboardExpand all lines: packages/function/package.json +7-2Lines changed: 7 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 6 | 6 | "type": "module", | 7 | 7 | "devDependencies": { | 8 | 8 | "@cloudflare/workers-types": "4.20250522.0", | 9 | | - "typescript": "catalog:", | 10 | | - "@types/node": "catalog:" | | 9 | + "@types/node": "catalog:", | | 10 | + "openai": "5.11.0", | | 11 | + "typescript": "catalog:" | 11 | 12 | }, | 12 | 13 | "dependencies": { | | 14 | + "@ai-sdk/anthropic": "2.0.0", | | 15 | + "@ai-sdk/openai": "2.0.2", | | 16 | + "@ai-sdk/openai-compatible": "1.0.1", | 13 | 17 | "@octokit/auth-app": "8.0.1", | 14 | 18 | "@octokit/rest": "22.0.0", | | 19 | + "ai": "catalog:", | 15 | 20 | "hono": "catalog:", | 16 | 21 | "jose": "6.0.11" | 17 | 22 | } | |
|