Completions

Creates a new chat completion response using the specified AI model.

post

Sends a chat completion request to generate AI responses based on the provided messages. Supports both streaming and non-streaming modes with automatic token billing.

Authorizations
AuthorizationstringRequired

Bearer authentication with JWT

Path parameters
modelIdentifierstring · uuidRequired

The unique identifier of the AI model to use for completion.

Body
streambooleanOptional
max_tokensinteger · int32 | nullableOptional
Responses
post
/inference/completions/{modelIdentifier}
POST /inference/completions/{modelIdentifier} HTTP/1.1
Host: api.example.uk.jylo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 126

{
  "messages": [
    {
      "role": "text",
      "content": "text"
    }
  ],
  "stream": true,
  "response_format": {
    "type": "text",
    "schema": "text"
  },
  "max_tokens": 1
}
{
  "id": "text",
  "model": "text",
  "choices": [
    {
      "index": 1,
      "message": {
        "role": "text",
        "content": "text"
      },
      "finishReason": "text"
    }
  ],
  "usage": {
    "promptTokens": 1,
    "completionTokens": 1,
    "totalTokens": 1
  }
}