modelhaus serves an OpenAI-compatible API. If you have code that talks to the OpenAI SDK, you can point it at modelhaus by changing two things: the base URL and the API key.
Base URL: https://modelhaus.ai/v1
Authenticate with a bearer token in the Authorization header:
Authorization: Bearer mh-...
Keys come from your dashboard. Create an account, verify your email, then create a key under Account → API keys. The full key is shown once at creation — copy it then. Treat keys like passwords; never commit them to source control.
A basic chat completion:
# Chat completion curl https://modelhaus.ai/v1/chat/completions \ -H "Authorization: Bearer mh-..." \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek-v4-pro", "messages": [ {"role": "system", "content": "You are concise."}, {"role": "user", "content": "Explain mixture-of-experts in one sentence."} ] }'
Install the official client with pip install openai, then:
from openai import OpenAI client = OpenAI( base_url="https://modelhaus.ai/v1", api_key="mh-...", # from your dashboard ) resp = client.chat.completions.create( model="llama-3.3-70b", messages=[ {"role": "user", "content": "Write a haiku about open models."}, ], ) print(resp.choices[0].message.content)
Streaming works too — pass stream=True and iterate over the response, exactly as with the OpenAI SDK.
Fetch the live catalog programmatically:
curl https://modelhaus.ai/v1/models \
-H "Authorization: Bearer mh-..."
Use these ids in the model field. See the models page for live pricing and context windows.
deepseek-v4-pro — DeepSeek-V4-Pro, frontier reasoning MoEllama-3.3-70b — Llama 3.3 70B, flagship chatqwen-2.5-32b — Qwen2.5 32B, workhorse chatqwen-2.5-coder — Qwen2.5-Coder 32B, code generation and reviewdeepseek-r1 — DeepSeek-R1, step-by-step reasoningnomic-embed — Nomic Embed, 768-dim text embeddingsGenerate vectors for search and RAG with the embeddings endpoint:
curl https://modelhaus.ai/v1/embeddings \ -H "Authorization: Bearer mh-..." \ -H "Content-Type: application/json" \ -d '{ "model": "nomic-embed", "input": "modelhaus hosts frontier open models" }'