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

# Coding agent setup

> Any agent that speaks the OpenAI protocol can run on Pearl, three settings, no code changes.

Coding agents are chat completions in a [tool loop](/docs/function-calling.md), so pointing one at Pearl is the same everywhere: a **base URL**, an **API key**, and a **model ID**. Every model in the catalog supports tools; start with `deepseek-ai/DeepSeek-V4-Pro-0813` for hard, long-context work and `zai-org/GLM-5.3-Flash` when latency and cost matter more. See [Models](/docs/models.md).

## The universal route: environment variables

Tools built on the official OpenAI SDKs read the standard variables, often that's the entire setup:

```bash theme={null}
export OPENAI_BASE_URL="https://inference.pearlresearch.ai/v1"
export OPENAI_API_KEY="$PEARL_API_KEY"
```

## opencode

Add a custom provider to `~/.config/opencode/opencode.json` (this exact setup runs Pearl's own engineering work), then pick a Pearl model from the model picker:

```json ~/.config/opencode/opencode.json theme={null}
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "pearl": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Pearl Inference",
      "options": {
        "baseURL": "https://inference.pearlresearch.ai/v1",
        "apiKey": "{env:PEARL_API_KEY}"
      },
      "models": {
        "deepseek-ai/DeepSeek-V4-Pro-0813": {"name": "DeepSeek V4 Pro"},
        "zai-org/GLM-5.3": {"name": "GLM-5.3"},
        "zai-org/GLM-5.3-Flash": {"name": "GLM-5.3 Flash"}
      }
    }
  }
}
```

## Aider

Aider routes OpenAI-compatible providers through the `openai/` model prefix:

```bash theme={null}
export OPENAI_API_BASE="https://inference.pearlresearch.ai/v1"
export OPENAI_API_KEY="$PEARL_API_KEY"

aider --model openai/deepseek-ai/DeepSeek-V4-Pro-0813
```

## Cline, Continue, and other IDE agents

IDE assistants with a provider picker all follow the same shape: choose **OpenAI Compatible** as the provider type, set the base URL to `https://inference.pearlresearch.ai/v1`, paste a Pearl API key, and enter a catalog model ID verbatim (they're namespaced, `zai-org/GLM-5.3`, not `glm`).

## Verify before blaming the tool

When an agent misbehaves, first prove the credentials and model work with one request, it separates configuration problems from tool problems in ten seconds:

```bash theme={null}
curl https://inference.pearlresearch.ai/v1/chat/completions \
  -H "Authorization: Bearer $PEARL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "deepseek-ai/DeepSeek-V4-Pro-0813", "messages": [{"role": "user", "content": "ping"}], "max_tokens": 10}'
```

## What makes agents run well on Pearl

* **Agent loops are the textbook [prompt-caching](/docs/prompt-caching.md) case**, long system prompts and an append-only transcript replay on every iteration, so the cached-input discount compounds across the whole run.
* **Watch `finish_reason`.** Agents that truncate mid-edit usually hit `max_tokens` during the thinking phase, raise the cap or lower `reasoning.effort`.
* **Give the agent its own API key** ("agents-dev"), so you can [revoke](/docs/api-keys.md) a runaway loop without touching production, and attribute its spend in [Analytics](/docs/analytics.md).

> [!NOTE]
>
> Agents retry aggressively by design, make sure your retry policy respects the [error semantics](/docs/inference.md): back off on `429`/`5xx`, but stop on `402`, no amount of retrying refills a balance.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.