OpenAI-compatible API
Use the official OpenAI SDKs with Hypervize — models, chat, completions, embeddings, and responses.
OpenAI-compatible API
Point the official OpenAI SDKs (and most OpenAI-compatible clients) at Hypervize:
base_url = https://hypervize.tech/api
api_key = hvz_live_…No /v1 segment is required. Paths live next to our existing routes under /api.
Supported endpoints
| Method | Path | Notes |
|---|---|---|
GET | /api/models | Catalog + current pricing (DB) |
GET | /api/models/{id} | One model (display name or catalog value) |
POST | /api/chat/completions | Multi-turn chat, tools, stream |
POST | /api/completions | Legacy prompt → text (platform tools not injected) |
POST | /api/embeddings | Vectors; prepaid / free as elastic |
POST | /api/responses | Responses API; tools on; optional chain |
GET | /api/responses/{id} | Retrieve stored response |
DELETE | /api/responses/{id} | Delete stored response |
Pinned keys (/api/b/…)
Same surface under /api/b/ for keys with pinned_model / pinned_tools (OpenClaw-style stable paths):
/api/b/models, /api/b/chat/completions, /api/b/completions, /api/b/embeddings, /api/b/responses, /api/b/responses/{id}.
SDK examples
Python
from openai import OpenAI
client = OpenAI(
base_url="https://hypervize.tech/api",
api_key="hvz_live_…",
)
print(client.models.list())
chat = client.chat.completions.create(
model="claude-sonnet-5",
messages=[{"role": "user", "content": "Hello"}],
stream=True,
)
emb = client.embeddings.create(
model="cohere.embed-v4", # or catalog display / value
input="hello",
)
resp = client.responses.create(
model="claude-sonnet-5",
input="Summarize scale-to-zero in one sentence.",
)
print(resp.output_text) # if SDK exposes it; else read resp.outputNode
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://hypervize.tech/api",
apiKey: process.env.HYPERVIZE_API_KEY,
});
const models = await client.models.list();
const completion = await client.chat.completions.create({
model: "claude-sonnet-5",
messages: [{ role: "user", content: "Hello" }],
});Models + pricing
GET /api/models returns OpenAI list objects plus Hypervize fields:
value,provider,chat_eligible,max_tokens,context_windowpricing:{ currency, input_per_million, output_per_million, per_image, display }from the livepricestable (null if unset)
Primary id is the display name (e.g. claude-sonnet-5). Request bodies accept display or full catalog value.
Responses API notes
- Tools:
- Plain client tools (no webhook / not platform): mapped to Responses
function_calloutput items (stream and non-stream). Plain-tool requests do not attach platform tools unless hybrid is enabled (same as chat completions). - Platform / webhook tools: managed path (final text and/or tool execution server-side), same as chat completions Mode B.
- Both together: see Using plain tools with platform tools.
- Plain client tools (no webhook / not platform): mapped to Responses
- Never rely on empty
status: "completed"with blank text as a tool result — that was a bug; you should seefunction_callitems or a real error. previous_response_id: continues from a prior response (~7 day retention). Works for non-stream and stream (stream is stored afterresponse.completedwhen the client drains the body).store: false: do not persist (cannot chain later).- Chain context is bounded to limit growth on long multi-turn sessions.
- Streaming event subset:
response.created,response.output_text.delta,response.completed(+[DONE]).function_callitems appear onresponse.completed.output.
Completions (legacy)
POST /api/completions maps prompt → a single user chat message, returns choices[].text.
Platform tools are not injected on this path. Prefer chat or responses for agent/tool use.
Errors (dual shape)
Inference errors use OpenAI-style objects and a top-level message for older clients:
{
"error": {
"message": "Insufficient prepaid balance. Please add funds to continue.",
"type": "insufficient_quota",
"code": "insufficient_balance",
"param": null
},
"message": "Insufficient prepaid balance. Please add funds to continue.",
"current_balance_usd": 0
}Prefer error.message or top-level message. Do not assume error is a string.
Billing
Same prepaid ledger as elastic chat: free queries, balance gates, usage queue, platform tools metering. Dedicated weekly post-pay is separate (/api/d/…).
See Billing & Payments.