Conversations

Send message

Sends a message to a conversation thread and returns the model's response. If conversation_id is omitted or null, a new conversation thread is created. Supports both streaming and non-streaming response modes via the stream flag. An optional system_prompt_id attaches a saved system prompt template to the request.

post/conversations/send_message

Request

  • Base URL: https://console.hyperstack.cloud/ai/api/v1
  • URL: https://console.hyperstack.cloud/ai/api/v1/conversations/send_message
  • Auth: API key in header api_key

Request body

messagestring required

The user's message text to send to the model.

modelstring required

Model to use for this message. Use the model_name from List base models for base models, or the model_name from List owned models for a deployed fine-tuned model.

conversation_idinteger

ID of an existing conversation thread to continue. If null or omitted, a new conversation thread is created and its ID is returned in the response.

settingsobject

Additional inference settings to override for this message (e.g. temperature, top_p).

streamboolean

When true, returns the response as a stream of server-sent events.

stream_optionsobject

Options that control streaming behaviour, such as whether to include usage statistics in the final stream chunk.

system_prompt_idinteger

ID of a saved system prompt template to apply to this message. Create and manage system prompts via Create system prompt.

image_attachmentsstring[] nullable

Optional image attachment for the message. Use the file_reference from Request an image upload URL. A maximum of one image is supported per message.

knowledge_base_idinteger nullable

Optional. ID of a knowledge base to ground the response in. When set, relevant passages are retrieved and passed to the model, and the response includes a citations array naming the sources used.

Example request

{
  "model": "Llama-3.3-70B-Instruct",
  "message": "What did I just say?",
  "conversation_id": 1001,
  "stream": false
}

Response

createdinteger

Unix timestamp of when the completion was created.

modelstring

Model used for this completion.

idstring

Unique identifier for the chat completion.

objectstring

The object type. Always chat.completion.

system_fingerprintstring

Backend configuration fingerprint for the model serving the request. May be an empty string.

Example response

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "This image is a stylized, pixel-art depiction of a sunset or sunrise over mountains.\n\nHere's a breakdown of what's in the image:\n\n- **The Sun:** A large, pale yellow/cream-colored circle sits just above the mountain ridge, appearing to be setting or rising.\n- **The Mountains:** Two dark purple, jagged peaks form the foreground. The silhouette suggests a simple, stylized mountain range.\n- **The Sky:** The background sky features a gradient of colors, transitioning from deep purple at the top to a warm orange/pink near the horizon where the sun is located.\n\nThe overall aesthetic is minimalist and retro, reminiscent of early video game graphics or digital art with a pixelated style. It evokes a sense of calm and natural beauty through its simple composition.",
        "role": "assistant"
      }
    }
  ],
  "conversation": {
    "id": 1001,
    "title": "Image content unknown."
  },
  "created": 1736932200,
  "id": "a1b2c3d4e5f6789012345678901234ab",
  "model": "qwen/qwen3-vl-8b-instruct",
  "object": "chat.completion",
  "system_fingerprint": "",
  "usage": {
    "completion_tokens": 159,
    "completion_tokens_details": {
      "accepted_prediction_tokens": 0,
      "audio_tokens": 0,
      "image_tokens": 0,
      "reasoning_tokens": 0,
      "rejected_prediction_tokens": 0,
      "text_tokens": 159,
      "video_tokens": 0
    },
    "prompt_tokens": 93,
    "prompt_tokens_details": {
      "audio_tokens": 0,
      "cache_creation_input_tokens": 0,
      "cache_read_input_tokens": 0,
      "cached_tokens": 0,
      "image_tokens": 79,
      "text_tokens": 14,
      "video_tokens": 0
    },
    "total_tokens": 252
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.