Skip to content

Commit c193810

Browse files
authored
docs(console): document personal API keys (anomalyco#57188)
1 parent 92242b5 commit c193810

8 files changed

Lines changed: 42 additions & 13 deletions

File tree

‎services/www/src/docs/content/console/api/index.mdx‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "API Overview"
3-
description: "Authenticate with the OpenCode Console API using service account keys or user tokens."
3+
description: "Authenticate with the OpenCode Console API using personal API keys, service account keys, or user tokens."
44
---
55

66
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" \
2121
| [Budgets](/console/api/budgets) | `/api/v1/budgets/members` |
2222
| [Config](#workspace-config) | `GET /api/v2/config` |
2323

24+
## Personal API keys
25+
26+
Every member can create personal API keys. A personal key acts as you, and its usage counts toward your
27+
[member budget](/console/budgets#member-budgets). Use one for your own scripts and [harnesses](/console/harnesses).
28+
29+
1. Open **Account** from the account menu and find **Personal API keys**.
30+
2. Click **Add API key**.
31+
3. Choose the **Workspace**, a **Key name**, and an optional **Expiration**, then click **Create**.
32+
4. Copy the key. It is shown only once.
33+
34+
Send it as a bearer token, like a service account key. Each key works in the workspace chosen when it was created.
35+
36+
```text
37+
Authorization: Bearer oc_sk_...
38+
```
39+
40+
Members' keys can list and call models. Owners and admins can also grant Console API permissions, up to their own role.
41+
A key can never create other keys.
42+
43+
Revoke a key from **Personal API keys** on the **Account** page. Owners and admins can see and revoke a member's keys
44+
from the member's page under **Members**. Leaving or being removed from a workspace revokes your keys in it.
45+
2446
## Service accounts
2547

2648
Integrations authenticate with a service account: a non-human member of the workspace with its own API keys, usage,

‎services/www/src/docs/content/console/api/inference.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ curl -X POST "https://opencode.ai/inference/openai/v1/chat/completions" \
1818

1919
## Authentication
2020

21-
Replace `<token>` with a [service account key](/console/api#service-accounts) created in the [Console](https://opencode.ai/console). Paid models
21+
Replace `<token>` 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
2222
require the header; free chat models can be called without it.
2323

2424
```text

‎services/www/src/docs/content/console/harnesses/claude-code.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export ANTHROPIC_AUTH_TOKEN="oc_sk_..."
1212
claude --model claude-sonnet-5-5
1313
```
1414

15-
Create the key under **Keys** in the [Console](https://opencode.ai/console). See [Get an API key](/console/harnesses#get-an-api-key).
15+
Replace `oc_sk_...` with a [personal API key](/console/harnesses#get-an-api-key).
1616

1717
## Configure
1818

‎services/www/src/docs/content/console/harnesses/codex.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ env_key = "OPENCODE_API_KEY"
2121
wire_api = "responses"
2222
```
2323

24-
Codex appends `/responses` to the base URL and reads the key from `env_key`. Create the key under **Keys** in the
25-
[Console](https://opencode.ai/console), then export it.
24+
Codex appends `/responses` to the base URL and reads the key from `env_key`. Create a
25+
[personal API key](/console/harnesses#get-an-api-key), then export it.
2626

2727
```bash
2828
export OPENCODE_API_KEY="oc_sk_..."

‎services/www/src/docs/content/console/harnesses/hermes.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Run the model setup and select **OpenCode Zen** for pay-as-you-go or **OpenCode
1919
hermes model
2020
```
2121

22-
Paste a key created under **Keys** in the [Console](https://opencode.ai/console), then choose a model. Hermes saves the
22+
Paste a [personal API key](/console/harnesses#get-an-api-key), then choose a model. Hermes saves the
2323
key to `~/.hermes/.env` and the selection to `~/.hermes/config.yaml`.
2424

2525
```yaml title="~/.hermes/config.yaml"

‎services/www/src/docs/content/console/harnesses/index.mdx‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,23 @@ is billed to your workspace like any other request.
1616

1717
## Get an API key
1818

19-
Harnesses authenticate with a [service account](/console/api#service-accounts) key. Open **Keys** in the
20-
[Console](https://opencode.ai/console), add a service account, and create a key with **Inference only** permission.
19+
Harnesses authenticate with a Console API key. The quickest option is a
20+
[personal API key](/console/api#personal-api-keys), which calls models as you.
21+
22+
1. Open **Account** from the account menu in the [Console](https://opencode.ai/console).
23+
2. Under **Personal API keys**, click **Add API key**.
24+
3. Choose the workspace, name the key, and click **Create**.
25+
4. Copy the key. It is shown only once.
2126

2227
```text
2328
oc_sk_1a2b3c4d5e6f_...
2429
```
2530

26-
Use a key from a workspace with credits for pay-as-you-go, or from a workspace subscribed to [Go](/console/go) for Go.
31+
Usage counts toward your [member budget](/console/budgets#member-budgets). Use a key from a workspace with credits for
32+
pay-as-you-go, or from a workspace subscribed to [Go](/console/go) for Go.
33+
34+
For shared machines or CI, owners and admins can create a [service account](/console/api#service-accounts) key instead,
35+
so usage isn't tied to one person.
2736

2837
## Base URLs
2938

‎services/www/src/docs/content/console/harnesses/pi.mdx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ every Console model works.
1313

1414
## Configure
1515

16-
Both providers read the key from `OPENCODE_API_KEY`. Create it under **Keys** in the
17-
[Console](https://opencode.ai/console).
16+
Both providers read the key from `OPENCODE_API_KEY`. Create a [personal API key](/console/harnesses#get-an-api-key).
1817

1918
```bash
2019
export OPENCODE_API_KEY="oc_sk_..."

‎services/www/src/docs/content/console/harnesses/raycast.mdx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ Use Console and Go models in Raycast AI Chat, Quick AI, and AI Commands through
1212
The extension loads the models enabled in your workspace and bills them to it.
1313

1414
1. Install the extension from the Raycast Store.
15-
2. Create a key under **Keys** in the [Console](https://opencode.ai/console) and paste it into the extension's
16-
**API Key** preference.
15+
2. Create a [personal API key](/console/harnesses#get-an-api-key) and paste it into the extension's **API Key** preference.
1716
3. Allow the extension to provide models in the Raycast model picker.
1817

1918
Run **Refresh Models** after enabling or disabling models in the Console.

0 commit comments

Comments
 (0)