Skip to main content
@obversa/engine-anthropic-api calls the Anthropic Messages API directly: it streams tokens as they arrive and starts no command-line process. Use it for a seat that only needs text, a judge or a scorer, where a coding agent’s tools and workspace would be wasted. It loads none of your own setup, so it always runs clean and has no clean option. Its row in the engines table says the same.

Install

Included in @obversa/obversa.

Requirements

  • An Anthropic API key, in the ANTHROPIC_API_KEY environment variable or the apiKey option.

Identity

The plugin reports provider: 'anthropic', with the model family read from the model name. It runs the model the request names; without one it uses defaultModel, and without that claude-haiku-4-5-20251001.

Quickstart

Construct the engine and ask it what it will run as, with no network call:
examples/engine-anthropic-api-binding.ts
admit returns the identity the engine reports before any request: the adapter, provider, model family, model and capabilities. Run it with npx tsx engine-anthropic-api-binding.ts:
Output
In a run, leave apiKey out and set ANTHROPIC_API_KEY, then pass the engine to run() in engines or bind it to a graph node.

Options

Errors

  • A missing key fails with a message that names both places to put it, and points at the agent-sdk and claude-cli engines, which use the host’s Claude sign-in instead.
  • A request that asks for tools or workspace access fails as invalid-config: the engine takes text-only requests. It ignores AgentRequest.env, because there’s no process to pass it to.
  • Server errors (HTTP 5xx) and connection errors, timeouts included, are retried. A rate limit (HTTP 429) fails as rate-limit, carrying the API’s retry-after wait when it sends one.

API

  • AnthropicApiEngine: the engine class. AnthropicApiEngineOptions: its options. Quickstart.

Next steps