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

# Create agent

> Creates an agent with its first version and deploys it to the default region. The whole config is validated first, so every problem comes back at once.

<Tip>
Open `playgroundUrl` from the response to talk to your agent in the browser. The link carries your API token, so don't share it.
</Tip>




## OpenAPI

````yaml /api-reference/rest/openapi.yaml post /v1/agents
openapi: 3.1.0
info:
  title: Zero Runtime REST API
  version: '1.0'
  description: >-
    Create, configure, version and deploy agents, and wire SIP telephony to
    them.
servers:
  - url: https://api.zeroruntime.ai
security:
  - token: []
tags:
  - name: Agents
  - name: Versions
  - name: Deployment
  - name: Phone numbers
  - name: Routing rules
  - name: Calls
  - name: Batch calls
  - name: Knowledge bases
  - name: Knowledge base folders
paths:
  /v1/agents:
    post:
      tags:
        - Agents
      summary: Create agent
      description: >
        Creates an agent with its first version and deploys it to the default
        region. The whole config is validated first, so every problem comes back
        at once.


        <Tip>

        Open `playgroundUrl` from the response to talk to your agent in the
        browser. The link carries your API token, so don't share it.

        </Tip>
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentConfig'
            examples:
              Inference:
                summary: Inference
                value:
                  name: Support Agent
                  defaultLanguage: english
                  languages:
                    english:
                      prompt: >-
                        You are a support agent for an online store. Keep
                        replies to one or two sentences.
                      greeting:
                        text: Hi! How can I help you today?
                        interruptible: false
                      stt:
                        - model: deepgram/nova-3-general
                      llm:
                        - model: google/gemini-3.5-flash
                      tts:
                        - model: cartesia/sonic-3
                          voice: faf0731e-dfb9-4cfc-8119-259a79b27e12
                      turnDetection:
                        model: videosdk/echo-large
                        mode: adaptive
                        minWaitSeconds: 0.5
                        maxWaitSeconds: 3
                      wakeUp:
                        enabled: true
                        afterSeconds: 10
                        message: Are you still there?
                      endCall:
                        enabled: true
                        when: >-
                          the customer says goodbye or confirms the issue is
                          resolved
                        message: Thanks for calling. Have a great day!
                  voiceProcessing:
                    vad:
                      sensitivity: medium
                      minSilenceDuration: 0.4
                    interruption:
                      mode: hybrid
                      minDuration: 0.3
                      minWords: 2
                    noiseCancellation:
                      model: aicoustics/quail-l-16khz
                  callSummary:
                    enabled: true
                    llm:
                      model: google/gemini-3.5-flash
                    instruction: Summarise the call in three bullets.
                    webhook:
                      url: https://example.com/hooks/call-summary
              Your own key (BYOK):
                summary: Your own key (BYOK)
                value:
                  name: Support Agent
                  defaultLanguage: english
                  languages:
                    english:
                      prompt: >-
                        You are a support agent for an online store. Keep
                        replies to one or two sentences.
                      greeting:
                        text: Hi! How can I help you today?
                        interruptible: false
                      stt:
                        - model: deepgram/nova-3-general
                      llm:
                        - model: openai/gpt-4o
                          apiKey: sk-proj-…
                      tts:
                        - model: cartesia/sonic-3
                          voice: faf0731e-dfb9-4cfc-8119-259a79b27e12
      responses:
        '201':
          description: Agent created and its first version deployed.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/AgentWithConfig'
                  - type: object
                    properties:
                      playgroundUrl:
                        type: string
                        description: >-
                          Opens the new agent in the playground, signed in with
                          the token you called with. Returned on create only.
                        example: >-
                          https://playground.videosdk.live/cli?token=eyJhbGciOi…&agentId=ag_7f2c91
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    AgentConfig:
      type: object
      required:
        - name
        - languages
      properties:
        name:
          type: string
          example: Support Agent
        defaultLanguage:
          type: string
          description: A language name, any casing.
          example: english
        languages:
          type: object
          description: >-
            Keyed by language name (`english`, `hindi`, …). Holds everything
            that varies by language.
          additionalProperties:
            $ref: '#/components/schemas/LanguageBlock'
          example:
            english:
              prompt: >-
                You are a support agent for an online store. Keep replies to one
                or two sentences.
              greeting:
                text: Hi! How can I help you today?
                interruptible: false
              stt:
                - model: deepgram/nova-3-general
                  language: en
              llm:
                - model: openai/gpt-4o
                  apiKey: ••••••••••••••••AbCd
              tts:
                - model: cartesia/sonic-3
                  voice: faf0731e-dfb9-4cfc-8119-259a79b27e12
        voiceProcessing:
          $ref: '#/components/schemas/VoiceProcessing'
        knowledgeBaseIds:
          type: array
          items:
            type: string
          description: >-
            Ids of the knowledge bases the agent answers from. An update
            replaces the list, so leaving it out removes them all.
        callSummary:
          type: object
          properties:
            enabled:
              type: boolean
            llm:
              $ref: '#/components/schemas/ModelEntry'
            instruction:
              type: string
            webhook:
              type: object
              properties:
                url:
                  type: string
                  format: uri
        tools:
          type: array
          items:
            type: string
          description: >-
            Ids of the tools the agent can call. An update replaces the list, so
            leaving it out removes them all.
        advanced:
          type: object
    AgentWithConfig:
      allOf:
        - $ref: '#/components/schemas/Agent'
        - type: object
          properties:
            versionId:
              type: string
              example: cm_31d0ba
            config:
              allOf:
                - $ref: '#/components/schemas/AgentConfig'
              description: The config as stored, with names resolved.
    LanguageBlock:
      type: object
      required:
        - prompt
      properties:
        prompt:
          type: string
        greeting:
          type: object
          properties:
            text:
              type: string
            interruptible:
              type: boolean
              description: Must match across languages.
        stt:
          $ref: '#/components/schemas/ModelSlot'
        llm:
          $ref: '#/components/schemas/ModelSlot'
        tts:
          $ref: '#/components/schemas/ModelSlot'
        realtime:
          allOf:
            - $ref: '#/components/schemas/ModelSlot'
          description: >-
            A realtime model fills STT, LLM and TTS itself. When set, `stt`,
            `llm` and `tts` in the same block are ignored.
        turnDetection:
          type: object
          properties:
            model:
              type: string
              description: >-
                A turn detection model from [Supported
                models](/api-reference/rest/models).
              example: videosdk/echo-large
            mode:
              type: string
              enum:
                - default
                - adaptive
            threshold:
              type: number
              minimum: 0
              maximum: 1
            minWaitSeconds:
              type: number
              minimum: 0
            maxWaitSeconds:
              type: number
              minimum: 0
              description: At least `minWaitSeconds`.
        wakeUp:
          type: object
          description: When `enabled` is true, `afterSeconds` and `message` are required.
          properties:
            enabled:
              type: boolean
            afterSeconds:
              type: number
              minimum: 0
            message:
              type: string
        endCall:
          type: object
          properties:
            enabled:
              type: boolean
              description: Must match across languages.
            when:
              type: string
              description: Must match across languages.
            message:
              type: string
    VoiceProcessing:
      type: object
      description: Shared by every language.
      properties:
        vad:
          type: object
          required:
            - sensitivity
          properties:
            sensitivity:
              type: string
              enum:
                - low
                - medium
                - high
            threshold:
              type: number
              minimum: 0
              maximum: 1
            minSpeechDuration:
              type: number
              minimum: 0
            minSilenceDuration:
              type: number
              minimum: 0
        interruption:
          type: object
          properties:
            mode:
              type: string
              enum:
                - hybrid
                - vad
                - stt
              description: '`vad` needs a `voiceProcessing.vad` block.'
            minDuration:
              type: number
              minimum: 0
            minWords:
              type: integer
              minimum: 0
        noiseCancellation:
          type: object
          description: '`{ "model": "provider/modelId" }` or `{ "provider": "…" }`.'
          properties:
            model:
              type: string
              description: >-
                A noise cancellation model from [Supported
                models](/api-reference/rest/models).
              example: aicoustics/quail-l-16khz
            provider:
              type: string
    ModelEntry:
      type: object
      description: One model in a slot.
      required:
        - model
      properties:
        model:
          type: string
          description: >-
            `provider/modelId`. Copy a slug from [Supported
            models](/api-reference/rest/models).
          example: cartesia/sonic-3
        voice:
          type: string
          description: >-
            The provider's voice id. Required for TTS models. Open a model's
            voices in [Supported models](/api-reference/rest/models) to copy
            one.
        language:
          type: string
          description: >-
            Optional language code for a regional variant, e.g. `en-IN`. Left
            out, the plain code is picked. See each model's codes in [Supported
            models](/api-reference/rest/models).
        apiKey:
          type: string
          description: >
            Your provider's own API key. Selects the bring-your-own-key variant
            of the model; leave it off for inference.


            Responses return it masked (`••••••••AbCd`). Send the full key on
            every create and update; a masked value is rejected.
          example: sk-proj-…
      additionalProperties: false
    Agent:
      type: object
      properties:
        agentId:
          type: string
          example: ag_7f2c91
        name:
          type: string
          example: Support Agent
        status:
          type: string
          enum:
            - inactive
            - active
          description: >-
            `active` once deployed. A new agent stays `inactive` only if its
            first deploy couldn't run, for example when the account has no
            active API key. Call [Deploy
            agent](/api-reference/deployment/deploy-agent) yourself then.
          example: active
        deploymentId:
          type: string
          example: dp_44b1e0
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ValidationError:
      type: object
      properties:
        status:
          type: string
          example: error
        errors:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                example: languages.english.tts[0].voice
              code:
                type: string
                example: UNKNOWN_VOICE
              message:
                type: string
                example: >-
                  Sonic 3 has no voice called "jacqueline". Pick one from its
                  voice list.
    Error:
      type: object
      properties:
        error:
          type: string
    ModelSlot:
      type: array
      description: The first entry is primary; the rest are fallbacks tried in order.
      items:
        $ref: '#/components/schemas/ModelEntry'
  responses:
    ValidationError:
      description: The body didn't validate. Every problem is listed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    Unauthorized:
      description: Missing or invalid `Authorization` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    token:
      type: apiKey
      in: header
      name: Authorization
      description: Your API token, sent raw (no `Bearer` prefix).
      x-default: <auth-token>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.