How do I add an API key and a cheaper provider to OpenCode?
In OpenCode, add a provider to ~/.config/opencode/opencode.json with npm "@ai-sdk/openai-compatible", a baseURL and the models you want; store its key with /connect and pick a model with /models. With MartLLM the baseURL is https://api.martllm.com/v1. On November 20, 2026, 68 DeepSeek, GLM, Kimi and Qwen models were taking requests through it, billed per token from prepaid credit. Qwen3.8 Flash cost $0.015 and $0.047 per million input and output tokens. A request that fails is not billed.
Prices as of November 20, 2026, 11:00 UTC. This page is rebuilt every hour.