+
+
+ {iife(() => {
+ const [formStore, setFormStore] = createStore({
+ value: "",
+ error: undefined as string | undefined,
+ })
- async function handleSubmit(e: SubmitEvent) {
- e.preventDefault()
+ async function handleSubmit(e: SubmitEvent) {
+ e.preventDefault()
- const form = e.currentTarget as HTMLFormElement
- const formData = new FormData(form)
- const apiKey = formData.get("apiKey") as string
+ const form = e.currentTarget as HTMLFormElement
+ const formData = new FormData(form)
+ const apiKey = formData.get("apiKey") as string
- if (!apiKey?.trim()) {
- setFormStore("error", "API key is required")
- return
- }
+ if (!apiKey?.trim()) {
+ setFormStore("error", "API key is required")
+ return
+ }
- setFormStore("error", undefined)
- await globalSDK.client.auth.set({
- providerID: providerID(),
- auth: {
- type: "api",
- key: apiKey,
- },
- })
- await globalSDK.client.global.dispose()
- setTimeout(() => {
- showToast({
- variant: "success",
- icon: "circle-check",
- title: `${provider().name} connected`,
- description: `${provider().name} models are now available to use.`,
+ setFormStore("error", undefined)
+ await globalSDK.client.auth.set({
+ providerID: providerID(),
+ auth: {
+ type: "api",
+ key: apiKey,
+ },
})
- layout.connect.complete()
- }, 500)
- }
+ await globalSDK.client.global.dispose()
+ setTimeout(() => {
+ showToast({
+ variant: "success",
+ icon: "circle-check",
+ title: `${provider().name} connected`,
+ description: `${provider().name} models are now available to use.`,
+ })
+ layout.connect.complete()
+ }, 500)
+ }
- return (
-
-
-
-
-
- OpenCode Zen gives you access to a curated set of reliable optimized models for
- coding agents.
+ return (
+
+
+
+
+
+ OpenCode Zen gives you access to a curated set of reliable optimized models for
+ coding agents.
+
+
+ With a single API key you’ll get access to models such as Claude, GPT, Gemini,
+ GLM and more.
+
+
+ Visit{" "}
+ {" "}
+ to collect your API key.
+
+
+
- With a single API key you’ll get access to models such as Claude, GPT, Gemini, GLM
- and more.
+ Enter your {provider().name} API key to connect your account and use{" "}
+ {provider().name} models in OpenCode.
-
- Visit{" "}
- {" "}
- to collect your API key.
-
-
-
-
-
- Enter your {provider().name} API key to connect your account and use{" "}
- {provider().name} models in OpenCode.
-