OpenCode Integration
Configure OpenCode to use Nyxos API through its Anthropic and OpenAI provider connections.
OpenCode is an AI coding agent for the terminal. It is configured with a JSON file — global at ~/.config/opencode/opencode.json or per-project at opencode.json in the project root. Nyxos API plugs into both of its first-party provider types.
Installation
With Node.js 18+ (install it from nodejs.org if needed):
npm install -g opencode-ai
opencode --versionConfiguration
Edit or create your opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"anthropic": {
"options": {
"baseURL": "https://api.nyxos.shop/v1",
"apiKey": "sk-5KjBXu1tjqZVzRq0W8Byi1qlbnboSkZzwtobHoXW5OCvRkkZ"
}
},
"openai": {
"options": {
"baseURL": "https://api.nyxos.shop/v1",
"apiKey": "sk-6ZFnmOM61Uw1NI16zCXRdIWa8FZ1JXwHWgremu0UncWEJR8G"
}
}
}
}anthropicprovider — for Claude models through the gateway's Anthropic-style routing.openaiprovider — for GPT, Grok and the rest of the OpenAI-compatible catalog.- Both use the same
https://api.nyxos.shop/v1base URL and one of yoursk-...keys (the keys above are examples — replace them with your own from API Keys).
Security notice: the API key lives in plain text in this file. Keep
opencode.jsonout of version control when it contains a real key (add it to.gitignorein project repos).
Select a Model
Launch OpenCode and switch to one of the configured providers:
opencode
/modelsPick an exact model ID from /pricing under the anthropic/ or openai/ provider — your key's group must include it (the automatic Auto-A group covers the catalog).