32dots HEIDELBERG AI
Session 1 easy

Bring your own model (or reuse a subscription)

LESSONLesson 1 · ~20 min

🎯Goal. Connect a model so opencode can actually run — using your own provider key, or a subscription you already pay for.

▶ Try this prompt

opencode "Read all CSV files in ./data/, merge them, remove duplicates by sample_id, fill missing numeric values with column medians, and save the result as cleaned_data.csv"

Once a model is connected, hand opencode a multi-step job like this and let it write and run the script.

  1. 1opencode is model-agnostic: connect any of 75+ providers — Anthropic, OpenAI, Google, Mistral, or a local model via Ollama — sourced through Models.dev. There's no intermediate markup; you pay your provider directly.
  2. 2Already paying for GitHub Copilot or ChatGPT Plus/Pro? Log in with that subscription and reuse it instead of adding a separate key.
  3. 3Pick the model that fits the job — a cheaper model for routine edits, a stronger one for tricky refactors. Switching models doesn't mean re-installing.

You'll see. opencode running against your chosen model, working through a multi-step data task and writing a real output file.

💳Cost. BYOK means token costs land directly on your provider bill — monitor usage or cap spending to avoid surprises. Reusing a Copilot or ChatGPT subscription means no new bill at all.

💡Takeaway. You choose the brain: any of 75+ providers, a local Ollama model, or a subscription you already own — no lock-in, no markup.