The gateway implements the chat-completions shape, not the full OpenAI platform. That means the official SDKs work for chat, streaming and tools; Responses, embeddings and audio do not.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://abliteratly.beer/v1",
api_key=os.environ["ABLITERATLY_API_KEY"],
)
r = client.chat.completions.create(
model="magnum-v4-72b",
messages=[
{"role": "system", "content": "You are concise."},
{"role": "user", "content": "Explain the trade-off in one paragraph."},
],
temperature=0.7,
max_tokens=400,
)
print(r.choices[0].message.content)
print(r.usage)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://abliteratly.beer/v1",
apiKey: process.env.ABLITERATLY_API_KEY!,
});
const r = await client.chat.completions.create({
model: "magnum-v4-72b",
messages: [{ role: "user", content: "Reply with OK." }],
max_tokens: 20,
});
console.log(r.choices[0]?.message?.content);
Pass a standard tools array and handle tool_calls in the response. Only use models whose model page lists tool support. Test a full loop: model call, tool execution, tool result message, second model call. A single successful call is not enough.
Set stream: true and accumulate delta.content. Some models pause between chunks while reasoning; set a generous client timeout. If your client aborts a slow stream, the request may still be billed for generated tokens.
client.chat.completions, not client.responses.Keep the base URL at /v1; the SDK appends the resource path. Use environment variables or a secret file, never a key in source control. Set a client timeout and retry 502/503 with exponential backoff. Handle 429 using Retry-After. For a full first request, see the quickstart.
Any OpenAI-compatible client works for chat completions. The official OpenAI Python and JavaScript SDKs are the shortest path. Use @ai-sdk/openai-compatible for OpenCode.
No. Set base_url to the API's /v1 endpoint and use a model ID from the catalog. Do not use the Responses API; this gateway implements chat completions.
Yes, if the client supports a custom base URL. The wire format is the standard chat-completions shape.
Custom providers may require you to list models manually. Copy enabled IDs from the directory; not every client discovers custom model catalogs.