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

# Configure Anthropic Claude as Cynative's LLM Provider

> Set up Cynative with Anthropic's Claude models. Configure API key, model selection, reasoning effort, and prompt caching for cost efficiency.

Cynative supports Anthropic's Claude family through the Bifrost `anthropic` provider. Claude models are well-suited to security research workloads: large context windows, strong instruction-following, and native support for extended thinking (reasoning). Cynative also automatically enables prompt caching for Anthropic, so repeated tool schemas and system prompts are billed at the cached read rate.

## Quick start

```bash theme={null}
export ANTHROPIC_API_KEY=sk-ant-...
export CYNATIVE_LLM_PROVIDER=anthropic
export CYNATIVE_LLM_MODEL=claude-opus-4-7
cynative -p "enumerate S3 buckets and check each one for public access"
```

No `~/.cynative/config.yaml` file is required.

## YAML configuration

```yaml theme={null}
llm:
  provider: anthropic
  model: claude-opus-4-7
  api_key: env.ANTHROPIC_API_KEY    # optional — falls back to ANTHROPIC_API_KEY env var
  network_config:
    default_request_timeout_in_seconds: 300
    max_retries: 3
    extra_headers:                  # optional; must be set in YAML (map — no env form)
      anthropic-beta: tools-2024-04-04
```

## Authentication

Get an API key from [console.anthropic.com/settings/keys](https://console.anthropic.com/settings/keys). Cynative resolves the key in this order:

1. `llm.api_key` in YAML (or `CYNATIVE_LLM_API_KEY` env var).
2. `llm.keys[]` in YAML (for multi-key load balancing or model filters).
3. `ANTHROPIC_API_KEY` — the canonical fallback.

Setting both `llm.api_key` and `llm.keys[]` is rejected at startup.

## Reasoning (extended thinking)

Claude models that support extended thinking expose it through Cynative's provider-portable `reasoning_effort` and `reasoning_max_tokens` fields:

```yaml theme={null}
llm:
  provider: anthropic
  model: claude-opus-4-7
  api_key: env.ANTHROPIC_API_KEY
  reasoning_effort: high            # pick ONE of the two forms:
  # reasoning_max_tokens: 8192      # explicit budget (takes priority over effort)
```

Or via environment variables:

```bash theme={null}
export CYNATIVE_LLM_REASONING_EFFORT=high
```

### How reasoning maps to Anthropic's API

| Cynative field | Behavior |
| - | - |
| `reasoning_effort` | Derives a thinking budget from the effort level. On Claude Opus 4.7+ (adaptive thinking), any non-`none` effort simply switches on adaptive thinking. |
| `reasoning_max_tokens` | Sets an explicit thinking budget. On pre-4.7 models, the minimum is **1,024** — smaller budgets are rejected at request time. On Opus 4.7+, any numeric value switches on adaptive thinking; the exact number is ignored. |
| Both set together | `reasoning_max_tokens` takes priority and the effort level is ignored. |
| `reasoning_effort: none` | Explicitly disables thinking. Combining `none` with `reasoning_max_tokens` is rejected at config validation. |

## Prompt caching

Cynative marks the stable prefix of every request with ephemeral cache breakpoints — the tool schemas, the system prompt, and the last two conversation turns. Anthropic's API caches that prefix and bills cached reads at a significant discount.

Key points:

* **Cache TTL:** Anthropic's default **five-minute ephemeral TTL**. Back-to-back calls (e.g. unattended `--auto-approve` runs) benefit the most; long human-approval pauses may let the cache expire.
* **Nothing to configure.** Caching is on automatically for the `anthropic` provider (and for Claude models on `bedrock` and `vertex`).
* **Write vs. read cost.** The first call in a window pays a write cost; subsequent calls within the window pay only the (cheaper) read cost. The Anthropic usage dashboard shows the split.

## Environment variable reference

| Environment variable | YAML equivalent | Description |
| - | - | - |
| `ANTHROPIC_API_KEY` | `llm.api_key` | Anthropic API key (`sk-ant-...`). |
| `CYNATIVE_LLM_PROVIDER` | `llm.provider` | Must be `anthropic`. |
| `CYNATIVE_LLM_MODEL` | `llm.model` | Model id (e.g. `claude-opus-4-7`, `claude-sonnet-4-5`). |
| `CYNATIVE_LLM_API_KEY` | `llm.api_key` | Generic key override (takes priority over `ANTHROPIC_API_KEY`). |
| `CYNATIVE_LLM_NETWORK_CONFIG_DEFAULT_REQUEST_TIMEOUT_IN_SECONDS` | `llm.network_config.default_request_timeout_in_seconds` | Per-request timeout in seconds. Cynative default: `300`. |
| `CYNATIVE_LLM_NETWORK_CONFIG_MAX_RETRIES` | `llm.network_config.max_retries` | Retry attempts on 429/5xx errors. Cynative default: `3`. |
| `CYNATIVE_LLM_REASONING_EFFORT` | `llm.reasoning_effort` | `none`, `minimal`, `low`, `medium`, or `high`. |
| `CYNATIVE_LLM_REASONING_MAX_TOKENS` | `llm.reasoning_max_tokens` | Explicit thinking budget in tokens (integer, minimum 1024 for pre-4.7 models). |

## Links

* [Anthropic API reference](https://docs.anthropic.com/en/api)
* [Bifrost Anthropic provider source](https://github.com/maximhq/bifrost/tree/main/core/providers/anthropic)


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