Osy#betaRun it on Osyrin: osyrin.com

Reference / Agent

Osysharp.Models.Anthropic — Anthropic's models as a provider

`Osysharp.Models.Anthropic` is the class that talks to Anthropic's Messages API. Name it on the models it serves and every call to those models goes through it.

previewagentsguidekit

You are here: Building with agents › The kits › Models.Anthropic

Summary#

Osysharp.Models.Anthropic is the class that talks to Anthropic's Messages API. Name it on the models it serves and every call to those models goes through it.

A provider is an ordinary class written in Osy#, using only what any app may use. The API key is a secret your app names; the kit asks for one host, api.anthropic.com, and an app that uses it grants that host or does not compile.

PackageOsysharp.Models.Anthropic, version 1.0.0
You add it withuse Osysharp.Models.Anthropic; in the app's manifest.
It sits on[[agent-kit-llm|Llm]]
It also usesHttp — parts of the platform's own library
Its own test appA ferry line's desk that answers travellers — kits/anthropic/tests

Description#

What do you get without writing anything?#

  • Complete and stream, with tools, prompt caching and structured output.
  • Token counts reported to the meter, so calls are priced from what the provider says was used.

When do you need it?#

When your models are Anthropic's. You need at least one provider kit, or a provider class of your own.

What does it expose?#

The tables below are generated from the kit itself, not written by hand: osy kits Osysharp.Models.Anthropic --surface lists each of them with the code of the kit's own test app that uses it, and the tests that show it working.

Types you use

TypeWhat it is
AnthropicClientThe Anthropic Messages API as an ILlmClient.
AnthropicMessageRequestWhat goes UP.
AnthropicMessageResponseWhat comes back from a non-streaming call.
AnthropicBlockOne block of the answer.
AnthropicUsageThe token counts.
AnthropicStreamEventOne server-sent event of a streamed answer.
AnthropicStreamDeltaThe changing part of an event: text as it is written, a tool's arguments as they are written, or the stop reason.

Go deeper#

  • [[agent-llm-calls#providers]] — how a provider is written and named
  • [[agent-llm-calls#models]] — saying which models the app has

Related

The map of the kits — which sits on which, and what each one is for

The agents family is 29 kits. Two are under everything: `Osysharp.Llm` for every model call and `Osysharp.Agents` for…

The Llm kit — call a model, and know what each call cost

`Osysharp.Llm` is the road every model call takes, written in Osy#: the operator's AI switch, the app's router, a…

The Llm kit — call a model, and know what each call cost

`Osysharp.Llm` is the road every model call takes, written in Osy#: the operator's AI switch, the app's router, a…