Step-by-step guide for Claude 3.5 Sonnet, Claude 3 Opus, and Claude 3 Haiku
Visit the Anthropic API console at:
console.anthropic.com/signupSign up using:
You'll receive a verification email. Click the link to verify your account.
Anthropic requires phone verification for security. Enter your phone number and the verification code you receive via SMS.
To access the API, you'll need to add a credit card:
Your API key will look something like this:
sk-ant-api03-aBcDeFgHiJkLmNoPqRsTuVwXyZ...Click the copy button to copy it to your clipboard.
Now that you have your API key, you can use it with AI Assess Tech:
import Anthropic from '@anthropic-ai/sdk';
import { AIAssessClient } from '@aiassesstech/sdk';
const anthropic = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY
});
const client = new AIAssessClient({
healthCheckKey: process.env.AIASSESS_KEY
});
const result = await client.assess(async (question) => {
const response = await anthropic.messages.create({
model: 'claude-haiku-4-5',
max_tokens: 100,
messages: [{ role: 'user', content: question }]
});
return response.content[0].type === 'text'
? response.content[0].text
: '';
});| Model | Input (per 1M tokens) | Output (per 1M tokens) | Est. Cost per Assessment |
|---|---|---|---|
| Claude 3 Haiku Recommended | $0.25 | $1.25 | ~$0.02 |
| Claude 3.5 Sonnet | $3.00 | $15.00 | ~$0.25 |
| Claude 3 Opus | $15.00 | $75.00 | ~$1.20 |
Prices are approximate and may change. Check anthropic.com/pricing for current rates.
Make sure you copied the entire key including the "sk-ant-" prefix. Check for any extra spaces before or after the key.
Anthropic has rate limits based on your account tier. Wait a minute and try again.
Your free credits may have been used. Add more credits atconsole.anthropic.com/settings/billing.
Now that you have your Anthropic API key, you can run your first AI ethical assessment: