# Class LittleGhost::Providers::Anthropic

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/Providers/Anthropic.html

Connects a Model to Anthropic's Messages API.

Requests send messages, Tool definitions, attachments, and model settings to
the configured Anthropic endpoint. The adapter reads its credential from
trusted configuration, honors cancellation and deadlines, and emits
LittleGhost StreamEvents. HTTP and response-shape failures become
ProviderError subclasses. It uses the built-in HTTP client and does not
require Anthropic's SDK.

## Inheritance

`LittleGhost::Providers::Anthropic < Base`

## Attributes

<a id="attribute-i-model"></a>
### `model` (R)

Provider-owned model identifier.

## Class methods

<a id="method-c-new"></a>
### `.new`

```ruby
.new(api_key:, model:, base_url: DEFAULT_BASE_URL, api_version: "2023-06-01",
        open_timeout: 10, read_timeout: 120, max_response_bytes: Support::HTTPClient::DEFAULT_MAX_RESPONSE_BYTES,
        transport: nil, **)
```

Creates an Anthropic Messages client for `model`.

<a id="method-c-request_options"></a>
### `.request_options`

```ruby
.request_options()
```

Request policy supported by the Anthropic HTTP client.

## Instance methods

<a id="method-i-capabilities"></a>
### `#capabilities`

```ruby
#capabilities(metadata: {})
```

Reports tool and structured-output support from model metadata.

<a id="method-i-stream"></a>
### `#stream`

```ruby
#stream(request)
```

Streams normalized events for `request`.
