"description":"Instance is not in Multi-User mode. Method denied"
},
"403":{
"description":"Forbidden",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
},
"application/xml":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
}
}
},
"500":{
"description":"Internal Server Error"
}
}
}
},
"/v1/admin/invite/new":{
"post":{
"tags":[
"Admin"
],
"description":"Create a new invite code for someone to use to register with instance. Methods are disabled until multi user mode is enabled via the UI.",
"description":"Overwrite workspace permissions to only be accessible by the given user ids and admins. Methods are disabled until multi user mode is enabled via the UI.",
"parameters":[
{
"name":"workspaceId",
"in":"path",
"required":true,
"schema":{
"type":"string"
},
"description":"id of the workspace in the database."
}
],
"responses":{
"200":{
"description":"OK",
"content":{
"application/json":{
"schema":{
"type":"object",
"example":{
"success":true,
"error":null
}
}
}
}
},
"401":{
"description":"Instance is not in Multi-User mode. Method denied"
},
"403":{
"description":"Forbidden",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
},
"application/xml":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
}
}
},
"500":{
"description":"Internal Server Error"
}
},
"requestBody":{
"description":"Entire array of user ids who can access the workspace. All fields are optional and will not update unless specified.",
"required":true,
"type":"object",
"content":{
"application/json":{
"example":{
"userIds":[
1,
2,
4,
12
]
}
}
}
}
}
},
"/v1/admin/workspace-chats":{
"post":{
"tags":[
"Admin"
],
"description":"All chats in the system ordered by most recent. Methods are disabled until multi user mode is enabled via the UI.",
"description":"Unique slug of workspace to delete"
}
],
"responses":{
"200":{
"description":"OK"
},
"400":{
"description":"Bad Request"
},
"403":{
"description":"Forbidden",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
},
"application/xml":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
}
}
},
"500":{
"description":"Internal Server Error"
}
}
}
},
"/v1/workspace/{slug}/update":{
"post":{
"tags":[
"Workspaces"
],
"description":"Update workspace settings by its unique slug.",
"parameters":[
{
"name":"slug",
"in":"path",
"required":true,
"schema":{
"type":"string"
},
"description":"Unique slug of workspace to find"
}
],
"responses":{
"200":{
"description":"OK",
"content":{
"application/json":{
"schema":{
"type":"object",
"example":{
"workspace":{
"id":79,
"name":"My workspace",
"slug":"my-workspace-123",
"createdAt":"2023-08-17 00:45:03",
"openAiTemp":null,
"lastUpdatedAt":"2023-08-17 00:45:03",
"openAiHistory":20,
"openAiPrompt":null,
"documents":[]
},
"message":null
}
}
}
}
},
"400":{
"description":"Bad Request"
},
"403":{
"description":"Forbidden",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
},
"application/xml":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
}
}
},
"500":{
"description":"Internal Server Error"
}
},
"requestBody":{
"description":"JSON object containing new settings to update a workspace. All keys are optional and will not update unless provided",
"required":true,
"type":"object",
"content":{
"application/json":{
"example":{
"name":"Updated Workspace Name",
"openAiTemp":0.2,
"openAiHistory":20,
"openAiPrompt":"Respond to all inquires and questions in binary - do not respond in any other format."
}
}
}
}
}
},
"/v1/workspace/{slug}/chats":{
"get":{
"tags":[
"Workspaces"
],
"description":"Get a workspaces chats regardless of user by its unique slug.",
"parameters":[
{
"name":"slug",
"in":"path",
"required":true,
"schema":{
"type":"string"
},
"description":"Unique slug of workspace to find"
}
],
"responses":{
"200":{
"description":"OK",
"content":{
"application/json":{
"schema":{
"type":"object",
"example":{
"history":[
{
"role":"user",
"content":"What is AnythingLLM?",
"sentAt":1692851630
},
{
"role":"assistant",
"content":"AnythingLLM is a platform that allows you to convert notes, PDFs, and other source materials into a chatbot. It ensures privacy, cites its answers, and allows multiple people to interact with the same documents simultaneously. It is particularly useful for businesses to enhance the visibility and readability of various written communications such as SOPs, contracts, and sales calls. You can try it out with a free trial to see if it meets your business needs.",
"sources":[
{
"source":"object about source document and snippets used"
}
]
}
]
}
}
}
}
},
"400":{
"description":"Bad Request"
},
"403":{
"description":"Forbidden",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
},
"application/xml":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
}
}
},
"500":{
"description":"Internal Server Error"
}
}
}
},
"/v1/workspace/{slug}/update-embeddings":{
"post":{
"tags":[
"Workspaces"
],
"description":"Add or remove documents from a workspace by its unique slug.",
"parameters":[
{
"name":"slug",
"in":"path",
"required":true,
"schema":{
"type":"string"
},
"description":"Unique slug of workspace to find"
}
],
"responses":{
"200":{
"description":"OK",
"content":{
"application/json":{
"schema":{
"type":"object",
"example":{
"workspace":{
"id":79,
"name":"My workspace",
"slug":"my-workspace-123",
"createdAt":"2023-08-17 00:45:03",
"openAiTemp":null,
"lastUpdatedAt":"2023-08-17 00:45:03",
"openAiHistory":20,
"openAiPrompt":null,
"documents":[]
},
"message":null
}
}
}
}
},
"400":{
"description":"Bad Request"
},
"403":{
"description":"Forbidden",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
},
"application/xml":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
}
}
},
"500":{
"description":"Internal Server Error"
}
},
"requestBody":{
"description":"JSON object of additions and removals of documents to add to update a workspace. The value should be the folder + filename with the exclusions of the top-level documents path.",
"description":"Send a prompt to the workspace and the type of conversation (query or chat).<br/><b>Query:</b> Will not use LLM unless there are relevant sources from vectorDB & does not recall chat history.<br/><b>Chat:</b> Uses LLM general knowledge w/custom embeddings to produce output, uses rolling chat history.",
"description":"Execute a streamable chat with a workspace",
"parameters":[
{
"name":"slug",
"in":"path",
"required":true,
"schema":{
"type":"string"
}
}
],
"responses":{
"200":{
"content":{
"text/event-stream":{
"schema":{
"type":"array",
"example":[
{
"id":"uuid-123",
"type":"abort | textResponseChunk",
"textResponse":"First chunk",
"sources":[],
"close":false,
"error":"null | text string of the failure mode."
},
{
"id":"uuid-123",
"type":"abort | textResponseChunk",
"textResponse":"chunk two",
"sources":[],
"close":false,
"error":"null | text string of the failure mode."
},
{
"id":"uuid-123",
"type":"abort | textResponseChunk",
"textResponse":"final chunk of LLM output!",
"sources":[
{
"title":"anythingllm.txt",
"chunk":"This is a context chunk used in the answer of the prompt by the LLM. This will only return in the final chunk."
}
],
"close":true,
"error":"null | text string of the failure mode."
}
]
}
}
},
"description":"OK"
},
"400":{
"description":"Bad Request"
},
"403":{
"description":"Forbidden",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
},
"application/xml":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
}
}
}
},
"requestBody":{
"description":"Send a prompt to the workspace and the type of conversation (query or chat).<br/><b>Query:</b> Will not use LLM unless there are relevant sources from vectorDB & does not recall chat history.<br/><b>Chat:</b> Uses LLM general knowledge w/custom embeddings to produce output, uses rolling chat history.",
"description":"Export all of the chats from the system in a known format. Output depends on the type sent. Will be send with the correct header for the output.",
"parameters":[
{
"name":"type",
"in":"query",
"description":"Export format jsonl, json, csv, jsonAlpaca",
"required":false,
"schema":{
"type":"string"
}
}
],
"responses":{
"200":{
"description":"OK",
"content":{
"application/json":{
"schema":{
"type":"object",
"example":[
{
"role":"user",
"content":"What is AnythinglLM?"
},
{
"role":"assistant",
"content":"AnythingLLM is a knowledge graph and vector database management system built using NodeJS express server. It provides an interface for handling all interactions, including vectorDB management and LLM (Language Model) interactions."
"content":"AnythingLLM is a platform that allows you to convert notes, PDFs, and other source materials into a chatbot. It ensures privacy, cites its answers, and allows multiple people to interact with the same documents simultaneously. It is particularly useful for businesses to enhance the visibility and readability of various written communications such as SOPs, contracts, and sales calls. You can try it out with a free trial to see if it meets your business needs.",
"sources":[
{
"source":"object about source document and snippets used"
}
]
}
]
}
}
}
}
},
"400":{
"description":"Bad Request"
},
"403":{
"description":"Forbidden",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
},
"application/xml":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
}
}
},
"500":{
"description":"Internal Server Error"
}
}
}
},
"/v1/workspace/{slug}/thread/{threadSlug}/chat":{
"post":{
"tags":[
"Workspace Threads"
],
"description":"Chat with a workspace thread",
"parameters":[
{
"name":"slug",
"in":"path",
"required":true,
"schema":{
"type":"string"
},
"description":"Unique slug of workspace"
},
{
"name":"threadSlug",
"in":"path",
"required":true,
"schema":{
"type":"string"
},
"description":"Unique slug of thread"
}
],
"responses":{
"200":{
"description":"OK",
"content":{
"application/json":{
"schema":{
"type":"object",
"example":{
"id":"chat-uuid",
"type":"abort | textResponse",
"textResponse":"Response to your query",
"sources":[
{
"title":"anythingllm.txt",
"chunk":"This is a context chunk used in the answer of the prompt by the LLM."
}
],
"close":true,
"error":"null | text string of the failure mode."
}
}
}
}
},
"400":{
"description":"Bad Request"
},
"403":{
"description":"Forbidden",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
},
"application/xml":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
}
}
},
"500":{
"description":"Internal Server Error"
}
},
"requestBody":{
"description":"Send a prompt to the workspace thread and the type of conversation (query or chat).",
"description":"Get all available \"models\" which are workspaces you can use for chatting.",
"parameters":[],
"responses":{
"200":{
"description":"OK",
"content":{
"application/json":{
"schema":{
"type":"object",
"example":{
"models":[
{
"name":"Sample workspace",
"model":"sample-workspace",
"llm":{
"provider":"ollama",
"model":"llama3:8b"
}
},
{
"name":"Second workspace",
"model":"workspace-2",
"llm":{
"provider":"openai",
"model":"gpt-3.5-turbo"
}
}
]
}
}
}
}
},
"403":{
"description":"Forbidden",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
},
"application/xml":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
}
}
},
"500":{
"description":"Internal Server Error"
}
}
}
},
"/v1/openai/chat/completions":{
"post":{
"tags":[
"OpenAI Compatible Endpoints"
],
"description":"Execute a chat with a workspace with OpenAI compatibility. Supports streaming as well. Model must be a workspace slug from /models.",
"parameters":[],
"responses":{
"200":{
"description":"OK"
},
"400":{
"description":"Bad Request"
},
"401":{
"description":"Unauthorized"
},
"403":{
"description":"Forbidden",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
},
"application/xml":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
}
}
},
"500":{
"description":"Internal Server Error"
}
},
"requestBody":{
"description":"Send a prompt to the workspace with full use of documents as if sending a chat in AnythingLLM. Only supports some values of OpenAI API. See example below.",
"required":true,
"type":"object",
"content":{
"application/json":{
"example":{
"messages":[
{
"role":"system",
"content":"You are a helpful assistant"
},
{
"role":"user",
"content":"What is AnythingLLM?"
},
{
"role":"assistant",
"content":"AnythingLLM is...."
},
{
"role":"user",
"content":"Follow up question..."
}
],
"model":"sample-workspace",
"stream":true,
"temperature":0.7
}
}
}
}
}
},
"/v1/openai/embeddings":{
"post":{
"tags":[
"OpenAI Compatible Endpoints"
],
"description":"Get the embeddings of any arbitrary text string. This will use the embedder provider set in the system. Please ensure the token length of each string fits within the context of your embedder model.",
"parameters":[],
"responses":{
"200":{
"description":"OK"
},
"403":{
"description":"Forbidden",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
},
"application/xml":{
"schema":{
"$ref":"#/components/schemas/InvalidAPIKey"
}
}
}
},
"500":{
"description":"Internal Server Error"
}
},
"requestBody":{
"description":"The input string(s) to be embedded. If the text is too long for the embedder model context, it will fail to embed. The vector and associated chunk metadata will be returned in the array order provided",
"required":true,
"type":"object",
"content":{
"application/json":{
"example":{
"input":[
"This is my first string to embed",
"This is my second string to embed"
],
"model":null
}
}
}
}
}
},
"/v1/openai/vector_stores":{
"get":{
"tags":[
"OpenAI Compatible Endpoints"
],
"description":"List all the vector database collections connected to AnythingLLM. These are essentially workspaces but return their unique vector db identifier - this is the same as the workspace slug.",