API Reference

Authentication, endpoints, error codes, and Swagger UI

API Reference

VoidLLM exposes two API surfaces: the Proxy API (OpenAI-compatible, for LLM requests) and the Admin API (for management).

Authentication

All requests require an API key in the Authorization header:

Authorization: Bearer vl_uk_...

Key types: vl_uk_ (user), vl_tk_ (team), vl_sa_ (service account), vl_sk_ (session).

Proxy API (/v1/*)

The proxy forwards requests to upstream LLM providers. Any OpenAI-compatible endpoint works:

EndpointDescription
POST /v1/chat/completionsChat completions (streaming supported)
POST /v1/completionsText completions
POST /v1/embeddingsText embeddings
POST /v1/images/generationsImage generation
POST /v1/audio/transcriptionsAudio transcription
POST /v1/audio/speechText to speech
GET /v1/modelsList available models

VoidLLM does not validate request bodies beyond extracting the model field. The upstream provider handles validation.

Admin API (/api/v1/*)

Management endpoints for organizations, teams, users, keys, models, and MCP servers.

Organizations

MethodEndpointDescription
GET/api/v1/orgsList organizations
POST/api/v1/orgsCreate organization
GET/api/v1/orgs/:idGet organization
PATCH/api/v1/orgs/:idUpdate organization

Teams

MethodEndpointDescription
GET/api/v1/orgs/:org_id/teamsList teams
POST/api/v1/orgs/:org_id/teamsCreate team
GET/api/v1/teams/:idGet team
PATCH/api/v1/teams/:idUpdate team
DELETE/api/v1/teams/:idDelete team

API Keys

MethodEndpointDescription
GET/api/v1/keysList keys
POST/api/v1/keysCreate key
DELETE/api/v1/keys/:idRevoke key
POST/api/v1/keys/:id/rotateRotate key (24h grace)

Models

MethodEndpointDescription
GET/api/v1/modelsList models
POST/api/v1/modelsCreate model
PATCH/api/v1/models/:idUpdate model
DELETE/api/v1/models/:idDelete model
POST/api/v1/models/:id/testTest upstream connectivity

Usage

MethodEndpointDescription
GET/api/v1/orgs/:org_id/usageOrg usage stats
GET/api/v1/usage/meCurrent user’s usage

MCP

MethodEndpointDescription
POST/api/v1/mcp/voidllmBuilt-in MCP tools
POST/api/v1/mcp/:aliasProxy to external MCP server
POST/api/v1/mcpCode Mode tools

Health Endpoints

EndpointAuthDescription
GET /healthzNoLiveness probe (always 200)
GET /readyzNoReadiness probe (503 during drain)
GET /metricsNoPrometheus metrics

Swagger UI

When VoidLLM is running, the full OpenAPI spec is available at:

  • Swagger UI: http://localhost:8080/api/docs
  • OpenAPI JSON: http://localhost:8080/api/docs/swagger.json

A static copy of the spec is also available in the repository: swagger.yaml

Error Responses

All errors follow a consistent format:

{
  "error": {
    "code": "not_found",
    "message": "model not found",
    "request_id": "019d3ba2-8130-7d96-b60e-2e0da53e2650"
  }
}
StatusCodeMeaning
400bad_requestInvalid request body or parameters
401unauthorizedMissing or invalid API key
403forbiddenInsufficient permissions
404not_foundResource not found
409conflictResource already exists
429rate_limit_exceededRate limit or token budget exceeded
502upstream_unavailableLLM provider unreachable