Client setup
Point an OpenAI-compatible or Anthropic-compatible client at BeefAPI with a Base URL and an API key.
Create an API key at API keys and keep the sk-... value private. OpenAI-compatible tools use https://global.beefapi.com/v1. Anthropic-style tools use https://global.beefapi.com with no /v1 suffix.
OpenAI SDK
You need the official OpenAI library, and a BeefAPI key from API keys.
Install the SDK with python3 -m pip install openai, then run this Python script after setting BEEFAPI_KEY:
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)For Node.js, install with npm install openai and save the following as example.mjs:
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);Send a message. The request appears in Usage.
Codex CLI
You need Codex CLI installed, and a BeefAPI key from API keys.
Put the model and Base URL in ~/.codex/config.toml (on Windows, %USERPROFILE%\.codex\config.toml):
model_provider = "beefapi"
model = "gpt-5.6-sol"
[model_providers.beefapi]
name = "BeefAPI"
base_url = "https://global.beefapi.com/v1"
wire_api = "responses"
env_key = "BEEFAPI_KEY"
supports_websockets = falseSet the environment variable named by env_key before starting Codex:
export BEEFAPI_KEY="sk-..."Send a message in Codex. The request appears in Usage.
Claude Code
You need Claude Code installed, and a BeefAPI key from API keys.
Set these environment variables. Use ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY. Do not append /v1 to the Base URL:
export ANTHROPIC_BASE_URL="https://global.beefapi.com"
export ANTHROPIC_AUTH_TOKEN="sk-..."You can also set the same names under env in ~/.claude/settings.json (on Windows, %USERPROFILE%\.claude\settings.json).
Send a message in Claude Code. The request appears in Usage.
Other OpenAI-compatible tools
You need a BeefAPI key from API keys, and a client that uses the OpenAI API.
You always need two values:
| Field | Value |
|---|---|
| Base URL | https://global.beefapi.com/v1 |
| API key | the sk-... value from API keys |
Send a message. The request appears in Usage.
Next steps
Use the API reference for Responses and streaming examples. Image and video models use their own endpoints: see Images and Videos.
Codex provider fields follow the official configuration reference. Put provider settings in the user-level file shown above and restart the CLI after changing them.