API reference
Every operation of the management API, generated from its OpenAPI document.
What your backend calls to manage what the dashboard manages, at the level of a project and below: the environment's keys, its customers and their provider keys, wallets, credits, top-ups and auto-refill, its usage, its webhook endpoints and events, trace exports, its Stripe connection, its gateway settings, its own provider keys and catalog models; and, with a project key, the project itself, its environments, its keys, its audit log and its billing.
- Keys. Two keys call this API. An environment's key with the
managementscope (hx_sk_…) acts in its own environment. A project key (hx_proj_…) manages its project and every environment of it, with the permissions of its role (adminormember), never the organization's own settings, members or other projects; the gateway never accepts it. - Environment. An environment's key decides the environment every call reads and changes. A project key names it in the
x-hixel-environment: env_…header on every environment's endpoint: without it the call isinvalid_request(400,environment_required); naming an environment outside the key's project, an archived one or an unknown one isnot_found(404,environment_not_found), alike, and so is an environment's key naming another environment than its own. A resource of another environment, project or organization reads asnot_found. - Roles and scopes. Every operation states what it needs of its key:
x-required-scope(an environment's key needs themanagementscope) andx-required-role(a project key'smemberrole reads;adminreads and changes everything at the project level and below). An endpoint only a project key may call (the project's own,PATCH /v1/gatewayand the writes of/v1/provider_keys) answers an environment's key withpermission_denied(403,project_key_required), and a project key whose role is short of an operation's withrole_not_allowed. Nothing of the organization's own (its settings, members, other projects) is in this API. - Customers are named by your own id for them,
external_id, in paths such as/v1/customers/{external_id}/wallet. - JSON bodies with snake_case names. Every amount is an integer number of micro-USD (millionths of a US dollar) and every token count an integer, both as decimal strings (
"1500000"is 1.50 USD), never JSON numbers. Instants are RFC 3339 strings in UTC. - Lists answer
{"data": [...], "next_cursor": …}: passnext_cursorback ascursor, with the same filters, for the next page; it isnullon the last page.limitis 1 to 100, 50 by default. - Retries. Writes accept an
Idempotency-Keyheader, so a retried write runs once: per environment on an environment's endpoints, per project on the project's own. - Errors answer
{"error": {"type", "code", "message", "param"}}, the status fixed bytype. Branch oncode, never onmessage.
Inference (/v1/chat/completions, /v1/responses, /v1/messages, …) is served on the same host by the gateway and is not part of this document.
The management API is served at https://api.hixel.dev, under /v1. Its OpenAPI 3.1 document is at https://api.hixel.dev/v1/openapi.json. Every call below shows a curl command and the same call with the Node SDK. Bodies and responses use snake_case names, amounts are strings of micro-USD (Amounts), every list is a page, a delete answers 204 with no body, every response carries x-hixel-request-id, and failures use the error envelope.
Two kinds of key call it (Authentication). An environment key (hx_sk_…, with the management scope) acts in its own environment. A project key (hx_proj_…) calls the project's own sections below, and every environment section too, naming the environment in x-hixel-environment: env_…. Each operation says which it takes; the curl samples use $HIXEL_API_KEY for an environment key and $HIXEL_PROJECT_KEY for a project key.
| Section | What it covers |
|---|---|
| System | Diagnostics of the control plane itself; no account's data and no key needed. |
| Project | The project the calling project key belongs to. |
| Project keys | The keys of the calling project key's project. |
| Environments | The environments of the calling project key's project. |
| Audit log | What was done in the calling project key's project, and by whom. |
| Project billing | What the calling project key's project cost your organization with the gateway (the provider cost of the requests on the platform's provider key), and whether its environments are let through. |
| Keys | The keys of the calling key's environment. |
| Customers | Your customers in the calling key's environment, each named by your own id for it (external_id), and the provider keys they bring. |
| Customer portal | What a customer's admin governs in the hosted portal, which your backend can read and change too. |
| Gateway | How the environment's requests are routed, limited, paid for, checked and cached. |
| Provider keys | Your own provider keys for the environment. |
| Catalog | The models offered to the calling key's environment through the platform's own provider keys, and their prices. |
| Wallets | Customers' prepaid balances and their ledgers. |
| Wallet settings | The calling key's environment's wallet settings. |
| Usage | Every request the environment's gateway served, as the usage log recorded it, and its analytics. |
| Webhook endpoints | Where the calling key's environment's events are sent. |
| Events | What happened in the calling key's environment, as webhook events. |
| Trace export destinations | The calling key's environment's recorded requests sent, as OpenTelemetry spans over OTLP/HTTP (JSON), to your own observability tools (Langfuse, Datadog, Honeycomb, Grafana, an OpenTelemetry Collector). |
| Stripe connection | The calling key's environment's connection to your own Stripe account. |
| Top-ups | Customers buying credit through Stripe Checkout on the environment's Stripe connection. |
| Auto-refill | Charging a customer's saved payment method off-session when its balance runs low, within a monthly cap. |
| Payments | The environment's payments, top-ups and auto-refills together. |
| Webhook events | Every event a webhook endpoint can receive, and its payload. |