Skip to main content
POST
/
files
Upload File
curl --request POST \
  --url https://geekai.dev/api/v1/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form purpose=file-extract \
  --form format=text \
  --form file=@example-file
{
  "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "size": 123,
  "type": "<string>",
  "status": "pending",
  "md5": "<string>",
  "content": "<string>"
}
GeekAI provides file upload and content extraction capabilities, supporting various file formats, including images, audio, video, and documents (PDF/Office/plain text). You can upload files to be recognized through the file upload interface, and then obtain the file content through the file content extraction interface. With this basic service, you can implement higher-level business scenarios such as AI file conversation/RAG.

cURL Request Example

curl --location --request POST 'https://geekai.dev/api/v1/files' \
--header 'Authorization: Bearer {YOUR_GEEKAI_API_KEY}' \
--form 'file=@"/E:/Documents/geekai/test.pdf"'

Authorizations

Authorization
string
header
required

token

Body

multipart/form-data
file
file
required

file to upload. Currently supported PDF, DOCX, XLSX, PPTX, PNG, JPG, JPEG, CSV, TXT, MD, MP3, and MP4.

purpose
string
default:file-extract

file processing purpose

Example:

"file-extract"

format
string
default:text

file format

Example:

"text"

Response

successful response

uuid
string<uuid>
required

file UUID

name
string
required

file name

status
enum<string>
required

file status: pending/reading/failed/done

Available options:
pending,
reading,
processing,
failed,
done
size
integer

file size(bytes)

type
string

file type

md5
string

file MD5 hash

content
string

file content(when status=done)

I