|
|
@@ -16,10 +16,11 @@ import { useToast } from "../ui/toast"
|
|
|
|
|
|
const PROVIDER_PRIORITY: Record<string, number> = {
|
|
|
opencode: 0,
|
|
|
- anthropic: 1,
|
|
|
+ openai: 1,
|
|
|
"github-copilot": 2,
|
|
|
- openai: 3,
|
|
|
- google: 4,
|
|
|
+ "opencode-go": 3,
|
|
|
+ anthropic: 4,
|
|
|
+ google: 5,
|
|
|
}
|
|
|
|
|
|
export function createDialogProviderOptions() {
|
|
|
@@ -37,6 +38,7 @@ export function createDialogProviderOptions() {
|
|
|
opencode: "(Recommended)",
|
|
|
anthropic: "(Claude Max or API key)",
|
|
|
openai: "(ChatGPT Plus/Pro or API key)",
|
|
|
+ "opencode-go": "(Low cost)",
|
|
|
}[provider.id],
|
|
|
category: provider.id in PROVIDER_PRIORITY ? "Popular" : "Other",
|
|
|
async onSelect() {
|
|
|
@@ -214,16 +216,30 @@ function ApiMethod(props: ApiMethodProps) {
|
|
|
title={props.title}
|
|
|
placeholder="API key"
|
|
|
description={
|
|
|
- props.providerID === "opencode" ? (
|
|
|
- <box gap={1}>
|
|
|
- <text fg={theme.textMuted}>
|
|
|
- OpenCode Zen gives you access to all the best coding models at the cheapest prices with a single API key.
|
|
|
- </text>
|
|
|
- <text fg={theme.text}>
|
|
|
- Go to <span style={{ fg: theme.primary }}>https://opencode.ai/zen</span> to get a key
|
|
|
- </text>
|
|
|
- </box>
|
|
|
- ) : undefined
|
|
|
+ {
|
|
|
+ opencode: (
|
|
|
+ <box gap={1}>
|
|
|
+ <text fg={theme.textMuted}>
|
|
|
+ OpenCode Zen gives you access to all the best coding models at the cheapest prices with a single API
|
|
|
+ key.
|
|
|
+ </text>
|
|
|
+ <text fg={theme.text}>
|
|
|
+ Go to <span style={{ fg: theme.primary }}>https://opencode.ai/zen</span> to get a key
|
|
|
+ </text>
|
|
|
+ </box>
|
|
|
+ ),
|
|
|
+ "opencode-go": (
|
|
|
+ <box gap={1}>
|
|
|
+ <text fg={theme.textMuted}>
|
|
|
+ OpenCode Go is a $10 per month subscription that provides reliable access to popular open coding models
|
|
|
+ with generous usage limits.
|
|
|
+ </text>
|
|
|
+ <text fg={theme.text}>
|
|
|
+ Go to <span style={{ fg: theme.primary }}>https://opencode.ai/zen</span> and enable OpenCode Go
|
|
|
+ </text>
|
|
|
+ </box>
|
|
|
+ ),
|
|
|
+ }[props.providerID] ?? undefined
|
|
|
}
|
|
|
onConfirm={async (value) => {
|
|
|
if (!value) return
|