base_url.
Endpoint: POST https://api.qhaigc.net/v1/chat/completions
Request Parameters
The model to use for completion. Examples:
gpt-4o, gpt-4o-mini, gpt-5-mini. Call GET /v1/models to retrieve the full list of available models.The conversation history as an array of message objects. Each object must contain
role and content.When
true, the response is delivered as a stream of server-sent events (SSE). Each event contains a partial delta until the [DONE] sentinel is sent.Additional options for streaming responses. Pass
{"include_usage": true} to receive token usage data in the final stream chunk.The maximum number of tokens to generate. Set this to control costs and prevent unexpectedly long responses.
Sampling temperature between
0 and 2. Higher values produce more varied output; lower values make responses more focused and deterministic. Defaults to 1.Response Fields
A unique identifier for this completion, prefixed with
chatcmpl-.Always
"chat.completion" for non-streaming responses.Unix timestamp (seconds) of when the completion was generated.
The model that produced the completion.
Array of completion choices. For most requests this contains a single element.
Token counts for this request.
Code Examples
Streaming Example
Multimodal Input
To send an image alongside your text, replace the
content string with an array of content parts. Each part is either {"type": "text", "text": "..."} or {"type": "image_url", "image_url": {"url": "https://..."}}. Only models that support vision (such as gpt-4o) will process the image.