POST
/
files
curl --request POST \
  --url https://geekai.co/api/v1/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form purpose=file-extract \
  --form format=text
{
  "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "size": 123,
  "type": "<string>",
  "status": "pending",
  "md5": "<string>",
  "content": "<string>"
}

极客智坊提供了文件上传与内容提取功能,支持多种文件格式,包括图片、音频、视频、文档(PDF/Office/纯文本)等,你可以通过上传文件接口上传待识别文件,然后通过文件内容提取接口获取文件内容,借助该基础服务,你可以完成AI文件对话/RAG等上层业务场景的功能实现。

cURL 请求示例

curl --location --request POST 'https://geekai.co/api/v1/files' \

--header 'Authorization: Bearer {YOUR_GEEKAI_API_KEY}' \

--form 'file=@"/E:/文档/geekai/test.pdf"'

Postman 请求响应示例

Authorizations

Authorization
string
header
required

JWT认证token

Body

multipart/form-data
file
file
required

上传的文件,目前支持PDF/DOCX/XLSX/PPTX/PNG/JPG/JPEG/CSV/TXT/MD/MP3/MP4等格式

purpose
string
default:file-extract

上传目的,目前仅支持文件提取

Example:

"file-extract"

format
string
default:text

返回文件内容格式,目前仅支持文本格式

Example:

"text"

Response

200
application/json
成功响应
uuid
string
required

文件唯一ID,可通过该ID获取文件内容

name
string
required

文件名称

status
enum<string>
required

文件状态: pending(待处理)/reading(读取中)/failed(读取失败)/done(已读取)

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

文件大小

type
string

文件MIME类型

md5
string

文件MD5值

content
string

文件内容(只有status=done时,才会填充该字段)