> ## 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 /voices/{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:
  /voices/{task_id}:
    get:
      tags:
        - GetVoices
      summary: 音色任务查询接口
      description: 根据任务ID查询音色生成任务的状态和结果。
      operationId: GetVoices
      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:
                      voices:
                        type: array
                        items:
                          type: object
                          properties:
                            voice_id:
                              type: string
                              description: 音色ID
                            voice_name:
                              type: string
                              description: 音色名称
                            trial_url:
                              type: string
                              format: uri
                              description: 试听URL
        '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.