BLACKFUEL
Getting Started

Migrate from OpenAI

Switch from OpenAI to Blackfuel by changing two values — the base URL and your API key

Blackfuel serves OpenAI-compatible endpoints your client already calls: the OpenAI Chat Completions API at POST /v1/chat/completions, plus POST /v1/embeddings and GET /v1/models. Requests and responses keep the shapes your code builds and reads, so a migration comes down to two values and a model ID.

What Changes

OpenAIBlackfuel
Base URLhttps://api.openai.com/v1https://api.blackfuel.ai/v1
API keyOPENAI_API_KEYBLACKFUEL_API_KEY
Model IDsgpt-4o, gpt-3.5-turbo, etc.See Available Models

Update Your Code

# Before
import os
import openai
client = openai.OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))

# After
import os
import openai
client = openai.OpenAI(
    base_url="https://api.blackfuel.ai/v1",
    api_key=os.environ["BLACKFUEL_API_KEY"],
)
// Before
import OpenAI from 'openai';
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

// After
import OpenAI from 'openai';
const client = new OpenAI({
  baseURL: 'https://api.blackfuel.ai/v1',
  apiKey: process.env.BLACKFUEL_API_KEY
});
# Before
curl https://api.openai.com/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" ...

# After
curl https://api.blackfuel.ai/v1/chat/completions \
  -H "Authorization: Bearer $BLACKFUEL_API_KEY" ...

Update Model Names

Blackfuel serves its own vendor/model IDs. An OpenAI model name is not one of them, so a request that still carries gpt-4o returns 404 with code: model_not_found (see Invalid Request Errors).

Pick the replacement from GET /v1/models by matching three fields on each entry:

  • task — text-generation for chat, embedding for embeddings.
  • context_length — must cover your longest prompt plus its completion.
  • supported_parameters — must list the parameters your requests send, such as tools, response_format, or reasoning_effort.

Available Models lists the catalog with pricing, and the Model Object documents every field.

Using Environment Variables

The OpenAI SDKs read OPENAI_BASE_URL and OPENAI_API_KEY from the environment, so you can point an unmodified codebase at Blackfuel by exporting the Blackfuel values under the names the SDK already looks for:

export OPENAI_BASE_URL="https://api.blackfuel.ai/v1"
export OPENAI_API_KEY="$BLACKFUEL_API_KEY"

The client then needs no arguments:

import openai

client = openai.OpenAI()  # reads OPENAI_BASE_URL and OPENAI_API_KEY
import OpenAI from 'openai';

const client = new OpenAI();  // reads OPENAI_BASE_URL and OPENAI_API_KEY

Supported Features

The request parameters your OpenAI code already sends carry over:

  • Streaming — stream: true, with the same SSE chunk format. See Streaming.
  • Tool calling — tools and tool_choice. See Tool Calling.
  • Structured output — response_format, both json_schema and json_object. See Reasoning with Structured Output.
  • Logprobs — logprobs and top_logprobs return per-token candidates under choices[].logprobs.
  • Multimodal input — image_url content parts work on models whose input_modalities includes image; any other model rejects the request with 400. See Vision (Multimodal).
  • Embeddings — POST /v1/embeddings. See Embeddings.
  • Reasoning — reasoning_effort, with the model's reasoning content in message.reasoning. See Reasoning.

Each GET /v1/models entry lists that model's supported_parameters.

EU Data Residency

Where the catalog lists an :eu variant of a model, that variant is served from the EU. Pass the variant ID as the model:

response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Flash-0731:eu",
    messages=[{"role": "user", "content": "Hello"}],
)
const response = await client.chat.completions.create({
  model: "deepseek-ai/DeepSeek-V4-Flash-0731:eu",
  messages: [{ role: "user", content: "Hello" }],
});

See EU-Hosted Models for which models have an :eu variant.

On this page