> ## 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.

# Extract Content

After the file is successfully uploaded, you can retrieve the file content through the file extraction interface. Note that GeekAI provides asynchronous file loading, so you need to poll the file content extraction interface to obtain the file content until it is retrieved.  When polling, you can check the `status` field in the response data to determine the file extraction status. `status=reading` indicates that the file is being read, `status=done` indicates that the file has been read successfully, and the file content can be obtained through the `content` field value. If `status=failed`, it means that the file reading failed.

### cURL Request Example

```bash theme={null}
curl --location --request GET 'https://geekai.dev/api/v1/file/27f9ab4d-137b-4bb3-bcca-ea28f2f89e95/content' \
--header 'Authorization: Bearer {YOUR_GEEKAI_API_KEY}'
```


## OpenAPI

````yaml openapi.yaml GET /file/{uuid}/content
openapi: 3.1.0
info:
  title: 极客智坊 API文档
  description: 极客智坊 API 消息接口规范文档
  version: 1.0.0
servers:
  - url: https://geekai.co/api/v1
    description: 国内代理入口
  - url: https://geekai.dev/api/v1
    description: 海外代理入口
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /file/{uuid}/content:
    get:
      tags:
        - Files
      summary: 获取文件内容
      description: 根据文件UUID获取文件内容，支持不同的返回格式和过滤选项。
      operationId: getFileContent
      parameters:
        - name: uuid
          in: path
          required: true
          description: 文件唯一标识符
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: 成功响应
          content:
            application/json:
              schema:
                type: object
                required:
                  - uuid
                  - status
                properties:
                  uuid:
                    type: string
                    format: uuid
                    description: 文件唯一ID,可通过该ID获取文件内容
                  name:
                    type: string
                    description: 文件名称
                  size:
                    type: integer
                    description: 文件大小
                  type:
                    type: string
                    description: 文件MIME类型
                  status:
                    type: string
                    description: '文件状态: pending（待处理）/reading（读取中）/failed（读取失败）/done（已读取）'
                    enum:
                      - pending
                      - reading
                      - processing
                      - failed
                      - done
                  md5:
                    type: string
                    description: 文件MD5值
                  url:
                    type: string
                    description: 文件URL地址
                  content:
                    type: string
                    description: 文件内容（只有status=done时，才会填充该字段）
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: 文件不存在
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - example:
                      code: file_not_found
                      message: 指定的文件不存在
        '500':
          $ref: '#/components/responses/StandardError'
components:
  responses:
    Unauthorized:
      description: 未授权
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                example: unauthorized
              message:
                type: string
                example: Invalid API key or token
    StandardError:
      description: 标准错误响应
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: 错误代码
          example: invalid_request
        message:
          type: string
          description: 错误信息描述
          example: 请求参数不合法
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API认证token
    apiKeyAuth:
      type: apiKey
      in: header
      name: GeekAI-API-Key
      description: API密钥认证

````