Opencode

Point Opencode at a Tokenmaxer key.

Install and initialize Ren

Install the Ren CLI, then pair it with your account before configuring this harness.

Terminal · Install
npm install -g @renai-labs/cli
Terminal · Initialize
ren init

Complete the browser pairing flow, then return here to continue.

Connect Opencode to Tokenmaxer

Writes the configuration, backs up anything it touches, and adds only the models available from the providers you’ve configured in Tokenmaxer. Run it again after connecting another plan and it adds what is new.

Terminal
ren inference setup opencode

Test it

Terminal
opencode run --model ren/anthropic/claude-sonnet-5 'say hello'

A reply, and `/models` lists the Ren provider with every model you configured.

Configure it manually

Replace <YOUR_KEY> with your key.

opencode takes the `/v1` suffix despite speaking the Anthropic API, because the AI SDK provider appends its own path segment.

  • Declare `limit` on every model

    opencode has no catalogue entry for Ren model ids and falls back to a default context window, which makes it compact far too early.

  • Declare `modalities` on every model

    Same missing catalogue entry, and here the fallback is `false` for every modality. Drag an image or a PDF onto a model with no `modalities` and opencode replaces it with `ERROR: Cannot read … (this model does not support image input)` before the request leaves your machine, so it reads like the model refused rather than like a config gap. Every model except GPT-5.3 Codex Spark accepts images and PDFs.

Claude models

~/.config/opencode/opencode.jsonc

Adds Ren as a provider. opencode deep-merges config, so your existing providers are untouched.

~/.config/opencode/opencode.jsonc
{
  "provider": {
    "ren": {
      "npm": "@ai-sdk/anthropic",
      "name": "Ren",
      "options": {
        "baseURL": "https://llm.useren.ai/v1",
        "apiKey": "<YOUR_KEY>"
      },
      "models": {
        "anthropic/claude-opus-5": {
          "name": "Claude Opus 5",
          "reasoning": true,
          "tool_call": true,
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 1000000,
            "output": 64000
          }
        },
        "anthropic/claude-sonnet-5": {
          "name": "Claude Sonnet 5",
          "reasoning": true,
          "tool_call": true,
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 1000000,
            "output": 64000
          }
        },
        "anthropic/claude-fable-5-1": {
          "name": "Claude Fable 5.1",
          "reasoning": true,
          "tool_call": true,
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 1000000,
            "output": 64000
          }
        },
        "anthropic/claude-haiku-4-5": {
          "name": "Claude Haiku 4.5",
          "reasoning": true,
          "tool_call": true,
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 200000,
            "output": 64000
          }
        }
      }
    }
  }
}

~/.config/opencode/opencode.jsonc

Optional

Makes Ren the default. Skip it to keep your current default and pick Ren from `/models` instead.

~/.config/opencode/opencode.jsonc
{
  "model": "ren/anthropic/claude-sonnet-5"
}

ChatGPT models

~/.config/opencode/opencode.jsonc

Adds Ren as a provider. opencode deep-merges config, so your existing providers are untouched.

~/.config/opencode/opencode.jsonc
{
  "provider": {
    "ren-codex": {
      "npm": "@ai-sdk/openai",
      "name": "Ren (Codex)",
      "options": {
        "baseURL": "https://llm.useren.ai/v1",
        "apiKey": "<YOUR_KEY>"
      },
      "models": {
        "openai/gpt-6-astra": {
          "name": "GPT-6 Astra",
          "reasoning": true,
          "tool_call": true,
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 272000,
            "output": 64000
          }
        },
        "openai/gpt-5.6-sol": {
          "name": "GPT-5.6 Sol",
          "reasoning": true,
          "tool_call": true,
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 272000,
            "output": 64000
          }
        },
        "openai/gpt-5.6-terra": {
          "name": "GPT-5.6 Terra",
          "reasoning": true,
          "tool_call": true,
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 272000,
            "output": 64000
          }
        },
        "openai/gpt-5.6-luna": {
          "name": "GPT-5.6 Luna",
          "reasoning": true,
          "tool_call": true,
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 272000,
            "output": 64000
          }
        },
        "openai/gpt-5.5": {
          "name": "GPT-5.5",
          "reasoning": true,
          "tool_call": true,
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 272000,
            "output": 64000
          }
        },
        "openai/gpt-5.4": {
          "name": "GPT-5.4",
          "reasoning": true,
          "tool_call": true,
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 272000,
            "output": 64000
          }
        },
        "openai/gpt-5.4-mini": {
          "name": "GPT-5.4 Mini",
          "reasoning": true,
          "tool_call": true,
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image",
              "pdf"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 272000,
            "output": 64000
          }
        },
        "openai/gpt-5.3-codex-spark": {
          "name": "GPT-5.3 Codex Spark",
          "reasoning": true,
          "tool_call": true,
          "attachment": false,
          "modalities": {
            "input": [
              "text"
            ],
            "output": [
              "text"
            ]
          },
          "limit": {
            "context": 128000,
            "output": 64000
          }
        }
      }
    }
  }
}

~/.config/opencode/opencode.jsonc

Optional

Makes Ren the default. Skip it to keep your current default and pick Ren from `/models` instead.

~/.config/opencode/opencode.jsonc
{
  "model": "ren-codex/openai/gpt-5.6-terra"
}