Skip to main content
idapt
HomeAI ModelsExploreResourcesPricing
Sign inUse for Free
  • Home
  • Pricing
  • AI Models
  • Skills
  • Image models
  • Voice models
  • Video models
  • Rankings
  • Multi-Model Chat
  • Agents
  • Computers
  • Drive
  • Automations
  • AI Gateway
  • All features →
  • Blog
  • About
  • Comparisons
  • Benchmarks
  • Model Match
  • Demos
  • Help center
  • FAQ
  • Privacy
  • Support
  • Developers
  • Quickstarts
  • API reference
  • API pricing
  • CLI
  • MCP
  • Migrate
  • Downloads
  • Desktop
© idapt[email protected]TermsPrivacy PolicyLegal noticeReport content
X (Twitter)Discord
Help Center
🔗

OpenAI SDK (Python) with idapt

Found this helpful? Share it:

Set up OpenAI SDK (Python) against idapt's compatible APIs with the steps below. This article and the AI Gateway quickstarts lander render the same shared steps, so they never drift.

OpenAI SDK (Python) with idapt

base_url plus your idapt key: existing code, 200+ models.

  1. 1

    Install

    bash
    pip install openai
  2. 2

    Point it at idapt

    python
    from openai import OpenAI
    
    client = OpenAI(
        base_url="https://idapt.app/api/openai/v1",
        api_key=os.environ["IDAPT_API_KEY"],
    )
    
    reply = client.chat.completions.create(
        model="qwen/qwen3.7-max",
        messages=[{"role": "user", "content": "Three facts about ravens."}],
    )

GOOD TO KNOW

API keys and scopesOpenAI-compatible API referenceOpenRouter-compatible API referenceRate limits and errors

MORE QUICKSTARTS

OpenAI SDK (JS)

LangChain (Python)

LangChain (Python)

LlamaIndex

Related articles

🔑

API keys and scopes

Create a key, choose its scopes, pin it to an API version, rotate it, and cap what it can spend.

🚦

Rate limits and errors

Every error shape the API returns, what each rate limit is, and how to handle a wall in code.

🛡️

Cap what an API key spends

Give every Gateway API key a lifetime, monthly, or daily USD cap, and what a capped-out key returns.

🔗

OpenAI-compatible API

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

🔗

OpenAI SDK (JS) with idapt

Point the official OpenAI Node SDK at idapt's compatible API: a three-line change routes 200+ models through your existing code.

🔗

LangChain (Python) with idapt

Use LangChain Python with idapt's OpenAI-compatible API: base_url configuration for ChatOpenAI with any catalog model.

🔗

LlamaIndex with idapt

Use LlamaIndex with idapt: configure the OpenAI-like client with a custom base URL and run retrieval pipelines on any catalog model.

Up next

Anthropic SDK with idapt

Point the Anthropic SDK (JS or Python) at idapt's Anthropic-compatible API and keep your Messages API code unchanged.

Was this helpful?