OpenAPI docs

Integration reference

Third-party applications can authenticate with a bearer API key and send OpenAI-style chat requests to the local gateway.

Quick start

POST /api/v1/chat/completions
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Supports both streaming and non-streaming chat completions with usage accounting. Set "stream": true in your request body to receive a real-time SSE token stream.

OpenAPI overview

The routes below are rendered directly from the application's generated OpenAPI definition.

get/api/v1/models

List admin-enabled local models

Public route

Responses

200Available models
GET /api/v1/models
Host: https://tslhostedai.thehackitect.com.ng
post/api/v1/chat/completions

Run a chat completion against an admin-enabled Ollama model

Bearer auth required

Responses

200OpenAI-style chat completion response
401Missing or invalid API key
429Monthly quota exceeded
503Ollama is unavailable at http://127.0.0.1:11434
POST /api/v1/chat/completions
Host: https://tslhostedai.thehackitect.com.ng
Authorization: Bearer YOUR_API_KEY

Raw OpenAPI snapshot

{
  "openapi": "3.1.0",
  "info": {
    "title": "TSLHostedAI API",
    "version": "0.1.0",
    "description": "OpenAI-style local gateway for admin-provisioned self-hosted models routed through Ollama."
  },
  "servers": [
    {
      "url": "https://tslhostedai.thehackitect.com.ng"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key"
      }
    },
    "schemas": {
      "ChatCompletionRequest": {
        "type": "object",
        "required": [
          "messages"
        ],
        "properties": {
          "model": {
            "type": "string",
            "example": "deepseek-r1:1.5b"
          },
          "stream": {
            "type": "boolean",
            "default": false
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "role",
                "content"
              ],
              "properties": {
                "role": {
                  "type": "string",
                  "enum": [
                    "system",
                    "user",
                    "assistant"
                  ]
                },
                "content": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "paths": {
    "/api/v1/models": {
      "get": {
        "summary": "List admin-enabled local models",
        "responses": {
          "200": {
            "description": "Available models"
          }
        }
      }
    },
    "/api/v1/chat/completions": {
      "post": {
        "summary": "Run a chat completion against an admin-enabled Ollama model",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OpenAI-style chat completion response"
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "429": {
            "description": "Monthly quota exceeded"
          },
          "503": {
            "description": "Ollama is unavailable at http://127.0.0.1:11434"
          }
        }
      }
    }
  }
}