Skip to content

AnthropicBackendAdapter

Defined in: backend/src/providers/anthropic.ts:141

Backend adapter for Anthropic Messages API.

new AnthropicBackendAdapter(config): AnthropicBackendAdapter

Defined in: backend/src/providers/anthropic.ts:149

BackendAdapterConfig

AnthropicBackendAdapter

readonly metadata: AdapterMetadata

Defined in: backend/src/providers/anthropic.ts:145

Adapter metadata for identification and capabilities.

BackendAdapter.metadata

estimateCost(request): Promise<number | null>

Defined in: backend/src/providers/anthropic.ts:456

Estimate cost for a request (rough heuristic).

IRChatRequest

Promise<number | null>

BackendAdapter.estimateCost


execute(request, signal?): Promise<IRChatResponse>

Defined in: backend/src/providers/anthropic.ts:180

Execute non-streaming chat completion request.

IRChatRequest

AbortSignal

Promise<IRChatResponse>

BackendAdapter.execute


executeStream(request, signal?): IRChatStream

Defined in: backend/src/providers/anthropic.ts:219

Execute streaming chat completion request.

IRChatRequest

AbortSignal

IRChatStream

BackendAdapter.executeStream


fromIR(request): AnthropicRequest

Defined in: backend/src/providers/anthropic.ts:497

Convert IR request to Anthropic format.

Public method for testing and debugging - see what will be sent to Anthropic.

IRChatRequest

AnthropicRequest

BackendAdapter.fromIR


healthCheck(): Promise<boolean>

Defined in: backend/src/providers/anthropic.ts:433

Health check to verify Anthropic API is accessible.

Promise<boolean>

BackendAdapter.healthCheck


listModels(options?): Promise<ListModelsResult>

Defined in: backend/src/providers/anthropic.ts:470

List available Anthropic models.

Since Anthropic doesn’t have a public models endpoint, this uses:

  1. Static config (config.models) - if provided
  2. Default model list - built-in list of Claude models

ListModelsOptions

Promise<ListModelsResult>

BackendAdapter.listModels


toIR(response, originalRequest, latencyMs): IRChatResponse

Defined in: backend/src/providers/anthropic.ts:553

Convert Anthropic response to IR format.

Public method for testing and debugging - parse Anthropic responses manually.

AnthropicResponse

IRChatRequest

number

IRChatResponse

BackendAdapter.toIR