Skip to main content
idapt
HomeCodeAI ModelsPricing
Sign inStart free trial

LangChain (Python) with idapt

ChatOpenAI with base_url pointed at idapt: every catalog model behind one key.

Last reviewed 2026-07-17

Install

bash
pip install langchain-openai

Point it at idapt

python
from langchain_openai import ChatOpenAI

model = ChatOpenAI(
    model="anthropic/claude-sonnet-5",
    api_key=os.environ["IDAPT_API_KEY"],
    base_url="https://idapt.app/api/openai/v1",
)

Pitfalls

base_url, not openai_api_base

Recent langchain-openai versions take base_url directly; the legacy openai_api_base kwarg still works but is deprecated.

References

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

More quickstarts

LangChain (JS)OpenAI SDK (Python)LiteLLM
  • 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)