Menu

Products Models Use Cases AI Agents API

OpenCode Quick Switch to Cloudwise MaaS

Install OpenCode and connect to 570+ AI models including Claude, GPT, Grok, DeepSeek, GLM, Kimi, and more

OpenCode is a powerful terminal-based AI coding assistant. Through Cloudwise MaaS, you can easily connect OpenCode to 570+ AI models including Claude, GPT, Grok, DeepSeek, GLM, Kimi, Doubao, and more โ€” all via a single JSON configuration file.

Install OpenCode

Execute the following command to install OpenCode:

# macOS / Linux curl -fsSL https://opencode.ai/install | bash source ~/.bashrc source ~/.zshrc

After installation, run opencode in your terminal to verify it's installed correctly. You should see the OpenCode TUI interface.

Configure Cloudwise MaaS Models

Edit the configuration file at ~/.config/opencode/opencode.json to connect OpenCode to Cloudwise MaaS.

Test Key: ak_f58064831857443bbfc75b0b4fb9d9c3

Note: The configuration supports two providers: local (OpenAI-compatible, for GPT/Grok/DeepSeek/GLM/Kimi/Doubao) and anthropic (for Claude models). Both are configured in the same JSON file.

Simple Configuration

A minimal configuration that lists all supported models. OpenCode will auto-detect model capabilities.

{ "$schema": "https://opencode.ai/config.json", "provider": { "local": { "npm": "@ai-sdk/openai-compatible", "name": "cloudwise", "options": { "baseURL": "https://api.cloudwise.ai/api/v1", "apiKey": "ak_********" }, "models": { "gpt-4o": { "name": "gpt-4o" }, "gpt-4.1": { "name": "gpt-4.1" }, "gpt-5": { "name": "gpt-5" }, "gpt-5-mini": { "name": "gpt-5-mini" }, "gpt-5.1": { "name": "gpt-5.1" }, "gpt-5.2": { "name": "gpt-5.2" }, "gpt-5.3-chat": { "name": "gpt-5.3-chat" }, "gpt-5.3-codex": { "name": "gpt-5.3-codex" }, "gpt-5.4": { "name": "gpt-5.4" }, "gpt-5.4-mini": { "name": "gpt-5.4-mini" }, "gpt-5.4-nano": { "name": "gpt-5.4-nano" }, "deepseek-v3.2": { "name": "deepseek-v3.2" }, "grok-4": { "name": "grok-4" }, "grok-4-0709": { "name": "grok-4-0709" }, "grok-3": { "name": "grok-3" }, "grok-3-mini": { "name": "grok-3-mini" }, "grok-4-fast-reasoning": { "name": "grok-4-fast-reasoning" }, "grok-4-1-fast-reasoning": { "name": "grok-4-1-fast-reasoning" }, "grok-4-1-fast-non-reasoning": { "name": "grok-4-1-fast-non-reasoning" }, "grok-4-fast-non-reasoning": { "name": "grok-4-fast-non-reasoning" }, "glm-5": { "name": "glm-5" }, "glm-5.1": { "name": "glm-5.1" }, "kimi-2.6": { "name": "kimi-2.6" }, "doubao-seed-1-8-251228": { "name": "doubao-seed-1-8-251228" } } }, "anthropic": { "npm": "@ai-sdk/anthropic", "name": "cloudwise", "options": { "baseURL": "https://api.cloudwise.ai/api/v1", "apiKey": "ak_********" }, "models": { "claude-opus-4-1-20250805": { "name": "claude-opus-4-1-20250805" }, "claude-opus-4-1-20250805-thinking": { "name": "claude-opus-4-1-20250805-thinking" }, "claude-opus-4-20250514": { "name": "claude-opus-4-20250514" }, "claude-opus-4-20250514-thinking": { "name": "claude-opus-4-20250514-thinking" }, "claude-opus-4-5-20251101": { "name": "claude-opus-4-5-20251101" }, "claude-opus-4-6": { "name": "claude-opus-4-6" }, "claude-opus-4-6-thinking": { "name": "claude-opus-4-6-thinking" }, "claude-opus-4-7": { "name": "claude-opus-4-7" }, "claude-opus-4-7-thinking": { "name": "claude-opus-4-7-thinking" }, "claude-sonnet-4-20250514": { "name": "claude-sonnet-4-20250514" }, "claude-sonnet-4-5-20250929": { "name": "claude-sonnet-4-5-20250929" }, "claude-sonnet-4-6": { "name": "claude-sonnet-4-6" }, "claude-sonnet-4-6-thinking": { "name": "claude-sonnet-4-6-thinking" }, "claude-haiku-4-5-20251001": { "name": "claude-haiku-4-5-20251001" } } } } }

Full Configuration (with limits & capabilities)

A detailed configuration that specifies context limits, output limits, modalities, tool support, and structured output support for each model. Recommended for advanced users.

{ "$schema": "https://opencode.ai/config.json", "provider": { "local": { "npm": "@ai-sdk/openai-compatible", "name": "cloudwise", "options": { "baseURL": "https://api.cloudwise.ai/api/v1", "apiKey": "ak_********" }, "models": { "gpt-4o": { "name": "gpt-4o", "limit": { "context": 128000, "output": 4096 }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "gpt-4.1": { "name": "gpt-4.1", "limit": { "context": 32768, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "gpt-5": { "name": "gpt-5", "limit": { "context": 200000, "output": 16384 }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "gpt-5-mini": { "name": "gpt-5-mini", "limit": { "context": 128000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "gpt-5.1": { "name": "gpt-5.1", "limit": { "context": 128000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "gpt-5.2": { "name": "gpt-5.2", "limit": { "context": 128000, "output": 16384 }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "gpt-5.3-chat": { "name": "gpt-5.3-chat", "limit": { "context": 200000, "output": 32768 }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "gpt-5.3-codex": { "name": "gpt-5.3-codex", "limit": { "context": 128000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": false, "supportsStructuredOutputs": true }, "gpt-5.4": { "name": "gpt-5.4", "limit": { "context": 256000, "output": 65536 }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "gpt-5.4-mini": { "name": "gpt-5.4-mini", "limit": { "context": 128000, "output": 16384 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "gpt-5.4-nano": { "name": "gpt-5.4-nano", "limit": { "context": 32768, "output": 4096 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": false }, "deepseek-v3.2": { "name": "deepseek-v3.2", "limit": { "context": 160000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "grok-4": { "name": "grok-4", "limit": { "context": 256000, "output": 32768 }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "grok-4-0709": { "name": "grok-4-0709", "limit": { "context": 256000, "output": 32768 }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "grok-3": { "name": "grok-3", "limit": { "context": 131072, "output": 8192 }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "grok-3-mini": { "name": "grok-3-mini", "limit": { "context": 65536, "output": 4096 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": false }, "grok-4-fast-reasoning": { "name": "grok-4-fast-reasoning", "limit": { "context": 128000, "output": 16384 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "grok-4-1-fast-reasoning": { "name": "grok-4-1-fast-reasoning", "limit": { "context": 256000, "output": 32768 }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "grok-4-1-fast-non-reasoning": { "name": "grok-4-1-fast-non-reasoning", "limit": { "context": 256000, "output": 32768 }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "supportsTools": false, "supportsStructuredOutputs": false }, "grok-4-fast-non-reasoning": { "name": "grok-4-fast-non-reasoning", "limit": { "context": 128000, "output": 16384 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": false, "supportsStructuredOutputs": false }, "glm-5": { "name": "glm-5", "limit": { "context": 128000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "glm-5.1": { "name": "glm-5.1", "limit": { "context": 204800, "output": 131072 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "kimi-2.6": { "name": "kimi-2.6", "limit": { "context": 200000, "output": 8192 }, "modalities": { "input": ["text", "image"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "doubao-seed-1-8-251228": { "name": "doubao-seed-1-8-251228", "limit": { "context": 32768, "output": 4096 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true } } }, "anthropic": { "npm": "@ai-sdk/anthropic", "name": "cloudwise", "options": { "baseURL": "https://api.cloudwise.ai/api/v1", "apiKey": "ak_********" }, "models": { "claude-opus-4-1-20250805": { "name": "claude-opus-4-1-20250805", "limit": { "context": 200000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "claude-opus-4-1-20250805-thinking": { "name": "claude-opus-4-1-20250805-thinking", "limit": { "context": 200000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true, "reasoning": true }, "claude-opus-4-20250514": { "name": "claude-opus-4-20250514", "limit": { "context": 200000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "claude-opus-4-20250514-thinking": { "name": "claude-opus-4-20250514-thinking", "limit": { "context": 200000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true, "reasoning": true }, "claude-opus-4-5-20251101": { "name": "claude-opus-4-5-20251101", "limit": { "context": 200000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "claude-opus-4-6": { "name": "claude-opus-4-6", "limit": { "context": 1000000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "claude-opus-4-6-thinking": { "name": "claude-opus-4-6-thinking", "limit": { "context": 1000000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true, "reasoning": true }, "claude-opus-4-7": { "name": "claude-opus-4-7", "limit": { "context": 1000000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "claude-opus-4-7-thinking": { "name": "claude-opus-4-7-thinking", "limit": { "context": 1000000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true, "reasoning": true }, "claude-sonnet-4-20250514": { "name": "claude-sonnet-4-20250514", "limit": { "context": 200000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "claude-sonnet-4-5-20250929": { "name": "claude-sonnet-4-5-20250929", "limit": { "context": 200000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "claude-sonnet-4-6": { "name": "claude-sonnet-4-6", "limit": { "context": 200000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true }, "claude-sonnet-4-6-thinking": { "name": "claude-sonnet-4-6-thinking", "limit": { "context": 200000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true, "reasoning": true }, "claude-haiku-4-5-20251001": { "name": "claude-haiku-4-5-20251001", "limit": { "context": 200000, "output": 8192 }, "modalities": { "input": ["text"], "output": ["text"] }, "supportsTools": true, "supportsStructuredOutputs": true } } } } }

Replace ak_******** with your actual Cloudwise API key in both the local and anthropic provider sections.

Switch Models

After saving your configuration, launch OpenCode and switch to your desired model:

1
Launch OpenCode
opencode
2
Open model selector

Inside the OpenCode TUI, type the command:

/models
OpenCode /models command
3
Search and select a model

In the model selector, search for your desired model. Models ending with "cloudwise" are provided by Cloudwise MaaS and can be used directly.

For example, search gpt-5.4 to find GPT models, or claude to find Claude models โ€” all tagged with cloudwise as the provider.

OpenCode Select Model - cloudwise provider
4
Verify connection

Once selected, OpenCode will use the Cloudwise MaaS API to serve your requests. Send a test message and check the model name in the status bar (e.g., Build ยท claude-opus-4-6 cloudwise).

OpenCode chat with claude-opus-4-6 via Cloudwise

Summary

You have now configured OpenCode to work with the Cloudwise MaaS platform. With a single JSON configuration file, you can access GPT, Claude, Grok, DeepSeek, GLM, Kimi, Doubao, and many more models โ€” all through the OpenCode terminal interface.

ItemValue
Config File~/.config/opencode/opencode.json
API Endpointhttps://api.cloudwise.ai/api/v1
OpenAI Provider@ai-sdk/openai-compatible
Anthropic Provider@ai-sdk/anthropic
Model Selector/models command in OpenCode TUI

If you encounter any issues, make sure your API key is valid and the opencode.json file is valid JSON. Visit maas.cloudwise.ai to manage your API keys and monitor usage.