AI

Anthropic integration

Ahena works with your Anthropic account: it checks your API key and the configured model (context window and output limit), and generates an adapter behind the common ahena.ai interface on the official SDK. Your app calls the Anthropic API directly. Ahena is never in the inference path.

Live verifiedLive verified: key validation, model discovery and DoctorFull Anthropic docs

What Ahena inspects

Read-only: inspecting and Doctor never change anything at Anthropic.

  • Whether the key is accepted by the Models API.
  • The models the key can see (ahena inspect anthropic), and your configured model's context window and max output.

Nothing to configure

Anthropic has nothing to plan or apply. Ahena gives you Doctor, model discovery and a generated adapter behind the common ahena.ai interface, so each environment can use a different AI provider. See AI providers.

Generated code: src/ahena/ai/providers/anthropic.ts behind ahena.ai.generate(), on the official SDK, with server-side refusal fallbacks enabled (two lines you can remove to opt out); ahena.ai.raw is the client.

How Ahena verifies

There's nothing to read back: Ahena changes nothing in your account, so there's no plan, apply or VERIFIED state. Doctor runs read-only checks and records PASS, INFO, WARNING or FAIL findings.

Checks use only the Models API, so they cost nothing. Ahena never sends a message on your account.

What Doctor diagnoses

Key checks from ahena doctor. Each finding says why it matters, where, the impact and whether Ahena can fix it. The full list is in the Anthropic docs.

CheckWhat it means
anthropic.keyKey accepted by the Models API.
anthropic.modelModel available, with context window and max output as evidence.

More on findings, health and continuous checks: Doctor.

Approvals

There's nothing to approve: connecting, Doctor, ahena inspect and ahena generate change nothing in your Anthropic account. Generated code is written to your repository, where you review it like any other change.

Manual steps

Ahena can't do these for you:

  • Create a key in the Anthropic Console, in a workspace with a spend limit.
  • Set ANTHROPIC_API_KEY (and AI_PROVIDER=anthropic if several adapters exist) where your app runs.

Credentials and permissions

NameSecretNotes
ANTHROPIC_API_KEYYesAn API key (sk-ant-…).

Least privilege

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

Each credential Ahena stores gets its own key and is envelope-encrypted, bound to the environment. See security.

Workflow example

Connect, check, then generate. There's no plan or apply step for an AI provider.

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

    Connect the key.

  2. ahena doctor -e production

    Check the key and the configured model's limits.

  3. ahena inspect anthropic -e production

    List the models this key can see.

  4. ahena generate -e production

    Write the ahena.ai adapter for this environment's provider.

Verification status

Live verified

Live verified: key validation, model discovery and Doctor

Verified against the real provider API for the capabilities listed. Its other capabilities are validated by Ahena's automated provider contract and conformance tests.

How Anthropic is tested
  • Verified against the real Anthropic API, read-only, using only the Models API: key validation with a valid and a deliberately wrong key, model listing, retrieving the configured model, Doctor and disconnect. A confirming rerun on 2026-10-04 passed.
  • No generation request was sent: the test harness refuses every non-GET request.
  • The generated adapter is typechecked against the official SDK, not run.

The providers overview explains Ahena's testing methodology and what has been verified for every provider.

Limitations

  • The common interface covers text generation. Tool use, streaming, files and other features use ahena.ai.raw, which is Anthropic-specific.
  • Rate limits and spend are managed in the Anthropic Console.
  • There's no drift tracking for AI providers.

Disconnecting

ahena disconnect anthropic removes the stored key (revoke it in the Anthropic Console); nothing else is changed.