Skip to main content

REST API Reference

CSGHub-Lite starts its service by default on port 11435 of localhost, providing API interfaces compatible with Ollama and OpenAI.

API Overview

MethodPathDescription
GET/api/healthService health check
GET/api/tagsList all local models
GET/api/psView currently running models
POST/api/showShow detailed information for a specific model
POST/api/pullPull model (supports streaming response)
POST/api/stopStop and unload model
DELETE/api/deleteRemove local model files
POST/api/generateText generation (supports interactive stream)
POST/api/chatChat conversation generation (supports stream)
POST/v1/chat/completionsOpenAI-compatible chat interface
GET/v1/modelsOpenAI-compatible model list interface

Interface Examples

Chat API

curl http://localhost:11435/api/chat -d '{
"model": "Qwen/Qwen3-0.6B-GGUF",
"messages": [{"role": "user", "content": "Hello!"}]
}'

Non-Streaming Text Generation (Generate API)

curl http://localhost:11435/api/generate -d '{
"model": "Qwen/Qwen3-0.6B-GGUF",
"prompt": "Write a line of poetry about programming",
"stream": false
}'

Get Running Models

curl http://localhost:11435/api/ps

OpenAI-Compatible Call (Python)

from openai import OpenAI

client = OpenAI(base_url="http://localhost:11435/v1", api_key="unused")

response = client.chat.completions.create(
model="Qwen/Qwen3-0.6B-GGUF",
messages=[{"role": "user", "content": "Hello, please introduce yourself."}]
)

print(response.choices[0].message.content)