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

# 获取主体

> [!NOTE]
>
> 创建主体任务需要通过任务结果获取接口查询主体生成状态，当  `task_status` 字段值为 `succeed` 表明主体创建成功，可以拿到主体ID进行后续操作。

### 请求/响应参数明细


## OpenAPI

````yaml openapi.yaml GET /elements/{task_id}
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:
  /elements/{task_id}:
    get:
      tags:
        - GetElements
      summary: 主体任务查询接口
      description: 根据任务ID查询主体生成任务的状态和结果。
      operationId: GetElements
      parameters:
        - name: task_id
          in: path
          required: true
          description: 主体生成任务ID
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: 成功响应
          content:
            application/json:
              schema:
                type: object
                required:
                  - task_id
                  - task_status
                properties:
                  task_id:
                    type: string
                    description: 主体任务ID
                  task_status:
                    type: string
                    description: 任务状态
                    enum:
                      - pending
                      - running
                      - succeed
                      - failed
                  task_result:
                    type: object
                    description: 任务结果，包含生成的主体ID信息
                    properties:
                      elements:
                        type: array
                        items:
                          type: object
                          properties:
                            element_id:
                              type: string
                              description: 主体ID
                            element_name:
                              type: string
                              description: 主体名称
                            element_description:
                              type: string
                              description: 主体描述
                            element_image_list:
                              type: object
                              description: 主体参考图片列表
                              properties:
                                frontal_image:
                                  type: string
                                  format: uri
                                  description: 正面参考图片URL
                                refer_images:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      image_url:
                                        type: string
                                        format: uri
                                    description: 其他参考图片URL
                            element_video_list:
                              type: object
                              description: 主体参考视频列表
                              properties:
                                refer_videos:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      video_url:
                                        type: string
                                        format: uri
                                    description: 视频URL
                            element_voice_id:
                              type: string
                              description: 主体参考音频ID
                            element_tag_list:
                              type: array
                              description: 主体标签列表
                              items:
                                type: object
                                properties:
                                  tag_id:
                                    type: string
                                    description: 标签ID
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: 任务不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/StandardError'
components:
  responses:
    ValidationError:
      description: 参数验证错误
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                example: validation_error
              message:
                type: string
                example: 参数验证失败
              details:
                type: object
                additionalProperties:
                  type: string
                example:
                  field: 错误描述
    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密钥认证

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.