News · November 13, 2026

OpenAI-compatible API: connect your SDK in two lines

base_url, API key, endpoints, SSE streaming and tool calling: what actually changes when you point an OpenAI SDK at the Effrenus API.

· 3 min read · Effrenus Team · RSS

apiopenaimigration

The OpenAI SDK has become the de facto interface for calling a language model, in both Python and JavaScript. Effrenus exposes the same API contract on /v1: most integrations work by replacing two parameters, base_url and api_key. Message format, streaming and error format follow the same convention, provided you choose a model from the Effrenus catalogue rather than an OpenAI identifier.

Two parameters, everything else stays the same

The endpoint is https://api.effrenus.com/v1 and authentication uses an sk-ef-… key sent as Authorization: Bearer. The official OpenAI libraries also read the OPENAI_BASE_URL environment variable: in an existing project, it is sometimes the only setting to change. In JavaScript, the options are called baseURL and apiKey; the HTTP contract remains identical, and a client that talks to the API directly only has to change the URL and the Authorization header.

from openai import OpenAI

client = OpenAI(
    base_url="https://api.effrenus.com/v1",
    api_key="sk-ef-...",
)

stream = client.chat.completions.create(
    model="dolphin-3.0-llama3.1-8b",
    messages=[{"role": "user", "content": "Hello"}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

What also changes is the model name: gpt-4o does not exist here and returns model_not_found. Identifiers are those of the Effrenus catalogue, and are listed with GET /v1/models. The quickstart guide shows how to create a key and make a first call.

Endpoints, streaming and errors

The contract covers common calls: POST /v1/chat/completions (chat, streaming or not, tools), POST /v1/completions (text completion), POST /v1/embeddings (BGE-M3) and GET /v1/models (models in the served catalogue). The documentation details each route and the accepted parameters.

Streaming uses the same mechanism as OpenAI: stream: true triggers a text/event-stream response, made of data: events and terminated by data: [DONE]. Ask for stream_options: {"include_usage": true} to receive a final chunk with the token count. The proxy does not buffer the response: chunks arrive as generation proceeds.

Structured mode (JSON output) depends on the chosen model; the response and error formats remain OpenAI's.

Errors keep the OpenAI format {"error": {"message", "type", "code"}} and the documented codes: 401 invalid_api_key, 402 insufficient_credits, 404 model_not_found, 429 rate_limit_exceeded with a Retry-After header, 503 upstream_unavailable. A client that already handles these codes for OpenAI has nothing to rewrite.

Tool calling: a per-model capability

Tool calling follows the OpenAI schema, but depends on the model: only those with the tools capability advertised in the catalogue accept it. In the current catalogue, that is the case for Dolphin 3.0, Hermes 3, Mistral Nemo 12B, Qwen2.5 14B and 32B, and Mistral Small 24B. Other models do not expose it: Qwen3 32B and Llama 3.3 70B are listed as chat only, DeepSeek R1 Distill 8B as chat and reasoning, BGE-M3 as embeddings. The /v1/models response indicates each model's capability.

On the backend, vLLM is configured with --enable-auto-tool-choice and a matching parser (hermes or mistral depending on the model). For an integration that depends on tools, check the capability in the /v1/models response before coding the flow: better to detect the absence of tools at startup than in production.

Migrating from OpenAI

The migration page summarises examples in Python, JavaScript and cURL, as well as common errors. The migration comes down to five steps:

  • replace base_url with https://api.effrenus.com/v1 and the key with sk-ef-…;
  • replace model identifiers with those from the catalogue;
  • check the SSE stream and 429 handling (Retry-After, exponential backoff);
  • compare the real cost (x-ef-cost-micro, usage) with your estimates;
  • test a sample of traffic before the full cutover.

The quickstart guide provides copy-paste examples and the configuration for the first call. The rest does not change: if your code talks to /v1/chat/completions with an OpenAI SDK, it already talks to Effrenus. Migration is limited to the URL, the key and the model identifiers — as long as the chosen model actually exposes the expected capabilities.

Read next

From reading to API calls

Create a key, top up from €5 and test the catalogue.

Create API key

← All news