SDKs & examples
The Arbitex Gateway is a superset of the OpenAI API, so any client, SDK, or tool that targets OpenAI works against the gateway with only two changes: the base URL and the API key. There is no Arbitex-specific SDK to install.
Base URL + key
Section titled “Base URL + key”| Setting | Value |
|---|---|
| Base URL | https://api.arbitex.ai/v1 |
| API key | arb_live_… (see Authentication) |
| Model format | provider/model-id (e.g. anthropic/claude-sonnet-4-20250514, openai/gpt-4o) |
OpenAI Python SDK
Section titled “OpenAI Python SDK”from openai import OpenAI
client = OpenAI( api_key="arb_live_your-api-key-here", base_url="https://api.arbitex.ai/v1",)
# Streaming, with Arbitex DLP events surfaced alongside standard chunksstream = client.chat.completions.create( model="openai/gpt-4o", messages=[{"role": "user", "content": "Summarize our Q3 results."}], stream=True,)for chunk in stream: delta = chunk.choices[0].delta.content or "" print(delta, end="")OpenAI Node.js SDK
Section titled “OpenAI Node.js SDK”import OpenAI from "openai";
const client = new OpenAI({ apiKey: "arb_live_your-api-key-here", baseURL: "https://api.arbitex.ai/v1",});
const resp = await client.chat.completions.create({ model: "anthropic/claude-sonnet-4-20250514", messages: [{ role: "user", content: "Draft a polite decline email." }],});console.log(resp.choices[0].message.content);Other tools
Section titled “Other tools”Any tool with a configurable OpenAI base URL works — LangChain, LlamaIndex, the OpenAI CLI, IDE assistants, and similar. Point the base URL at https://api.arbitex.ai/v1 and supply your arb_live_ key.
Reading Arbitex extensions
Section titled “Reading Arbitex extensions”The standard SDKs return the OpenAI response shape. To read the Arbitex additions:
- Policy headers (
X-Policy-Action,X-Matched-Rule) — read them from the raw HTTP response. Most SDKs expose response headers via awith_raw_responseaccessor or equivalent. - DLP streaming events (
dlp_correction,output_blocked) — surface as events in the stream; handle them alongside standard content chunks.
See Chat completions for the full streaming + DLP-event reference.
Next steps
Section titled “Next steps”- Developer quickstart — the two-line change, end to end.
- Authentication — where your
arb_live_key comes from and how to keep it safe. - Errors & status codes — handling failures the SDK surfaces as exceptions.