NewHow we catch a seller listing the wrong model, and refund you if one does.

OpenCode with MartLLM: a cheaper provider in opencode.json

Add an "uberllm" provider to ~/.config/opencode/opencode.json with npm "@ai-sdk/openai-compatible", baseURL https://api.martllm.com/v1 and the models you want, give it your MartLLM key (environment variable or /connect), then pick uberllm/<model id> with /models.

Fastest: one command

npx uberllm init --tool opencode

It makes a key for this machine in your browser, saves it to a file only you can read, and adds the provider to ~/.config/opencode/opencode.json with a model that is taking requests now. Add --project to write the opencode.json of one project instead. The file is backed up first, and npx uberllm init --undo puts it back. What it changes. To do it by hand, follow the steps below.

Steps

  1. Make a key on your keys page and add credit.
  2. Open (or create) ~/.config/opencode/opencode.json. For one project only, use opencode.json in the project folder instead.
  3. Add the provider:
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "uberllm": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "MartLLM",
      "options": {
        "baseURL": "https://api.martllm.com/v1",
        "apiKey": "{env:UBERLLM_API_KEY}"
      },
      "models": {
        "moonshotai/kimi-k3": { "name": "moonshotai/kimi-k3" },
        "deepseek/deepseek-v4.1-flash": { "name": "deepseek/deepseek-v4.1-flash" },
        "deepseek/deepseek-v4.1-flash": { "name": "deepseek/deepseek-v4.1-flash" }
      }
    }
  },
  "model": "uberllm/moonshotai/kimi-k3",
  "small_model": "uberllm/deepseek/deepseek-v4.1-flash"
}
  1. Give OpenCode the key. Either set the variable the config reads:
export UBERLLM_API_KEY=ull_your_key

or run /connect inside OpenCode, scroll to Other, enter uberllm as the provider id and paste the key. The id must match the name in provider exactly. If you use /connect, you can delete the apiKey line.

  1. Start opencode, type /models and pick one of the MartLLM models.

Why the model id has two slashes

OpenCode names a model <provider>/<model>, and MartLLM ids already contain a slash (deepseek/…). OpenCode splits on the first slash only, so uberllm/moonshotai/kimi-k3 means provider uberllm, model moonshotai/kimi-k3. The key under models must be the MartLLM id exactly as it is on martllm.com/models.

Tell OpenCode the context size

OpenCode uses the context size to know when to compact a long session. Add a limit to each model, using the numbers on its model page:

"moonshotai/kimi-k3": {
  "name": "moonshotai/kimi-k3",
  "limit": { "context": 1000000, "output": 64000 }
}

The numbers above are an example; copy the real ones for the model you choose.

Use the right package

Keep "npm": "@ai-sdk/openai-compatible". That package calls /v1/chat/completions, the route every MartLLM model is tested on.

Troubleshooting

  • ProviderModelNotFoundError: the model you picked is not in the models list, or the key there differs from the id in "model". Add it with the exact MartLLM id.
  • 401 / no answer: {env:UBERLLM_API_KEY} becomes empty when the variable is not set in the shell that started OpenCode. Export it, or use /connect.
  • /connect key not used: the provider id you typed there is not uberllm. Run opencode auth list to see what is stored.
  • 404: check baseURL ends in /v1, and the npm package is the openai-compatible one.
  • 402 insufficient credits: add credit on the credits page.

Keep reading

Coding models that work well in OpenCode

All take tool calls and have long context. The first two are in the config below.

ModelModel id (paste this)Price now
Kimi K3moonshotai/kimi-k3$0.0384 in · $0.2021 out / 1M
DeepSeek V4.1 Flashdeepseek/deepseek-v4.1-flash$0.0075 in · $0.0282 out / 1M
GLM 5.3z-ai/glm-5.3$0.0029 in · $0.0100 out / 1M
Claude Sonnet 5.5anthropic/claude-sonnet-5.5$0.3600 in · $1.80 out / 1M
Qwen 3 Coder 480bqwen/qwen3-coder$0.0030 in · $0.0099 out / 1M
GPT-5.5openai/gpt-5.5$1.25 in · $7.50 out / 1M
Claude Opus 5.5anthropic/claude-opus-5.5$0.6780 in · $3.39 out / 1M
DeepSeek V4 Prodeepseek/deepseek-v4-pro$0.0634 in · $0.1268 out / 1M
MiniMax M3minimax/minimax-m3$0.0230 in · $0.0920 out / 1M

Prices at the last hourly build, no fee added · every model →

For cheap background work

Good as small_model (titles, summaries) or for simple edits.

ModelModel id (paste this)Price now
DeepSeek V4.1 Flashdeepseek/deepseek-v4.1-flash$0.0075 in · $0.0282 out / 1M
GLM 5.3z-ai/glm-5.3$0.0029 in · $0.0100 out / 1M
Qwen 3 Coder 480bqwen/qwen3-coder$0.0030 in · $0.0099 out / 1M
DeepSeek V3.2deepseek/deepseek-v3.2$0.0026 in · $0.0038 out / 1M
GPT-OSS 120Bopenai/gpt-oss-120b$0.000069 in · $0.00030 out / 1M
Kimi K2 Thinkingmoonshotai/kimi-k2-thinking$0.0059 in · $0.0248 out / 1M

Prices at the last hourly build, no fee added · every model →

FAQ

How do I use MartLLM in OpenCode?

Add a provider "uberllm" to opencode.json with npm "@ai-sdk/openai-compatible", options.baseURL https://api.martllm.com/v1 and your key, list the model ids under models, then select uberllm/<model id> with /models.

Do MartLLM model ids with a slash work in OpenCode?

Yes. OpenCode splits the model name on the first slash only, so uberllm/deepseek/deepseek-v4.1-flash is provider uberllm, model deepseek/deepseek-v4.1-flash.