Skip to main content
The gateway speaks the OpenAI Chat Completions and Responses wire formats, so any OpenAI-compatible client works by changing two things:
  1. Base URLhttps://api.impossibl.com/v1
  2. API key → your gateway key (imp-rt-..., from POST /v1/accounts)
Then pick a 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 with createOpenAI:

LangChain (Python)

Anthropic SDK

The gateway also implements Anthropic’s Messages API at POST /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):
A bare 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:

Raw HTTP

No SDK required — see the Agent quickstart for curl examples, and Streaming for SSE.