Chat Completions
Server-side HTTP API for Adriaticum chat completions at https://api.mijatovic.io. Responses use an OpenAI-like non-streaming chat.completion shape. This is not a full OpenAI-compatible API.
Canonical Host & Base URL
The public API operates strictly on the dedicated API hostname. Sibling hosts do not serve the machine API.
| Canonical Host | https://api.mijatovic.io |
| Base URL | https://api.mijatovic.io/v1 |
| Endpoint | POST /v1/chat/completions |
| Supported Model | adriaticum-1 |
Authentication
Requests must supply an active API key using standard HTTP Bearer authentication. Keys begin with mjt_ followed by 64 hexadecimal characters.
Authorization: Bearer $MIJATOVIC_API_KEYAPI keys can be created, renamed, and revoked in Platform → API Keys. The secret is shown once at creation. API authentication is independent of browser login sessions.
Request Parameters
Requests must be formatted as valid JSON objects. Only the parameters below are accepted. Unrecognized parameters are rejected with HTTP 400.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Must be set to adriaticum-1. |
messages | array | Yes | Array of 1–20 message objects with role (system, user, or assistant) and string content (max 10,000 characters each). |
temperature | number | No | Sampling temperature between 0.0 and 2.0 (default 0.7). |
max_tokens | integer | No | Maximum completion tokens between 1 and 512 (default 384). |
Not supported in v1: stream, top_p, tools, response_format, n, seed, web_search, and any other parameters.
Request Bounds
- Hard request-body limit: 256 KB. Payloads exceeding this limit receive HTTP 413.
- Maximum messages: 20 messages per request.
- Maximum message length: 10,000 characters per message.
- Total content length: 32,000 characters across all messages.
Streaming, Web Search & CORS
- Streaming: Not supported. Sending
"stream": trueis rejected with HTTP 400 and codeunsupported_parameter. - Web Search: Not available in Public API v1. There is no
web_searchfield and no automatic search. - CORS: The API is server-to-server only. Browser cross-origin API access is not supported. Do not call the API from client-side JavaScript in a browser.
Rate Limits
Each account is limited to 20 requests per 60 seconds. The limit is account-scoped: multiple API keys owned by the same account share this limit.
When the limit is exceeded, the API returns HTTP 429 with error code rate_limited and a Retry-After header (60 seconds).
Response Format
Successful completions return HTTP 200 with completion output and usage metrics:
{
"id": "chatcmpl_9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d",
"object": "chat.completion",
"created": 1726070000,
"model": "adriaticum-1",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello. How can I assist you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 9,
"total_tokens": 21
}
}Token metrics (prompt_tokens, completion_tokens, total_tokens) reflect measurements from the inference runtime. When unavailable, values are returned as null rather than fabricated.
Recorded request metrics can be reviewed in Platform → Usage.
Timeouts
Requests may occasionally time out with HTTP 504 and code timeout, particularly after a period of inactivity. A timeout does not mean that the API key is invalid. You may retry after a short wait. Avoid aggressive automatic retries.
Status Codes & Error Envelope
Errors return a standardized JSON error envelope containing an error code, message, and unique request ID:
{
"error": {
"code": "invalid_api_key",
"message": "The provided API key is invalid or has been revoked.",
"request_id": "chatcmpl_9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d"
}
}| Status | Error Code(s) | Description |
|---|---|---|
400 | invalid_json, unsupported_parameter, invalid_model, model_not_found, invalid_messages, invalid_message, invalid_role, invalid_content, message_too_long, empty_content, context_length_exceeded, invalid_temperature, invalid_max_tokens | Invalid request body, parameters, or message content. |
401 | missing_authorization, invalid_authorization_scheme, invalid_api_key | Missing, malformed, or invalid API key. |
403 | insufficient_permission | API key lacks permission to execute completions. |
404 | not_found | Unknown route or request sent to non-API host. |
413 | payload_too_large | Request body exceeds 256 KB. |
429 | rate_limited | Account rate limit exceeded. Retry after Retry-After. |
502 | inference_error | Inference service communication error. |
503 | service_unavailable, unconfigured, busy | Service temporarily unavailable or busy. |
504 | timeout | Request timed out before completion. |
Code Examples
The following plain HTTP examples demonstrate executing completions from server-side code. Replace $MIJATOVIC_API_KEY with your developer secret.
cURL
curl -X POST https://api.mijatovic.io/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MIJATOVIC_API_KEY" \
-d '{
"model": "adriaticum-1",
"messages": [
{"role": "user", "content": "Hello"}
]
}'Node.js (Server-Side)
// Server-side Node.js execution
const response = await fetch("https://api.mijatovic.io/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${process.env.MIJATOVIC_API_KEY}`
},
body: JSON.stringify({
model: "adriaticum-1",
messages: [
{ role: "user", content: "Hello" }
]
})
});
const data = await response.json();Python
# Python requests execution
import os
import requests
response = requests.post(
"https://api.mijatovic.io/v1/chat/completions",
headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {os.environ['MIJATOVIC_API_KEY']}",
},
json={
"model": "adriaticum-1",
"messages": [
{"role": "user", "content": "Hello"}
],
},
)
data = response.json()