Documentation menu

Providers

Anthropic

Uses the Ahena CLI (beta). Install it with npm install -g @ahena/cli, or prefix commands with npx @ahena/cli. See Installation. The dashboard covers projects, connections, Doctor, the Stack Graph, plans and approvals without it.

Overview

Ahena checks your Anthropic API key and the configured model (context window and output limit), and generates an adapter behind the common ahena.ai interface using the official @anthropic-ai/sdk. Your app calls the Anthropic API directly. Ahena is never in the inference path, and its checks use only the Models API, so they cost nothing.

Package: @ahena/provider-anthropic · Category: ai · Default model: claude-opus-5-5

Connection

ANTHROPIC_API_KEY (secret, sk-ant-…).

ANTHROPIC_API_KEY=sk-ant-… ahena connect anthropic -e production

Permissions

Ahena only reads the Models API. Create a dedicated key in a workspace with a spend limit, and give your app its own key.

Capabilities

Capability What Ahena does
text-generation Generates src/ahena/ai/providers/anthropic.ts behind ahena.ai.generate(); ahena.ai.raw is the SDK client.
model-availability Checks ai.model with models.retrieve and reports context window and max output.

The generated adapter enables server-side refusal fallbacks (fallbacks: "default" with the server-side-fallback-2026-07-01 beta): if a request is declined by a safety classifier, the API retries it on a suitable fallback model within the same call. Remove those two lines to opt out. A final refusal becomes a clear error.

Network: only api.anthropic.com (enforced).

Limitations

  • The common interface covers text generation. Tool use, streaming, files and other features use ahena.ai.raw (Anthropic-specific code; ahena switch reports it).
  • Rate limits and spend are managed in the Anthropic Console.

Manual steps

  1. Create a key at https://platform.claude.com/settings/keys in a workspace with a spend limit.
  2. Set ANTHROPIC_API_KEY (and AI_PROVIDER=anthropic if several adapters exist) where your app runs.

Doctor checks

Id Severity Meaning
anthropic.key PASS / FAIL Key accepted by the Models API.
anthropic.model PASS / FAIL Model available, with context window and max output as evidence.

Disconnect behavior

Removes the connection and the key Ahena stored. Revoke the key in the Anthropic Console. Nothing else is changed.