> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ttapi.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建角色

> 创建角色用于生成视频



## OpenAPI

````yaml openapi/cn/sora.json POST /sora/characters
openapi: 3.1.0
info:
  title: Sora API DOCS
  version: 1.0.0
  description: TTAPI Sora API 接口服务，目前集成了市场上最为领先的视频大模型sora2。
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /sora/characters:
    post:
      description: 创建角色用于生成视频
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CharactersRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    CharactersRequest:
      type: object
      properties:
        timestamps:
          type: string
          description: 单位秒，例如 ‘1,2’ 是指视频的1～2秒中出现的角色，注意范围差值最大 3 秒最小 1 秒
        url:
          type: string
          description: 视频中包含需要创建的角色
        hookUrl:
          type: string
          description: >-
            回调通知地址，任务完成或失败将通过请地址进行通知，<a href="fetch"
            target="_self">通知数据结构</a>与fetch结构一致。如果未设置，则需要请求<a href="fetch"
            target="_self">fetch接口</a>进行查询
      required:
        - timestamps
        - url
  responses:
    SuccessResponse:
      description: 请求成功
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: SUCCESS
              message:
                type: string
                example: success
              data:
                type: object
                example:
                  jobId: jobId
            required:
              - status
              - message
              - data
    400Response:
      description: 参数错误
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: '"prompt" cannot be empty.'
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: 授权失败
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        请前往 <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI 控制台</a>
        获取 API 密钥。

````