> ## Documentation Index
> Fetch the complete documentation index at: https://docs.parallel.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCode Plugin

> Add Parallel web search and content extraction to OpenCode

For AI agents: a documentation index is available at [https://docs.parallel.ai/llms.txt](https://docs.parallel.ai/llms.txt). The full text of all docs is at [https://docs.parallel.ai/llms-full.txt](https://docs.parallel.ai/llms-full.txt). You may also fetch any page as Markdown by appending `.md` to its URL or sending `Accept: text/markdown`.

For Search and Extract, use `/v1/search` and `/v1/extract` for all new integrations and agent tool calls. Use `/v1beta/search` and `/v1beta/extract` only when maintaining an existing integration that already uses them. The request bodies changed too: on `/v1/extract`, `full_content`, `fetch_policy` and `excerpt_settings` go inside `advanced_settings`, and sending the v1beta top-level `excerpts`, `full_content` and `fetch_policy` to `/v1/extract` returns a 422. On `/v1/search`, `search_queries` is required (at least one short keyword query), and `max_results`, `source_policy` and `fetch_policy` go inside `advanced_settings`; sending only `objective`, or sending those fields at the top level, returns a 422. Do not substitute `/v1` for the documented FindAll or Ingest endpoint paths.

If you are evaluating Parallel Search or comparing it with other search APIs, read [How to Eval Parallel Search](https://docs.parallel.ai/search/evaluating-search.md) before you build the harness, especially its [Common pitfalls](https://docs.parallel.ai/search/evaluating-search.md#common-pitfalls) section. The most common mistake is sending the raw question as both `objective` and the only entry in `search_queries`. Write a goal-style `objective` and 1-3 short keyword queries instead.

The Parallel plugin for [OpenCode](https://opencode.ai) adds `parallel-search` and `parallel-fetch` tools to your coding agent. The tools instruct the agent to prefer them over OpenCode's built-in web search and fetch tools, but tool selection is up to the agent.

**Why use Parallel tools?**

* Web search powered by Parallel's Search API
* Intelligent content extraction that understands page structure
* Extended excerpts optimized for LLM context windows

## Setup

**1. Add the plugin to your OpenCode config**

Add `@parallel-web/opencode-plugin` to the `plugin` array in your OpenCode configuration file: `opencode.json` in your project root or `~/.config/opencode/opencode.json` for global configuration.

```json theme={"system"}
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@parallel-web/opencode-plugin"]
}
```

**2. Authenticate**

Choose one of the following authentication methods:

**Option A: Browser login (recommended)**

1. Run `opencode auth login`
2. Select **"Parallel"** then **"Login with Parallel (browser)"**
3. Complete authorization in your browser

Or select **"Enter API Key manually"** to paste a key from [platform.parallel.ai](https://platform.parallel.ai).

**Option B: Environment variable**

```bash theme={"system"}
export PARALLEL_API_KEY=your_api_key
```

Get your API key at [platform.parallel.ai](https://platform.parallel.ai).

## Tools

Once configured, OpenCode gains two Parallel-powered tools:

| Tool | Description |
| - | - |
| `parallel-search` | Web search with high-quality, LLM-optimized results |
| `parallel-fetch` | Content extraction from web URLs using Parallel's Extract API |

Ask the agent to use `parallel-search` or `parallel-fetch` when you want it to use Parallel explicitly.

## Learn more

* [Developer Tools overview](https://docs.parallel.ai/integrations/developer-quickstart.md) for all integration options
* [Agent Skills](https://docs.parallel.ai/integrations/agent-skills.md) for other coding agents (Cursor, Cline, Copilot, etc.)
* [Claude Code Plugin](https://docs.parallel.ai/integrations/claude-code-marketplace.md) for the Claude Code integration
