OpenCode Integration
Use OpenCode as an AI coding assistant with TULIP.
Prerequisites
- OpenCode installed (
npm install -g opencodeor via installation docs) - A valid TULIP API key
- Access to the TU Delft network (or eduVPN)
Setup
1. Create the Configuration File
Create or edit ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"tudelft-tulip": {
"npm": "@ai-sdk/openai-compatible",
"name": "TU Delft Tulip",
"options": {
"baseURL": "https://api.tulip.tudelft.nl/chat/v1",
"apiKey": "{env:TUDELFT_TULIP_API_KEY}"
},
"models": {
"chat": {
"name": "Tulip Chat"
}
}
}
}
}
2. Set Your API Key
Add the environment variable to your shell profile (~/.bashrc, ~/.zshrc, or equivalent):
Reload your shell or run source ~/.bashrc (or ~/.zshrc).
3. Verify
Select the TU Delft Tulip provider and Tulip Chat model when prompted.
Usage
Start an interactive coding session:
Use /models to switch models mid-session.
Use /connect to manage provider connections.
Troubleshooting
"Unauthorized" or "request was blocked"
- Verify
TUDELFT_TULIP_API_KEYis set:echo $TUDELFT_TULIP_API_KEY - Ensure the
apiKeyfield inopencode.jsonuses the correct syntax:"{env:TUDELFT_TULIP_API_KEY}"
Connection timeout
Verify you are on the TU Delft network or connected via eduVPN.
Model not found
The default model is chat. See Model Mapping for available models.