1. 开发工具接入
RezeAI
  • 快速开始
    • Product Introduction
    • BaseUrl
    • Generate calling code quickly using AI
    • Plugin Configuration Guide
    • Large Model Support and Channel Capability Description
    • Claude code error code explanation
  • 开发工具接入
    • OpenClaw
    • Claude Code
    • OpenCode
    • Codex
    • Gemini CLI
  • 接口说明
    • Models
      • List models
        • Native OpenAI format
        • Native Gemini format
    • Images
      • Native Gemini format
        • OpenAI chat format
        • Gemini native format
      • Native OpenAI format
        • Generate image
        • Edit image
    • Chat
      • Native OpenAI format
        • Responses format
      • Native Claude format
    • Audio
      • Native OpenAI format
        • Audio transcription
        • Audio translation
        • Text-to-speech
      • Native Gemini format
    • Wanxiang 2.7 Images
      • Wanxiang 2.7 text-to-image (sync)
      • Wanxiang 2.7 image edit (async polling)
    • GeminiVeo
      • Gemini Veo
        • Create video task
        • Create video task (/video/generations)
      • Task query
        • Query video task
        • Query video task (/video/generations)
        • Proxy-download the video of a completed task
    • Seedance Asset Library
      • Asset groups
        • ModelArk asset Universal OpenAPI (official Query style)
        • Create asset group
        • List asset groups
        • Get asset group details
        • Update asset group
        • Delete asset group
      • Assets
        • Create asset (upload URL)
        • List assets
        • Get asset details
        • Update asset
        • Delete asset
      • Live person verification
        • Create live person H5 verification session
        • Query live person verification result
    • Sora
      • Sora 2
        • Remix video
    • Kling
      • Text-to-video
        • Kling text-to-video
      • Image-to-video
        • Kling image-to-video
      • Task query
        • Query text-to-video task
        • Query image-to-video task
    • Jimeng
      • Jimeng official API
        • Jimeng official submit/query (distinguished by Action)
    • Embeddings
      • Native OpenAI format
      • Native Gemini format
    • Completions
      • Native OpenAI format
    • Realtime
      • Native OpenAI format
    • Rerank
      • Document reranking
    • Moderations
      • Native OpenAI format
    • 数据模型
      • Schemas
        • ModelsResponse
        • ToolCall
        • GeminiModelsResponse
        • ChatCompletionResponse
        • CompletionRequest
        • CompletionResponse
        • ResponsesResponse
        • ClaudeRequest
        • ClaudeMessage
        • ClaudeResponse
        • EmbeddingResponse
        • ImageResponse
        • AudioTranscriptionResponse
        • RerankResponse
        • ModerationRequest
        • ModerationResponse
        • GeminiRequest
        • GeminiResponse
      • Model
      • Usage
      • SoraVideoTaskCreated
      • KlingErrorResponse
      • JimengVideoTaskCreated
      • HailuoVideoTaskCreated
      • ViduVideoTaskCreated
      • GeminiVeoVideoTaskCreated
      • VertexVeoVideoTaskCreated
      • HappyHorseMediaItem
      • MediaItem
      • KlingTaskCreated
      • HappyHorseVideoTaskCreated
      • Message
      • SoraErrorResponse
      • KlingVideoTaskStatus
      • JimengErrorResponse
      • HailuoErrorResponse
      • ViduErrorResponse
      • ListFilterBase
      • GeminiVeoErrorResponse
      • VertexVeoErrorResponse
      • WanVideoTaskCreated
      • HappyHorseVideoTaskStatus
      • ArkListFilterBase
      • MessageContent
      • JimengOfficialSubmitRequest
      • ErrorResponse
      • ListAssetGroupsRequest
      • HappyHorseErrorResponse
      • SeedanceErrorResponse
      • Tool
      • ImageGenerationResponse
      • WanImageGenerationResponse
      • ListAssetsRequest
      • WanErrorResponse
      • GetAssetRequest
      • GetAssetGroupRequest
      • ChatCompletionRequest
      • UpdateAssetGroupRequest
      • UpdateAssetRequest
      • DeleteAssetRequest
      • ResponseFormat
      • DeleteAssetGroupRequest
      • ResponsesRequest
      • GatewayError
      • ArkGatewayError
      • EmbeddingRequest
      • SpeechRequest
      • RerankRequest
      • VideoRequest
      • VideoResponse
      • VideoTaskResponse
      • VideoTaskMetadata
      • VideoTaskError
      • OpenAIVideoError
      • HappyHorseVideoRequest
      • SeedanceVideoRequest
      • ProjectName
      • WanVideoRequest
      • ArkProjectName
      • SoraVideoRequest
      • KlingVideoRequest
      • JimengVideoRequest
      • HailuoVideoRequest
      • ViduVideoRequest
      • GeminiVeoVideoRequest
      • VertexVeoVideoRequest
      • CreateAssetGroupRequest
      • Wan27ImageRequest
      • SeedanceMetadata
      • VideoTaskCreated
      • CreateAssetRequest
      • Wan27ImageEditRequest
      • SeedanceVideoTaskCreated
      • SoraVideoTaskStatus
      • JimengVideoTaskStatus
      • HailuoVideoTaskStatus
      • ViduVideoTaskStatus
      • GeminiVeoVideoTaskStatus
      • VertexVeoVideoTaskStatus
      • VideoTaskStatus
      • SeedanceVideoTaskStatus
      • WanVideoTaskStatus
      • ListAssetsFilter
      • ArkListAssetsFilter
      • JimengOfficialGetResultRequest
      • CreateVisualValidateSessionRequest
      • GetVisualValidateResultRequest
      • UpstreamResultEnvelope
      • ArkUpstreamResultEnvelope
  1. 开发工具接入

OpenCode

OpenCode Integration with RezeAI Tutorial#

OpenCode is a powerful terminal AI programming tool (supporting both CLI and TUI interfaces), enabling code generation, project analysis, and file operations directly in the terminal using natural language.
This article will guide you through replacing OpenCode's underlying models with the RezeAI aggregation interface, resulting in a more stable and cost-effective programming assistance experience (supporting both GPT and Claude series models).

I. Pre-Integration Preparation (3 Core Elements)#

Please log in to the RezeAI console to obtain your dedicated access information:
| Configuration Items | Recommended Content | Notes |
| :--- | :--- | :--- |
| API Key | sk-xxxxxxxxxxxxxxxx | Please directly enter the Key generated in the RezeAI console |
| Base URL | https://api.rezeai.com/v1 | Must include the /v1 suffix |
| Model Name | For example, gpt-5 or claude-opus-4-6 | Enter the model that RezeAI actually supports and that your account has permission to access |

II. Installing OpenCode#

Please ensure that Node.js (version 18 or higher) is installed on your computer.
If your environment does not have Node.js, click here to download
Open a terminal (Windows recommends using PowerShell, macOS/Linux uses the terminal), and run the following commands:
NPM global installation (Windows recommended):
Official one-click installation script (macOS/Linux recommended):
After installation, run opencode --version. If the version number is output successfully, the installation is successful.

III. Configuring and Starting RezeAI#

To allow you to seamlessly use both GPT and Claude models simultaneously, it is recommended to directly modify the OpenCode local configuration file.

Step 1: Configure the Network Node (Provider)#

1.
Locate or create the configuration file:
Windows path: C:\Users\Your username\.config\opencode\opencode.json
macOS / Linux path: ~/.config/opencode/opencode.json
(If the corresponding folder does not exist, please create it manually)
2.
Paste the following JSON content into it and save it (this will override the default addresses of OpenAI and Anthropic):
``json
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"openai": {
"options": {
"baseURL": "https://api.rezeai.com/v1"
}
},
"anthropic": {
"options": {
"baseURL": "https://api.rezeai.com/v1"
}
}
}
}

### Step 2: Configure the Authentication Key (Auth)

1. Locate or create the key file:

* **Windows path**: `C:\Users\Your Username\.local\share\opencode\auth.json`

* **macOS / Linux path**: `~/.local/share/opencode/auth.json`

*(If the corresponding folder does not exist, please create it manually)*

2. Paste the following JSON content and save it (**Remember to replace `sk-...` with your actual RezeAI API Key**):

``json

{
"openai": {

"type": "api",

"key": "sk-your RezeAI key"

},

"anthropic": {

"type": "api",

"key": "sk-your RezeAI key"

}
}

IV. Getting Started and Model Switching#

After configuration, reopen your terminal to begin using it.
1.
Call up the model list: Type /models in the input box and press Enter. Select the model you want to use from the list (for example, if you select the Claude model, it will automatically use the Anthropic channel configured above).
2.
Start the conversation: Enter your first command, for example:
Write a piece of Python bubble sort code
If the model can read the request correctly and stream the code, congratulations, RezeAI has been successfully integrated!

V. Common Problem Troubleshooting (FAQ)#

Q1: Why does it say authentication failed / Invalid API Key?
Check if the API Key in auth.json is copied completely, ensuring there are no extra spaces.
Check if the file format is standard JSON (punctuation marks must be English half-width characters).
Q2: Why does it say connection timed out or Fetch Failed? **
Please ensure that the baseURL in opencode.json correctly includes the /v1 suffix (i.e., https://api.rezeai.com/v1).
Q3: Why does it say "Model not found"?
You can enter /models in the dialog box to view the list of models currently supported by the tool. As long as you select a model and the RezeAI backend supports mapping that model, it can be used normally.
修改于 2026-08-18 13:37:44
上一页
Claude Code
下一页
Codex
Built with