CONNECT OPENCODE

Set your OpenCode base URL. Start with a lower API rate.

Connect Codimixa in OpenCode using your API key and the exact model ID from the catalog. Choose a model that supports the features your coding task needs.

Selected model rates from 0.3× official API pricing

Keep three values together.

Use the Codimixa base URL, a Codimixa API key and an available model ID in the same configuration.

SettingValue
baseURLhttps://api.codimixa.com/v1
apiKeyYour Codimixa key, read from your local environment
Model IDCopy the exact ID from the Codimixa model page

Choose the config file.

Put opencode.json in your project root, or use ~/.config/opencode/opencode.json for a user-wide default. Matching project settings override global settings. OPENCODE_CONFIG selects a custom file; check project and managed settings if your choice is overridden. These instructions follow the OpenCode documentation checked October 25, 2026.

Add the connection to OpenCode.

Use @ai-sdk/openai for GPT models that use Responses, including GPT-6 Astra and GPT-6.1 Sol. Save this example in opencode.json and set CODIMIXA_API_KEY in your local environment.

json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "codimixa": {
      "npm": "@ai-sdk/openai",
      "name": "Codimixa",
      "options": {
        "baseURL": "https://api.codimixa.com/v1",
        "apiKey": "{env:CODIMIXA_API_KEY}"
      },
      "models": {
        "gpt-6-astra": {
          "name": "GPT-6 Astra"
        }
      }
    }
  },
  "model": "codimixa/gpt-6-astra"
}

Choose the adapter for another model.

Use @ai-sdk/openai-compatible for Chat Completions models such as deepseek-v4.1-flash. Change both the models key and the final model value to the exact Codimixa ID. GPT-6.1 Sol requires Responses for tool calling.

Set the default model or switch for one run.

The model value is provider_id/model_id: codimixa/gpt-6-astra in this example. Both keys must exist in your provider configuration. Use /models to switch interactively; an explicit --model option takes priority over the configured default.

bash
opencode --version
opencode --model codimixa/gpt-6-astra

Try text first, then an editing task.

Ask OpenCode to explain one function. Next, ask for a small edit with a test you can run locally. Review the patch and inspect your account usage. Keep the client version and exact model ID with the result before using the setup for a larger change.

Resolve the common setup mistakes.

Start with the error from one small request. Repeating a configuration error adds no useful evidence.

SymptomCheck next
Authentication failsThe environment variable is available to the OpenCode process and contains a Codimixa key.
Model is missingThe provider key, models key and provider/model value agree exactly.
Wrong default startsCheck --model, project config and managed settings before changing the global file.
Text works, tools failMatch the model’s recommended API format to the adapter and inspect the response.
Unexpected usageInspect all turns and billed categories for the task, including retries.

Keep the price visible as context grows.

Selected model rates start at 0.3× the matching official API reference. Longer sessions still send more context; compare the model’s actual rates with a representative coding session.

A FEW DETAILS

Before you continue

Should I put /chat/completions in the base URL?

For this configuration, use https://api.codimixa.com/v1 as the base URL. The selected adapter supplies the request path.

Which adapter sends Responses requests?

Use @ai-sdk/openai for /v1/responses. Use @ai-sdk/openai-compatible for /v1/chat/completions. The example above selects Responses for GPT-6 Astra.

Reference documentation

OpenCode — ProvidersOpenCode — Models