openapi: 3.0.3 info: title: Ask Sage Server Admin Training API description: 'Ask Sage is an AI-powered platform providing intelligent completions, knowledge management, and workflow automation. ## Base URL `https://api.asksage.ai` ## Authentication All endpoints require a valid JWT token passed via the `x-access-tokens` header, unless otherwise noted. Obtain a token by authenticating through the User API (`/user/get-token-with-api-key`). ## Message Format The `message` field in API requests can be either: - A single string prompt: `"What is Ask Sage?"` - An array of conversation messages: `[{"user": "me", "message": "what is Ask Sage?"}, {"user": "gpt", "message": "Ask Sage is an..."}]` ## Key Features - **AI Completions** — Query multiple LLM providers with a unified interface - **Knowledge Training** — Upload documents, files, and data to build custom datasets - **Tabular Data** — Ingest and query structured data (CSV, XLSX) with natural language - **Agent Builder** — Create, configure, and execute multi-step AI workflows - **Plugins** — Extend capabilities with built-in and custom plugins - **MCP Servers** — Connect to Model Context Protocol servers for tool integration' version: '2.0' contact: name: Ask Sage Support email: support@asksage.ai url: https://asksage.ai servers: - url: '{baseUrl}/server' description: Ask Sage Server API variables: baseUrl: default: https://api.asksage.ai description: API base URL. Use https://api.asksage.ai for production, or your self-hosted instance URL. security: - ApiKeyAuth: [] tags: - name: Training description: Model training and content ingestion paths: /train: post: summary: Train the model description: Add new content to the knowledge base tags: - Training requestBody: required: true content: application/json: schema: type: object required: - content properties: content: type: string description: Content to train/ingest context: type: string description: Additional context for the content skip_vectordb: type: boolean default: false description: Skip adding to vector database force_dataset: type: string description: Force specific dataset for training responses: '200': description: Training successful content: application/json: schema: type: object properties: response: type: string embedding: type: string status: type: integer get: summary: Train the model (GET) description: Add new content to the knowledge base tags: - Training responses: '200': description: Training successful content: application/json: schema: type: object properties: response: type: string embedding: type: string status: type: integer /train-with-file: post: summary: Train with file description: Train the model using file content tags: - Training requestBody: required: true content: multipart/form-data: schema: type: object required: - file properties: file: type: string format: binary description: File to train from dataset: type: string description: Dataset to add content to responses: '200': description: File training successful content: application/json: schema: type: object properties: response: type: string embedding: type: array items: type: string status: type: integer get: summary: Train with file (GET) description: Train the model using file content tags: - Training responses: '200': description: File training successful content: application/json: schema: type: object properties: response: type: string embedding: type: array items: type: string status: type: integer /train-with-array: post: summary: Train with array of data description: Train the model using an array of content tags: - Training requestBody: required: true content: multipart/form-data: schema: type: object required: - data - dataset properties: data: type: string description: JSON array of data to train dataset: type: string description: Dataset name context: type: string description: Additional context filename: type: string description: Source filename responses: '200': description: Array training successful content: application/json: schema: type: object properties: response: type: string embedding: type: array items: type: array items: type: string status: type: integer get: summary: Train with array of data (GET) description: Train the model using an array of content tags: - Training responses: '200': description: Array training successful content: application/json: schema: type: object properties: response: type: string embedding: type: array items: type: array items: type: string status: type: integer components: securitySchemes: ApiKeyAuth: type: apiKey in: header name: x-access-tokens description: JWT authentication token. Obtain a token by calling the User API endpoint `/user/get-token-with-api-key` with your email and API key.