OpenAI-compatible setup
Any client or SDK that supports an OpenAI-compatible API can connect to BRUCEAI with the Base URL and API key below. /v1/models, /v1/chat/completions and /v1/responses are supported.
If the client asks for a model name, start with gpt-5.6-terra on an OpenAI key; GPT-6.1 Sol, GPT-6 Astra / Sol / Luna, GPT-5.6 Sol / Luna and GPT-5.5 are also available. Use grok-4.7 / grok-4.6 / grok-4.5 with a Grok key and deepseek-v4.1-flash with a DeepSeek key. Billing follows the actual model and context tier.
Copy these model IDs into config files, API request bodies, or any OpenAI-compatible client that asks for a model name. Each group needs the matching key type.
Prepare your API key
After signing in, open the API key page to create or copy a key. It looks like sk-or-v1-xxxxxxxxxxxx. Treat it like a password.
Create API keyOpenAI-compatible clients usually require a Base URL that includes /v1.
Click Create API key, give it a name you will recognize, then pick the key type by the models you plan to call:
- OpenAI key
- Serves gpt-6.1-sol, gpt-6-astra, gpt-6-sol, gpt-6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna and gpt-5.5. Works with Codex, GitHub Copilot and any OpenAI-compatible client.
- Grok key
- Serves grok-4.7, grok-4.6 and grok-4.5. Works with Grok Build, Codex and any OpenAI-compatible client.
- DeepSeek key
- Serves deepseek-v4.1-flash: 1M context, thinking mode, tool calling and image input. Works with Codex and any OpenAI-compatible client.
A key only serves its own provider's models. Sending a GPT model id with a Grok key, or a Grok id with an OpenAI key, is refused with a 400. Create one key per provider if you use several.
Do not share your API key with anyone, and do not commit it to GitHub, GitLab, or any public repository.
The commands below switch to the system you choose.
Health check
curl https://api.bruceai.net/healthList the models this key can use
The response is exactly what this key can call: an OpenAI key lists the GPT family, a Grok key lists only grok-4.7, grok-4.6 and grok-4.5, and a DeepSeek key lists only deepseek-v4.1-flash.
curl https://api.bruceai.net/v1/models \
-H "Authorization: Bearer sk-or-v1-your-key"Chat Completions streaming example
curl -N https://api.bruceai.net/v1/chat/completions \
-H "Authorization: Bearer sk-or-v1-your-key" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.6-terra","messages":[{"role":"user","content":"hi"}],"stream":true}'OpenAI SDK examples
The official openai package works as-is once base_url points at BRUCEAI. For Grok or DeepSeek, swap the key and the model.
from openai import OpenAI
client = OpenAI(
api_key="sk-or-v1-your-key",
base_url="https://api.bruceai.net/v1",
)
response = client.chat.completions.create(
model="gpt-5.6-terra",
messages=[{"role": "user", "content": "hi"}],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: "sk-or-v1-your-key",
baseURL: "https://api.bruceai.net/v1",
});
const response = await client.chat.completions.create({
model: "gpt-5.6-terra",
messages: [{ role: "user", content: "hi" }],
});
console.log(response.choices[0].message.content);Troubleshooting
401 / invalid token: make sure the key is complete, has no extra spaces, and starts with sk-or-v1-.
400 / unsupported_model: the model id does not belong to this key's provider, or is misspelled (use lowercase gpt-5.6-terra, grok-4.6, deepseek-v4.1-flash).
404: make sure the Base URL ends with /v1 and the endpoint is /chat/completions, /responses or /models.
400 / conversation too large: compact the conversation in your client (for example /compact in Codex), or start a new one.