From c193810f6554d28819d7e43ff24456880eb1867f Mon Sep 17 00:00:00 2001 From: Victor Navarro Date: Mon, 19 Oct 2026 21:54:44 +0200 Subject: [PATCH] docs(console): document personal API keys (#57188) --- .../src/docs/content/console/api/index.mdx | 24 ++++++++++++++++++- .../docs/content/console/api/inference.mdx | 2 +- .../content/console/harnesses/claude-code.mdx | 2 +- .../docs/content/console/harnesses/codex.mdx | 4 ++-- .../docs/content/console/harnesses/hermes.mdx | 2 +- .../docs/content/console/harnesses/index.mdx | 15 +++++++++--- .../src/docs/content/console/harnesses/pi.mdx | 3 +-- .../content/console/harnesses/raycast.mdx | 3 +-- 8 files changed, 42 insertions(+), 13 deletions(-) diff --git a/services/www/src/docs/content/console/api/index.mdx b/services/www/src/docs/content/console/api/index.mdx index 8a7eaebc8a1..b0ce04c2fc1 100644 --- a/services/www/src/docs/content/console/api/index.mdx +++ b/services/www/src/docs/content/console/api/index.mdx @@ -1,6 +1,6 @@ --- title: "API Overview" -description: "Authenticate with the OpenCode Console API using service account keys or user tokens." +description: "Authenticate with the OpenCode Console API using personal API keys, service account keys, or user tokens." --- The Console API lets integrations read workspace configuration and manage budgets. Paths are relative @@ -21,6 +21,28 @@ curl --fail-with-body "${CONSOLE_URL}/api/v2/config" \ | [Budgets](/console/api/budgets) | `/api/v1/budgets/members` | | [Config](#workspace-config) | `GET /api/v2/config` | +## Personal API keys + +Every member can create personal API keys. A personal key acts as you, and its usage counts toward your +[member budget](/console/budgets#member-budgets). Use one for your own scripts and [harnesses](/console/harnesses). + +1. Open **Account** from the account menu and find **Personal API keys**. +2. Click **Add API key**. +3. Choose the **Workspace**, a **Key name**, and an optional **Expiration**, then click **Create**. +4. Copy the key. It is shown only once. + +Send it as a bearer token, like a service account key. Each key works in the workspace chosen when it was created. + +```text +Authorization: Bearer oc_sk_... +``` + +Members' keys can list and call models. Owners and admins can also grant Console API permissions, up to their own role. +A key can never create other keys. + +Revoke a key from **Personal API keys** on the **Account** page. Owners and admins can see and revoke a member's keys +from the member's page under **Members**. Leaving or being removed from a workspace revokes your keys in it. + ## Service accounts Integrations authenticate with a service account: a non-human member of the workspace with its own API keys, usage, diff --git a/services/www/src/docs/content/console/api/inference.mdx b/services/www/src/docs/content/console/api/inference.mdx index e5f2cae0192..33426a7d2ea 100644 --- a/services/www/src/docs/content/console/api/inference.mdx +++ b/services/www/src/docs/content/console/api/inference.mdx @@ -18,7 +18,7 @@ curl -X POST "https://opencode.ai/inference/openai/v1/chat/completions" \ ## Authentication -Replace `` with a [service account key](/console/api#service-accounts) created in the [Console](https://opencode.ai/console). Paid models +Replace `` with a [personal API key](/console/api#personal-api-keys) or a [service account key](/console/api#service-accounts) created in the [Console](https://opencode.ai/console). Paid models require the header; free chat models can be called without it. ```text diff --git a/services/www/src/docs/content/console/harnesses/claude-code.mdx b/services/www/src/docs/content/console/harnesses/claude-code.mdx index bbbed70263f..1ffa4b0efd6 100644 --- a/services/www/src/docs/content/console/harnesses/claude-code.mdx +++ b/services/www/src/docs/content/console/harnesses/claude-code.mdx @@ -12,7 +12,7 @@ export ANTHROPIC_AUTH_TOKEN="oc_sk_..." claude --model claude-sonnet-5-5 ``` -Create the key under **Keys** in the [Console](https://opencode.ai/console). See [Get an API key](/console/harnesses#get-an-api-key). +Replace `oc_sk_...` with a [personal API key](/console/harnesses#get-an-api-key). ## Configure diff --git a/services/www/src/docs/content/console/harnesses/codex.mdx b/services/www/src/docs/content/console/harnesses/codex.mdx index 894775be4e7..a3944e65774 100644 --- a/services/www/src/docs/content/console/harnesses/codex.mdx +++ b/services/www/src/docs/content/console/harnesses/codex.mdx @@ -21,8 +21,8 @@ env_key = "OPENCODE_API_KEY" wire_api = "responses" ``` -Codex appends `/responses` to the base URL and reads the key from `env_key`. Create the key under **Keys** in the -[Console](https://opencode.ai/console), then export it. +Codex appends `/responses` to the base URL and reads the key from `env_key`. Create a +[personal API key](/console/harnesses#get-an-api-key), then export it. ```bash export OPENCODE_API_KEY="oc_sk_..." diff --git a/services/www/src/docs/content/console/harnesses/hermes.mdx b/services/www/src/docs/content/console/harnesses/hermes.mdx index 58976266ac5..ef49c7e1084 100644 --- a/services/www/src/docs/content/console/harnesses/hermes.mdx +++ b/services/www/src/docs/content/console/harnesses/hermes.mdx @@ -19,7 +19,7 @@ Run the model setup and select **OpenCode Zen** for pay-as-you-go or **OpenCode hermes model ``` -Paste a key created under **Keys** in the [Console](https://opencode.ai/console), then choose a model. Hermes saves the +Paste a [personal API key](/console/harnesses#get-an-api-key), then choose a model. Hermes saves the key to `~/.hermes/.env` and the selection to `~/.hermes/config.yaml`. ```yaml title="~/.hermes/config.yaml" diff --git a/services/www/src/docs/content/console/harnesses/index.mdx b/services/www/src/docs/content/console/harnesses/index.mdx index 0464fe15e6c..9240865b6c4 100644 --- a/services/www/src/docs/content/console/harnesses/index.mdx +++ b/services/www/src/docs/content/console/harnesses/index.mdx @@ -16,14 +16,23 @@ is billed to your workspace like any other request. ## Get an API key -Harnesses authenticate with a [service account](/console/api#service-accounts) key. Open **Keys** in the -[Console](https://opencode.ai/console), add a service account, and create a key with **Inference only** permission. +Harnesses authenticate with a Console API key. The quickest option is a +[personal API key](/console/api#personal-api-keys), which calls models as you. + +1. Open **Account** from the account menu in the [Console](https://opencode.ai/console). +2. Under **Personal API keys**, click **Add API key**. +3. Choose the workspace, name the key, and click **Create**. +4. Copy the key. It is shown only once. ```text oc_sk_1a2b3c4d5e6f_... ``` -Use a key from a workspace with credits for pay-as-you-go, or from a workspace subscribed to [Go](/console/go) for Go. +Usage counts toward your [member budget](/console/budgets#member-budgets). Use a key from a workspace with credits for +pay-as-you-go, or from a workspace subscribed to [Go](/console/go) for Go. + +For shared machines or CI, owners and admins can create a [service account](/console/api#service-accounts) key instead, +so usage isn't tied to one person. ## Base URLs diff --git a/services/www/src/docs/content/console/harnesses/pi.mdx b/services/www/src/docs/content/console/harnesses/pi.mdx index 4f6a352b50f..9f684c25e28 100644 --- a/services/www/src/docs/content/console/harnesses/pi.mdx +++ b/services/www/src/docs/content/console/harnesses/pi.mdx @@ -13,8 +13,7 @@ every Console model works. ## Configure -Both providers read the key from `OPENCODE_API_KEY`. Create it under **Keys** in the -[Console](https://opencode.ai/console). +Both providers read the key from `OPENCODE_API_KEY`. Create a [personal API key](/console/harnesses#get-an-api-key). ```bash export OPENCODE_API_KEY="oc_sk_..." diff --git a/services/www/src/docs/content/console/harnesses/raycast.mdx b/services/www/src/docs/content/console/harnesses/raycast.mdx index 6487eba241b..da59d6d88c4 100644 --- a/services/www/src/docs/content/console/harnesses/raycast.mdx +++ b/services/www/src/docs/content/console/harnesses/raycast.mdx @@ -12,8 +12,7 @@ Use Console and Go models in Raycast AI Chat, Quick AI, and AI Commands through The extension loads the models enabled in your workspace and bills them to it. 1. Install the extension from the Raycast Store. -2. Create a key under **Keys** in the [Console](https://opencode.ai/console) and paste it into the extension's - **API Key** preference. +2. Create a [personal API key](/console/harnesses#get-an-api-key) and paste it into the extension's **API Key** preference. 3. Allow the extension to provide models in the Raycast model picker. Run **Refresh Models** after enabling or disabling models in the Console.