Before building an agent that uses an Anthropic model, you’ll need to create an Anthropic developer account and get an API key.

Configuration

name
AnthropicModel
The name of the Anthropic model you want your agent to use. By default, your agent will use claude-3-7-latest.
secret
string
The name of the secret which contains your Anthropic API key. NOTE: This is the name of the secret, not your actual secret key!

Creating the Model

Calling anthropic() with no arguments will use all default values:
import { Agent, anthropic } from '@ardent-ai/sdk';

const agent = new Agent({
  model: anthropic()
});
Passing a single string argument will set the model name:
import { Agent, anthropic } from '@ardent-ai/sdk';

const agent = new Agent({
  model: anthropic('claude-4-0-opus')
});
Or, you can set every parameter by passing a configuration object:
import { Agent, anthropic } from '@ardent-ai/sdk';

const agent = new Agent({
  model: anthropic({
    name: 'claude-4-0-opus',
    secret: 'MY_CUSTOM_ANTHROPIC_SECRET_NAME'
  })
});