Skip to main content

Anthropic

Type: conversation.anthropic

Status: alpha

Reference: https://docs.dapr.io/reference/components-reference/supported-conversation/anthropic/

Example

apiVersion: cra.diagrid.io/v1beta1
kind: Component
metadata:
name: <name>
spec:
type: conversation.anthropic
version: v1
metadata:
# API key for Anthropic, or for the Microsoft Foundry resource when apiType is 'foundry'.
- name: key
value: |
**********
# The type of API to use. Set to 'foundry' to call Anthropic Claude models hosted on Microsoft Foundry; otherwise the public Anthropic API is used. (Optional)
#- name: apiType
# value: "anthropic"
# A time-to-live value for a prompt cache to expire. Uses Golang durations (Optional)
#- name: cacheTTL
# value: "10m"
# Custom base URL for the Anthropic API. Required when apiType is 'foundry'; for Foundry use the form 'https://{resource}.services.ai.azure.com/anthropic/v1'. If not specified for the default apiType, the public Anthropic API is used. (Optional)
#- name: endpoint
# value: "https://my-resource.services.ai.azure.com/anthropic/v1"
# The Anthropic LLM to use. When apiType is 'foundry', this is the Foundry deployment name (defaults to the Claude model ID, e.g. 'claude-opus-4-7'). Configurable via ANTHROPIC_MODEL environment variable. (Optional)
#- name: model
# value: "claude-sonnet-4-20250514"

Authentication profiles

Available authentication profiles:

  • API Key

API Key

Authenticate using an API key

key (string)

Required - API key for Anthropic, or for the Microsoft Foundry resource when apiType is 'foundry'.

Example value:

**********

Metadata

apiType (string)

The type of API to use. Set to 'foundry' to call Anthropic Claude models hosted on Microsoft Foundry; otherwise the public Anthropic API is used.

Default value: anthropic

Example value: foundry

Allowed values:

  • anthropic

  • foundry

cacheTTL (string)

A time-to-live value for a prompt cache to expire. Uses Golang durations

Example value: 10m

endpoint (string)

Custom base URL for the Anthropic API. Required when apiType is 'foundry'; for Foundry use the form 'https://{resource}.services.ai.azure.com/anthropic/v1'. If not specified for the default apiType, the public Anthropic API is used.

Example value: https://my-resource.services.ai.azure.com/anthropic/v1

model (string)

The Anthropic LLM to use. When apiType is 'foundry', this is the Foundry deployment name (defaults to the Claude model ID, e.g. 'claude-opus-4-7'). Configurable via ANTHROPIC_MODEL environment variable.

Default value: claude-sonnet-4-20250514

Example value: claude-sonnet-4-20250514