# OpenCode

### **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

Start with the one-liner curl install - no Docker or complex deps needed:

`curl -fsSL https://opencode.ai/install | bash ​.`

This adds the opencode CLI globally.&#x20;

Verify with `opencode --version`, then launch via opencode.&#x20;

For VS Code integration, it pairs seamlessly as an LSP client.&#x20;

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

## Setup guide <a href="#openrouter-setup" id="openrouter-setup"></a>

Infron powers model access via its [OpenAI-compatible API ](https://app.gitbook.com/s/oWo5LeOZTLqTSLX7mP7F/openai-compatible-api).​​​

Configure the endpoint through the GUI.

<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&#x26;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/`

```json
{
    "$schema": "https://opencode.ai/config.json",
    "disabled_providers": [
        "infronai"
    ],
    "provider": {
        "infronai": {
            "name": "infronai",
            "npm": "@ai-sdk/openai-compatible",
            "models": {
                "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
                    }
                }
            },
            "options": {
                "baseURL": "http://localhost:3000/v1"
            }
        }
    }
}
```

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&#x26;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&#x26;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&#x26;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: 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 current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
