Skip to main content
Dedicated endpoints expose OpenAI-compatible inference at https://<ENDPOINT_HOST>/v1. On supported routes such as GLM-5.1, you can send pre-tokenized prompts to /v1/completions and constrain decoding with SGLang/XGrammar-compatible EBNF by passing ebnf.

Curl Request

Set stream to true and add -N to stream text completion chunks as server-sent events:

Request Body

Advanced SGLang passthrough fields are also accepted when you need lower-level control: custom_params, ignore_eos, no_stop_trim, spaces_between_special_tokens, stop_regex, structural_tag, custom_logit_processor, logprob_start_len, lora_path, priority, return_hidden_states, return_logprob, return_routed_experts, return_text_in_logprobs, rid, token_ids_logprob, and top_logprobs_num.
prompt must be token IDs on this endpoint. A non-empty array like [9703] is valid; ["hello"], an empty array, booleans, negative integers, and mixed token/string arrays are rejected.

Response Shape

Non-streaming responses use the OpenAI text completion shape:
Use the model IDs and capabilities configured for your dedicated endpoint. If a model route on your endpoint does not support /v1/completions, use the standard chat completions path instead.