OPENCODE

OpenCode Integration

Use llm.market as an OpenAI-compatible provider inside OpenCode — any llm.market-hosted model becomes selectable in the TUI.

OpenCode

OpenCode wires providers through the Vercel AI SDK. Its openai-compatible adapter speaks any OpenAI-compatible endpoint.

Install

Example
curl -fsSL https://opencode.ai/install | bash
# or
npm install -g opencode-ai@latest

Configure llm.market as a provider

Example
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "llm-market": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "llm.market",
      "options": { "baseURL": "https://llm.market/v1" },
      "models": {
        "claude-sonnet-4.5": { "name": "Claude Sonnet 4.5" },
        "gpt-5": { "name": "GPT-5" },
        "glm-4.6": { "name": "GLM 4.6" },
        "MODEL_FROM_V1_MODELS": { "name": "Active catalog model" }
      }
    }
  },
  "model": "llm-market/claude-sonnet-4.5"
}
Choosing models

Any id from llm.market's /v1/models works as a model key. Only models with Tools support will edit files reliably.

Register the API key

Example
opencode auth login

Select llm-market when prompted, then paste your llm.market API key starting with sk-.

Run it

Example
cd your-project
opencode
# Type /models inside the TUI to switch models.

Troubleshooting

  • Model replies with text but never edits files: pick a model marked Tools on the models page.
  • Auth prompt loops: run opencode auth logout, then opencode auth login again and choose llm-market.

Stuck on setup, or want a free key?

Ask the community on our Discord.