Create Chat Completion
POST
/v1/chat/completions
Creates a model response for the given chat conversation. This is the primary endpoint for text generation.
Request Body
| Parameter | Type | Description |
|---|---|---|
| model required | string | ID of the model to use (e.g., "mythic-4") |
| messages required | array | List of messages in the conversation |
| max_tokens optional | integer | Maximum tokens to generate |
| temperature optional | number | Sampling temperature (0-2). Default: 1 |
| stream optional | boolean | Stream partial responses. Default: false |
curl https://api.mythicdot.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MYTHICDOT_API_KEY" \
-d '{
"model": "mythic-4",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
}'
Response
200 OK{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1706234567,
"model": "mythic-4",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 10,
"total_tokens": 35
}
}
Create Embedding
POST
/v1/embeddings
Creates an embedding vector representing the input text. Useful for semantic search and similarity.
curl https://api.mythicdot.ai/v1/embeddings \
-H "Authorization: Bearer $MYTHICDOT_API_KEY" \
-d '{
"model": "mythic-embed-3",
"input": "The quick brown fox jumps over the lazy dog"
}'
List Models
GET
/v1/models
Lists all models available to your account.
curl https://api.mythicdot.ai/v1/models \
-H "Authorization: Bearer $MYTHICDOT_API_KEY"