agentleFS
Timmy6942025Timmy6942025/opencode-builder-skill/skills/opencode-providers/SKILL.md

opencode-providers

Skill2 starsChanged 6 months agoMITView on GitHub

Use this skill when configuring LLM providers in OpenCode, setting up API keys, connecting providers via /connect, configuring custom OpenAI-compatible providers, setting up local models (Ollama, llama.cpp, LM Studio), or troubleshooting provider authentication issues. Covers all 75+ supported providers, OpenCode Zen, OpenCode Go, provider-specific options, and environment variable configuration.

  • Reads credentials
  • Installs packages

The file

Show its rules and text

We split this skill into the rules it gives an agent

98 rules. About 0 are common, 37 are distinctive, and 61 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈37

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 61

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run /connect in the TUI and select your provider

    line 17
  2. Very specific:

    Run /models to select a model

    line 19
  3. Very specific:

    Run /connect, select OpenCode Zen, paste API key

    line 60
  4. Very specific:

    Run /models to see recommended models

    line 61
  5. Distinctive:

    $5 first month, $10/month: after that

    line 103
  6. Very specific:

    Run /connect, select OpenCode Go, go to opencode.ai/auth

    line 107
  7. Very specific:

    Run /models to see available models

    line 110
  8. Very specific:

    Run /connect, select Anthropic

    line 140
  9. Very specific:

    Run /models to select model

    line 142
  10. Very specific:

    Run /connect, select OpenAI

    line 167
  11. Very specific:

    Run /connect, select xAI

    line 178
  12. Distinctive:

    Create API key at console.x.ai

    line 188
  13. Very specific:

    Run /connect, search for GitHub Copilot

    line 199
  14. Distinctive:

    Create Azure OpenAI resource in Azure portal

    line 315
  15. Very specific:

    Run /connect, search for Azure

    line 317
  16. Very specific:

    Run /models to select deployed model

    line 323
  17. Distinctive:

    Note: If you see "I'm sorry, but I cannot assist with that request" errors, change the content filter from DefaultV2 to Default in your …

    line 325
  18. Very specific:

    Run /connect, select GitLab

    line 334
  19. Very specific:

    OAuth for self-hosted: Create application with callback URL http://127.0.0.1:8080/callback and scopes api, read_user, read_repository.

    line 361
  20. Distinctive:

    Create gateway in Cloudflare dashboard > AI > AI Gateway

    line 380
  21. Very specific:

    Run /connect, search for Cloudflare AI Gateway

    line 381
  22. Distinctive:

    Run AI models on Cloudflare's global network via REST API.

    line 408
  23. Very specific:

    Run /connect, select DigitalOcean, choose Login with DigitalOcean

    line 421
  24. Distinctive:

    Create API key in Vercel dashboard > AI Gateway tab

    line 437
  25. Very specific:

    Run /connect, search for Vercel AI Gateway

    line 438
  26. Distinctive:

    Create service key in SAP BTP Cockpit

    line 466
  27. Very specific:

    Run /connect, search for SAP AI Core

    line 467
  28. Distinctive:

    Create API key at openrouter.ai/settings/keys

    line 486
  29. Very specific:

    Run /connect, search for OpenRouter

    line 487
  30. Distinctive:

    Create account at api.together.ai, click Add Key

    line 513
  31. Very specific:

    Run /connect, search for Together AI, enter key

    line 514
  32. Very specific:

    Run /models to select

    line 515
  33. Distinctive:

    Create account at app.fireworks.ai, click Create API Key

    line 519
  34. Very specific:

    Run /connect, search for Fireworks AI, enter key

    line 520
  35. Distinctive:

    Create account at console.groq.com, click Create API Key

    line 525
  36. Very specific:

    Run /connect, search for Groq, enter key

    line 526
  37. Distinctive:

    Create account at inference.cerebras.ai, generate API key

    line 531
  38. Very specific:

    Run /connect, search for Cerebras, enter key

    line 532
  39. Very specific:

    Run /models to select (e.g.

    line 533
  40. Distinctive:

    Create account at platform.deepseek.com, create API key

    line 537
  41. Very specific:

    Run /connect, search for DeepSeek, enter key

    line 538
  42. Very specific:

    Run /models to select (e.g.

    line 539
  43. Distinctive:

    Create token at huggingface.co/settings/tokens with Inference Providers permission

    line 545
  44. Very specific:

    Run /connect, search for Hugging Face, enter token

    line 546
  45. Distinctive:

    Create account at build.nvidia.com, generate API key

    line 553
  46. Very specific:

    Run /connect, search for NVIDIA, enter key

    line 554
  47. Distinctive:

    Create account at tokenfactory.nebius.com, click Add Key

    line 578
  48. Very specific:

    Run /connect, search for Nebius Token Factory, enter key

    line 579
  49. Distinctive:

    Create account at app.baseten.co, generate API key

    line 584
  50. Very specific:

    Run /connect, search for Baseten, enter key

    line 585
  51. Distinctive:

    Create account at deepinfra.com/dash, generate API key

    line 590
  52. Very specific:

    Run /connect, search for Deep Infra, enter key

    line 591
  53. Distinctive:

    Create account at venice.ai, generate API key

    line 596
  54. Very specific:

    Run /connect, search for Venice AI, enter key

    line 597
  55. Very specific:

    Run /models to select (e.g.

    line 598
  56. Distinctive:

    Create account at platform.moonshot.ai/console, create API key

    line 602
  57. Very specific:

    Run /connect, search for Moonshot AI, enter key

    line 603
  58. Very specific:

    Run /models to select (e.g.

    line 604
  59. Distinctive:

    Create account at platform.minimax.io/login, generate API key

    line 608
  60. Very specific:

    Run /connect, search for MiniMax, enter key

    line 609
  61. Very specific:

    Run /models to select (e.g.

    line 610
  62. Distinctive:

    Create account at cortecs.ai, generate API key

    line 614
  63. Very specific:

    Run /connect, search for Cortecs, enter key

    line 615
  64. Very specific:

    Run /models to select (e.g.

    line 616
  65. Distinctive:

    Create account at ai.io.net, generate API key

    line 620
  66. Very specific:

    Run /connect, search for IO.NET, enter key

    line 621
  67. Distinctive:

    Create account at app.frogbot.ai/signup, generate API key

    line 626
  68. Very specific:

    Run /connect, search for FrogBot, enter key

    line 627
  69. Distinctive:

    Create account at z.ai/manage-apikey/apikey-list, create API key

    line 632
  70. Very specific:

    Run /connect, search for Z.AI

    line 633
  71. Distinctive:

    If subscribed to GLM Coding Plan, select Z.AI Coding Plan

    line 634
  72. Very specific:

    Run /models to select (e.g.

    line 636
  73. Distinctive:

    Create API key at zenmux.ai/settings/keys

    line 640
  74. Very specific:

    Run /connect, search for ZenMux, enter key

    line 641
  75. Distinctive:

    Create API key at llmgateway.io/dashboard

    line 646
  76. Very specific:

    Run /connect, search for LLM Gateway, enter key

    line 647
  77. Distinctive:

    Create auth token in STACKIT Portal > AI Model Serving

    line 670
  78. Very specific:

    Run /connect, search for STACKIT, enter token

    line 671
  79. Distinctive:

    Create API key in OVHcloud panel > Public Cloud > AI & Machine Learning > AI Endpoints

    line 676
  80. Very specific:

    Run /connect, search for OVHcloud AI Endpoints, enter key

    line 677
  81. Very specific:

    Run /connect, search for Scaleway, enter key

    line 683
  82. Distinctive:

    Create account at 302.ai, generate API key

    line 688
  83. Very specific:

    Run /connect, search for 302.AI, enter key

    line 689
  84. Distinctive:

    Create account at helicone.ai, generate API key

    line 696
  85. Very specific:

    Run /connect, search for Helicone, enter key

    line 697
  86. Very specific:

    Tip: If tool calls aren't working, increase num_ctx in Ollama to 16k-32k.

    line 768
  87. Very specific:

    Run /connect, search for Ollama Cloud, enter key

    line 773
  88. Very specific:

    Run /models to select cloud model

    line 778
  89. Distinctive:

    Tip: If tool calls aren't working, pick a model with strong tool-calling support (e.g.

    line 850
  90. Very specific:

    Add any OpenAI-compatible provider not listed in /connect:

    line 856
  91. Very specific:

    Run /connect, scroll to Other

    line 858
  92. Very specific:

    Check auth setup: Run opencode auth list to verify credentials are stored.

    line 936
  93. Very specific:

    Ensure provider ID in /connect matches the ID in opencode.json

    line 939
  94. Distinctive:

    Verify correct npm package:

    line 940
  95. Very specific:

    Verify options.baseURL is correct

    line 944
  96. Distinctive:

    Clear provider cache: If models aren't appearing, try clearing the provider package cache and restarting.

    line 946
  97. Distinctive:

    API call errors: Check API key validity, endpoint URL, and model availability with the provider directly.

    line 948
  98. Very specific:

    Local model issues: Ensure the local server (Ollama, llama.cpp, LM Studio) is running and accessible at the configured baseURL.

    line 950

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

OpenCode Providers

📚 Official Docs: For the latest information, always refer to the official documentation: https://opencode.ai/docs/providers/

Overview

OpenCode uses the AI SDK and Models.dev to support 75+ LLM providers and local models. Providers are configured through opencode.json and authenticated via the /connect command.

Quick start:

  1. Run /connect in the TUI and select your provider
  2. Enter your API key when prompted
  3. Run /models to select a model

Credentials

API keys added via /connect are stored in ~/.local/share/opencode/auth.json.

Provider Config

Customize providers through the provider section in opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "anthropic": {
      "options": {
        "baseURL": "https://api.anthropic.com/v1"
      }
    }
  }
}

Key config fields:

  • npm — AI SDK package (e.g. @ai-sdk/openai-compatible for OpenAI-compatible endpoints, @ai-sdk/openai for /v1/responses endpoints)
  • name — Display name in UI
  • options.baseURL — API endpoint URL
  • options.apiKey — API key (or use /connect)
  • options.headers — Custom headers sent with each request
  • models — Map of model IDs to configurations
  • limit.context — Maximum input tokens the model accepts
  • limit.output — Maximum tokens the model can generate

OpenCode Zen

OpenCode Zen is a curated list of tested and verified models provided by the OpenCode team. It works like any other provider — pay-as-you-go, completely optional.

Setup:

  1. Sign in at opencode.ai/auth, add billing details, copy API key
  2. Run /connect, select OpenCode Zen, paste API key
  3. Run /models to see recommended models

Free models available:

  • DeepSeek V4 Flash Free
  • MiMo-V2.5 Free
  • Nemotron 3 Super Free
  • Big Pickle (stealth model)

Pricing (per 1M tokens, selected models):

ModelInputOutputCached Read
GPT 5.5 (≤272K)$5.00$30.00$0.50
GPT 5.4$2.50$15.00$0.25
Claude Opus 4.8$5.00$25.00$0.50
Claude Sonnet 4.6$3.00$15.00$0.30
Gemini 3.5 Flash$1.50$9.00$0.15
Kimi K2.5$0.60$3.00$0.10
MiniMax M2.7$0.30$1.20$0.06
Qwen3.6 Plus$0.20$1.20$0.02
GPT 5 Nano$0.05$0.40$0.005

Features:

  • Auto-reload: Balance below $5 triggers $20 reload (configurable, can disable)
  • Monthly limits: Set per-workspace and per-member spending caps
  • Teams: Invite teammates, assign roles (Admin/Member), curate model access, bring your own keys
  • Privacy: Zero-retention by default; free models may use data for improvement; OpenAI/Anthropic retain requests 30 days

Model ID format in config: opencode/<model-id> (e.g. opencode/gpt-5.5)

Endpoints:

  • OpenAI models: https://opencode.ai/zen/v1/responses
  • Anthropic models: https://opencode.ai/zen/v1/messages
  • Google models: https://opencode.ai/zen/v1/models/<model>
  • Other models: https://opencode.ai/zen/v1/chat/completions

OpenCode Go

OpenCode Go is a low-cost subscription plan for popular open coding models.

  • $5 first month, $10/month after that
  • Models tested and verified for coding tasks

Setup:

  1. Run /connect, select OpenCode Go, go to opencode.ai/auth
  2. Sign in, add billing, copy API key
  3. Paste API key in terminal
  4. Run /models to see available models

Usage limits:

  • 5 hour limit: $12
  • Weekly limit: $30
  • Monthly limit: $60

Available models:

  • GLM-5
  • GLM-5.1
  • Kimi K2.5
  • Kimi K2.6
  • MiMo-V2.5
  • MiMo-V2.5-Pro
  • MiniMax M2.5
  • MiniMax M2.7
  • Qwen3.6 Plus
  • Qwen3.7 Max
  • DeepSeek V4 Pro
  • DeepSeek V4 Flash

Major Providers

Anthropic (Claude)

Supports Claude Pro/Max OAuth and API keys.

Setup:

  1. Run /connect, select Anthropic
  2. Select Claude Pro/Pro Max for OAuth (opens browser) or Manually enter API Key
  3. Run /models to select model

Available models: Claude Opus 4, Claude Sonnet 4, Claude Haiku 3.5, and others.

Config example:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "anthropic": {
      "options": {
        "baseURL": "https://api.anthropic.com/v1"
      }
    }
  }
}

Note: Claude Pro/Max OAuth is the only supported way to use Anthropic subscriptions. Third-party plugins that use Claude subscriptions are explicitly prohibited by Anthropic and are no longer bundled with OpenCode as of v1.3.0.

OpenAI

Supports ChatGPT Plus/Pro OAuth and API keys.

Setup:

  1. Run /connect, select OpenAI
  2. Select ChatGPT Plus/Pro for OAuth or Manually enter API Key
  3. Run /models to select model

Using API keys: Select Manually enter API Key and paste your key.

xAI

Supports SuperGrok OAuth, device-code flow, and API keys.

Auth Method 1 — SuperGrok OAuth (browser):

  1. Run /connect, select xAI
  2. Select xAI Grok OAuth (SuperGrok Subscription)
  3. Browser opens for consent

Auth Method 2 — SuperGrok device-code (headless/VPS):

  1. Run /connect, select xAI
  2. Select xAI Grok OAuth (Headless/Remote/VPS)
  3. Visit the verification URL on another device and enter the displayed code

Auth Method 3 — API key:

  1. Create API key at console.x.ai
  2. Run /connect, select xAI
  3. Select Manually enter API Key and paste your key

Available models: Grok Beta and others.

GitHub Copilot

Uses device code flow. Requires GitHub Copilot subscription (some models need Pro+).

Setup:

  1. Run /connect, search for GitHub Copilot
  2. Navigate to github.com/login/device and enter the displayed code
  3. Wait for authorization
  4. Run /models to select model
┌ Login with GitHub Copilot
│
│ https://github.com/login/device
│
│ Enter code: 8F43-6FCF
│
└ Waiting for authorization...

Google Vertex AI

Requires Google Cloud project with Vertex AI API enabled.

Environment variables:

export GOOGLE_CLOUD_PROJECT=your-project-id
export VERTEX_LOCATION=global  # optional, defaults to global
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json

Or authenticate with gcloud:

gcloud auth application-default login

Config example:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "google-vertex": {
      "options": {
        "baseURL": "https://global-aiplatform.googleapis.com"
      }
    }
  }
}

Tip: The global region improves availability at no extra cost. Use regional endpoints (e.g. us-central1) for data residency requirements.

Amazon Bedrock

Supports multiple authentication methods with configurable precedence.

Environment variables:

# Option 1: AWS access keys
export AWS_ACCESS_KEY_ID=XXX
export AWS_SECRET_ACCESS_KEY=YYY

# Option 2: Named AWS profile
export AWS_PROFILE=my-profile

# Option 3: Bedrock bearer token
export AWS_BEARER_TOKEN_BEDROCK=XXX

Config example:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "amazon-bedrock": {
      "options": {
        "region": "us-east-1",
        "profile": "my-aws-profile",
        "endpoint": "https://bedrock-runtime.us-east-1.vpce-xxxxx.amazonaws.com"
      }
    }
  }
}

Available options:

  • region — AWS region (e.g. us-east-1, eu-west-1)
  • profile — Named profile from ~/.aws/credentials
  • endpoint — Custom endpoint URL for VPC endpoints (alias for baseURL)

Authentication methods:

  • AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY — IAM user access keys
  • AWS_PROFILE — Named profiles from ~/.aws/credentials
  • AWS_BEARER_TOKEN_BEDROCK — Long-term API keys from Bedrock console
  • AWS_WEB_IDENTITY_TOKEN_FILE / AWS_ROLE_ARN — EKS IRSA / Kubernetes OIDC

Authentication precedence:

  1. Bearer Token (AWS_BEARER_TOKEN_BEDROCK or /connect token)
  2. AWS Credential Chain (profile, access keys, shared credentials, IAM roles, Web Identity, instance metadata)

Custom inference profiles:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "amazon-bedrock": {
      "models": {
        "anthropic-claude-sonnet-4.5": {
          "id": "arn:aws:bedrock:us-east-1:xxx:application-inference-profile/yyy"
        }
      }
    }
  }
}

Azure OpenAI

Requires Azure OpenAI resource and model deployment.

Setup:

  1. Create Azure OpenAI resource in Azure portal
  2. Deploy a model in Azure AI Foundry (deployment name must match model name)
  3. Run /connect, search for Azure
  4. Enter API key
  5. Set resource name:
export AZURE_RESOURCE_NAME=XXX
  1. Run /models to select deployed model

Note: If you see "I'm sorry, but I cannot assist with that request" errors, change the content filter from DefaultV2 to Default in your Azure resource.

Azure Cognitive Services uses a separate provider with AZURE_COGNITIVE_SERVICES_RESOURCE_NAME.

GitLab Duo

Requires GitLab Premium or Ultimate subscription. Supports OAuth and personal access token.

Setup:

  1. Run /connect, select GitLab
  2. Choose authentication method:
    • OAuth (Recommended): Browser opens for authorization
    • Personal Access Token: Generate at GitLab User Settings > Access Tokens (scopes: api, token starts with glpat-)
  3. Run /models to select model

Available models:

  • duo-chat-haiku-4-5 (default) — Fast responses
  • duo-chat-sonnet-4-5 — Balanced performance
  • duo-chat-opus-4-5 — Most capable

Self-hosted GitLab:

export GITLAB_INSTANCE_URL=https://gitlab.company.com
export GITLAB_TOKEN=glpat-...
export GITLAB_AI_GATEWAY_URL=https://ai-gateway.company.com  # optional

Compliance config (lock to self-hosted):

{
  "$schema": "https://opencode.ai/config.json",
  "small_model": "gitlab/duo-chat-haiku-4-5",
  "share": "disabled"
}

OAuth for self-hosted: Create application with callback URL http://127.0.0.1:8080/callback and scopes api, read_user, read_repository. Set GITLAB_OAUTH_CLIENT_ID env var.

GitLab API tools plugin:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-gitlab-plugin"]
}

Cloud Providers

Cloudflare AI Gateway

Unified endpoint for OpenAI, Anthropic, Workers AI, and more.

Setup:

  1. Create gateway in Cloudflare dashboard > AI > AI Gateway
  2. Run /connect, search for Cloudflare AI Gateway
  3. Enter Account ID, Gateway ID, and API token

Environment variables:

export CLOUDFLARE_ACCOUNT_ID=your-32-character-account-id
export CLOUDFLARE_GATEWAY_ID=your-gateway-id
export CLOUDFLARE_API_TOKEN=your-api-token

Config:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "cloudflare-ai-gateway": {
      "models": {
        "openai/gpt-4o": {},
        "anthropic/claude-sonnet-4": {}
      }
    }
  }
}

Cloudflare Workers AI

Run AI models on Cloudflare's global network via REST API.

Environment variables:

export CLOUDFLARE_ACCOUNT_ID=your-32-character-account-id
export CLOUDFLARE_API_KEY=your-api-token

DigitalOcean

Supports OAuth (recommended) and Model Access Keys. Inference Routers route requests to optimal models.

OAuth (recommended):

  1. Run /connect, select DigitalOcean, choose Login with DigitalOcean
  2. Authorize in browser
  3. Inference Routers appear as router:<name> in model picker

Model Access Key:

export DIGITALOCEAN_ACCESS_TOKEN=your-model-access-key

Note: Inference Routers are only auto-discovered with OAuth, not with Model Access Keys.

Vercel AI Gateway

Unified endpoint for OpenAI, Anthropic, Google, xAI, and more. Models at list price.

Setup:

  1. Create API key in Vercel dashboard > AI Gateway tab
  2. Run /connect, search for Vercel AI Gateway
  3. Enter API key

Routing options:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "vercel": {
      "models": {
        "anthropic/claude-sonnet-4": {
          "options": {
            "order": ["anthropic", "vertex"],
            "only": ["anthropic"],
            "zeroDataRetention": false
          }
        }
      }
    }
  }
}

SAP AI Core

Access 40+ models from OpenAI, Anthropic, Google, Amazon, Meta, Mistral, and AI21.

Setup:

  1. Create service key in SAP BTP Cockpit
  2. Run /connect, search for SAP AI Core
  3. Enter service key JSON

Environment variables:

export AICORE_SERVICE_KEY='{"clientid":"...","clientsecret":"...","url":"...","serviceurls":{"AI_API_URL":"..."}}'
export AICORE_DEPLOYMENT_ID=your-deployment-id  # optional
export AICORE_RESOURCE_GROUP=your-resource-group  # optional

AI Platform Providers

OpenRouter

Multi-provider gateway with many preloaded models.

Setup:

  1. Create API key at openrouter.ai/settings/keys
  2. Run /connect, search for OpenRouter
  3. Enter API key

Config — add models and provider routing:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "openrouter": {
      "models": {
        "moonshotai/kimi-k2": {
          "options": {
            "provider": {
              "order": ["baseten"],
              "allow_fallbacks": false
            }
          }
        }
      }
    }
  }
}

Together AI

  1. Create account at api.together.ai, click Add Key
  2. Run /connect, search for Together AI, enter key
  3. Run /models to select

Fireworks AI

  1. Create account at app.fireworks.ai, click Create API Key
  2. Run /connect, search for Fireworks AI, enter key
  3. Run /models to select

Groq

  1. Create account at console.groq.com, click Create API Key
  2. Run /connect, search for Groq, enter key
  3. Run /models to select

Cerebras

  1. Create account at inference.cerebras.ai, generate API key
  2. Run /connect, search for Cerebras, enter key
  3. Run /models to select (e.g. Qwen 3 Coder 480B)

DeepSeek

  1. Create account at platform.deepseek.com, create API key
  2. Run /connect, search for DeepSeek, enter key
  3. Run /models to select (e.g. DeepSeek V4 Pro)

Hugging Face

Inference Providers access via 17+ providers.

  1. Create token at huggingface.co/settings/tokens with Inference Providers permission
  2. Run /connect, search for Hugging Face, enter token
  3. Run /models to select

NVIDIA

Free access to Nemotron and open models via build.nvidia.com.

  1. Create account at build.nvidia.com, generate API key
  2. Run /connect, search for NVIDIA, enter key
  3. Run /models to select

Environment variable:

export NVIDIA_API_KEY=nvapi-your-key-here

On-prem / NIM:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "nvidia": {
      "options": {
        "baseURL": "http://localhost:8000/v1"
      }
    }
  }
}

Nebius Token Factory

  1. Create account at tokenfactory.nebius.com, click Add Key
  2. Run /connect, search for Nebius Token Factory, enter key
  3. Run /models to select

Baseten

  1. Create account at app.baseten.co, generate API key
  2. Run /connect, search for Baseten, enter key
  3. Run /models to select

Deep Infra

  1. Create account at deepinfra.com/dash, generate API key
  2. Run /connect, search for Deep Infra, enter key
  3. Run /models to select

Venice AI

  1. Create account at venice.ai, generate API key
  2. Run /connect, search for Venice AI, enter key
  3. Run /models to select (e.g. Llama 3.3 70B)

Moonshot AI

  1. Create account at platform.moonshot.ai/console, create API key
  2. Run /connect, search for Moonshot AI, enter key
  3. Run /models to select (e.g. Kimi K2)

MiniMax

  1. Create account at platform.minimax.io/login, generate API key
  2. Run /connect, search for MiniMax, enter key
  3. Run /models to select (e.g. M2.1)

Cortecs

  1. Create account at cortecs.ai, generate API key
  2. Run /connect, search for Cortecs, enter key
  3. Run /models to select (e.g. Kimi K2 Instruct)

IO.NET

  1. Create account at ai.io.net, generate API key
  2. Run /connect, search for IO.NET, enter key
  3. Run /models to select

FrogBot

  1. Create account at app.frogbot.ai/signup, generate API key
  2. Run /connect, search for FrogBot, enter key
  3. Run /models to select

Z.AI

  1. Create account at z.ai/manage-apikey/apikey-list, create API key
  2. Run /connect, search for Z.AI
  3. If subscribed to GLM Coding Plan, select Z.AI Coding Plan
  4. Enter API key
  5. Run /models to select (e.g. GLM-4.7)

ZenMux

  1. Create API key at zenmux.ai/settings/keys
  2. Run /connect, search for ZenMux, enter key
  3. Run /models to select

LLM Gateway

  1. Create API key at llmgateway.io/dashboard
  2. Run /connect, search for LLM Gateway, enter key
  3. Run /models to select

Config example:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "llmgateway": {
      "models": {
        "glm-4.7": { "name": "GLM 4.7" },
        "gpt-5.2": { "name": "GPT 5.2" },
        "gemini-2.5-pro": { "name": "Gemini 2.5 Pro" }
      }
    }
  }
}

STACKIT

Sovereign European AI model serving (Llama, Mistral, Qwen).

  1. Create auth token in STACKIT Portal > AI Model Serving
  2. Run /connect, search for STACKIT, enter token
  3. Run /models to select

OVHcloud AI Endpoints

  1. Create API key in OVHcloud panel > Public Cloud > AI & Machine Learning > AI Endpoints
  2. Run /connect, search for OVHcloud AI Endpoints, enter key
  3. Run /models to select

Scaleway

  1. Generate API key in Scaleway Console IAM settings
  2. Run /connect, search for Scaleway, enter key
  3. Run /models to select

302.AI

  1. Create account at 302.ai, generate API key
  2. Run /connect, search for 302.AI, enter key
  3. Run /models to select

Helicone

LLM observability platform with logging, monitoring, and analytics.

  1. Create account at helicone.ai, generate API key
  2. Run /connect, search for Helicone, enter key
  3. Run /models to select

Custom config with headers:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "helicone": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Helicone",
      "options": {
        "baseURL": "https://ai-gateway.helicone.ai",
        "headers": {
          "Helicone-Cache-Enabled": "true",
          "Helicone-User-Id": "opencode"
        }
      },
      "models": {
        "gpt-4o": { "name": "GPT-4o" },
        "claude-sonnet-4-20250514": { "name": "Claude Sonnet 4" }
      }
    }
  }
}

Session tracking plugin:

npm install -g opencode-helicone-session
{ "plugin": ["opencode-helicone-session"] }

Common Helicone headers:

HeaderDescription
Helicone-Cache-EnabledEnable response caching (true/false)
Helicone-User-IdTrack metrics by user
Helicone-Property-[Name]Add custom properties
Helicone-Prompt-IdAssociate requests with prompt versions

Local Models

Ollama

Ollama can auto-configure itself for OpenCode. See the Ollama integration docs.

Manual config:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Ollama (local)",
      "options": {
        "baseURL": "http://localhost:11434/v1"
      },
      "models": {
        "llama2": { "name": "Llama 2" }
      }
    }
  }
}

Tip: If tool calls aren't working, increase num_ctx in Ollama to 16k-32k.

Ollama Cloud

  1. Sign in at ollama.com, go to Settings > Keys, create API key
  2. Run /connect, search for Ollama Cloud, enter key
  3. Pull model info locally first:
ollama pull gpt-oss:20b-cloud
  1. Run /models to select cloud model

llama.cpp

Uses llama-server utility from llama.cpp.

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "llama.cpp": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "llama-server (local)",
      "options": {
        "baseURL": "http://127.0.0.1:8080/v1"
      },
      "models": {
        "qwen3-coder:a3b": {
          "name": "Qwen3-Coder: a3b-30b (local)",
          "limit": {
            "context": 128000,
            "output": 65536
          }
        }
      }
    }
  }
}

LM Studio

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "lmstudio": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LM Studio (local)",
      "options": {
        "baseURL": "http://127.0.0.1:1234/v1"
      },
      "models": {
        "google/gemma-3n-e4b": { "name": "Gemma 3n-e4b (local)" }
      }
    }
  }
}

Atomic Chat

Desktop app that runs local LLMs behind an OpenAI-compatible API (default: http://127.0.0.1:1337/v1).

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "atomic-chat": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Atomic Chat (local)",
      "options": {
        "baseURL": "http://127.0.0.1:1337/v1"
      },
      "models": {
        "<your-model-id>": { "name": "<your-model-name>" }
      }
    }
  }
}

Tip: If tool calls aren't working, pick a model with strong tool-calling support (e.g. Qwen-Coder or DeepSeek-Coder).


Custom Provider

Add any OpenAI-compatible provider not listed in /connect:

  1. Run /connect, scroll to Other
  2. Enter a unique provider ID
  3. Enter your API key
  4. Configure in opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "myprovider": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "My AI Provider",
      "options": {
        "baseURL": "https://api.myprovider.com/v1",
        "apiKey": "{env:MY_PROVIDER_API_KEY}",
        "headers": {
          "Authorization": "Bearer custom-token"
        }
      },
      "models": {
        "my-model-name": {
          "name": "My Model Display Name",
          "limit": {
            "context": 200000,
            "output": 65536
          }
        }
      }
    }
  }
}

Configuration options:

  • npm — Use @ai-sdk/openai-compatible for /v1/chat/completions endpoints; use @ai-sdk/openai for /v1/responses endpoints
  • apiKey — Set using {env:VAR_NAME} syntax or literal value
  • headers — Custom headers sent with each request
  • limit.context — Maximum input tokens
  • limit.output — Maximum output tokens

The limit fields allow OpenCode to understand remaining context. Standard providers pull these from models.dev automatically.


Environment Variables

VariableProviderDescription
AWS_ACCESS_KEY_IDAmazon BedrockAWS access key
AWS_SECRET_ACCESS_KEYAmazon BedrockAWS secret key
AWS_PROFILEAmazon BedrockNamed AWS profile
AWS_REGIONAmazon BedrockAWS region
AWS_BEARER_TOKEN_BEDROCKAmazon BedrockLong-term Bedrock API key
AWS_WEB_IDENTITY_TOKEN_FILEAmazon BedrockEKS IRSA token file
AWS_ROLE_ARNAmazon BedrockEKS IRSA role ARN
GOOGLE_CLOUD_PROJECTGoogle Vertex AIGCP project ID
GOOGLE_APPLICATION_CREDENTIALSGoogle Vertex AIService account JSON path
VERTEX_LOCATIONGoogle Vertex AIRegion (default: global)
AZURE_RESOURCE_NAMEAzure OpenAIAzure resource name
AZURE_COGNITIVE_SERVICES_RESOURCE_NAMEAzure Cognitive ServicesResource name
NVIDIA_API_KEYNVIDIAAPI key
DIGITALOCEAN_ACCESS_TOKENDigitalOceanModel access key
GITLAB_TOKENGitLab DuoPersonal access token
GITLAB_INSTANCE_URLGitLab DuoSelf-hosted instance URL
GITLAB_AI_GATEWAY_URLGitLab DuoCustom AI Gateway URL
GITLAB_OAUTH_CLIENT_IDGitLab DuoOAuth app client ID (self-hosted)
CLOUDFLARE_ACCOUNT_IDCloudflareAccount ID
CLOUDFLARE_API_KEYCloudflare Workers AIAPI token
CLOUDFLARE_API_TOKENCloudflare AI GatewayAPI token
CLOUDFLARE_GATEWAY_IDCloudflare AI GatewayGateway ID
AICORE_SERVICE_KEYSAP AI CoreService key JSON
AICORE_DEPLOYMENT_IDSAP AI CoreDeployment ID (optional)
AICORE_RESOURCE_GROUPSAP AI CoreResource group (optional)

Troubleshooting

  1. Check auth setup: Run opencode auth list to verify credentials are stored. Does not apply to environment-variable-based providers (Amazon Bedrock, Google Vertex AI, etc.).
  2. Custom provider issues:
    • Ensure provider ID in /connect matches the ID in opencode.json
    • Verify correct npm package:
      • @ai-sdk/openai-compatible for /v1/chat/completions endpoints
      • @ai-sdk/openai for /v1/responses endpoints
      • Provider-specific packages (e.g. @ai-sdk/cerebras) when available
    • Verify options.baseURL is correct
  3. Clear provider cache: If models aren't appearing, try clearing the provider package cache and restarting.
  4. API call errors: Check API key validity, endpoint URL, and model availability with the provider directly.
  5. Local model issues: Ensure the local server (Ollama, llama.cpp, LM Studio) is running and accessible at the configured baseURL.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.