Skip to main content
idapt
HomeCodeAI ModelsPricing
Sign inStart free trial

Anthropic SDK with idapt

The Anthropic-compatible surface: Messages API code unchanged, routed through idapt.

Last reviewed 2026-07-17

Install

bash
npm i @anthropic-ai/sdk   # or: pip install anthropic

Point it at idapt

ts
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  baseURL: "https://idapt.app/api/anthropic/v1",
  apiKey: process.env.IDAPT_API_KEY,
});

const reply = await client.messages.create({
  model: "anthropic/claude-opus-4.8",
  max_tokens: 512,
  messages: [{ role: "user", content: "Three facts about ravens." }],
});

Python: Anthropic(base_url=..., api_key=...) takes the same two arguments.

Pitfalls

Messages API shape, Anthropic auth header

The compat surface speaks the Messages API and accepts the SDK's x-api-key header with your idapt key. Non-Anthropic catalog models work here too.

References

  • Anthropic-compatible API reference
  • API keys and scopes
  • Rate limits and errors

More quickstarts

Claude CodeOpenAI SDK (JS)curl
  • Home
  • Pricing
  • AI Models
  • Image models
  • Voice models
  • Video models
  • Rankings
  • New models
  • Model status
  • Multi-Model Chat
  • Agents
  • Computers
  • Drive
  • Automations
  • AI Gateway
  • All features →
  • LLM cost calculator
  • Token counter
  • All free tools →
  • Blog
  • Use cases
  • Comparisons
  • Best of
  • Benchmarks
  • Demos
  • Changelog
  • Help center
  • FAQ
  • Privacy
  • Compare all models
  • Support
  • idapt Code
  • Developers
  • Quickstarts
  • API reference
  • API pricing
  • CLI
  • MCP
  • Downloads
  • Desktop
  • Badges and embeds
© idapt[email protected]TermsPrivacy PolicyLegal noticeReport content
X (Twitter)