Skip to main content

Migrating from OpenAI/Anthropic

For most projects three changes are enough: base URL, API key and model name.

OpenAI SDK​

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)

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/messages itself.
  • Key as bearer token: pass the key as auth_token (Python) or authToken (TypeScript), not as api_key. The SDK then sends it in the Authorization: Bearer header. Do not set ANTHROPIC_API_KEY in that environment.
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)

Differences from OpenAI and Anthropic​

TopicAt Open Hippo
Model namesOur 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.
AuthenticationOnly Authorization: Bearer <key> is documented.
Unknown parametersParameters a model does not support are silently dropped instead of raising an error. Check the result, not just the status code. See below.
StreamingVia SSE on /v1/chat/completions and /v1/messages, see Streaming.
EndpointsOnly the paths listed in Authentication & basics. There are no files, batches, fine-tuning, assistants or image generation. /v1/responses supports creating a response only.
Reasoningreasoning_effort (OpenAI) and thinking (Anthropic) are mapped to the model's levels, see Chat.
BillingPrepaid balance in euros. When it is empty, the API answers 402. Partner models only after the first top-up, see Prepaid & pricing.
LimitsBudgets per key, account, member and company instead of tier limits, see Budgets & limits.
Error formatAuthentication 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 mode
  • stream_options.include_usage
  • seed
  • logprobs
  • n
  • parallel_tool_calls

Questions: support@openhippo.io.