Endpoints
hlid listens on bind_addr (default 127.0.0.1:8080) and exposes:
Inference
| Method | Path | Dialect |
|---|---|---|
POST | /v1/messages | Anthropic Messages |
POST | /v1/messages/count_tokens | Anthropic token count |
POST | /v1/chat/completions | OpenAI Chat Completions |
POST | /v1/responses | OpenAI Responses |
POST | /v1/completions | OpenAI Completions (legacy) |
The path tells hlid what dialect the agent speaks. The model in the body tells it where to go. Streaming is requested the way each dialect already does it ("stream": true).
Discovery
| Method | Path | Purpose |
|---|---|---|
GET | /v1/models | Model list |
Observability
| Method | Path | Purpose |
|---|---|---|
GET | /hlid/requests | All recent request captures |
GET | /hlid/requests/<id> | A single capture |
GET | /health | Health check — {"status": "ok"} |
Auth
When auth_key is configured, every endpoint requires it, sent either way:
Authorization: Bearer <key>
x-api-key: <key>Failures return a 401 in the dialect of the endpoint — an OpenAI-shaped error body on OpenAI paths, an Anthropic-shaped one on Anthropic paths — so SDKs surface the error cleanly instead of choking on an unexpected shape.
Errors
All errors are dialect-native for the endpoint that received the request:
- Unknown model (no registry match) → 404-family error naming the model
- Upstream failure → the backend's status and message, passed through
- Timeout → 504-family error after
request_timeout_secs