Overview
Edgee’s OpenAI-compatible API works seamlessly with OpenCode, allowing you to leverage OpenCode’s powerful CLI agent capabilities while maintaining control over your LLM infrastructure.Configuration
To use Edgee with OpenCode, you need to configure theopencode.json configuration file. Open or create ~/.config/opencode/opencode.json and add the following configuration:
"your-edgee-api-key" with your actual Edgee API key.
Usage
Once configured, you can select the configured models directly within the OpenCode CLI interface. When you launch OpenCode, you will be able to choose from the models you defined in themodels section of your configuration (e.g., “mistral small (edgee)”, “gpt-4 (edgee)”, etc.).
Authentication
Edgee uses standard Bearer token authentication. Your API key configured inopencode.json is automatically used to authenticate requests to the Edgee API.
Benefits of Using OpenCode with Edgee
Unified Infrastructure
Access all LLM providers through Edgee while using OpenCode’s developer-friendly CLI.
Cost Control
Leverage Edgee’s cost tracking and routing while building applications with OpenCode.
Reliability
Combine OpenCode’s agent capabilities with Edgee’s automatic failover and load balancing.
Observability
Monitor your OpenCode sessions with Edgee’s built-in observability features.
Next Steps
- Explore OpenCode’s documentation for more features
- Check out Edgee’s routing capabilities for intelligent model selection
- Set up observability to monitor your OpenCode sessions