Getting started
Introduction
An OpenAI-compatible gateway for models and isolated code execution, with prepaid billing, hard spending limits and signed receipts for every billed operation.
Overview
Hush is an API gateway for AI workloads. A single project API key gives your application access to models from several providers through an OpenAI-compatible interface, and to isolated sandboxes for executing Python and Node.js code.
Every billed operation runs through the same pipeline, whether it comes from the public API, the console playground or a hosted agent:
- authentication and scope checks,
- model and policy allowlists, then per-key and per-project rate limits,
- a budget check and a balance reservation for the estimated maximum cost, in one locked transaction,
- execution upstream or on a sandbox node,
- exact metering, settlement of the reservation against the actual cost,
- a signed receipt that anyone can verify.
At a glance
- Base URL
- https://www.hushcompute.xyz/v1
- Authentication
- Authorization: Bearer proj_live_…
- Format
- JSON over HTTPS · Server-Sent Events for streams
- Request body limit
- 2 MB
- Money
- Integer micro-USD (1 USD = 1,000,000 µUSD)
- Receipts
- keccak256 hash · EIP-191 signature
API surface
Endpoints are grouped by the API key scope they require. Availability labels describe what is implemented today.
| Endpoint | Scope | Status |
|---|---|---|
| POST /v1/chat/completions | inference | Live |
| POST /v1/responses | inference | Beta |
| GET /v1/models | any valid key | Live |
| POST /v1/sandbox/executions | sandboxes | Live |
| GET /v1/receipts/{receipt_id} | receipts | Live |
| GET /api/proofs/{receipt_id} | public, no key | Live |
| Agents API | agents | Coming soon |
Core concepts
Projects. API keys, the prepaid balance, the spending policy, agents and receipts all belong to a project. Receipts identify a project only by a one-way hash.
API keys. Keys are scoped, can be restricted to specific models, and can carry their own monthly limit, rate limit and expiration. See API Keys.
Balance. Usage is prepaid. Credit is added with USDG on Robinhood Chain (or with development credit on local deployments). A request reserves its estimated maximum cost before it runs, and the unused part is released afterwards. Balances can never go negative. See Usage.
Budgets. Project monthly budgets, per-key monthly limits and per-run agent budgets are enforced before execution, not reported afterwards. See Budgets.
Receipts. Each billed operation produces a receipt: a canonical JSON payload with the model, token counts, cost, timing and salted fingerprints of the input and output, hashed with keccak256 and signed by the platform. Receipts never contain prompts or outputs. See Receipts.
Agents and sandboxes. Hosted agents call models and execute code through the same gateway, so policies, billing and receipts apply to every step. See Agents and Sandboxes.
Conventions
- Identifiers are prefixed and time-sortable:
req_requests,rcpt_receipts,sbxr_sandbox executions,run_agent runs. The part after the underscore is 26 Crockford base32 characters. - Money is integer µUSD, serialized as a decimal string (for example
"cost_micro_usd": "2233"). A formattedcost_usdstring is included for display. Do arithmetic on the µUSD value, not on the formatted one. - Timestamps in OpenAI-compatible objects (
created) are Unix seconds. Receipt timestamps are ISO 8601 UTC with millisecond precision. - Headers. Responses carry
x-request-idand, when a receipt is issued,x-receipt-id. Rate-limited responses carryretry-after. - Errors share one JSON shape with a machine-readable
type. See Errors.
OpenAI compatibility
The official openai SDKs work unchanged when their base URL is set to https://www.hushcompute.xyz/v1. Responses add two fields, receipt and billing, which the SDKs pass through. Differences to be aware of:
- Image inputs are not yet supported and return a 400 error.
nmust be 1, andtool_choiceaccepts onlyautoornone.- Request fields the gateway does not implement, such as
response_format, are ignored rather than rejected. - The Responses API is a text-only subset with no tools and no stored state.
Next steps
- Quickstart: send a request and verify its receipt in a few minutes.
- Chat Completions: the full request and streaming reference.
- Receipt Verification: verify receipts independently in TypeScript or Python.