BeefAPI Get started

Keep the SDK.
Move the three values.

BeefAPI exposes an OpenAI-compatible Base URL. Existing SDK code can point at it, with one Base URL, one key and a model ID that the key actually serves.

OPENAI SDK · BASE URL · FIRST REQUEST

REUSE THE OPENAI SDK

BEEFAPI
SDK MIGRATION

Can I reuse the OpenAI SDK by changing only the Base URL?

Before you start

  • Install the official library: python3 -m pip install openai, or npm install openai for Node.js.
  • Create a global key in API keys and export it as BEEFAPI_KEY. Keep it on your server.
  • List the models your key can use before choosing one; the example scripts below use a placeholder ID.

List the models for your key

curl --fail-with-body https://global.beefapi.com/v1/models \
  --header "Authorization: Bearer $BEEFAPI_KEY"

The three values you change

  • Base URL: https://global.beefapi.com/v1 for OpenAI-compatible clients, including SDKs and plain HTTP.
  • API key: the sk-... value from API keys on the global site.
  • Model: an ID returned by GET /v1/models for that key. Model IDs may differ from the ones you used before, so treat that list as the source of truth.

Python · official openai library

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["BEEFAPI_KEY"],
    base_url="https://global.beefapi.com/v1",
)

completion = client.chat.completions.create(
    model="gpt-5.6-sol",
    messages=[{"role": "user", "content": "Hello"}],
)
print(completion.choices[0].message.content)

Node.js · official openai package

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env.BEEFAPI_KEY,
  baseURL: 'https://global.beefapi.com/v1',
});

const completion = await client.chat.completions.create({
  model: 'gpt-5.6-sol',
  messages: [{ role: 'user', content: 'Hello' }],
});
console.log(completion.choices[0].message.content);

Confirm the switch worked

A successful response is the first half of the check; the matching entry in the Usage log is the second. Use the request ID from that entry whenever you need to compare the two.

  • Successful response plus a matching usage record: the Base URL, key and model are all correct for that call.
  • 404 model_not_found: the Base URL is reachable and the model ID is not available to this key.
  • 401: the credential was not read, so check the variable name, the shell that started the process, and whether the key is enabled.
  • No response at all: that is a transport problem, not a compatibility problem.
A Base URL alone does not prove compatibilityTEST BEFORE MIGRATING

What the BeefAPI docs cover on this Base URL is Chat Completions, the Responses API, streaming on both, GET /v1/models, plus the separate image and video endpoints, each with its own request shape in the API overview. Change one endpoint at a time and test the exact fields you depend on. Do not assume that platform-specific features outside those endpoints behave the same way.

Still deciding

Does streaming still work after only changing the Base URL?

For the documented endpoints, yes. Use an SSE parser or the SDK rather than splitting network chunks yourself. A chunk can contain several events or part of one event, and the Chat Completions, Responses and Anthropic stream formats are not interchangeable.

Can I keep my existing model names?

Only if GET /v1/models returns them for your key. An ID that is not in that list returns 404 model_not_found, which is a model problem rather than a Base URL problem.

Should I keep my original provider as a fallback?

That is an application decision. If you route between providers, decide which provider serves which model ID and record which one produced each request, because an ID that exists with one provider may not exist with the other.

Sources

Page facts checked 2026-09-26. Prices, model IDs and client configurations change; the linked sources are authoritative.

GLOBAL KEY · USD CREDITCreate an API key