Skip to main content
OpenCode is an AI coding agent that runs in your terminal. You can connect it to NagaAI by defining a custom provider in ~/.config/opencode/opencode.json and then authenticating with your NagaAI API key inside OpenCode.

Setup

1

Install OpenCode

Follow the official installation docs at https://opencode.ai/docs.You can install it with the official install script:
curl -fsSL https://opencode.ai/install | bash
Or install it with npm:
npm install -g opencode-ai
2

Create a NagaAI API key

Create an API key in the dashboard: https://naga.ac/dashboard.
If you’re new to NagaAI, follow the Quickstart first.
3

Add NagaAI as a custom provider

Open ~/.config/opencode/opencode.json and configure a custom provider named naga-ai:
{
  "$schema": "https://opencode.ai/config.json",
  "disabled_providers": [],
  "provider": {
    "naga-ai": {
      "name": "NagaAI",
      "npm": "@ai-sdk/openai",
      "models": {
        "gpt-5.4": {
          "name": "GPT 5.4",
          "limit": {
            "context": 1050000,
            "output": 128000
          },
          "modalities": {
            "input": ["text", "image"],
            "output": ["text"]
          }
        }
      },
      "options": {
        "baseURL": "https://api.naga.ac/v1"
      }
    }
  }
}
This example registers gpt-5.4, but you can add other NagaAI models too. For agentic coding, prefer models with tools support.
4

Connect your API key in OpenCode

Start OpenCode in your project directory:
opencode
Then run:
/connect
In the provider list:
  1. Select NagaAI
  2. Paste your NagaAI API key
  3. Save the credential
5

Choose the model and start coding

After connecting, select the configured NagaAI model in OpenCode and start your session.
The provider base URL should be https://api.naga.ac/v1.

Notes

  • Config file: ~/.config/opencode/opencode.json
  • Base URL: https://api.naga.ac/v1
  • Provider name in config: naga-ai
  • Display name in OpenCode: NagaAI
  • Recommended starter model: gpt-5.4

Try it

  • “Summarize this repository: structure, build system, and entry points.”
  • “Find where feature X is implemented and list the relevant files.”
  • “Run tests and fix the first failing test.”
  • “Refactor module Y and update all call sites.”