WebInfer

Anthropic logo

Anthropic

Claude models via Anthropic API

Flagship
Major Cloud Provider
API

Configure Anthropic

Add your Anthropic API key in Settings

Go to Settings
About Anthropic

Access Claude, one of the most advanced AI models, via the Anthropic API. Claude excels at long conversations, careful instruction following, and complex reasoning tasks.

Key Features
  • State-of-the-art language understanding
  • Long context windows (up to 200K tokens)
  • Strong safety and alignment
  • Excellent at following instructions
  • Great for analysis and reasoning
Capabilities
chat
vision
function-calling
long-context
Configuration Schema
Required and optional fields for configuring this provider
FieldTypeRequired
apiKey
password
Required
CLI Usage
For users running the daemon server locally or a self-hosted gateway

Add provider:

npx webinfer provider add anthropic --key YOUR_API_KEY

Test connection:

npx webinfer provider test anthropic

Get your API key from https://console.anthropic.com/

Programmatic Usage
Use Anthropic in your code with WebInfer

Basic usage:

import { generateText } from "webinfer"

// WebInfer automatically routes to the best available provider
const result = await generateText({
  prompt: "Write a haiku about programming"
})

console.log(result.text)

Specify Anthropic explicitly:

import { generateText } from "webinfer"

const result = await generateText({
  prompt: "Write a haiku about programming",
  provider: "anthropic",
  model: "claude-3-5-sonnet-20241022"
})

console.log(result.text)
console.log("Provider:", result.provider)
console.log("Model:", result.model)

Streaming:

import { streamText } from "webinfer"

const { textStream } = await streamText({
  prompt: "Write a story about AI",
  provider: "anthropic"
})

for await (const chunk of textStream) {
  process.stdout.write(chunk)
}
Pricing
Paid
Pay-per-use pricing. New users get $5 in free credits.