Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ echo '{"message":"hi"}' | agent
opencode:

```bash
echo '{"message":"hi"}' | opencode run --format json --model opencode/grok-code
echo '{"message":"hi"}' | opencode run --format json --model opencode/kimi-k2.5-free
```

### Plain Text Input (@link-assistant/agent only)
Expand All @@ -60,7 +60,7 @@ echo '{"message":"hello world"}' | agent
**opencode:**

```bash
echo '{"message":"hello world"}' | opencode run --format json --model opencode/grok-code
echo '{"message":"hello world"}' | opencode run --format json --model opencode/kimi-k2.5-free
```

## File Operations
Expand All @@ -78,7 +78,7 @@ echo '{"message":"run command","tools":[{"name":"bash","params":{"command":"echo
**opencode:**

```bash
echo '{"message":"run command","tools":[{"name":"bash","params":{"command":"echo hello world"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"run command","tools":[{"name":"bash","params":{"command":"echo hello world"}}]}' | opencode run --format json --model opencode/kimi-k2.5-free
```

**Example with description:**
Expand All @@ -100,7 +100,7 @@ echo '{"message":"read file","tools":[{"name":"read","params":{"file_path":"/pat
**opencode:**

```bash
echo '{"message":"read file","tools":[{"name":"read","params":{"file_path":"/path/to/file.txt"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"read file","tools":[{"name":"read","params":{"file_path":"/path/to/file.txt"}}]}' | opencode run --format json --model opencode/kimi-k2.5-free
```

### write Tool
Expand All @@ -116,7 +116,7 @@ echo '{"message":"write file","tools":[{"name":"write","params":{"file_path":"/t
**opencode:**

```bash
echo '{"message":"write file","tools":[{"name":"write","params":{"file_path":"/tmp/test.txt","content":"Hello World"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"write file","tools":[{"name":"write","params":{"file_path":"/tmp/test.txt","content":"Hello World"}}]}' | opencode run --format json --model opencode/kimi-k2.5-free
```

### edit Tool
Expand All @@ -132,7 +132,7 @@ echo '{"message":"edit file","tools":[{"name":"edit","params":{"file_path":"/tmp
**opencode:**

```bash
echo '{"message":"edit file","tools":[{"name":"edit","params":{"file_path":"/tmp/test.txt","old_string":"Hello","new_string":"Hi"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"edit file","tools":[{"name":"edit","params":{"file_path":"/tmp/test.txt","old_string":"Hello","new_string":"Hi"}}]}' | opencode run --format json --model opencode/kimi-k2.5-free
```

### list Tool
Expand All @@ -148,7 +148,7 @@ echo '{"message":"list directory","tools":[{"name":"list","params":{"path":"."}}
**opencode:**

```bash
echo '{"message":"list directory","tools":[{"name":"list","params":{"path":"."}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"list directory","tools":[{"name":"list","params":{"path":"."}}]}' | opencode run --format json --model opencode/kimi-k2.5-free
```

## Search Tools
Expand All @@ -170,7 +170,7 @@ echo '{"message":"find ts files","tools":[{"name":"glob","params":{"pattern":"sr
**opencode:**

```bash
echo '{"message":"find js files","tools":[{"name":"glob","params":{"pattern":"**/*.js"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"find js files","tools":[{"name":"glob","params":{"pattern":"**/*.js"}}]}' | opencode run --format json --model opencode/kimi-k2.5-free
```

### grep Tool
Expand All @@ -193,7 +193,7 @@ echo '{"message":"search error","tools":[{"name":"grep","params":{"pattern":"err
**opencode:**

```bash
echo '{"message":"search pattern","tools":[{"name":"grep","params":{"pattern":"TODO","output_mode":"content"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"search pattern","tools":[{"name":"grep","params":{"pattern":"TODO","output_mode":"content"}}]}' | opencode run --format json --model opencode/kimi-k2.5-free
```

### websearch Tool
Expand All @@ -211,7 +211,7 @@ echo '{"message":"search web","tools":[{"name":"websearch","params":{"query":"Re
**opencode (requires OPENCODE_EXPERIMENTAL_EXA=true):**

```bash
echo '{"message":"search web","tools":[{"name":"websearch","params":{"query":"TypeScript latest features"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"search web","tools":[{"name":"websearch","params":{"query":"TypeScript latest features"}}]}' | opencode run --format json --model opencode/kimi-k2.5-free
```

### codesearch Tool
Expand All @@ -229,7 +229,7 @@ echo '{"message":"search code","tools":[{"name":"codesearch","params":{"query":"
**opencode (requires OPENCODE_EXPERIMENTAL_EXA=true):**

```bash
echo '{"message":"search code","tools":[{"name":"codesearch","params":{"query":"React hooks implementation"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"search code","tools":[{"name":"codesearch","params":{"query":"React hooks implementation"}}]}' | opencode run --format json --model opencode/kimi-k2.5-free
```

## Execution Tools
Expand All @@ -252,7 +252,7 @@ mkdir -p .link-assistant-agent
echo '{"experimental":{"batch_tool":true}}' > .link-assistant-agent/opencode.json

# Then run
echo '{"message":"run batch","tools":[{"name":"batch","params":{"tool_calls":[{"tool":"bash","parameters":{"command":"echo hello"}},{"tool":"bash","parameters":{"command":"echo world"}}]}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"run batch","tools":[{"name":"batch","params":{"tool_calls":[{"tool":"bash","parameters":{"command":"echo hello"}},{"tool":"bash","parameters":{"command":"echo world"}}]}}]}' | opencode run --format json --model opencode/kimi-k2.5-free
```

### task Tool
Expand All @@ -268,7 +268,7 @@ echo '{"message":"launch task","tools":[{"name":"task","params":{"description":"
**opencode:**

```bash
echo '{"message":"launch task","tools":[{"name":"task","params":{"description":"Analyze codebase","prompt":"Find all TODO comments in JavaScript files","subagent_type":"general-purpose"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"launch task","tools":[{"name":"task","params":{"description":"Analyze codebase","prompt":"Find all TODO comments in JavaScript files","subagent_type":"general-purpose"}}]}' | opencode run --format json --model opencode/kimi-k2.5-free
```

## Utility Tools
Expand All @@ -290,7 +290,7 @@ echo '{"message":"read todos","tools":[{"name":"todoread","params":{}}]}' | agen
**opencode:**

```bash
echo '{"message":"add todos","tools":[{"name":"todowrite","params":{"todos":[{"content":"Implement feature X","status":"pending","activeForm":"Implementing feature X"}]}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"add todos","tools":[{"name":"todowrite","params":{"todos":[{"content":"Implement feature X","status":"pending","activeForm":"Implementing feature X"}]}}]}' | opencode run --format json --model opencode/kimi-k2.5-free
```

### webfetch Tool
Expand All @@ -306,7 +306,7 @@ echo '{"message":"fetch url","tools":[{"name":"webfetch","params":{"url":"https:
**opencode:**

```bash
echo '{"message":"fetch url","tools":[{"name":"webfetch","params":{"url":"https://example.com","prompt":"Summarize the content"}}]}' | opencode run --format json --model opencode/grok-code
echo '{"message":"fetch url","tools":[{"name":"webfetch","params":{"url":"https://example.com","prompt":"Summarize the content"}}]}' | opencode run --format json --model opencode/kimi-k2.5-free
```

## Output Format
Expand Down
42 changes: 31 additions & 11 deletions MODELS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,23 @@ This agent supports multiple model providers. By default, it uses models from th
All models are accessed using the format `<provider>/<model-id>`. Use the `--model` option to specify which model to use:

```bash
echo "hi" | agent --model opencode/grok-code
echo "hi" | agent --model opencode/gpt-5-nano
```

## OpenCode Zen Pricing

Below are the prices per 1M tokens for OpenCode Zen models. Models are sorted by output price (lowest first) for best pricing visibility.

| Model | Model ID | Input | Output | Cached Read | Cached Write |
| ---------------------------------------- | --------------------------- | ------ | ------ | ----------- | ------------ |
| Model | Model ID | Input | Output | Cached Read | Cached Write |
| ---------------------------------------- | ----------------------------- | ------ | ------ | ----------- | ------------ |
| **Free Models (Output: $0.00)** |
| Grok Code Fast 1 | `opencode/grok-code` | Free | Free | Free | - |
| GPT 5 Nano | `opencode/gpt-5-nano` | Free | Free | Free | - |
| Big Pickle | `opencode/big-pickle` | Free | Free | Free | - |
| Kimi K2.5 Free (recommended) | `opencode/kimi-k2.5-free` | Free | Free | Free | - |
| MiniMax M2.1 Free | `opencode/minimax-m2.1-free` | Free | Free | Free | - |
| GPT 5 Nano | `opencode/gpt-5-nano` | Free | Free | Free | - |
| GLM 4.7 Free | `opencode/glm-4.7-free` | Free | Free | Free | - |
| Big Pickle | `opencode/big-pickle` | Free | Free | Free | - |
| **Discontinued Free Models** |
| ~~Grok Code Fast 1~~ | `opencode/grok-code` | ~~Free~~ | ~~Free~~ | ~~Free~~ | - |
| **Paid Models (sorted by output price)** |
| Qwen3 Coder 480B | `opencode/qwen3-coder-480b` | $0.45 | $1.50 | - | - |
| GLM 4.6 | `opencode/glm-4-6` | $0.60 | $2.20 | $0.10 | - |
Expand All @@ -52,25 +56,41 @@ Below are the prices per 1M tokens for OpenCode Zen models. Models are sorted by

## Default Model

The default model is **Grok Code Fast 1** (`opencode/grok-code`), which is completely free. This model provides excellent performance for coding tasks with no cost.
The default model is **Kimi K2.5 Free** (`opencode/kimi-k2.5-free`), which is completely free and recommended for coding tasks.

> **Note:** Grok Code Fast 1 (`opencode/grok-code`) was previously the default free model, but xAI ended the free tier for this model on OpenCode Zen in January 2026. **The grok-code model is no longer included as a free model in OpenCode Zen subscription.** See [Case Study #133](docs/case-studies/issue-133/README.md) for details.

### Free Models (in order of recommendation)

1. **Kimi K2.5 Free** (`opencode/kimi-k2.5-free`) - Best recommended free model
2. **MiniMax M2.1 Free** (`opencode/minimax-m2.1-free`) - Good alternative
3. **GPT 5 Nano** (`opencode/gpt-5-nano`) - Reliable free option
4. **GLM 4.7 Free** (`opencode/glm-4.7-free`) - Another free option
5. **Big Pickle** (`opencode/big-pickle`) - Basic free model

## Usage Examples

### Using the Default Model (Free)

```bash
# Uses opencode/grok-code by default
# Uses opencode/kimi-k2.5-free by default
echo "hello" | agent
```

### Using Other Free Models

```bash
# Big Pickle (free)
echo "hello" | agent --model opencode/big-pickle
# MiniMax M2.1 Free
echo "hello" | agent --model opencode/minimax-m2.1-free

# GPT 5 Nano (free)
# GPT 5 Nano
echo "hello" | agent --model opencode/gpt-5-nano

# GLM 4.7 Free
echo "hello" | agent --model opencode/glm-4.7-free

# Big Pickle (basic free)
echo "hello" | agent --model opencode/big-pickle
```

### Using Paid Models
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ See [rust/README.md](rust/README.md) for full documentation.

We're creating a slimmed-down, public domain version of OpenCode CLI focused on the "agentic run mode" for use in virtual machines, Docker containers, and other environments where unrestricted AI agent access is acceptable. This is **not** for general desktop use - it's for isolated environments where you want maximum AI agent freedom.

**OpenCode Compatibility**: We maintain 100% compatibility with OpenCode's JSON event streaming format, so tools expecting `opencode run --format json --model opencode/grok-code` output will work with our agent-cli.
**OpenCode Compatibility**: We maintain 100% compatibility with OpenCode's JSON event streaming format, so tools expecting `opencode run --format json --model opencode/kimi-k2.5-free` output will work with our agent-cli.

## Features

Expand Down Expand Up @@ -111,7 +111,7 @@ echo '{"message":"hi"}' | agent
**With custom model:**

```bash
echo "hi" | agent --model opencode/grok-code
echo "hi" | agent --model opencode/kimi-k2.5-free
```

**Direct prompt mode:**
Expand Down
Loading