FileGPT API Documentation
Still in Alpha version
Last updated
Still in Alpha version
Last updated
This is the official documentation of FileGPT. We will walk you through basics of using FileGPT API.
As a quick intro, FileGPT () allows you to chat with all kinds of documents, including but not limited to, regular files, audios and videos, and youtube!
We deliver a consistent experience and integration for a range of documents, types, and embeddings, trying to bring the service to
First, log in on and go to your profile page. API access is available to our pro users and above.
Once you have access, you will be able to view your api usage on the profile page. You also have the options to generate api keys and invalidate old ones.
For all requests coming in at FileGPT, authentication is needed by setting
Authorization: <YOUR_API_KEY>
, for example Authorization: abcdefgh
Thats it! Easy peasy!
The base endpoint is https://lb.filegpt.app
Below is a sample workflow of using our API. We first present the existing endpoints and then show some working end-to-end examples to get you started easily.
First, a collection is a set of documents. A document is the basic building block, and note that documents have different types. Generally, we categorize documents into three for now:
FILE: this is the most common one, it covers pdf, txt, pptx, jpg, etc.
YOUTUBE: this handles the youtube video links
WEB_URL: this handles web pages
POST /api/collection
POST
ENDPOINT/api/collection
title*
String
documents*
List
List of documents, see schema for detail reference
GET /api/collection/{collection_id}
GET
ENDPONIT/api/collection/{collection_id}
This will get the collection and all documents in the collection
collection_id*
String
DELETE /api/collection/{collection_id}
This will delete all files in your collection for privacy and security. Recommended to use as often as possible.
DELETE
ENDPOINT/api/collection/{collection_id}
This will delete the collection and all documents in the collection
collection_id*
String
your collection id
POST /api/build
POST
http://ENDPOINT/api/api/build
collectionId*
String
A success status of 200. Note that the build job is async. You should use the GET
method to poll the status of the collection, and the status will change to READY
if everything goes well, or it will be FAILED
if error occured. The error message is in the StatusMessage field.
Send a JSON body of a QueryRequest Object.
A plain text streaming response.
Non-streaming version will be out soon. We will provide examples on how to consume the stream if you need.
In this example, we walk through how you can use filegpt as an add-on service, on top of your existing chatbot, to let users chat with their own documents.
Here's an outline of the workflow:
You manage your storage of users' uploaded file.
Generate a presigned URL with a 1-2 minute expiration window
Create a collection with the documents, you can create a collection with one or multiple documents.
Build the collection
Query the collection with the user input.
This is the object you need to create a a collection. You specify a list of documents of your own, with URL provided, and then you can create a collection. It holds all documents together.
create a collection with a list of documents. You should pass in a object.
A object.
A object.
A object.