---
title: OpenCode · Volcano Ark (Doubao)
nav: OpenCode · Ark
summary: One command puts OpenCode on Volcano Ark — the Coding Plan or pay-as-you-go, the key on the phone's key card, one real call before switching and an automatic switch-back.
order: 45
---
# OpenCode · Volcano Ark (Doubao)

OpenCode is an open-source AI coding tool; Volcano Ark is ByteDance's model platform on Volcengine (Doubao, DeepSeek, GLM, Kimi and others). Agent J offers the two as one choice: OpenCode underneath, models from Ark.

Not sure which provider yet? Start with [Choose by your model](/docs/models/). How to buy the Ark Coding Plan and get its key is on [Use the Volcano Ark Coding Plan](/docs/ark/). Installing and pairing the phone: [Install](/docs/install/).

## Who it is for {#who}

- In mainland China, with a Chinese model such as Doubao Seed 2.1 Pro as Agent J's main AI.
- With an Ark account already: use the Coding Plan if you have it, otherwise pay as you go, per token from the balance.
- If you want one tap on the phone instead of editing OpenCode's configuration yourself.

## Two ways in: plan or pay-as-you-go {#plan}

| | Coding Plan | Pay-as-you-go |
|---|---|---|
| Address | `…/api/coding/v3` | `…/api/v3` (Ark's standard address) |
| Billing | the plan's quota, monthly | per token from the account balance |
| Who may use it | **coding Agents only** (OpenCode, Claude Code …) | any program |
| Default model | `doubao-seed-2.1-pro` | `doubao-seed-2-1-pro-260915` |
| Key stored as | `ARK_CODING_PLAN_API_KEY` | `ARK_API_KEY` |

**The plan address is for coding Agents only.** That is Ark's rule: any other program calling the plan address may be treated as abuse and the account banned. Agent J lets only your OpenCode use it — Agent J's own programs never call the plan address, and support bots never get the plan key.

One Ark API key works on both addresses: **the address decides whether the plan or the balance pays.** Prices: the [Volcano Ark model prices](https://www.volcengine.com/docs/82379/1099320) and the order page are authoritative.

## Get the key {#key}

1. Open the Ark console https://console.volcengine.com/ark/ and create a key under API key management.
2. Pay-as-you-go: top up the account in the console first, and open the models you want in the model square.
3. **Do not copy it to anyone yet.** Paste it only when the key card appears on your phone.

## Switch in one step {#switch}

On the phone, tap Switch AI coding tool in the menu, add the words OpenCode Volcano Ark and send — or just tell the Agent. It asks whether you have the plan or pay as you go, then runs one of these:

```bash
agentj agent switch opencode --preset ark --plan coding
```

```bash
agentj agent switch opencode --preset ark --plan payg
```

What it does, in order:

1. Looks for OpenCode on the computer (if it is missing it tells you how to install it, see [Install the AI command-line tools](/docs/setup-agents/#opencode)) and also for Ark's own arkcli.
2. If the background service has no key yet, it stops and prints the key card command. A key card opens on the phone; paste the key there only — the Agent never sees it. A pay-as-you-go key is checked once against Ark's model list.
3. Writes Ark into OpenCode's configuration; your own settings stay exactly as they are.
4. **Makes one real call to Ark through OpenCode** and switches only if it works. After the switch the new Agent greets you first.
5. If any step fails, it switches back to the tool you had and removes the Ark settings it just added.

For another Ark model add `--model`, for example `--model doubao-seed-2-1-lite-260915` with pay-as-you-go.

## arkcli {#arkcli}

arkcli is Volcano Ark's official command-line tool (`npm i -g @volcengine/ark-cli`). Its helper can also write Ark settings for OpenCode, but it needs a browser login to your Volcengine account in a terminal, which a phone cannot do. So Agent J does not call it and writes equivalent settings itself, referring to the key by name only. Having arkcli installed is fine; the switch shows its version.

## Models and screenshots {#models}

Pay-as-you-go writes these models by default (read from Ark's model list on 2026-10-17):

- Read screenshots: `doubao-seed-2-1-pro-260915` (default), `doubao-seed-2-1-lite-260915`, `doubao-seed-2-1-turbo-260628`, `doubao-seed-2-0-code-preview-260215`.
- Text only: `deepseek-v4-pro-ga-260813`, `deepseek-v4-1-flash-260910`, `glm-5-2-260617`, `glm-5-3-flash-260828`.

For browser automation or when you send it screenshots, pick a model that reads them. The plan's models are on [Use the Volcano Ark Coding Plan](/docs/ark/#models).

## Common problems {#pitfalls}

- Balance too low (pay-as-you-go): Ark refuses the call, the switch stops at the check and your current tool keeps working. Top up in the console, then switch again.
- Model not opened: pay-as-you-go models must be opened in the model square first. Pick an opened one, or open it and switch again.
- Plan quota used up: wait for it to refresh, or use pay-as-you-go.
- Already on OpenCode: the Ark settings are written and the Agent tells you how to change only the model.

## Switch back {#switch-back}

Tell the Agent to switch back to Claude Code (or whichever you had), or run:

```bash
agentj agent switch --undo
```

More in [Switch the AI coding tool](/docs/switch-harness/).

<details>
<summary>Addresses and names</summary>

- Plan: `https://ark.cn-beijing.volces.com/api/coding/v3`, provider `ark-coding-plan`, key name `ARK_CODING_PLAN_API_KEY`
- Pay-as-you-go: `https://ark.cn-beijing.volces.com/api/v3`, provider `ark-api`, key name `ARK_API_KEY`, check `GET /api/v3/models`
- OpenCode settings file: `~/.config/opencode/opencode.json`

</details>
