> For the complete documentation index, see [llms.txt](https://infronai.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infronai.gitbook.io/docs/frameworks-and-integrations/opencode.md).

# OpenCode

Kickstart OpenCode with Infron

### **Account & API Keys Setup**

The first step to start using Infron is to [create an account](https://infron.ai/login) and [get your API key](https://infron.ai/dashboard/apiKeys).

### Installation OpenCode

{% code collapsedlinecount="10" %}

```bash
# Official install script
curl -fsSL https://opencode.ai/install | bash

# npm
npm install -g opencode-ai

# pnpm
pnpm install -g opencode-ai

# bun
bun install -g opencode-ai

# macOS / Linux Homebrew tap
brew install anomalyco/tap/opencode

# Verify
opencode --version
opencode
```

{% endcode %}

Full docs: [opencode.ai/docs](https://opencode.ai/docs)

Inside the TUI, run `/connect`, choose `Other`, set provider id to `infronai`, then paste the Infron API key. Alternatively use `INFRON_API_KEY` through environment variables.​​

### Infron model discovery

{% code collapsedlinecount="10" %}

```bash
open https://infron.ai/models

curl -sL --noproxy '*' 'https://infron.ai/llms-full.txt' | less

curl -sL --noproxy '*' 'https://infron.ai/llms-full.txt' \
  | rg -n 'gpt-5|claude|gemini|deepseek|qwen|kimi|glm'
```

{% endcode %}

### opencode.json setup <a href="#infron-setup" id="infron-setup"></a>

<figure><img src="https://3822312837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9C9AjT7j46HAcQrOVWw%2Fuploads%2FrwYQBlWL3NBgtGoZxwK8%2Fimg_v3_02vs_b07ca50f-f78d-4de6-a87d-fd04b5e6b0ag.jpg?alt=media&amp;token=effc1e93-ccdf-4091-9a4b-41cca003eeb1" alt=""><figcaption></figcaption></figure>

By default, the customer provider configuration in Opencode enables only text‑chat capabilities. To enable the full range of model features (such as multimodal file inputs), you must manually add the following configuration items to the configuration file.

`cd ~/.config/opencode/`

{% code collapsedlinecount="10" %}

```json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "infronai": {
      "name": "Infron AI",
      "npm": "@ai-sdk/openai-compatible",
      "models": {
        "openai/gpt-5.2": {
          "name": "GPT-5.2",
          "attachment": true,
          "reasoning": true,
          "tool_call": true,
          "temperature": true,
          "release_date": "2026-06-01",
          "modalities": {
            "input": ["text", "image"],
            "output": ["text"]
          },
          "cost": {
            "input": 0,
            "output": 0
          },
          "limit": {
            "context": 400000,
            "output": 128000
          }
        },
        "openai/gpt-5-mini": {
          "name": "GPT-5 Mini",
          "attachment": true,
          "reasoning": true,
          "tool_call": true,
          "temperature": true,
          "release_date": "2026-06-01",
          "modalities": {
            "input": ["text", "image"],
            "output": ["text"]
          },
          "cost": {
            "input": 0,
            "output": 0
          },
          "limit": {
            "context": 400000,
            "output": 128000
          }
        },
        "anthropic/claude-opus-4.8": {
          "name": "Claude Opus 4.8",
          "attachment": true,
          "reasoning": true,
          "tool_call": true,
          "temperature": true,
          "release_date": "2026-06-01",
          "modalities": {
            "input": ["text", "image", "pdf"],
            "output": ["text"]
          },
          "cost": {
            "input": 0,
            "output": 0
          },
          "limit": {
            "context": 200000,
            "output": 32000
          }
        },
        "anthropic/claude-opus-4.6": {
          "name": "Claude Opus 4.6",
          "attachment": true,
          "reasoning": true,
          "tool_call": true,
          "temperature": true,
          "release_date": "2026-06-01",
          "modalities": {
            "input": ["text", "image", "pdf"],
            "output": ["text"]
          },
          "cost": {
            "input": 0,
            "output": 0
          },
          "limit": {
            "context": 200000,
            "output": 32000
          }
        },
        "anthropic/claude-sonnet-4.5": {
          "name": "Claude Sonnet 4.5",
          "attachment": true,
          "reasoning": true,
          "tool_call": true,
          "temperature": true,
          "release_date": "2025-09-29",
          "modalities": {
            "input": ["text", "image", "pdf"],
            "output": ["text"]
          },
          "cost": {
            "input": 0,
            "output": 0
          },
          "limit": {
            "context": 200000,
            "output": 32000
          }
        },
        "google/gemini-3-flash-preview": {
          "name": "Gemini 3 Flash Preview",
          "attachment": true,
          "reasoning": true,
          "tool_call": true,
          "temperature": true,
          "release_date": "2025-11-01",
          "modalities": {
            "input": ["text", "image", "pdf"],
            "output": ["text"]
          },
          "cost": {
            "input": 0.5,
            "output": 3
          },
          "limit": {
            "context": 1000000,
            "output": 65535
          }
        },
        "google/gemini-2.5-flash": {
          "name": "Gemini 2.5 Flash",
          "attachment": true,
          "reasoning": true,
          "tool_call": true,
          "temperature": true,
          "release_date": "2025-06-01",
          "modalities": {
            "input": ["text", "image", "pdf"],
            "output": ["text"]
          },
          "cost": {
            "input": 0,
            "output": 0
          },
          "limit": {
            "context": 1000000,
            "output": 65535
          }
        },
        "deepseek/deepseek-v3.2": {
          "name": "DeepSeek V3.2",
          "attachment": false,
          "reasoning": false,
          "tool_call": true,
          "temperature": true,
          "release_date": "2026-06-01",
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "cost": {
            "input": 0,
            "output": 0
          },
          "limit": {
            "context": 128000,
            "output": 32000
          }
        },
        "qwen/qwen3-coder-plus": {
          "name": "Qwen3 Coder Plus",
          "attachment": false,
          "reasoning": false,
          "tool_call": true,
          "temperature": true,
          "release_date": "2026-06-01",
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "cost": {
            "input": 0,
            "output": 0
          },
          "limit": {
            "context": 128000,
            "output": 32000
          }
        },
        "moonshotai/kimi-k2-0905": {
          "name": "Kimi K2 0905",
          "attachment": false,
          "reasoning": true,
          "tool_call": true,
          "temperature": true,
          "release_date": "2025-09-05",
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "cost": {
            "input": 0,
            "output": 0
          },
          "limit": {
            "context": 128000,
            "output": 32000
          }
        },
        "z-ai/glm-5": {
          "name": "GLM-5",
          "attachment": false,
          "reasoning": true,
          "tool_call": true,
          "temperature": true,
          "release_date": "2026-06-01",
          "modalities": {
            "input": ["text"],
            "output": ["text"]
          },
          "cost": {
            "input": 0,
            "output": 0
          },
          "limit": {
            "context": 128000,
            "output": 32000
          }
        }
      },
      "options": {
        "baseURL": "https://llm.onerouter.pro/v1",
        "apiKey": "{env:INFRON_API_KEY}"
      }
    }
  }
}
```

{% endcode %}

After completing the configuration, you can start the Opencode CLI.

<figure><img src="https://3822312837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9C9AjT7j46HAcQrOVWw%2Fuploads%2FoxOxWLJXt2IPHGtCAeot%2Fimg_v3_02v8_7be41848-7b3f-4132-a42c-8a2ad1bb867g.jpg?alt=media&amp;token=25f7596e-8be3-4965-afe4-35e80126ad6a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3822312837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9C9AjT7j46HAcQrOVWw%2Fuploads%2FdSJKjnxXtdP0CLspPFNj%2Fimg_v3_02v8_22014869-436a-4b7b-a164-1b14eb34688g.jpg?alt=media&amp;token=55a13d33-7155-4a89-b936-f10fd24c8c0a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3822312837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9C9AjT7j46HAcQrOVWw%2Fuploads%2F0EQwxn5QN3GDXOzgGVfT%2Fimg_v3_02v8_c6969e54-9ef8-4fe3-be3a-7b28a240e0eg.jpg?alt=media&amp;token=1358b885-794d-4f4a-814b-3e9ab0a63e29" alt=""><figcaption></figcaption></figure>

### Basic Usage <a href="#basic-usage" id="basic-usage"></a>

Run `opencode` in a repo to init: It prompts project context, then use slash commands in the TUI.​

* `/connect`: Link Infron (auto-detects env vars).
* `/models`: List/select (e.g., Claude 3.5 Sonnet or Gemini 3 Flash).
* `/init`: Scans repo, suggests plan (e.g., "Analyze main.rs and create layers").
* Core flow: `/plan` for outline, `/build` to generate`/run` code, `/improve` for refinements.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://infronai.gitbook.io/docs/frameworks-and-integrations/opencode.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
