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

# Get Agent

> Retrieve all information about an agent.



## OpenAPI

````yaml GET /api/v1/agents/{agentId}
openapi: 3.1.0
info:
  title: PlayAI API
  version: 1.0.0
  description: |
    A single, combined OpenAPI specification that merges:
      • PlayAI Agent API
      • PlayAI PlayNote API
      • PlayAI Text-to-Speech (TTS) API
      • PlayAI Dialog Turbo API

    This file contains all endpoints, schemas, and components 
    from the four original specs. See "Merged Issues" below 
    for notes on how certain conflicts were resolved.
servers:
  - url: https://api.play.ai
security:
  - ApiKeyAuth: []
    XUserIdAuth: []
paths:
  /api/v1/agents/{agentId}:
    get:
      description: Retrieve all information about an agent.
      parameters:
        - name: agentId
          in: path
          description: The agent's ID.
          required: true
          schema:
            $ref: '#/components/schemas/AgentId'
        - name: accept
          in: header
          required: false
          schema:
            type: string
            enum:
              - application/json
      responses:
        '200':
          $ref: '#/components/responses/AgentResourceResponse'
      security:
        - ApiKeyAuth: []
          XUserIdAuth: []
components:
  schemas:
    AgentId:
      description: The unique ID for each agent.
      type: string
      example: f0gZrOKBKL7veJ6o1M
    AgentResource:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/AgentId'
        voice:
          $ref: '#/components/schemas/VoiceId'
          description: >-
            The unique ID for a voice to be used.

            >**💡 Tip:** Check out the [How to Get ID of
            Voices](/documentation/text-to-speech/tts-voices#how-to-use-a-voice)
            guide
        voiceSpeed:
          $ref: '#/components/schemas/VoiceSpeed'
        ttsModel:
          $ref: '#/components/schemas/TtsModel'
        displayName:
          $ref: '#/components/schemas/AgentDisplayName'
        description:
          $ref: '#/components/schemas/AgentDescription'
        greeting:
          $ref: '#/components/schemas/AgentGreeting'
        prompt:
          $ref: '#/components/schemas/AgentPrompt'
        criticalKnowledge:
          $ref: '#/components/schemas/CriticalKnowledge'
        answerOnlyFromCriticalKnowledge:
          $ref: '#/components/schemas/AnswerOnlyFromCriticalKnowledge'
        visibility:
          $ref: '#/components/schemas/Visibility'
        language:
          $ref: '#/components/schemas/Language'
        llm:
          $ref: '#/components/schemas/CustomLlm'
        avatarPhotoUrl:
          $ref: '#/components/schemas/AvatarPhotoUrl'
        criticalKnowledgeFiles:
          $ref: '#/components/schemas/CriticalKnowledgeFiles'
        phoneNumbers:
          $ref: '#/components/schemas/PhoneNumbers'
        actions:
          $ref: '#/components/schemas/Actions'
      required:
        - id
        - voice
        - displayName
        - description
        - visibility
        - answerOnlyFromCriticalKnowledge
    VoiceId:
      description: The unique ID for a PlayAI Voice.
      type: string
      example: >-
        s3://voice-cloning-zero-shot/baf1ef41-36b6-428c-9bdf-50ba54682bd8/original/manifest.json
    VoiceSpeed:
      type: number
      nullable: true
      description: The voice speed, i.e. how fast is the agent's speech.
      example: 1.2
      minimum: 0.5
      maximum: 1.5
    TtsModel:
      type: string
      nullable: true
      description: The voice model to use for the agent's speech.
      enum:
        - PlayHT2.0-turbo
        - Play3.0-mini
        - PlayDialog
      example: PlayHT2.0-turbo
      default: PlayDialog
    AgentDisplayName:
      type: string
      nullable: false
      maxLength: 250
      description: The agent's name
      example: My Agent
    AgentDescription:
      type: string
      nullable: false
      maxLength: 500
      description: The agent's description
      example: My agent is the best agent
    AgentGreeting:
      type: string
      nullable: true
      maxLength: 250
      description: The greeting message for the agent
      example: Hello! How can I help you today?
    AgentPrompt:
      type: string
      nullable: true
      maxLength: 10000
      description: Instructions for the agent
      example: >
        You are an agent for a company that sells widgets. A customer calls in
        and asks about the different types of widgets you sell. You should
        respond by telling the customer about the different types of widgets you
        sell and how they differ from each other.
    CriticalKnowledge:
      type: string
      nullable: true
      maxLength: 20000
      description: The agent's critical knowledge
      example: >-
        We have been in business for 20 years and have sold over 1 million
        widgets. Currently, we have 3 types of widgets: the standard widget, the
        deluxe widget, and the super widget. The standard widget is our most
        popular widget and is the most affordable. The deluxe widget is our
        mid-range widget and is popular with customers who want a little more
        than the standard widget. The super widget is our top of the line widget
        and is popular with customers who want the best of the best.
    AnswerOnlyFromCriticalKnowledge:
      type: boolean
      nullable: false
      description: >-
        If true, the agent will only respond with information from the critical
        knowledge field.
      default: false
    Visibility:
      type: string
      nullable: false
      enum:
        - public
        - private
      description: The visibility of the agent
      default: public
    Language:
      type: string
      nullable: true
      description: The language of the agent
      example: english
      enum:
        - arabic
        - english
        - french
        - german
        - greek
        - hindi
        - italian
        - japanese
        - korean
        - malay
        - mandarin
        - polish
        - portuguese
        - russian
        - spanish
        - thai
        - turkish
    CustomLlm:
      description: >
        Leave this field out or `null` if you don't want the agent to use your
        custom LLM API.
      type: object
      nullable: true
      default: null
      properties:
        baseURL:
          type: string
          example: https://my.own.llm.api.example.com
        apiKey:
          type: string
          example: abcdefghijklmnopqrstuvwxyz
        baseParams:
          nullable: true
          type: object
          properties:
            defaultHeaders:
              type: object
              nullable: true
            model:
              type: string
              example: gpt-3.5-turbo
            temperature:
              type: integer
              nullable: true
              description: Between 0 and 1.
            maxTokens:
              type: integer
              nullable: true
              example: 3000
    AvatarPhotoUrl:
      type: string
      nullable: true
      format: uri
      description: The URL of the agent's avatar photo
      example: https://api.play.ai/api/v1/agents/as43.../avatar-photo
    CriticalKnowledgeFiles:
      type: array
      nullable: false
      items:
        type: object
        properties:
          id:
            type: string
            example: e0e92064e26257fed1477465...
          name:
            type: string
            example: whatever you want.pdf
          url:
            type: string
            example: >-
              https://api.play.ai/api/v1/agents/as43.../critical-knowledge-files/e0e92...
          size:
            type: integer
            nullable: true
            example: 108439
          type:
            type: string
            nullable: true
            example: pdf
        required:
          - id
          - name
          - url
    PhoneNumbers:
      type: array
      nullable: false
      items:
        type: object
        properties:
          phoneNumber:
            type: string
            example: 13659874563
          country:
            type: string
            example: US
          locality:
            type: string
            nullable: true
            example: Malibu
    Actions:
      type: array
      nullable: false
      items:
        $ref: '#/components/schemas/ActionId'
    ActionId:
      description: The unique ID for each action.
      type: string
      example: f0gZrOKBKL7veJ6o1M
  responses:
    AgentResourceResponse:
      description: Agent resource response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AgentResource'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: >
        Your secret API key from [PlayAI](https://play.ai/api/keys), formatted
        as `Bearer YOUR_SECRET_API_KEY`.
    XUserIdAuth:
      type: apiKey
      in: header
      name: X-USER-ID
      description: |
        Your unique user ID from [PlayAI](https://play.ai/api/keys).
      x-prompt: What is your PlayAI user ID?

````