Generate human-like text for any task. Chat, complete, summarize, translate, and more.
The Chat Completions API is the primary way to generate text. It takes a list of messages and returns a model-generated response.
from mythicdot import MythicDot client = MythicDot() response = client.chat.completions.create( model="mythic-4", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What's the capital of France?"} ] ) print(response.choices[0].message.content) # "The capital of France is Paris."
Each message in the conversation has a role that determines how the model interprets it.
| Parameter | Type | Description |
|---|---|---|
| model required | string | Model ID to use (e.g., "mythic-4", "mythic-4-mini") |
| messages required | array | List of messages in the conversation. Each message has a role and content. |
| temperature optional | number | Sampling temperature 0-2. Higher = more random. Default: 1 |
| max_tokens optional | integer | Maximum tokens to generate. Default varies by model. |
| top_p optional | number | Nucleus sampling. Consider tokens with top_p probability mass. Default: 1 |
| stream optional | boolean | Enable streaming responses. Default: false |
| stop optional | string | array | Up to 4 sequences where the model will stop generating. |
| response_format optional | object | Enable JSON mode or structured outputs. |
| tools optional | array | List of functions the model can call. See Function Calling. |
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1704067200,
"model": "mythic-4",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The capital of France is Paris."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 8,
"total_tokens": 33
}
}
Most capable model for complex tasks requiring advanced reasoning and creativity.
Fast and cost-effective for most everyday tasks. Great balance of speed and quality.
Optimized for instruction following and structured outputs. Best for agents.
Legacy model. Use mythic-4-mini for better performance at similar cost.
Use clear, specific instructions in your system prompt. Provide examples (few-shot prompting) for complex formats. Set temperature to 0 for deterministic, factual responses. Use temperature 0.7-1.0 for creative writing.