Migrating from OpenAI/Anthropic
For most projects three changes are enough: base URL, API key and model name.
OpenAI SDK
- Python
- TypeScript
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.openhippo.io/v1", # instead of https://api.openai.com/v1
api_key=os.environ["OPENHIPPO_API_KEY"], # hk_live_...
)
response = client.chat.completions.create(
model="openhippo/gpt-oss-120b", # a model from our list
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.openhippo.io/v1", // instead of https://api.openai.com/v1
apiKey: process.env.OPENHIPPO_API_KEY, // hk_live_...
});
const response = await client.chat.completions.create({
model: "openhippo/gpt-oss-120b", // a model from our list
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);
Many tools read the variables OPENAI_BASE_URL and OPENAI_API_KEY. Then this is enough:
export OPENAI_BASE_URL="https://api.openhippo.io/v1"
export OPENAI_API_KEY="$OPENHIPPO_API_KEY"
Anthropic SDK
Open Hippo offers the Anthropic Messages API at /v1/messages, streaming included. Two particulars:
- Base URL without
/v1: the SDK appends/v1/messagesitself. - Key as bearer token: pass the key as
auth_token(Python) orauthToken(TypeScript), not asapi_key. The SDK then sends it in theAuthorization: Bearerheader. Do not setANTHROPIC_API_KEYin that environment.
- Python
- TypeScript
pip install anthropic
import os
from anthropic import Anthropic
client = Anthropic(
base_url="https://api.openhippo.io",
auth_token=os.environ["OPENHIPPO_API_KEY"],
)
message = client.messages.create(
model="openhippo/gpt-oss-120b",
max_tokens=512,
messages=[{"role": "user", "content": "Hello!"}],
)
print(message.content[0].text)
npm install @anthropic-ai/sdk
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://api.openhippo.io",
authToken: process.env.OPENHIPPO_API_KEY,
apiKey: null,
});
const message = await client.messages.create({
model: "openhippo/gpt-oss-120b",
max_tokens: 512,
messages: [{ role: "user", content: "Hello!" }],
});
for (const block of message.content) {
if (block.type === "text") console.log(block.text);
}
Differences from OpenAI and Anthropic
| Topic | At Open Hippo |
|---|---|
| Model names | Our own IDs such as openhippo/gpt-oss-120b or aliases such as hippo-coding, see Models. Names are case-sensitive; an unknown name returns 400 invalid_request_error. |
| Authentication | Only Authorization: Bearer <key> is documented. |
| Unknown parameters | Parameters a model does not support are silently dropped instead of raising an error. Check the result, not just the status code. See below. |
| Streaming | Via SSE on /v1/chat/completions and /v1/messages, see Streaming. |
| Endpoints | Only the paths listed in Authentication & basics. There are no files, batches, fine-tuning, assistants or image generation. /v1/responses supports creating a response only. |
| Reasoning | reasoning_effort (OpenAI) and thinking (Anthropic) are mapped to the model's levels, see Chat. |
| Billing | Prepaid balance in euros. When it is empty, the API answers 402. Partner models only after the first top-up, see Prepaid & pricing. |
| Limits | Budgets per key, account, member and company instead of tier limits, see Budgets & limits. |
| Error format | Authentication and billing errors use the OpenAI format {"error": {...}}, on /v1/messages too. See Errors, limits, retries. |
Not yet documented
We have not yet documented or tested the behaviour of these parameters and features. Depending on the model they may work or be silently dropped; check the result yourself:
response_format/ JSON modestream_options.include_usageseedlogprobsnparallel_tool_calls
Questions: support@openhippo.io.