# OpenCode on ORB Cloud

OpenCode uses a config file for base URL. One extra line needed.

## orb.toml

```toml
[agent]
name = "my-agent"
lang = "binary"
entry = "/usr/local/bin/opencode"

[agent.env]
HOME = "/root"
ANTHROPIC_API_KEY = "${ANTHROPIC_API_KEY}"

[build]
steps = [
  "npm install -g opencode-ai",
]

[llm]
base_url = "https://api.anthropic.com"

[resources]
runtime = "2GB"
disk    = "4GB"
```

## Framework config

OpenCode reads `baseURL` from `opencode.json`, not from env vars.

Write the config from a build step:

```toml
[build]
steps = [
  "npm install -g opencode-ai",
  "mkdir -p /agent/code",
  "echo '{\"provider\":{\"anthropic\":{\"baseURL\":\"http://127.0.0.1:8080\"}}}' > /agent/code/opencode.json",
]
working_dir = "/agent/code"
```

Or read `ORB_PROXY_URL` from your entry script and patch the config at runtime so the proxy URL doesn't end up baked into your repo.
