OpenCode

How It Works

OpenCode supports custom providers via the @ai-sdk/openai-compatible package. By pointing it at June's API and providing your June API key, all requests are routed through June's infrastructure. This gives you the same privacy and billing benefits you're used to from June, within a coding agent of your choice.

Setup

Desktop App

Open Manage models, select Connect provider, then choose Custom OpenAI-compatible provider and fill in:

  • Provider ID: june
  • Display name: June
  • Base URL: https://api.blockchain.info/ai/api/v1
  • API key: your June API key
  • Models: the model IDs you want to use, e.g. anthropic/claude-opus-latest and openai/gpt-latest

Terminal

Run /connect, scroll to Other at the bottom of the provider list, enter june as the provider ID, then paste your June API key.

Then edit ~/.config/opencode/opencode.jsonc to register the provider and the models you want to use:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "june": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "June",
      "options": {
        "baseURL": "https://api.blockchain.info/ai/api/v1"
      },
      "models": {
        "anthropic/claude-opus-latest": {
          "name": "Claude Opus (Latest)"
        },
        "openai/gpt-latest": {
          "name": "GPT (Latest)"
        }
      }
    }
  }
}

Model Selection

You can add any other models you want to use, either in the custom provider form or under the models object in your config. See the models guide for the full list of supported models.