Install OpenCode and Connect It to Moyi API

OpenCode is an open-source AI coding assistant that can run in terminal and desktop/web-style interfaces.

New accounts start with a $0 balance — top up before your first request. Top up from $5. If a request returns 402 with "wallet balance is insufficient", your balance is empty — your base URL and key are fine. Top up and retry.

1. Connect to Moyi API

If OpenCode Desktop is already installed, add Moyi API:

  1. Open OpenCode Desktop and click the settings icon in the lower-left corner.

  1. In the left navigation, choose Server -> Providers.
  2. At the bottom of the provider list, find Custom provider and click Connect.

  1. Fill in the custom provider form:
  • Provider ID: moyiapi
  • Display name: Moyi API
  • Base URL: https://api.moyi-api.com/v1
  • API key: paste the key you created in the Moyi API dashboard
  1. In Models, click Add model and add the model IDs you need.
Available model IDs34 models

OpenAIGPT9

  • gpt-6.1-sol
  • gpt-6-astra
  • gpt-6-sol
  • gpt-6-luna
  • gpt-5.6-sol
  • gpt-5.6-terra
  • gpt-5.6-luna
  • gpt-5.5
  • gpt-5.4

ClaudeClaude12

  • claude-opus-5-5
  • claude-sonnet-5-5
  • claude-haiku-5-5
  • claude-fable-5-1
  • claude-opus-5
  • claude-fable-5
  • claude-sonnet-5
  • claude-opus-4-8
  • claude-opus-4-7
  • claude-opus-4-6
  • claude-sonnet-4-6
  • claude-haiku-4-5

GeminiGemini5

  • gemini-3.8-flash
  • gemini-3.7-flash
  • gemini-3.6-flash
  • gemini-3.5-flash-lite
  • gemini-3.1-pro-preview

DeepSeekDeepSeek4

  • deepseek-flash
  • deepseek-v4-flash-vision-exp
  • deepseek-v4-pro
  • deepseek-v4-flash

ZhipuGLM3

  • glm-5.3-flash
  • glm-5.3
  • glm-5.2

GrokGrok1

  • grok-4.6
  1. Leave request headers empty.
  2. Click Submit to save.

Note: Because of an OpenCode client limitation, custom providers only support the OpenAI protocol. Calling Claude models this way can miss cache hits, cause requests to fail, and incur unnecessary costs. We do not recommend using Claude models in OpenCode. Use a Claude client when you need Claude models.

2. Install OpenCode from scratch

Download and install

Install or upgrade from the OpenCode download page.

Run and configure

Run:

plaintext
opencode

Add Moyi API

Open OpenCode Desktop and follow steps 1 to 7 in the previous section.

Set the model

In Settings, choose Server -> Models and switch the default chat model to a Moyi API model. New conversations will use it by default.

Start using OpenCode

Return to the main OpenCode Desktop screen and create a new conversation.

Ready? Three steps to startLog in to the console · top up · create an API key