OpenCode is an open-source AI coding agent built for the terminal. It supports multiple AI providers and offers features like session management, file change tracking, and tool integration. Since OpenCode supports OpenAI-compatible endpoints, you can configure it to use MARA Cloud models.
Prerequisites
- OpenCode installed
- A MARA Cloud API key. See API Keys and URLs to generate one.
Step 1: Add your API key
Run the
/connect command inside OpenCode and select Other to add your MARA Cloud API key. Alternatively, set it as an environment variable:bash
export MARA_API_KEY="your-mara-api-key"Step 2: Configure MARA Cloud as a provider
Create or update your OpenCode config file at
~/.config/opencode/opencode.json (global) or opencode.json in your project root:json
{
"$schema": "https://opencode.ai/config.json",
"model": "mara/MiniMax-M2.5",
"provider": {
"mara": {
"npm": "@ai-sdk/openai-compatible",
"name": "MARA Cloud",
"options": {
"baseURL": "https://api.cloud.mara.com/v1",
"apiKey": "your-mara-api-key"
},
"models": {
"MiniMax-M2.5": {
"name": "MiniMax M2.5"
},
"gpt-oss-120B": {
"name": "GPT OSS 120B"
}
}
}
}
}Step 3: Start using MARA Cloud in OpenCode
Launch OpenCode and select your MARA Cloud model using the
/models command. Your requests will now be routed to MARA Cloud.bash
opencodeLearn more
- Model Catalog - Browse all available models.
- OpenCode Documentation - Official OpenCode docs.
- OpenCode Providers - Full list of supported providers.