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

# Create Agent

> Create a new agent using LiveKit Cloud for all media/dispatch config.



## OpenAPI

````yaml https://api.mrassistant.ai/openapi.json post /agents
openapi: 3.1.0
info:
  title: Backend - Multilingual Voice Agent System
  description: FastAPI backend for multilingual voice agents with tool use
  version: 1.0.0
servers: []
security: []
paths:
  /agents:
    post:
      tags:
        - agents
      summary: Create Agent
      description: Create a new agent using LiveKit Cloud for all media/dispatch config.
      operationId: create_agent_agents_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    AgentCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        default_user_lang:
          type: string
          maxLength: 10
          minLength: 2
          title: Default User Lang
        thinking_lang:
          type: string
          maxLength: 10
          minLength: 2
          title: Thinking Lang
        default_voice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Default Voice Id
        interruptions_enabled:
          type: boolean
          title: Interruptions Enabled
          default: true
        escalation_policy:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Escalation Policy
        model_provider:
          type: string
          pattern: >-
            ^(openai|azure_openai|anthropic|google|groq|cerebras|deepseek|xai|perplexity|together|amazon_bedrock|anyscale|openrouter|deepinfra)$
          title: Model Provider
          default: openai
        model_name:
          type: string
          maxLength: 100
          minLength: 1
          title: Model Name
          default: gpt-4o-mini
        temperature:
          type: number
          maximum: 1
          minimum: 0
          title: Temperature
          default: 0.7
        max_tokens:
          type: integer
          maximum: 1000
          minimum: 50
          title: Max Tokens
          default: 150
        system_prompt:
          anyOf:
            - type: string
              maxLength: 8000
            - type: 'null'
          title: System Prompt
          description: >-
            Full system prompt defining the agent's role, behavior, and
            instructions. Falls back to description if not set.
        persona:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Persona
          description: >-
            Short character/personality descriptor (e.g. 'Friendly British
            accountant'). Renders as 'Personality: ...' in the system prompt.
        first_message_mode:
          type: string
          pattern: >-
            ^(assistant-speaks-first|wait-for-user|assistant-speaks-first-with-model-generated-message)$
          title: First Message Mode
          default: assistant-speaks-first
        first_message_script:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: First Message Script
        voice_provider:
          type: string
          pattern: ^(elevenlabs|cartesia|openai|deepgram|google|azure|rime|lmnt)$
          title: Voice Provider
          default: elevenlabs
        voice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Voice Id
        background_sound_url:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Background Sound Url
        input_min_characters:
          type: integer
          maximum: 100
          minimum: 10
          title: Input Min Characters
          default: 30
        transcriber_provider:
          type: string
          pattern: ^(deepgram|openai|assemblyai|google|azure)$
          title: Transcriber Provider
          default: deepgram
        transcriber_model:
          type: string
          maxLength: 100
          minLength: 1
          title: Transcriber Model
          default: nova-3
        background_denoising:
          type: boolean
          title: Background Denoising
          default: true
        confidence_threshold:
          type: number
          maximum: 1
          minimum: 0
          title: Confidence Threshold
          default: 0.4
        multilingual_enabled:
          type: boolean
          title: Multilingual Enabled
          description: Enable automatic language detection for multilingual conversations
          default: false
        supported_languages:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Supported Languages
          description: >-
            List of language codes the agent supports (e.g., ['en', 'es',
            'fr']). If multilingual_enabled=true and this is empty, all
            languages are supported.
        language_detection_provider:
          type: string
          pattern: ^(auto|deepgram|whisper)$
          title: Language Detection Provider
          description: >-
            Provider for language detection: 'auto' uses STT provider's built-in
            detection
          default: auto
        respond_in_user_language:
          type: boolean
          title: Respond In User Language
          description: >-
            When true, agent responds in the detected user language. When false,
            always responds in default_user_lang.
          default: true
        wait_seconds:
          type: number
          maximum: 1
          minimum: 0.1
          title: Wait Seconds
          default: 0.4
        smart_endpointing:
          type: boolean
          title: Smart Endpointing
          default: true
        interruption_words:
          type: integer
          maximum: 10
          minimum: 0
          title: Interruption Words
          default: 3
        punctuation_boundary_ms:
          type: integer
          maximum: 500
          minimum: 50
          title: Punctuation Boundary Ms
          default: 100
        no_punctuation_boundary_ms:
          type: integer
          maximum: 3000
          minimum: 800
          title: No Punctuation Boundary Ms
          default: 1500
        silence_timeout_seconds:
          type: integer
          maximum: 120
          minimum: 10
          title: Silence Timeout Seconds
          default: 30
        max_duration_seconds:
          type: integer
          maximum: 1800
          minimum: 180
          title: Max Duration Seconds
          default: 600
        idle_messages_enabled:
          type: boolean
          title: Idle Messages Enabled
          default: true
        max_idle_messages:
          type: integer
          maximum: 10
          minimum: 1
          title: Max Idle Messages
          default: 3
        idle_timeout_seconds:
          type: number
          maximum: 60
          minimum: 5
          title: Idle Timeout Seconds
          default: 7.5
        analysis_prompt:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Analysis Prompt
        analysis_timeout_sec:
          type: integer
          maximum: 60
          minimum: 1
          title: Analysis Timeout Sec
          default: 10
        min_messages_for_analysis:
          type: integer
          maximum: 10
          minimum: 0
          title: Min Messages For Analysis
          default: 2
        voicemail_detection_enabled:
          type: boolean
          title: Voicemail Detection Enabled
          default: true
        voicemail_message:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Voicemail Message
        end_call_message:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: End Call Message
        keypad_input_enabled:
          type: boolean
          title: Keypad Input Enabled
          default: false
        keypad_timeout_seconds:
          type: integer
          maximum: 6
          minimum: 1
          title: Keypad Timeout Seconds
          default: 2
        keypad_delimiters:
          type: string
          pattern: ^[#*]+$
          title: Keypad Delimiters
          default: '#'
        sip_enabled:
          type: boolean
          title: Sip Enabled
          description: Enable SIP/phone calling for this agent
          default: false
        recording_enabled:
          type: boolean
          title: Recording Enabled
          description: Enable call recording for this agent
          default: true
        analytics_enabled:
          type: boolean
          title: Analytics Enabled
          description: Enable analytics tracking for this agent
          default: true
        knowledge:
          anyOf:
            - items:
                additionalProperties:
                  type: string
                type: object
              type: array
            - type: 'null'
          title: Knowledge
        tools:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Tools
        channels:
          anyOf:
            - additionalProperties:
                type: boolean
              type: object
            - type: 'null'
          title: Channels
      type: object
      required:
        - name
        - default_user_lang
        - thinking_lang
      title: AgentCreate
      description: Agent creation model.
    AgentCreateResponse:
      properties:
        agent_id:
          type: string
          format: uuid
          title: Agent Id
        version:
          type: integer
          title: Version
        livekit:
          additionalProperties: true
          type: object
          title: Livekit
        embed:
          additionalProperties:
            type: string
          type: object
          title: Embed
        sip:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Sip
        capabilities:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Capabilities
        tools:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Tools
          default: []
        workflow:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Workflow
        client_messages:
          items:
            type: string
          type: array
          title: Client Messages
          default:
            - conversation-update
            - tool-calls
            - transcript.partial
            - transcript.final
      type: object
      required:
        - agent_id
        - version
        - livekit
        - embed
      title: AgentCreateResponse
      description: Agent creation response model.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````