> ## 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.

# Zero Runtime Cloud

> Deploy your agent to Zero Runtime Cloud with one command. Zero Runtime builds, hosts, and runs it for you.

Zero Runtime Cloud hosts and runs your worker on our compute, so you never operate a
server. You need an agent project that runs locally.

<Note>
  Run every `zeroruntime` command from **inside your project folder**. The CLI keeps your agent,
  image, and version IDs in `zeroruntime.yaml` there, so most commands need no flags. See
  [how the CLI tracks state](/deployments/operate/overview#how-the-cli-tracks-state).
</Note>

<Steps>
  <Step title="Remove the local test invoke">
    For local testing, use the `on_ready` callback in `serve()` to start a playground session when the worker is ready. Remove it in production to avoid automatically creating a new room for every worker. In production, start sessions via `zeroruntime invoke` CLI, the dispatch API, or telephony routing rules.

    <CodeGroup>
      ```python main.py theme={null}
      def invoke_agent():  # [!code --]
          zeroruntime.invoke(room=Room(playground=True))  # [!code --]

      if __name__ == "__main__":
          zeroruntime.serve(MyVoiceAgent, on_ready=invoke_agent)  # [!code --]
          zeroruntime.serve(MyVoiceAgent)  # [!code ++]
      ```

      ```typescript agent.ts theme={null}
      await zeroruntime.serve(MyVoiceAgent, { // [!code --]
        on_ready: () => zeroruntime.invoke({ room: Room({ playground: true }) }), // [!code --]
      }); // [!code --]
      await zeroruntime.serve(MyVoiceAgent, {}); // [!code ++]
      ```
    </CodeGroup>
  </Step>

  <Step title="Initialize the deployment">
    Register the agent with Zero Runtime Cloud. This writes `agent.id` and `deploy.id` to
    `zeroruntime.yaml` and generates a `Dockerfile` if your project doesn't have one:

    ```bash theme={null}
    zeroruntime init --name my-agent
    ```

    <Tip>
      Please make sure the entry-point file name matches the file specified in the Dockerfile’s `CMD`.
    </Tip>
  </Step>

  <Step title="Deploy">
    Build the image and deploy it. `--env .env` also uploads your provider keys as
    [secrets](/deployments/operate/secrets):

    ```bash theme={null}
    zeroruntime up --env .env
    ```

    ```text Expected output theme={null}
    ✓ Agent is up!
      Version ID: v_1o4eux
      Agent ID: ag_53wdl1
    ```

    The first deploy builds image `<agent-id>:v0.0`, and each later `up` builds the next one.
    See [Version Management](/deployments/operate/version-management).
  </Step>

  <Step title="Confirm it's live">
    ```bash theme={null}
    zeroruntime version describe
    ```
  </Step>

  <Step title="Talk to your agent">
    Start the agent in a room. The CLI prints a playground link you can open to talk to it:

    ```bash theme={null}
    zeroruntime invoke
    ```

    ```text Expected output theme={null}
    ✓ Agent invoked successfully
      Room ID: <room-id>

    Interact with your agent here:
      https://playground.zeroruntime.ai?token=...&meetingId=<room-id>
    ```
  </Step>
</Steps>

## Ship an update

Changed your code? Run the same command. It builds the next image and creates a new version:

```bash theme={null}
zeroruntime up --env .env
```

## Connect telephony

Deployed a telephony agent but skipped gateway setup? Configure it now so calls reach your
deployed agent. Use the **Agent ID** printed by `zeroruntime up` (also stored as `agent.id`
in `zeroruntime.yaml`) wherever an agent ID is required.

<AccordionGroup>
  <Accordion title="Set up inbound calls" icon="phone-arrow-down-left">
    **1. Create an inbound gateway**: the entry point for incoming calls.

    <Tabs>
      <Tab title="Dashboard">
        1. Copy the **Inbound URL** from the Zero Runtime dashboard.
        2. Go to **Twilio** and create a new SIP Trunk.
        3. Go to the **Origination** section, paste the Inbound URL there, and save it.

        <Tip>
          Using a different SIP provider? Follow its inbound setup:
          [Telnyx](/telephony/integrations/telnyx),
          [Vonage](/telephony/integrations/vonage#configuring-inbound-calling), or
          [Plivo](/telephony/integrations/plivo).
        </Tip>

        <Frame>
          <video autoPlay loop muted playsInline controls className="w-full aspect-video rounded-xl" src="https://assets.videosdk.live/images/setup.mp4" />
        </Frame>
      </Tab>

      <Tab title="API">
        ```bash theme={null}
        curl --request POST \
          --url https://api.videosdk.live/v2/sip/inbound-gateways \
          --header 'Authorization: YOUR_ZERORUNTIME_AUTH_TOKEN' \
          --header 'Content-Type: application/json' \
          --data '{ "name": "My Inbound Gateway", "numbers": ["+1234567890"] }'
        ```

        Then set the **origination URI** of your Twilio SIP trunk to the inbound gateway hostname (shown in the dashboard), e.g. `sip:9WXXXXXXX.sip.videosdk.live`.
      </Tab>
    </Tabs>

    **2. Create a routing rule**: connects the inbound gateway to your deployed agent.

    <Tabs>
      <Tab title="Dashboard">
        1. From your inbound gateway, click **Configure rule**, then **Create new routing rule**.
        2. Enter a **Routing Rule Name** and select **API Key** authentication.
        3. Choose the **Call Direction** (Inbound).
        4. Enter the **Phone Number** and select a **Room Type**.
        5. Enter your **Agent ID** and click **Save**.

        <Frame>
          <video autoPlay loop muted playsInline controls className="w-full aspect-video rounded-xl" src="https://assets.videosdk.live/images/routing-rules.mp4" />
        </Frame>
      </Tab>

      <Tab title="API">
        ```bash theme={null}
        curl --request POST \
          --url https://api.videosdk.live/v2/sip/routing-rule \
          --header 'Authorization: YOUR_ZERORUNTIME_AUTH_TOKEN' \
          --header 'Content-Type: application/json' \
          --data '{
            "gatewayId": "gateway_in_123456789",
            "name": "Support Line Rule",
            "numbers": ["+1234567890"],
            "agentId": "ag_53wdl1"
          }'
        ```
      </Tab>
    </Tabs>

    **3. Test it**: dial your provider's phone number from any phone. The agent greets you as soon as the call connects.
  </Accordion>

  <Accordion title="Set up outbound calls" icon="phone-arrow-up-right">
    **1. Create an outbound gateway**: lets the agent dial out to the PSTN.

    <Tabs>
      <Tab title="Dashboard">
        1. In Twilio, open your SIP Trunk and go to the **Termination** section. Create a **Termination URI** and add username/password credentials.
        2. Back in the Zero Runtime Dashboard, open the outbound gateway configuration.
        3. Paste the Twilio **Termination URI** as the address, add the same **username/password** credentials, and save.

        <Tip>
          Using a different SIP provider? Follow its outbound setup:
          [Telnyx](/telephony/integrations/telnyx),
          [Vonage](/telephony/integrations/vonage#configuring-outbound-calling), or
          [Plivo](/telephony/integrations/plivo).
        </Tip>

        <Frame>
          <video autoPlay loop muted playsInline controls className="w-full aspect-video rounded-xl" src="https://assets.videosdk.live/images/outbound-gateway.mp4" />
        </Frame>
      </Tab>

      <Tab title="API">
        ```bash theme={null}
        curl --request POST \
          --url https://api.videosdk.live/v2/sip/outbound-gateways \
          --header 'Authorization: YOUR_ZERORUNTIME_AUTH_TOKEN' \
          --header 'Content-Type: application/json' \
          --data '{
            "name": "My Outbound Gateway",
            "numbers": ["+12065551234"],
            "address": "sip.myprovider.com",
            "transport": "udp",
            "auth": { "username": "your-username", "password": "your-password" }
          }'
        ```

        Set `address` and `auth` to match your Twilio **Termination URI** and credentials so outbound calls reach the PSTN.
      </Tab>
    </Tabs>

    **2. Place a call**: trigger a call from the agent. Replace `YOUR_ZERORUNTIME_AUTH_TOKEN` and `routingRuleId` with your own.

    ```bash theme={null}
    curl --request POST \
      --url https://api.videosdk.live/v2/sip/call \
      --header 'Authorization: YOUR_ZERORUNTIME_AUTH_TOKEN' \
      --header 'Content-Type: application/json' \
      --data '{
        "sipCallFrom": "+14155550100",
        "sipCallTo": "+14155550199",
        "routingRuleId": "rr_2554md"
      }'
    ```
  </Accordion>
</AccordionGroup>

## Next

<CardGroup cols={2}>
  <Card title="Operate your agent" icon="sliders" href="/deployments/operate/overview">
    Versions, secrets, sessions, logs, and scaling down.
  </Card>

  <Card title="CLI Reference" icon="book" href="/deployments/cli-reference">
    Every command and flag.
  </Card>
</CardGroup>


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