Stop paying monthly subscriptions. Connect OpenCode to Zeabur AI Hub to access GPT-5 and Claude 4.5 in your terminal with a unified pay-as-you-go API.
Imagine a tool as powerful as Claude Code, but with the ability to switch models from GPT-5 to Claude Sonnet 4.5 instantly—without manually managing multiple subscriptions and API keys.
OpenCode has emerged as the premier OpenCode CLI for developers who want a GPT-5 terminal coding assistant. However, configuring it effectively requires the right infrastructure. By integrating Zeabur AI Hub, developers can unlock a flexible model that provides access to top-tier LLMs without the burden of fixed monthly fees.
In this article, we will explain what the OpenCode CLI and Zeabur AI Hub are, and guide you through the setup process to get a unified LLM API key for developers.

OpenCode is an open-source AI coding assistant designed to live in your terminal. Unlike proprietary tools that lock you into a specific model, OpenCode is provider-agnostic. This allows you to route your coding queries to OpenAI, Anthropic, or custom endpoints. Its flexibility makes it a favorite among developers who value privacy and data control over their codebase.
Zeabur is a modern deployment platform that simplifies infrastructure for developers. The Zeabur AI Hub acts as a unified API gateway that aggregates various LLM providers (like OpenAI and Anthropic) into a single endpoint.
This unified infrastructure is versatile—it powers not just OpenCode, but also other advanced integrations like Codex, ensuring you have a consistent experience across all your AI tools.
Key Benefits of this Integration:
Follow this tutorial to configure your environment in under 2 minutes.
Install OpenCode CLI: Ensure you have the tool installed on your machine.
npm install -g opencode
Zeabur Credentials:
Choose your Endpoint: For the lowest latency, pick the endpoint closest to your location:
https://hnd1.aihub.zeabur.ai/https://sfo1.aihub.zeabur.ai/OpenCode uses a configuration file to manage custom providers. We will add Zeabur as a compatible provider to enable model switching.
Create or edit the OpenCode configuration file located at ~/.config/opencode/config.json.
# Open the config file in your preferred editor
nano ~/.config/opencode/config.json
Paste the following configuration. Note: You can swap the baseURL for the US endpoint (sfo1) if you are in the Americas.
{
"$schema": "<https://opencode.ai/config.json>",
"provider": {
"zeabur": {
"npm": "@ai-sdk/openai-compatible",
"name": "Zeabur AI Hub",
"options": {
"baseURL": "<https://hnd1.aihub.zeabur.ai/>"
},
"models": {
"claude-sonnet-4-5": {
"name": "Claude Sonnet 4.5"
},
"claude-haiku-4-5": {
"name": "GPT-5-Codex"
},
"gpt-5":{
"name": "GPT 5"
}
}
}
}
}
Save the file (Ctrl+O -> Enter) and Exit (Ctrl+X).
Now that the configuration is set, you need to authenticate using the OpenCode CLI.
Run the tool:
opencode
Enter the connection command:
/connect
Select Zeabur AI Hub from the list of providers.
Paste your Zeabur AI Hub API Key when prompted.
You are now connected! You can switch between the latest models without changing API keys.
Why developers are switching to this setup:
Happy Coding!