myt AI Cloud

By Mauritius Telecom

Beta
⌘K
Core features

Text generation

Chat-style text generation through the chat completions endpoint.

POST

/v1/chat/completions

Generates a model response for the given chat conversation. Supports multi-turn history, system prompts, tool calls, and streaming.

Request body

FieldTypeRequiredNotes
modelstringYesModel id from /v1/models.
messagesarrayYesOrdered list of system, user, and assistant turns.
streambooleanNotrue to receive tokens as server-sent events.
temperaturenumberNoSampling temperature (0–2). Lower = more deterministic.
top_pnumberNoNucleus sampling threshold.
max_tokensintegerNoMaximum tokens to generate.
stopstring or arrayNoStop sequence(s) that terminate generation.
nintegerNoNumber of completion choices to return.

Example request

{
"model": "myt/qwen3.6-35b-a3b",
"messages": [
  { "role": "system", "content": "You are a concise assistant." },
  { "role": "user",   "content": "Explain what a REST API is in two sentences." }
],
"temperature": 0.7,
"max_tokens": 128
}

Response

{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1749366600,
"model": "myt/qwen3.6-35b-a3b",
"choices": [
  {
    "index": 0,
    "finish_reason": "stop",
    "message": {
      "role": "assistant",
      "content": "A REST API is a web service that uses standard HTTP methods (GET, POST, PUT, DELETE) to allow clients to read and modify resources on a server. It is stateless, meaning each request carries all the information needed to process it."
    }
  }
],
"usage": {
  "prompt_tokens": 29,
  "completion_tokens": 44,
  "total_tokens": 73
}
}

Streaming

Set "stream": true to receive tokens incrementally via server-sent events. Each chunk contains a delta object; the stream ends with data: [DONE].

data: {"id":"chatcmpl-abc","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"role":"assistant","content":"A"}}]}

data: {"id":"chatcmpl-abc","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":" REST"}}]}

data: [DONE]

Errors

StatusWhen
400Missing model or messages, invalid parameter values
401API key missing or invalid
403Model not allowed for your project
429Rate limit or monthly budget exceeded

Code examples

curl -sS --request "POST" \
  --url "$MYT_BASE_URL/chat/completions" \
  --header "Authorization: Bearer $MYT_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"model":"myt/qwen3.6-35b-a3b","messages":[{"role":"user","content":"Hello"}]}'

Streaming example

curl -sS --request "POST" \
  --url "$MYT_BASE_URL/chat/completions" \
  --header "Authorization: Bearer $MYT_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"model":"myt/qwen3.6-35b-a3b","stream":true,"messages":[{"role":"user","content":"Count from 1 to 5 slowly."}]}'

Full parameter reference: Chat completions.

On this page