Skip to main content
This notebook provides a quick-start guide to use SGLang in chat completions after installation. Once your server is running, API documentation is available at http://localhost:30000/docs (Swagger UI), http://localhost:30000/redoc (ReDoc), or http://localhost:30000/openapi.json (OpenAPI spec, useful for AI agents). Replace 30000 with your port if using a different one.

Launch A Server

Example

Using cURL

Example

Using Python Requests

Example

Using OpenAI Python Client

Example

Streaming

Example

Using Native Generation APIs

You can also use the native /generate endpoint with requests, which provides more flexibility. An API reference is available at Sampling Parameters.
Example

Streaming

Example
Example