REFERENCE

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 Hosthttps://api.mijatovic.io
Base URLhttps://api.mijatovic.io/v1
EndpointPOST /v1/chat/completions
Supported Modeladriaticum-1

Authentication

Requests must supply an active API key using standard HTTP Bearer authentication. Keys begin with mjt_ followed by 64 hexadecimal characters.

Header
Authorization: Bearer $MIJATOVIC_API_KEY

API 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.

ParameterTypeRequiredDescription
modelstringYesMust be set to adriaticum-1.
messagesarrayYesArray of 1–20 message objects with role (system, user, or assistant) and string content (max 10,000 characters each).
temperaturenumberNoSampling temperature between 0.0 and 2.0 (default 0.7).
max_tokensintegerNoMaximum 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": true is rejected with HTTP 400 and code unsupported_parameter.
  • Web Search: Not available in Public API v1. There is no web_search field 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:

200 OK Response
{
  "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 Envelope
{
  "error": {
    "code": "invalid_api_key",
    "message": "The provided API key is invalid or has been revoked.",
    "request_id": "chatcmpl_9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d"
  }
}
StatusError Code(s)Description
400invalid_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_tokensInvalid request body, parameters, or message content.
401missing_authorization, invalid_authorization_scheme, invalid_api_keyMissing, malformed, or invalid API key.
403insufficient_permissionAPI key lacks permission to execute completions.
404not_foundUnknown route or request sent to non-API host.
413payload_too_largeRequest body exceeds 256 KB.
429rate_limitedAccount rate limit exceeded. Retry after Retry-After.
502inference_errorInference service communication error.
503service_unavailable, unconfigured, busyService temporarily unavailable or busy.
504timeoutRequest 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
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)

Node.js
// 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
# 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()