Inference
Create chat completion
Sends a chat prompt to a model and returns a completion. Supports both streaming (server-sent events) and non-streaming response modes. Use the model field to target a base model by its model_name. Optional sampling parameters include temperature, top_p, top_k, max_tokens, presence_penalty, and repetition_penalty. Total tokens (prompt + completion) must not exceed the model's context window.
post/chat/completions
Request
- Base URL: https://console.hyperstack.cloud/ai/api/v1
- URL: https://console.hyperstack.cloud/ai/api/v1/chat/completions
- Auth: API key in header api_key
Request body
Example request
{
"model": "Llama-3.3-70B-Instruct",
"messages": [
{
"role": "user",
"content": "Reply with exactly: OK"
}
],
"stream": false
}Response
Example response
{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "This is a minimalist, pixel-art style image depicting a serene sunset or sunrise over a mountain range.\n\nThe key elements are:\n\n* **The Sky:** The background features a smooth gradient, transitioning from a deep purple at the top to a warm orange-pink near the horizon. This creates a calm, atmospheric effect.\n* **The Sun:** A large, bright, off-white circle representing the sun is positioned just above the horizon, partially obscured by the mountains.\n* **The Mountains:** Two simple, dark purple, triangular mountain silhouettes dominate the lower half of the image. They are rendered in a low-resolution, pixelated style, giving the scene a retro video game aesthetic.\n\nThe overall composition is balanced and tranquil, with the sun acting as a central focal point. The use of simple shapes and a limited color palette emphasizes the peacefulness of the scene.",
"role": "assistant"
}
}
],
"created": 1736932200,
"id": "a1b2c3d4e5f6789012345678901234ab",
"model": "qwen/qwen3-vl-8b-instruct",
"object": "chat.completion",
"usage": {
"completion_tokens": 177,
"prompt_tokens": 91,
"total_tokens": 268
}
}Changes
No recorded changes to this operation across all 1 revision of this API.