BYOK is live — 1,000,000 free BYOK requests every month, no top-up requiredLearn more

Docs

Framework integrations

Tools that support OpenAI-compatible providers need three values: the base URL https://api.boostrail.com/v1, an API key, and a model id from the Models page. The examples below read the key from the BOOSTRAIL_API_KEY environment variable.

Vercel AI SDK

Use the AI SDK's OpenAI-compatible provider package. Create the provider once, then pass a model id to it.

Install
npm install ai @ai-sdk/openai-compatible
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";

const boostrail = createOpenAICompatible({
  name: "boostrail",
  apiKey: process.env.BOOSTRAIL_API_KEY,
  baseURL: "https://api.boostrail.com/v1",
  includeUsage: true,
});

const { text, usage } = await generateText({
  model: boostrail("deepseek-v4.1-flash"),
  prompt: "Hello",
});
console.log(text, usage);
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { streamText } from "ai";

const boostrail = createOpenAICompatible({
  name: "boostrail",
  apiKey: process.env.BOOSTRAIL_API_KEY,
  baseURL: "https://api.boostrail.com/v1",
  includeUsage: true,
});

const result = streamText({
  model: boostrail("deepseek-v4.1-flash"),
  prompt: "Write a haiku about trains.",
});
for await (const part of result.textStream) process.stdout.write(part);
console.log(await result.usage);

Both calls return token usage in usage. Checked with ai 7.0 and @ai-sdk/openai-compatible 3.0.

LiteLLM

In the LiteLLM Python SDK, add the openai/ prefix to the model id and pass the base URL as api_base.

Install
pip install litellm
import os
import litellm

response = litellm.completion(
    model="openai/deepseek-v4.1-flash",
    api_base="https://api.boostrail.com/v1",
    api_key=os.environ["BOOSTRAIL_API_KEY"],
    messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)
import os
import litellm

stream = litellm.completion(
    model="openai/deepseek-v4.1-flash",
    api_base="https://api.boostrail.com/v1",
    api_key=os.environ["BOOSTRAIL_API_KEY"],
    messages=[{"role": "user", "content": "Write a haiku about trains."}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

For the LiteLLM Proxy, add one entry per model to model_list. model_name is the name your clients send to the proxy; os.environ/BOOSTRAIL_API_KEY reads the key from the environment.

config.yaml
model_list:
  - model_name: deepseek-v4.1-flash
    litellm_params:
      model: openai/deepseek-v4.1-flash
      api_base: https://api.boostrail.com/v1
      api_key: os.environ/BOOSTRAIL_API_KEY
Start the proxy
pip install 'litellm[proxy]'
litellm --config config.yaml

LibreChat

Add BoostRail as a custom endpoint in librechat.yaml, and put the key in LibreChat's .env file.

.env
BOOSTRAIL_API_KEY=YOUR_API_KEY
librechat.yaml
endpoints:
  custom:
    - name: "BoostRail"
      apiKey: "${BOOSTRAIL_API_KEY}"
      baseURL: "https://api.boostrail.com/v1"
      models:
        default: ["deepseek-v4.1-flash"]
        fetch: true
      titleConvo: true
      titleModel: "deepseek-v4.1-flash"
      modelDisplayLabel: "BoostRail"
  • fetch: true loads the model list from GET /v1/models. LibreChat falls back to the default list only if that request fails.
  • The fetched list includes models that run only on your own lab keys. They work after you add a key for that lab; see BYOK.
  • titleModel is the model LibreChat uses to name conversations.
  • To have each LibreChat user enter their own BoostRail key, set apiKey: "user_provided".

Other tools

Other tools with a custom OpenAI base URL setting take the same three values. Settings for Claude Code, Codex CLI, Cline and other coding agents are on the Coding agents page.

Last updated: 2026-10-07