Skip to main content
idapt
HomeCodeAI ModelsPricing
Sign inStart free
  • Home
  • Pricing
  • AI Models
  • Image models
  • Voice models
  • Video models
  • Rankings
  • New models
  • Model status
  • Multi-Model Chat
  • Voice Mode
  • Voice HUD
  • Web Search
  • Image Generation
  • Video Generation
  • Audio Generation
  • Transcription
  • Drive
  • Credentials
  • Sharing
  • Workspaces
  • Tasks
  • Memory
  • Agents
  • Subagents
  • Automations
  • Skills
  • idapt Code
  • Code Execution
  • Computers
  • Computer Use
  • Computer Assist · Soon
  • Containers · Soon
  • Cloud Computers
  • Local AI
  • AI Gateway
  • API & SDK
  • CLI
  • MCP
  • Tunnels
  • All features →
  • LLM cost calculator
  • Token counter
  • Context window checker
  • Can I run it
  • Model picker quiz
  • Savings finder
  • Video cost estimator
  • Text to speech cost
  • Transcription cost
  • API endpoint tester
  • All free tools →
  • Blog
  • Use cases
  • Comparisons
  • Best of
  • Skills
  • Learn
  • 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)
Help Center
🤖

Anthropic-compatible API

Learn more about this feature

Everything, programmable.A typed SDK and a versioned REST API over chats, files, agents, and computers.

Found this helpful? Share it:

idapt exposes an Anthropic-compatible Messages API so you can use 200+ models from Claude Code, the Anthropic SDK, or any tool that supports the Anthropic format. Point your code at idapt instead of Anthropic, and everything just works 🤖

Pro and up

What you need

  1. An API key with the completions scope. See API keys and scopes.

  2. The base URL https://idapt.app/api/anthropic/v1.

  3. An active subscription, or your own provider key (BYOK). The free daily pool does not apply on this gateway.

Quick start

Claude Code

Set these environment variables and Claude Code will connect through idapt:

export ANTHROPIC_BASE_URL=https://idapt.app/api/anthropic/v1
export ANTHROPIC_API_KEY=uk_your_key_here

If you encounter issues with beta features, set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 as well.

Python

import anthropic

client = anthropic.Anthropic(
    base_url="https://idapt.app/api/anthropic/v1",
    api_key="uk_your_key_here",
)

message = client.messages.create(
    model="anthropic/claude-sonnet-4.6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)

print(message.content[0].text)

Node.js / TypeScript

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

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

const message = await client.messages.create({
  model: "openai/gpt-5.4-pro",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello!" }],
});

console.log(message.content[0].text);

curl

curl https://idapt.app/api/anthropic/v1/messages \
  -H "x-api-key: uk_your_key_here" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemini-2.5-flash",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

You can use any model from the idapt catalog, not just Anthropic models. Switch models by changing the model parameter.

Supported endpoints

  • POST /messages, Create a message (streaming and non-streaming)

  • GET /models, List available models (with pagination)

  • GET /models/{id}, Get a single model's details

The anthropic-version and anthropic-beta headers are accepted but not required.

Streaming

Set stream: true to receive Server-Sent Events in the Anthropic streaming format. Events include message_start, content_block_start, content_block_delta, content_block_stop, message_delta, and message_stop.

Token usage is reported in message_start(input tokens) and message_delta(output tokens).

Models

Use the full model ID including the provider prefix, for example anthropic/claude-sonnet-4.6, openai/gpt-5.4-pro, or google/gemini-2.5-flash.

Call GET /models to see all available models, or browse the full catalog on the Models page.

Tool use

Tool definitions use the Anthropic format with input_schema. Tool results are sent as tool_result content blocks in user messages.

Usage and billing

Completions on this gateway need an active subscription or your own provider key, the same options as the OpenAI-compatible gateway. Calls without one return a 403 with code free_tier_requires_subscription. Language models bill at the prices shown in the app, and bring-your-own-key calls bill to your provider account.

Watch your spend on the usage page (/app/usage). See Plans, allowances, and credits for how the meters fit together.

Error handling

Errors follow the Anthropic format. Common status codes:

  • 400, Bad request (missing model, invalid params, missing max_tokens)

  • 401, Invalid or missing API key

  • 403, Key lacks required permissions

  • 429, Rate limit exceeded

The Anthropic SDK automatically parses these errors and throws typed exceptions.

FAQs

Related articles

🔁

Switch from the Anthropic API

Point the Anthropic SDK or Claude Code at idapt's base URL: the same Messages API with usage tracking and per-key spend caps.

🔗

OpenAI-compatible API

Use idapt's 200+ models from any app that speaks the OpenAI API format.

🤖

Connect Claude Code

Drive your idapt workspace from Claude Code over the CLI or MCP, with a shared memory and agent identity.

Up next

Switch from the OpenAI API

Point your OpenAI SDK at idapt's base URL and keep your code: chat, embeddings, images, audio, and video across 200+ models.

Was this helpful?