TensaHub › Anthropic (Claude)

Anthropic (Claude)

Pay as you go; OpenAI SDK-compatible endpoint, 1 model(s) indexed. curl, Python and JavaScript samples, live testing.

Test and rate in the catalog

Type
Provider
Provider
Anthropic (Claude)
Pricing
Paid
Keyless access
No
Key variable
ANTHROPIC_API_KEY
Base URL (OpenAI-compatible)
https://api.anthropic.com/v1
Inputs
Text
Developer rating
Not rated yet
Documentation
https://www.anthropic.com/pricing
Get a key
https://console.anthropic.com

Code samples

cURL

curl https://api.anthropic.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ANTHROPIC_API_KEY" \
  -d '{"model":"claude-haiku-5-5","messages":[{"role":"user","content":"Hello, introduce yourself in one sentence."}]}'

Python

# pip install openai
import os
from openai import OpenAI

client = OpenAI(base_url="https://api.anthropic.com/v1", api_key=os.environ["ANTHROPIC_API_KEY"])
r = client.chat.completions.create(
    model="claude-haiku-5-5",
    messages=[{"role": "user", "content": "Hello, introduce yourself in one sentence."}],
)
print(r.choices[0].message.content)

JavaScript

// npm install openai
import OpenAI from 'openai'

const client = new OpenAI({ baseURL: 'https://api.anthropic.com/v1', apiKey: process.env.ANTHROPIC_API_KEY })
const r = await client.chat.completions.create({
  model: 'claude-haiku-5-5',
  messages: [{ role: 'user', content: 'Hello, introduce yourself in one sentence.' }],
})
console.log(r.choices[0].message.content)

Generate the integration code →

Popular searches

Frequently asked questions

Is the Anthropic (Claude) API free?

Pricing is not published in a standard form: check the provider’s page.

How do I call Anthropic (Claude) from my code?

Anthropic (Claude) exposes an OpenAI-compatible API at https://api.anthropic.com/v1: use any OpenAI SDK (Python, JavaScript…) with this base URL. Ready-to-use code (streaming, JSON, retries) is available in the developer toolkit.

Alternatives