Dev.to AI πŸ€– Ai πŸ‘ 2

How to Connect GPT 6.2 Models in OpenCode via Agent Router (+$175 Free Credits)

Here is a quick guide to connecting GPT 6.2 Sol and GPT 6 Astra in OpenCode via Agent Router and claiming a \$175 bonus: Register: Sign up using the invite link to receive the \$175 credit: Register on Agent Router (+

Here is a quick guide to connecting GPT 6.2 Sol and GPT 6 Astra in OpenCode via Agent Router and claiming a \$175 bonus:

  1. Register: Sign up using the invite link to receive the \$175 credit: Register on Agent Router (+\$175 Bonus) (required for the bonus).
  2. Account Setup: Log in via GitHub and verify your \$175 balance.
  3. API Key: Generate an API key in your dashboard, set the limit to 750,000,000, and copy the sk- key.
  4. Configure OpenCode: Create or edit opencode.json in ~/.config/opencode (or %USERPROFILE%\.config\opencode on Windows) with your gateway settings and API key:
{
  "\$schema": "https://opencode.ai",
  "provider": {
    "AgentRouter-openai-gateway": {
      "npm": "@ai-sdk/openai",
      "name": "AgentRouter OpenAI",
      "options": {
        "baseURL": "https://agentrouter.org",
        "apiKey": "YOUR_API_KEY"
      },
      "models": {
        "gpt-6.2-sol": { "name": "GPT 6.2 Sol" },
        "gpt-6-astra": { "name": "GPT 6 Astra" }
      }
    }
  },
  "model": "AgentRouter-openai-gateway/gpt-6.2-sol"
}

(Replace "YOUR_API_KEY" with your copied key).

  1. Launch: Save the file, restart OpenCode, and select GPT 6.2 Sol or GPT 6 Astra from your model selector.
πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.