OpenCode + DeepSeek

Run OpenCode on an unlimited DeepSeek API.

OpenCode supports custom OpenAI-compatible providers. Add Camel Stream to opencode.json, select DeepSeek V4 Flash, and keep request-heavy terminal coding sessions on a predictable monthly plan.

Why this setup

Keep the agent. Change the inference bill.

01

Terminal-native coding

Use OpenCode's normal workflow while routing model calls through a flat-rate DeepSeek endpoint.

02

Explicit provider config

The provider and model are declared in opencode.json, making the setup reviewable and reproducible across projects.

03

Room for agent traffic

Repository exploration and iterative tool use can generate many tokens. Stream removes the per-token overage calculation from those sessions.

Configuration

Connect OpenCode to Stream.

1. Save your Stream key

Set CAMELAI_API_KEY in the shell that launches OpenCode so the configuration can read the credential without committing it to your repository.

2. Add the custom provider

Create or update opencode.json in your project with the Camel Stream provider and model configuration below.

3. Select the model

Start OpenCode, open /models, choose Camel Stream, and select DeepSeek V4 Flash. Test it on a small repository task before moving a long-running session.

opencode.json
Stream endpoint
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "camel-stream": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Camel Stream",
      "options": {
        "baseURL": "https://api.camelai.com/v1",
        "apiKey": "{env:CAMELAI_API_KEY}"
      },
      "models": {
        "deepseek-v4-flash": {
          "name": "DeepSeek V4 Flash"
        }
      }
    }
  }
}

Troubleshooting

Check these details first.

Agent configuration formats change. Compare this guide with the linked official documentation when upgrading OpenCode.

01

Make sure the provider ID in opencode.json is camel-stream and the API key environment variable is available to the OpenCode process.

02

Use @ai-sdk/openai-compatible for the chat-completions endpoint.

03

If the model does not appear, restart OpenCode and run /models again after saving opencode.json.

04

Confirm the model ID is deepseek-v4-flash, not the display label DeepSeek V4 Flash.

Frequently asked questions

Before you connect.

Give your coding agent room to work.

DeepSeek V4 Flash through an OpenAI-compatible API with unlimited token usage for one fixed monthly price.

Get your API key