Skip to content
SnowLLM / Documentation

HTTP API ​

Supported APIs ​

APIRequest endpoint
OpenAI Chat CompletionsPOST /v1/chat/completions
OpenAI ResponsesPOST /v1/responses
Anthropic MessagesPOST /v1/messages

All three support streaming and function tool calls. Image input requires a checkpoint with a vision tower; send data URLs, or enable HTTP(S) image fetching with --allow-image-urls.

Compatibility covers the implemented inference endpoints, not the entire upstream APIs. Responses is stateless: resend the conversation in input; previous_response_id and background requests are unsupported. Built-in tools, grammar-constrained JSON output and forced tool selection are unsupported.

Client base URLs:

  • OpenAI (Chat Completions or Responses): http://127.0.0.1:8000/v1
  • Anthropic (Messages): http://127.0.0.1:8000

Authentication ​

When inference authentication is enabled, send Authorization: Bearer <inference key> with inference requests. Anthropic Messages and its token-counting endpoint also accept the inference key in x-api-key. An unauthenticated GET /health returns only readiness. When management authentication is enabled, send Authorization: Bearer <management key> to the management port.

See the Web UI service management guide for setup flags, key files and HTTPS.

First request ​

Load a model first. Replace model with its ID from GET /v1/models.

sh
curl http://127.0.0.1:8000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"Qwen3.8-Flash-Next","messages":[{"role":"user","content":"Hello!"}],"stream":true}'

API types and request formats ​

The three conversation APIs use the same model inference engine. Choose the protocol expected by your client.

APIInput and outputClient
Chat Completionsmessages input; choices[].message output, or choices[].delta when streamingOpenAI chat clients
Responsesinput with optional instructions; output items, or Responses streaming eventsOpenAI Responses clients
Messagesmessages with a top-level system prompt; content blocks, or Messages streaming eventsAnthropic clients
sh
curl http://127.0.0.1:8000/v1/responses \
  -H 'Content-Type: application/json' \
  -d '{"model":"Qwen3.8-Flash-Next","input":"Hello!","max_output_tokens":128,"stream":true}'
sh
curl http://127.0.0.1:8000/v1/messages \
  -H 'Content-Type: application/json' \
  -d '{"model":"Qwen3.8-Flash-Next","messages":[{"role":"user","content":"Hello!"}],"max_tokens":128,"stream":true}'

POST /v1/completions also accepts a text prompt and returns choices[].text. POST /v1/messages/count_tokens accepts the Messages request format and returns the input token count.

SnowLLM extensions ​

The inference service defaults to port 8000; the management service defaults to 8001. Send model load and unload requests to the management port, and inference requests to the inference port.

RequestPurpose
GET /v1/modelsList ready model IDs
GET /healthQuery service health
GET /metricsPrometheus metrics; use ?format=json for JSON
POST /start_profile, POST /stop_profileStart and stop inference profiling
GET /v1/inference?model=IDDescribe auxiliary components and configuration
POST /v1/inference/{component}?model=IDRun auxiliary inference with application/x-npz numeric tensors
GET /daemon/statusQuery loading progress and management state
POST /daemon/models/loadLoad a model with optional id and startup options
POST /daemon/models/unloadUnload a model by id
POST /daemon/models/defaultSelect the default model by id

Select a resident model with the request's model field. Auxiliary endpoints use the model query parameter. The MinerU adapter uses auxiliary endpoints for model inference; send PDFs to the native MinerU parsing API.

For example, load MinerU through the management service:

sh
curl http://127.0.0.1:8001/daemon/models/load \
  -H 'Content-Type: application/json' \
  -d '{"model":"b/mineru","id":"documents","options":["--max-gpu-mem","12GiB"]}'

Loading is asynchronous. Wait for ready using GET /daemon/status, then use documents as the model ID. See Web UI for model management and port configuration.

Profiling ​

Enable the torch profiler when starting the model. --profiler-dir is optional; it defaults to ~/.cache/snowllm/profiler on the server.

sh
snowllm PATH --enable-profiler --profiler-dir /tmp/snowllm-traces

Use the inference port to capture a request, then stop and flush the trace:

sh
curl -f -X POST http://127.0.0.1:8000/start_profile
curl -f http://127.0.0.1:8000/v1/completions \
  -H 'Content-Type: application/json' \
  -d '{"prompt":"Hello","max_tokens":8}'
curl -f -X POST http://127.0.0.1:8000/stop_profile

Start returns {"status":"profiling"}. Stop returns {"status":"stopped","trace_dir":"/tmp/snowllm-traces"} and writes a *.pt.trace.tar.gz archive containing one *.pt.trace.json file in that directory. Extract the JSON before opening it in a trace viewer. Repeat start/stop to capture another window. Disabled profiling, duplicate starts, and stops without an active profile return HTTP 400. With multiple models, start uses the default model's configuration and captures work on its shared GPU worker; stop ends the active recording even if the default model changes. Pass the flags as model load options when using the management service.