Use OpenCode with STACKIT AI Model Serving
Last updated on
Prerequisites
Section titled “Prerequisites”- You have a STACKIT customer account: Create a customer Account
- You have a STACKIT user account: Create a user account
- You have a STACKIT project: Create a project
What is OpenCode?
Section titled “What is OpenCode?”OpenCode is an open-source AI coding assistant that runs in your terminal. It provides intelligent code completions, explanations, and refactoring suggestions powered by various LLM providers. STACKIT AI Model Serving is available as an official built-in provider in OpenCode, allowing you to use STACKIT’s hosted models directly in your development workflow.
For installation and system requirements, refer to the OpenCode documentation.
Get a STACKIT AI Model Serving Auth Token
Section titled “Get a STACKIT AI Model Serving Auth Token”To authenticate with STACKIT AI Model Serving, you need to create an auth token. Refer to Manage auth tokens to create your token in the STACKIT Portal.
Configure OpenCode to use STACKIT AI Model Serving
Section titled “Configure OpenCode to use STACKIT AI Model Serving”Refer to the OpenCode STACKIT Provider documentation for configuration steps. You will need your STACKIT AI Model Serving Auth Token during the setup.
See Available Shared Models for the complete list of available models.
Troubleshooting
Section titled “Troubleshooting”Authentication errors
Section titled “Authentication errors”If you receive authentication errors:
- Verify your auth token is still valid (tokens expire based on the
ttlDurationset during creation) - Run
/connectagain and re-enter your token - Ensure you have access to the STACKIT project
Connection errors
Section titled “Connection errors”If OpenCode cannot connect to STACKIT:
- Check your network connection and firewall settings
- Ensure the STACKIT AI Model Serving API is accessible from your network
- Verify your auth token has not expired
Model not found
Section titled “Model not found”If you receive “model not found” errors:
- Run
/modelsto see the current list of available models - Check Available Shared Models for the current model catalog
- Some models may have been updated or deprecated