API Endpoints

In this section will cover how to access the Ask Sage API and the available endpoints.

Table of contents
  1. API Endpoints
    1. User API Endpoints:
    2. Server API Endpoints:

API Endpoints

The Ask Sage API is a RESTful API that provides access to the Ask Sage platform. The API is divided into two main parts: the User API and the Server API. Each API has its own set of endpoints and functionalities.

User API Endpoints:

The User API is used for managing users, authentication, and datasets.

  • The Base URL varies depending on the environment you are working on, but it typically follows the format: [ Base URL: api.asksage.ai/user/ ]

Reference the following Swagger Documentation for detailed information on the User API endpoints and how to use them:

  • Ask Sage User API: Copy and paste the following URL to access the Swagger documentation:
    https://app.swaggerhub.com/apis-docs/asksageinc/ask-sage_user_api/1.21
    

The following table shows a summary of some of the available endpoints in the User API: (Reference the Swagger documentation for full details on each endpoint and other available endpoints.)

Endpoint Description
POST /get-token-with-api-key Get an access token with API Key and email
POST /get-user-logins Get your last logins (limited to 5 by default)
POST /get-user-logs Get your last prompts
POST /add-dataset Add a new dataset
POST /delete-datasets Deletes a dataset
POST /get-chats Get all chat sessions for user
POST /get-chat-session Get specific chat session
POST /delete-chat-session Delete chat session
POST /deassign-dataset Remove dataset from user
POST /update-permission-dataset Update dataset permissions
POST /get-datasets-with-permissions Get user datasets with permissions
POST /get-user-api-keys Get user API keys
POST /user-api-key Create new API key
DELETE /user-api-key Delete API key

Server API Endpoints:

The Server API is used for managing the server, including the Ask Sage API.

  • The Base URL varies depending on the environment you are working on, but it typically follows the format: [ Base URL: api.asksage.ai/server/ ]

Reference the following Swagger Documentation for detailed information on the Server API endpoints and how to use them:

  • Ask Sage Server API: Copy and paste the following URL to access the Swagger documentation:
    https://app.swaggerhub.com/apis-docs/asksageinc/ask-sage_server_api/1.55
    

The following table shows the available endpoints in the Server API:

Endpoint Description
POST /get-models Returns a list of available models via the Ask Sage services
POST /query Main endpoint for generating completions based on the user’s input
POST /query_with_file Query with file endpoint for generating completions based on the user’s input
POST /query-plugin Query with plugin endpoint for generating completions based on the user’s input
POST /execute-plugin Execute a plugin with the provided content
POST /follow_up_questions Endpoint for generating follow-up questions based on the user’s input
POST /tokenizer Endpoint for getting tokens of string value
POST /get-personas Endpoint for getting the tokens of string
POST /get-datasets Returns a list of available datasets
POST /get-plugins Returns a list of available plugins
POST /train Trains the model based on the user’s input
POST /file Converts a supported file to plain/text
POST /execute-plugin-with-file Execute a plugin that requires file input
POST /get-deep-agent Get streaming updates from a deep agent
POST /add-mcp-server Add a new MCP (Model Context Protocol) server for the user
PUT /update-mcp-server Update an existing MCP server configuration
GET /list-mcp-servers Get a list of all MCP servers configured for the user
POST /list-mcp-servers Get a list of all MCP servers configured for the user
GET /list-mcp-whitelisted-servers Get a list of all whitelisted MCP servers
GET /list-mcp-tools Get a list of all available MCP tools from configured servers
DELETE /delete-mcp-server Soft delete an MCP server by setting it as inactive
DELETE /dataset Delete a specific dataset
POST /delete-filename-from-dataset Remove a specific file from a dataset
POST /get-all-files-ingested Returns a list of all files that have been ingested
POST /copy-files-dataset Copy files from one dataset to another
POST /vote-down Mark a response as unhelpful or incorrect
GET /count-monthly-tokens Returns the count of tokens used this month
POST /count-monthly-tokens Returns the count of tokens used this month for specific app
GET /count-monthly-teach-tokens Returns the count of teaching/training tokens used this month
POST /train-with-file Train the model using file content
POST /train-with-array Train the model using an array of content
GET /get-secrets Returns a list of user’s stored secrets (keys only, not values)
POST /get-text-to-speech Generate audio from text using text-to-speech

Base URLs may change, depending on the environment you are working on. If you need assistance, please reach out to us at support@asksage.ai.


Table of contents


Back to top

Copyright © 2025 Ask Sage Inc. All Rights Reserved.