- Documentation
- Use Palepale in OpenCode
Use Palepale in OpenCode
Set up the provider, choose a model, and keep credentials out of your configuration.
Before you connect
Install OpenCode using its official installation guide. Activate Palepale access and get your gateway base URL, device credential and approved model ID. The base URL ends with /v1.
Set the connection variables
export PALEPALE_BASE_URL="https://YOUR_GATEWAY/v1"export PALEPALE_API_KEY="YOUR_DEVICE_CREDENTIAL"In PowerShell:
$env:PALEPALE_BASE_URL = "https://YOUR_GATEWAY/v1"$env:PALEPALE_API_KEY = "YOUR_DEVICE_CREDENTIAL"Launch OpenCode from this terminal so it inherits the variables.
Merge the provider configuration
Add the following provider to your existing opencode.json. Keep the other settings and replace the model placeholder with an ID from your gateway catalog.
{ "$schema": "https://opencode.ai/config.json", "provider": { "palepale": { "npm": "@ai-sdk/openai-compatible", "name": "Palepale", "options": { "baseURL": "{env:PALEPALE_BASE_URL}", "apiKey": "{env:PALEPALE_API_KEY}" }, "models": { "REPLACE_WITH_APPROVED_MODEL_ID": { "name": "Your selected model" } } } }}Environment references keep the secret out of this file. Alternatively, use /connect, select Other and enter provider ID palepale and your credential; omit options.apiKey when using the stored credential.
Select the model
Run /models in OpenCode and choose your Palepale entry. Send a short prompt first. Use a tool-capable model for agent tasks; a model name alone does not establish its capabilities.
Match limits and prices
Read GET /v1/models from your activated gateway. Copy confirmed limits and rates into OpenCode's model settings when needed:
- limit.context corresponds to context_window; limit.output corresponds to max_output_tokens.
- cost.input, cost.output and cost.cache_read use the catalog's per-million-token rates.
- Enable tool_call, reasoning and temperature only when the catalog confirms them.
- Reasoning-enabled streams use reasoning_content. OpenCode's model settings must support that field to display it.
The manual model list is a snapshot. Update its IDs when the gateway catalog changes; this configuration does not install an automatic catalog-refresh plugin.
Resolve setup issues
If Palepale is missing from /models, check JSON syntax and that the provider is named palepale. For 401, check the inherited environment variable or saved credential. For 404, recheck the base URL and model ID. For 429, follow the limits guide.
This provider uses chat completions. Choose the compatible driver shown above. See OpenCode's provider settings and configuration variables for application-specific details.
Need a hand?
Open Palepale Discord for activation or account support. Compare API offers or choose a plan.