HTTP API
Supported APIs
| API | Request endpoint |
|---|---|
| OpenAI Chat Completions | POST /v1/chat/completions |
| OpenAI Responses | POST /v1/responses |
| Anthropic Messages | POST /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.
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.
| API | Input and output | Client |
|---|---|---|
| Chat Completions | messages input; choices[].message output, or choices[].delta when streaming | OpenAI chat clients |
| Responses | input with optional instructions; output items, or Responses streaming events | OpenAI Responses clients |
| Messages | messages with a top-level system prompt; content blocks, or Messages streaming events | Anthropic clients |
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}'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.
| Request | Purpose |
|---|---|
GET /v1/models | List ready model IDs |
GET /health | Query service health |
GET /metrics | Prometheus metrics; use ?format=json for JSON |
POST /start_profile, POST /stop_profile | Start and stop inference profiling |
GET /v1/inference?model=ID | Describe auxiliary components and configuration |
POST /v1/inference/{component}?model=ID | Run auxiliary inference with application/x-npz numeric tensors |
GET /daemon/status | Query loading progress and management state |
POST /daemon/models/load | Load a model with optional id and startup options |
POST /daemon/models/unload | Unload a model by id |
POST /daemon/models/default | Select 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:
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.
snowllm PATH --enable-profiler --profiler-dir /tmp/snowllm-tracesUse the inference port to capture a request, then stop and flush the trace:
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_profileStart 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.