THE INTEGRATION GUIDE
API Reference
Everything you need to integrate with the HashBid inference gateway.
Core endpoints
Chat Completions
An OpenAI Chat Completions compatible endpoint for most chat models, with tool calling and SSE streaming.
Responses
An OpenAI Responses compatible endpoint using input-based requests and streaming events. The gateway keeps no conversation state: fields such as previous_response_id and store are ignored, so send the full history in input for multi-turn conversations.
Messages
An Anthropic Messages compatible endpoint for Claude SDK, Claude Code, tools, and thinking. The body is validated strictly against the Anthropic schema, so OpenAI fields such as stop or response_format are rejected with 400. POST /v1/messages/count_tokens estimates input tokens.
Embeddings
Turns text into vector embeddings for search, clustering, and RAG. OpenAI Embeddings compatible — the official SDKs work unchanged. Billed on input tokens only; embeddings generate no output tokens, and there is no streaming form of this endpoint.
Generate image
OpenAI-compatible image generation. Model-agnostic — works with Volcano Engine Seedream, Bailian qwen-image, OpenAI gpt-image, and others. The gateway forwards only the fields listed below and ignores the rest; values such as size are validated by the upstream model.
Video generation
OpenAI-compatible video generation, run asynchronously. The create call waits up to about 60 seconds: if generation finishes in that time the result comes back directly; otherwise it returns the current status, and you poll GET /v1/videos/{id}, then download the video from GET /v1/videos/{id}/content once it completes. Only application/json bodies are accepted for now; unlisted fields are ignored.
Gemini generateContent
Pass-through to Google Gemini's native API, supporting generateContent, streamGenerateContent, and countTokens (estimated locally). Useful for SDKs and tools that speak the Gemini wire format, such as Gemini CLI. Authenticate with the Authorization: Bearer or x-goog-api-key header; a key in the key query parameter is rejected.
Additional endpoints
List models
Returns the model catalog available to your account. The model value in an inference request is an item's id. The response also carries the Anthropic list fields (has_more, first_id, last_id), so both official SDKs can parse it.
Get model
Looks up a single model by id (the value from GET /v1/models, or its model UUID); the fields match a list item. Models not enabled for your account return 404.
Usage summary
Usage and charges bucketed by hour or day; without start, the window reaches back 30 days from end, which defaults to today (UTC). The response is wrapped in a {code, data, message} envelope; the fields below live under data.
Usage records
Per-call records, cursor-paginated; limit clamps to [1, 200]. Keep paging with next_cursor until items comes back empty. The response is wrapped in a {code, data, message} envelope; the fields below live under data.
Billing balance
A snapshot of your account balance. The response is wrapped in a {code, data, message} envelope; the fields below live under data.
Billing ledger
Balance ledger entries, cursor-paginated; limit clamps to [1, 100]. The response is wrapped in a {code, data, message} envelope; the fields below live under data.