- Base URL →
https://api.impossibl.com/v1 - API key → your gateway key (
imp-rt-..., fromPOST /v1/accounts)
provider/model id (e.g. anthropic/claude-sonnet-4-5). Everything
else in your code stays the same.
OpenAI Python SDK
OpenAI Node SDK
Vercel AI SDK
Point the OpenAI provider at the gateway withcreateOpenAI:
LangChain (Python)
Anthropic SDK
The gateway also implements Anthropic’s Messages API atPOST /v1/messages, so
the official anthropic SDK works as a drop-in too. The Anthropic SDK sends the
key as x-api-key and appends /v1/messages itself, so point its base URL at
the gateway root (no /v1):
claude-... id routes to Anthropic; use a provider/model id (e.g.
openai/gpt-4o-mini) to reach another provider through the Messages endpoint.
Claude Code CLI
Point Anthropic’s own Claude Code CLI at the gateway with a few environment variables — this lets you run Claude Code against any model the gateway serves (not just Claude), and BYOK credentials apply the same as any other request:Claude Code sends
ANTHROPIC_AUTH_TOKEN as Authorization: Bearer ... — the header the
gateway’s key auth expects — while ANTHROPIC_API_KEY is sent as x-api-key and takes
priority if both are set. Clear ANTHROPIC_API_KEY (empty string, or unset it) so
ANTHROPIC_AUTH_TOKEN is what’s actually used.ANTHROPIC_MODEL accepts any registered provider/model id (see Models &
pricing), not just Claude models — requests still arrive in Anthropic’s wire
format and the gateway translates them. Add the exports to your shell profile to make
them permanent, or prefix a single run instead:

