PlayHT Agents API

Voice agent management.

OpenAPI Specification

playht-agents-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: PlayAI Agents API
  description: 'PlayAI (formerly PlayHT) is a generative voice platform. The REST API

    covers text-to-speech generation (PlayDialog, Dialog 1.0 Turbo, and

    Play 3.0 Mini models), voice catalog, voice agents, external functions,

    and PlayNote document-to-audio jobs.


    Authentication uses two headers: `AUTHORIZATION` carries the secret API

    key, and `X-USER-ID` carries the PlayAI user identifier.

    '
  version: 1.0.0
  contact:
    name: API Evangelist
    email: kin@apievangelist.com
  license:
    name: Proprietary
servers:
- url: https://api.play.ai
  description: PlayAI production API
security:
- apiKey: []
  userId: []
tags:
- name: Agents
  description: Voice agent management.
paths:
  /api/v1/agents:
    post:
      tags:
      - Agents
      summary: Create a PlayAI agent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Agent'
      responses:
        '201':
          description: Agent created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
  /api/v1/agents/{agentId}:
    parameters:
    - $ref: '#/components/parameters/AgentId'
    get:
      tags:
      - Agents
      summary: Retrieve agent information
      responses:
        '200':
          description: Agent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
    patch:
      tags:
      - Agents
      summary: Update agent properties
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Agent'
      responses:
        '200':
          description: Updated agent.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
components:
  parameters:
    AgentId:
      name: agentId
      in: path
      required: true
      schema:
        type: string
  schemas:
    Agent:
      type: object
      properties:
        id:
          type: string
        displayName:
          type: string
        description:
          type: string
        voice:
          type: string
        prompt:
          type: string
        criticalKnowledge:
          type: string
        greeting:
          type: string
        externalFunctions:
          type: array
          items:
            type: string
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: AUTHORIZATION
      description: Secret API key issued in the PlayAI console.
    userId:
      type: apiKey
      in: header
      name: X-USER-ID
      description: PlayAI user identifier paired with the API key.