跳转到主要内容
GET
/
file
/
{uuid}
/
content
获取文件内容
curl --request GET \
  --url https://geekai.co/api/v1/file/{uuid}/content \
  --header 'Authorization: Bearer <token>'
{
  "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "pending",
  "name": "<string>",
  "size": 123,
  "type": "<string>",
  "md5": "<string>",
  "url": "<string>",
  "content": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.geekai.co/llms.txt

Use this file to discover all available pages before exploring further.

文件上传成功后,就可以通过文件提取接口获取文件内容了。需要注意的是,极客智坊提供的是文件异步加载,所以需要轮询提取文件内容接口获取文件内容,直到获取到文件内容为止。 轮询时,可以通过响应数据中的 status 字段判断文件提取状态,status=reading 表示文件正在读取中,status=done 表示文件读取完成,此时可以通过 content 字段值获取文件内容,如果 status=failed,则表示文件读取失败。

cURL 请求示例

curl --location --request GET 'https://geekai.co/api/v1/file/27f9ab4d-137b-4bb3-bcca-ea28f2f89e95/content' \
--header 'Authorization: Bearer {$GEEKAI_API_KEY}' 

Postman 请求响应示例

提取文件内容

授权

Authorization
string
header
必填

API认证token

路径参数

uuid
string<uuid>
必填

文件唯一标识符

响应

成功响应

uuid
string<uuid>
必填

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

status
enum<string>
必填

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

可用选项:
pending,
reading,
processing,
failed,
done
name
string

文件名称

size
integer

文件大小

type
string

文件MIME类型

md5
string

文件MD5值

url
string

文件URL地址

content
string

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