Skip to main content
Choose your client below. First create a key and set IMPOSSIBL_API_KEY in your server environment. Use a full model ID. Check API compatibility for supported fields and endpoints; changing the URL does not make every provider-specific SDK feature portable.

OpenAI Python SDK

OpenAI Node SDK

Vercel AI SDK

Use an explicit provider instance so the request goes to impossibl:
Use gateway.chat(modelId) for Chat Completions or gateway.responses(modelId) for Responses. A bare string model uses the AI SDK’s default gateway configuration, not this client. AI SDK provider documentation.

LangChain (Python)

ChatOpenAI does not preserve every non-standard reasoning or tool metadata field. Test multi-turn tool use with your chosen model; see tool context.

Anthropic SDK

The gateway also implements Anthropic’s Messages API at POST /v1/messages, so you can use the official anthropic SDK for supported Messages requests. 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

After installing Claude Code, set its gateway connection in the shell where you launch it. Start with a Claude model; other models can differ in tool behavior and instruction following.
Clear a conflicting ANTHROPIC_API_KEY so Claude Code uses the bearer token above. Your selected model must support the tools the client uses. The gateway relays function calls; the coding tool executes them locally.

Raw HTTP

Use the quickstart for a complete cURL request, or streaming for incremental output.