opencode go: each API goes to the endpoint Go's docs name, Gemini at /inference/go/google/v1beta (@jd04063221 on X)
Go's docs (opencode.ai/docs/console/go, Endpoints) give one URL per API under /inference/go: /openai/v1, /anthropic, /google/v1beta. The preset and the filled-in defaults still used /zen/go and Gemini's /inference/go/v1. The preset now gives the three; a preset provider saved with the older URLs is moved on load; openCodeRoot reads the per-API forms; a Go URL in the per-API form gets its siblings in that form. A URL the user gave stays. Run (mote): go test -run 'OpenCode|Preset|PlanQuota|Balance|Go|Gemini' ./internal/provider ./internal/gateway ok; vet darwin/linux/windows ok. Broken by hand: old opencode_endpoints.go/presets.go with the new TestOpenCodeEndpointsFilledIn goes red on 6 cases. Not tried: a real Go key (none here); old /zen/go routes still answer (400 MissingSessionID unauthenticated), so URLs the user set keep working. Full suite and GUI files not run before the tag.
This commit is contained in:
@@ -23,6 +23,7 @@ keys and accounts per request is in [Gateway routing and fallback](gateway-routi
|
||||
| Anthropic key header | A provider of the user's own on a third-party Anthropic API is sent its key as both `x-api-key` and `Authorization: Bearer` (`AuthHeaders`); Anthropic's own API, Bedrock, Azure, Vertex and every subscription account have their own and never this choice (`BothAuth` is false). Some services refuse the two together with a 401 (Aloha on Discord: "鉴权 header, x-api-key 和 Authorization 不可以同时存在"), so `Provider.AuthHeader` (`authHeader`: empty for both, `x-api-key` or `bearer`; anything else is read as empty) sends one alone, picked in the editor's Key header row (shown while `bothAuth` is true, or a custom provider's Anthropic URL is a third party's). Left at both, a 401 whose body `catalog.BothAuthRefused` tells as that refusal (it names both headers and says they can't be together, in Chinese or English) is asked once more with x-api-key alone, then Bearer alone (`RetryOneAuth`, in the gateway's `forwardOnce` and the provider test's `probe`; `catalog.fetchOne` for the model list through `listAuth`); the first not answered 401 or 403 is kept with `LearnAuthHeader`, which never changes a pick the user made. A request carrying the user's own `Authorization` or `x-api-key` header is never retried. | [`authheader.go`](../../internal/provider/authheader.go), [`test.go`](../../internal/provider/test.go), [`catalog/authheader.go`](../../internal/catalog/authheader.go), [`catalog/live.go`](../../internal/catalog/live.go) |
|
||||
| GLM Coding Plan key at pay as you go | Zhipu's and Z.ai's presets offer Pay as you go first (`/api/paas/v4`) and the Coding Plan (`/api/coding/paas/v4`, Responses at `/api/v1`); both share `/api/anthropic`, which bills the plan, so a plan's key left at Pay as you go worked in Claude Code and was refused 429 code 1113 "余额不足或无可用资源包" in Codex (@cleverpigo on X). Nothing in the key tells the two apart, so a Chat request to `open.bigmodel.cn` or `api.z.ai` at `/api/paas/v4` refused 1113 is asked once more at `/api/coding/paas/v4` (`RetryZhipuCoding`, in the gateway's `forwardOnce` and the provider test's `probe`). Served there, `LearnZhipuCoding` moves a saved provider with that one key, still at that URL, to the plan's OpenAI URL (and the preset's plan Responses URL when it has none); one with other keys stays and is asked again each time. Refused there too, the 1113 body keeps its code and gets both URLs and what to change in its message (`ZhipuNoBalanceHint`). A pay-as-you-go key with a balance is never answered 1113 and never sent to the plan's endpoint. | [`zhipu_coding.go`](../../internal/provider/zhipu_coding.go), [`test.go`](../../internal/provider/test.go) |
|
||||
| A Zen free model on OpenCode Go | OpenCode's two gateways serve different free models: Zen's free tier (`/zen`, asked with the public key `OpenCodeAnonymousKey`) serves its `-free` models and big-pickle, Go (`/zen/go`, a Go key) only a few of its own (beam-free, iceman-contributor-free on 2026-11-02). Go answers a model it doesn't serve 400 "Upstream request failed: Model is unavailable." before it reads the key, so Claude Code asking one of Zen's free models on an OpenCode Go provider failed on every request (51bit.eth on Discord). Such a request, a free model by `OpenCodeFree`, is asked once more at Zen's free tier on the same API (`openCodeGoToZenFree`, `OpenCodeFreeURL`), with the public key and never the user's Go key (`RetryOpenCodeFreeOnZen`, in the gateway's `forwardOnce`); a model that isn't free isn't. Refused there too, or not free, the 400 keeps Go's words and says where the model is served. Not changed: when Go's `/models` refuses the key, the provider lists models.dev's `opencode-go`, which names free models Go doesn't serve (#4900). | [`opencode_go_free.go`](../../internal/provider/opencode_go_free.go) |
|
||||
| OpenCode Go endpoints | Go's docs name one URL per API under `/inference/go`: `/openai/v1` (chat, Responses), `/anthropic` (Messages), `/google/v1beta` (Gemini, `models/{id}:streamGenerateContent`). The preset gives them (`OpenCodeGoChat`, `OpenCodeGoAnthropic`, `OpenCodeGoGemini`); a provider of the preset saved with the older `/zen/go` or `/inference/go/v1` URLs is moved on load, and one added by hand with a single Go URL gets the rest filled beside it (`openCodeEndpoints`). A URL the user gave another API stays. | [`opencode_endpoints.go`](../../internal/provider/opencode_endpoints.go) |
|
||||
| Zhipu's 200 refusals | Zhipu's and Z.ai's `/api/v1` (the GLM Coding Plan's Responses API, from their Codex pages) and `/api/monitor` answer a refusal 200 in the platform's envelope, `{"code":1000,"msg":"身份验证失败。","success":false}`, where their OpenAI and Anthropic endpoints answer the same key 401 (@xanahopper on X: a refused key tested green on the Responses row only). `ZhipuEnveloped` turns a 2xx JSON body from `open.bigmodel.cn` or `api.z.ai` with `success: false` into `{"error":{"code","message"}}` at the status Zhipu's error-code table gives (1000–1005 → 401, 1113 and 1302–1399 → 429, 1220 → 403, 1210–1229, 1261 and 1301 → 400, anything else → 502), in the provider test's `probe` (endpoint tests, model tests, Detect APIs) and the gateway's `forwardOnce`. A stream, a compressed body, a body over 64 KB and every other host pass as they came. The plan's quota card for a key refused there (1000–1005, or a 401) says `<Zhipu or Z.ai> didn't take this key (<their words>): …` with the vendor's API-keys page (`zhipuRefused`), not asked again as a team's key, and the GUI shows it as that (`quotaError`) rather than "Allowance unavailable". | [`zhipu_envelope.go`](../../internal/provider/zhipu_envelope.go), [`planquota.go`](../../internal/provider/planquota.go), [`test.go`](../../internal/provider/test.go) |
|
||||
| Extra body | `ExtraBody` (`extraBody` in providers.json, the editor's *Extra body*, #1604) is a JSON object whose fields `WithExtraBody` adds at the top level of every JSON body sent to the provider: Messages, Chat, Responses and Gemini, relayed as they came or translated, in the gateway's `forwardOnce` and in Test and Detect (`tested`). A field the body has already is kept; a name written `"!name"` replaces it. Values are put in as written, objects whole, not merged. `${sessionId}` in any string, at any depth, becomes the request's session: the agent's session header (`sessionOf`), else the id `conversationID` derives from how the conversation opens (`magpie-` and its hash, [Gateway routing](gateway-routing.md#responsibilities-and-sources-of-truth)'s Affinity), so it stays the same through one conversation; Test and Detect send `magpie-test-` and 12 random letters, a new one each time. `${threadId}` is the thread the agent names within that session: Codex's `thread_id` (its turn metadata or `thread-id` header, `threadOf`), which a subagent has of its own while it shares its lead's session; read only when the provider's headers or extraBody name it (`AsksThread`). No other agent names a thread, and there `${threadId}` is the session's id. `${subagentId}` becomes the Claude Code subagent the request is of (`x-claude-code-agent-id`, `subOf`), "" on the conversation's own turns, which never send the header, so `${sessionId}:${subagentId}` keeps one prompt_cache_key per subagent where `${sessionId}` alone carries every subagent's turns on one key (#2937). `model`, `stream` and the conversation (`messages`, `input`, `contents`, `system`, `systemInstruction`, `system_instruction`, `instructions`, `tools`, `ExtraBodyReserved`) are magpie's: Save refuses them with or without `!` (`ExtraBodyOK`), the editor says so as they are typed, and one written into providers.json by hand is dropped on read (`cleanExtraBody`). Not sent with it: `count_tokens`, embeddings, images, video and System One's decision model (other APIs), and a signed-in account's requests, except a ChatGPT (Codex) account's (magpie-releases#18): its requests are built as Codex CLI's (`codexBody`) and take the fields Codex CLI adds by choice, such as `access_programs` (OpenAI's Daybreak), while `store`, `tool_choice` and `include`, which the backend needs as `codexBody` sets them, can't be set (`codexOwned`). Its extraBody is written into providers.json by hand under the account's entry and kept onto the account by `withPicks`, and kept by a later `Save` (#4738: `Save` dropped it before); the editor has no box for it. A client's own top-level `access_programs` on Responses or Chat is carried to a Responses build as it came (`Request.AccessPrograms`), so a request translated (a Codex account is streamed, so a whole Responses request is made again) keeps it as a relayed one does. It reaches only the upstreams Codex itself sends it to (`keepsAccessPrograms`, #3172, see [gateway routing](gateway-routing.md)); it is taken out before the extraBody merge, so an `access_programs` the user puts in a provider's extraBody still goes. One object goes to every API; fields for one API alone are not a thing yet. A `thinking` budget it puts in on an Anthropic endpoint is fitted to a Claude that thinks only adaptively after the merge, as an agent's is (`adaptiveThinking`, `TestExtraBodyBudgetFittedToAdaptiveModel`). | [`extrabody.go`](../../internal/provider/extrabody.go), [`gateway.go`](../../internal/gateway/gateway.go) |
|
||||
| Headers' conversation ids | `${sessionId}`, `${threadId}` and `${subagentId}` in a value of the provider's `Headers` (Axel Burks on Discord: a gateway in front of several Azure accounts routes one conversation to one account by a session header) are the ids extraBody gets, on every request `Sign` signs: the gateway carries the conversation to it in the request's context (`WithConversation`), on every API and `count_tokens` too. A request that is no turn of a conversation (a model list, a balance, an embedding, image or video, System One's decision model, a search) gets an id of its own, `magpie-` and 12 random letters, new each time (`OwnConversation`); Test and Detect's is their `magpie-test-` id, the same in headers and body. A literal placeholder is never sent. In a header the ids go without control characters (`headerSafe`): an agent's session id with CR or LF in it would split the header, or Go would fail the request. A value with neither placeholder goes as written (`SentHeaders`). | [`conversation.go`](../../internal/provider/conversation.go), [`account.go`](../../internal/provider/account.go), [`gateway.go`](../../internal/gateway/gateway.go), [`codex_resume.go`](../../internal/gateway/codex_resume.go) |
|
||||
|
||||
@@ -63,7 +63,7 @@ func openCodeGeminiServer(t *testing.T, s *Server) func() []openCodeAsk {
|
||||
switch {
|
||||
case r.Method != http.MethodPost:
|
||||
return reply(404, "application/json", `{}`)
|
||||
case gemini && (strings.HasPrefix(path, "/zen/v1/models/") || strings.HasPrefix(path, "/inference/go/v1/models/")):
|
||||
case gemini && (strings.HasPrefix(path, "/zen/v1/models/") || strings.HasPrefix(path, "/inference/go/google/v1beta/models/")):
|
||||
return reply(200, "text/event-stream", openCodeGeminiSSE)
|
||||
case strings.Contains(path, ":") || strings.Contains(path, "/models/"):
|
||||
return reply(404, "text/html", `<html>Not Found</html>`)
|
||||
@@ -113,7 +113,7 @@ func TestOpenCodeGoGeminiModelOnGeminiAPI(t *testing.T) {
|
||||
}
|
||||
s := New()
|
||||
took := openCodeGeminiServer(t, s)
|
||||
const want = "opencode.ai/inference/go/v1/models/gemini-4-argon-contributor:streamGenerateContent?alt=sse"
|
||||
const want = "opencode.ai/inference/go/google/v1beta/models/gemini-4-argon-contributor:streamGenerateContent?alt=sse"
|
||||
check := func(what string, code int, body string) openCodeAsk {
|
||||
t.Helper()
|
||||
asked := took()
|
||||
|
||||
@@ -36,7 +36,7 @@ func goFreeServer(t *testing.T, models, serves []string, zenStatus int, zenRefus
|
||||
t.Setenv("XDG_CONFIG_HOME", t.TempDir())
|
||||
t.Setenv("XDG_CACHE_HOME", t.TempDir())
|
||||
if err := provider.Save(provider.Provider{ID: "go", Name: "OpenCode Go", Preset: "opencode-go", Key: "sk-go-users-own",
|
||||
Chat: "https://opencode.ai/zen/go/v1", Responses: "https://opencode.ai/zen/go/v1", Anthropic: "https://opencode.ai/zen/go",
|
||||
Chat: provider.OpenCodeGoChat, Responses: provider.OpenCodeGoChat, Anthropic: provider.OpenCodeGoAnthropic,
|
||||
Models: models}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -55,7 +55,7 @@ func goFreeServer(t *testing.T, models, serves []string, zenStatus int, zenRefus
|
||||
model = m
|
||||
}
|
||||
}
|
||||
if strings.HasPrefix(r.URL.Path, "/zen/go/") {
|
||||
if strings.HasPrefix(r.URL.Path, "/inference/go/") {
|
||||
for _, m := range serves {
|
||||
if m == model {
|
||||
return &http.Response{StatusCode: 200, Header: http.Header{"Content-Type": {"text/event-stream"}},
|
||||
@@ -96,8 +96,8 @@ func TestOpenCodeGoFreeModelAskedAtZen(t *testing.T) {
|
||||
}
|
||||
a := asked()
|
||||
// on the API Go was asked on, at Zen's free tier
|
||||
want := map[string]string{"opencode.ai/zen/go/v1/messages": "opencode.ai/inference/anthropic/v1/messages",
|
||||
"opencode.ai/zen/go/v1/chat/completions": "opencode.ai/inference/openai/v1/chat/completions"}
|
||||
want := map[string]string{"opencode.ai/inference/go/anthropic/v1/messages": "opencode.ai/inference/anthropic/v1/messages",
|
||||
"opencode.ai/inference/go/openai/v1/chat/completions": "opencode.ai/inference/openai/v1/chat/completions"}
|
||||
if len(a) != 2 || want[a[0].url] == "" || a[1].url != want[a[0].url] {
|
||||
t.Fatalf("asked %+v", a)
|
||||
}
|
||||
@@ -114,7 +114,7 @@ func TestOpenCodeGoOwnFreeModelStaysOnGo(t *testing.T) {
|
||||
if rec.Code != 200 || !strings.Contains(rec.Body.String(), "from go") {
|
||||
t.Fatalf("%d %s", rec.Code, rec.Body)
|
||||
}
|
||||
if a := asked(); len(a) != 1 || !strings.HasPrefix(a[0].url, "opencode.ai/zen/go/") {
|
||||
if a := asked(); len(a) != 1 || !strings.HasPrefix(a[0].url, "opencode.ai/inference/go/") {
|
||||
t.Fatalf("asked %+v", a)
|
||||
}
|
||||
}
|
||||
@@ -137,7 +137,7 @@ func TestOpenCodeGoUnavailableSaysWhere(t *testing.T) {
|
||||
t.Fatalf("%d %s", rec.Code, body)
|
||||
}
|
||||
for _, a := range asked()[n:] {
|
||||
if !strings.HasPrefix(a.url, "opencode.ai/zen/go/") {
|
||||
if !strings.HasPrefix(a.url, "opencode.ai/inference/go/") {
|
||||
t.Fatalf("a paid model asked at %s", a.url)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package provider
|
||||
import (
|
||||
"cmp"
|
||||
"net/url"
|
||||
"slices"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -20,7 +21,16 @@ func openCodeRoot(base string) (root, catalogID string) {
|
||||
if !openCodeHost(u.Hostname()) {
|
||||
return "", ""
|
||||
}
|
||||
switch path := strings.TrimSuffix(strings.TrimRight(u.Path, "/"), "/v1"); path {
|
||||
path := strings.TrimRight(u.Path, "/")
|
||||
if r, ok := strings.CutSuffix(path, "/google/v1beta"); ok {
|
||||
path = r
|
||||
} else {
|
||||
path = strings.TrimSuffix(path, "/v1")
|
||||
for _, api := range []string{"/openai", "/anthropic", "/google"} {
|
||||
path = strings.TrimSuffix(path, api)
|
||||
}
|
||||
}
|
||||
switch path {
|
||||
case "/zen/go", "/inference/go":
|
||||
return u.Scheme + "://" + u.Host + path, "opencode-go"
|
||||
case "/zen", "/inference":
|
||||
@@ -63,15 +73,54 @@ func openCodeGateway(base string) string {
|
||||
// root is: models/{model}:streamGenerateContent is asked under it. Zen's
|
||||
// /zen/v1 relays it to the inference API's Google route, reading the key
|
||||
// from x-goog-api-key; Go's /zen/go/v1 has no such route (404), so Go's
|
||||
// Gemini models are asked at the inference API's /inference/go/v1, where
|
||||
// Go's docs give their endpoint (opencode.ai/v2/docs/console/go, #2168).
|
||||
// Gemini models are asked at the inference API, where Go's docs give
|
||||
// their endpoint: /inference/go/google/v1beta/models/{model} (since
|
||||
// November 2026; before it /inference/go/v1, #2168).
|
||||
func openCodeGemini(root string) string {
|
||||
if r, ok := strings.CutSuffix(root, "/zen/go"); ok {
|
||||
return r + "/inference/go/v1"
|
||||
return r + "/inference/go/google/v1beta"
|
||||
}
|
||||
if strings.HasSuffix(root, "/inference/go") {
|
||||
return root + "/google/v1beta"
|
||||
}
|
||||
return root + "/v1"
|
||||
}
|
||||
|
||||
// openCodeGoSplit is whether a Go URL names its API in the path, the way
|
||||
// Go's docs give them since November 2026: …/inference/go/openai/v1 (chat
|
||||
// and Responses), …/inference/go/anthropic (Messages) and
|
||||
// …/inference/go/google/v1beta (Gemini).
|
||||
func openCodeGoSplit(u string) bool {
|
||||
pu, err := url.Parse(strings.TrimSpace(u))
|
||||
if err != nil || openCodeGateway(u) != "go" {
|
||||
return false
|
||||
}
|
||||
for _, seg := range strings.Split(pu.Path, "/") {
|
||||
if seg == "openai" || seg == "anthropic" || seg == "google" {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// openCodeGoOld are the URLs the OpenCode Go preset gave before Go's docs
|
||||
// named an endpoint per API; a provider of the preset saved with them is
|
||||
// moved to where the docs have them (openCodeEndpoints).
|
||||
var openCodeGoOld = map[string]bool{
|
||||
"https://opencode.ai/zen/go/v1": true,
|
||||
"https://opencode.ai/zen/go": true,
|
||||
"https://opencode.ai/inference/go/v1": true,
|
||||
"https://opencode.ai/inference/go": true,
|
||||
}
|
||||
|
||||
// OpenCodeGo are the URLs Go's docs give each API (opencode.ai/docs/console/go,
|
||||
// Endpoints).
|
||||
const (
|
||||
OpenCodeGoChat = "https://opencode.ai/inference/go/openai/v1"
|
||||
OpenCodeGoAnthropic = "https://opencode.ai/inference/go/anthropic"
|
||||
OpenCodeGoGemini = "https://opencode.ai/inference/go/google/v1beta"
|
||||
)
|
||||
|
||||
// openCodeEndpoints fills in the APIs of OpenCode's gateway a provider at
|
||||
// it was saved without. Zen and Go serve each model on one API of three,
|
||||
// all under one root — chat completions and Responses at /v1, Anthropic's
|
||||
@@ -96,9 +145,31 @@ func (p *Provider) openCodeEndpoints() {
|
||||
if root == "" {
|
||||
return
|
||||
}
|
||||
p.Chat = cmp.Or(p.Chat, root+"/v1")
|
||||
p.Responses = cmp.Or(p.Responses, root+"/v1")
|
||||
p.Anthropic = cmp.Or(p.Anthropic, root)
|
||||
chat, anthropic := root+"/v1", root
|
||||
if strings.HasSuffix(root, "/inference/go") && slices.ContainsFunc([]string{p.Chat, p.Responses, p.Anthropic, p.Gemini}, openCodeGoSplit) {
|
||||
chat, anthropic = root+"/openai/v1", root+"/anthropic"
|
||||
}
|
||||
if p.Preset == "opencode-go" {
|
||||
// the preset's own URLs, saved before Go's docs named one per API
|
||||
for _, f := range []struct {
|
||||
have *string
|
||||
to string
|
||||
}{{&p.Chat, OpenCodeGoChat}, {&p.Responses, OpenCodeGoChat}, {&p.Anthropic, OpenCodeGoAnthropic}} {
|
||||
if openCodeGoOld[strings.ToLower(*f.have)] {
|
||||
*f.have = f.to
|
||||
}
|
||||
}
|
||||
if strings.EqualFold(p.Gemini, "https://opencode.ai/inference/go/v1") {
|
||||
p.Gemini = OpenCodeGoGemini
|
||||
}
|
||||
root, catalogID = openCodeRoot(cmp.Or(p.Chat, p.Responses, p.Anthropic, p.Gemini))
|
||||
if strings.HasSuffix(root, "/inference/go") {
|
||||
chat, anthropic = root+"/openai/v1", root+"/anthropic"
|
||||
}
|
||||
}
|
||||
p.Chat = cmp.Or(p.Chat, chat)
|
||||
p.Responses = cmp.Or(p.Responses, chat)
|
||||
p.Anthropic = cmp.Or(p.Anthropic, anthropic)
|
||||
p.Gemini = cmp.Or(p.Gemini, openCodeGemini(root))
|
||||
p.Catalog = cmp.Or(p.Catalog, catalogID)
|
||||
}
|
||||
|
||||
@@ -51,14 +51,21 @@ func TestOpenCodeEndpointsFilledIn(t *testing.T) {
|
||||
apis map[string]Protocol // "" for none named
|
||||
}{
|
||||
{"go, chat alone", Provider{ID: "opencode-go", Chat: zg + "/v1"},
|
||||
zg + "/v1", zg + "/v1", zg, igo + "/v1", "opencode-go",
|
||||
zg + "/v1", zg + "/v1", zg, igo + "/google/v1beta", "opencode-go",
|
||||
map[string]Protocol{"gpt-6-luna": Responses, "minimax-m2.7": Anthropic, "gemini-4-argon-contributor": Gemini, "glm-5.3": ""}},
|
||||
{"go, anthropic alone with /v1", Provider{ID: "ocgo", Anthropic: zg + "/v1"},
|
||||
zg + "/v1", zg + "/v1", zg, igo + "/v1", "opencode-go",
|
||||
zg + "/v1", zg + "/v1", zg, igo + "/google/v1beta", "opencode-go",
|
||||
map[string]Protocol{"gpt-6-luna": Responses}},
|
||||
{"go at the inference API", Provider{ID: "ocgo", Chat: igo + "/v1"},
|
||||
igo + "/v1", igo + "/v1", igo, igo + "/v1", "opencode-go",
|
||||
igo + "/v1", igo + "/v1", igo, igo + "/google/v1beta", "opencode-go",
|
||||
map[string]Protocol{"gemini-4-argon-contributor": Gemini, "glm-5.3": ""}},
|
||||
{"go at the per-API URLs the docs give", Provider{ID: "ocgo", Chat: igo + "/openai/v1"},
|
||||
igo + "/openai/v1", igo + "/openai/v1", igo + "/anthropic", igo + "/google/v1beta", "opencode-go",
|
||||
map[string]Protocol{"gemini-4-argon-contributor": Gemini, "gpt-6-luna": Responses}},
|
||||
{"go, gemini url alone", Provider{ID: "ocgo", Gemini: igo + "/google/v1beta"},
|
||||
igo + "/openai/v1", igo + "/openai/v1", igo + "/anthropic", igo + "/google/v1beta", "opencode-go", nil},
|
||||
{"the go preset saved with its old URLs", Provider{ID: "opencode-go", Preset: "opencode-go", Chat: zg + "/v1", Responses: zg + "/v1", Anthropic: zg},
|
||||
igo + "/openai/v1", igo + "/openai/v1", igo + "/anthropic", igo + "/google/v1beta", "opencode-go", nil},
|
||||
{"zen saved with go's catalog", Provider{ID: "opencode-go", Catalog: "opencode-go", Chat: zen + "/v1"},
|
||||
zen + "/v1", zen + "/v1", zen, zen + "/v1", "opencode-go",
|
||||
map[string]Protocol{"claude-opus-5": Anthropic, "gemini-3-flash": Gemini, "minimax-m2.7": ""}},
|
||||
|
||||
@@ -564,7 +564,7 @@ var presets = []PresetDef{
|
||||
Chat: "https://api.gmi-serving.com/v1",
|
||||
Website: "https://www.gmicloud.ai", KeysURL: "https://console.gmicloud.ai"},
|
||||
{ID: "opencode-go", Name: "OpenCode Go", Icon: "opencode", Kind: KindRelay, Catalog: "opencode-go",
|
||||
Chat: "https://opencode.ai/zen/go/v1", Responses: "https://opencode.ai/zen/go/v1", Anthropic: "https://opencode.ai/zen/go",
|
||||
Chat: OpenCodeGoChat, Responses: OpenCodeGoChat, Anthropic: OpenCodeGoAnthropic,
|
||||
Note: "open coding models, $10/month",
|
||||
Website: "https://opencode.ai/docs/go", KeysURL: "https://opencode.ai/auth"},
|
||||
// Cline's plan for open models, at the Cline API with a Cline key: the
|
||||
|
||||
Reference in New Issue
Block a user