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

# Claude Agent SDK provider

> Bridge provider claude-sdk — Anthropic Agent SDK with API key or CLI login

Provider id: **`claude-sdk`** · CtrlNode agent type: **`ClaudeAgentSdk`**

Uses `@anthropic-ai/claude-agent-sdk` to run agentic tasks in the task workspace. CtrlNode labels this **Claude** in the UI (SDK mode).

## When to use it

* You have an **Anthropic API key** and want programmatic tool access
* You need configurable tool lists (`Read`, `Write`, `Bash`, etc.)
* You run headless servers without Claude Code subscription

## Prerequisites

**Option A — API key (servers)**

```env theme={null}
ANTHROPIC_API_KEY=sk-ant-...
```

**Option B — CLI login (workstation)**

```bash theme={null}
npm install -g @anthropic-ai/claude-code
claude login
```

Optional: set `CLAUDE_SDK_EXECUTABLE` to a custom `claude` binary path on Linux.

## Environment variables

| Variable                     | Default                          | Description                                       |
| ---------------------------- | -------------------------------- | ------------------------------------------------- |
| `ANTHROPIC_API_KEY`          | —                                | API key (if not using CLI login)                  |
| `CLAUDE_SDK_TOOLS`           | `Read,Write,Edit,Bash,Glob,Grep` | Allowed tools                                     |
| `CLAUDE_SDK_MAX_TURNS`       | `50`                             | Max turns                                         |
| `CLAUDE_SDK_TIMEOUT_MINUTES` | `10`                             | Task timeout                                      |
| `CLAUDE_SDK_PERMISSION_MODE` | `bypassPermissions`              | `bypassPermissions` \| `acceptEdits` \| `dontAsk` |
| `CLAUDE_SDK_EXECUTABLE`      | —                                | Path to `claude` binary                           |
| `BASE_PATH`                  | Home                             | Workspace root                                    |

## Example `.env`

```env theme={null}
PAIRING_TOKEN=...
PROVIDERS=claude-sdk
ANTHROPIC_API_KEY=sk-ant-...
BASE_PATH=/home/you
```

## CtrlNode setup

1. Project agent type **Claude** / `ClaudeAgentSdk`
2. Register agents in **Team**
3. Start Bridge with key or login present

## Combine providers

```env theme={null}
PROVIDERS=claude-sdk,copilot
ANTHROPIC_API_KEY=...
COPILOT_GITHUB_TOKEN=...
```

## Troubleshooting

| Issue                               | Fix                                           |
| ----------------------------------- | --------------------------------------------- |
| Warning `anthropic_api_key_missing` | Set `ANTHROPIC_API_KEY` or run `claude login` |
| SDK cannot find binary              | Set `CLAUDE_SDK_EXECUTABLE`                   |
| Task uses CLI provider instead      | Agent type must be `ClaudeAgentSdk`           |

[← All providers](/bridge/providers)
