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

# 创建主体

用于创建自定义主体，创建自定义主体可用于视频生成场景，目前仅可灵支持。


## OpenAPI

````yaml openapi.yaml POST /elements/create
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/create:
    post:
      tags:
        - CreateElements
      summary: 创建自定义主体
      description: 创建自定义主体，用于视频生成场景。
      operationId: createElements
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - name
              properties:
                name:
                  type: string
                  description: 主体名称
                  example: test-element
                model:
                  type: string
                  description: 模型ID
                  example: kling-element-v2
                description:
                  type: string
                  description: 主体描述
                reference_type:
                  type: string
                  description: 主体参考方式
                  enum:
                    - video_refer
                    - image_refer
                image:
                  type: string
                  description: 正面参考图URL/Base64编码
                images:
                  type: array
                  items:
                    type: string
                  description: 其他参考图URL/Base64编码
                videos:
                  type: array
                  items:
                    type: string
                  description: 参考视频URL/Base64编码
                voice_id:
                  type: string
                  description: 音色ID，用于指定生成的音色
                tag_list:
                  type: array
                  items:
                    type: object
                    properties:
                      tag_id:
                        type: string
                        description: >-
                          标签ID：o_101 热梗, o_102 人物, o_103 动物, o_104 道具, o_105 服饰,
                          o_106 场景, o_107 特效, o_108 其他
                  description: 为主体配置标签列表
      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:
                      voices:
                        type: array
                        items:
                          type: object
                          properties:
                            voice_id:
                              type: string
                              description: 音色ID
                            voice_name:
                              type: string
                              description: 音色名称
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '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.