Use Poolside models in OpenCode - Poolside
Watch the setup video
Poolside with OpenCode
Prerequisites
- You have one of the following:
- A Poolside Platform API key. To create one, go to platform.poolside.ai.
- An API key for your organization’s Poolside deployment.
- An OpenRouter API key with access to Poolside models. To create one, go to OpenRouter API keys.
Steps
- Poolside Platform
- Poolside deployment
- OpenRouter
- In Poolside Platform, open API Keys.
- Click New key.
- Copy the API key.
- In OpenCode, run the
/connectcommand.
/connect
```
05. Scroll to **Other**.
06. Enter `poolside` as the provider ID.
poolside
```
- Enter your Poolside Platform API key.
- Add an example Poolside provider to your
opencode.jsonfile. Themodelsblock below is an example. Use a Poolside model available to your API key. To find model IDs for your access method, see List available models.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"poolside": {
"npm": "@ai-sdk/openai-compatible",
"name": "Poolside",
"options": {
"baseURL": "https://inference.poolside.ai/v1"
},
"models": {
"<poolside-model-id>": {
"name": "Poolside model"
}
}
}
}
}
```
09. Run the `/models` command.
/models
```
- Select a Poolside model.
- Start a new chat and send a codebase question to confirm OpenCode responds with the selected Poolside model.
If you run Poolside on your own infrastructure, set the base URL to your deployment’s OpenAI-compatible endpoint instead. Replace <api-domain> with your deployment’s host. The path is /openai/v1.
To use OpenCode with your organization’s Poolside deployment, configure Poolside as a custom OpenAI-compatible provider and provide your API key through the POOLSIDE_API_KEY environment variable.
export POOLSIDE_API_KEY="<api-key>"
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"poolside": {
"npm": "@ai-sdk/openai-compatible",
"name": "Poolside",
"env": ["POOLSIDE_API_KEY"],
"options": {
"baseURL": "https://poolside.example.com/openai/v1"
}
}
}
}
env: Environment variables OpenCode reads your API key from.options.baseURL: Your deployment’s OpenAI-compatible endpoint.
Run the /models command, select a Poolside model, then start a new chat and send a codebase question to confirm OpenCode responds with the selected Poolside model.
- In OpenCode, run the
/connectcommand.
/connect
```
2. Select **OpenRouter**.
3. Enter your OpenRouter API key. To create one, go to [OpenRouter API keys](https://openrouter.ai/keys).
4. Select a Poolside model. OpenRouter may offer free and paid Poolside models. To see current availability, see [Poolside models on OpenRouter](https://openrouter.ai/poolside).
5. Start a new chat and send a codebase question to confirm OpenCode responds with the selected Poolside model.