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

# Stream infrastructure eviction warnings for the account via SSE.

> Subscribe, via server-sent events, to pending infrastructure evictions for every Devbox in the account. On connect the stream emits one event per Devbox that currently has a pending eviction, then one event as each further eviction is scheduled. Best-effort and advisory: a Devbox stays running until its deadline, and delivery is not guaranteed.



## OpenAPI

````yaml /openapi-specs/stainless-processed-openapi.json get /v1/devboxes/watch_evictions
openapi: 3.1.0
info:
  title: RunLoop API
  version: '0.1'
  description: >-
    The RunLoop API spec that allows you to host lambda functions and Devboxes
    to enable scaled long running ai workflows.
  contact:
    name: Runloop AI Support
    url: https://runloop.ai
    email: support@runloop.ai
servers:
  - url: https://api.runloop.ai
    description: Runloop API
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: Benchmark
  - name: Blueprint
  - name: Blueprint-Lifecycle
  - name: Blueprint-ObservabilityTools
  - name: Devbox
  - name: Devbox-FileTools
  - name: Devbox-Lifecycle
  - name: Devbox-NetworkTools
  - name: Devbox-ObservabilityTools
  - name: Devbox-PersistenceTools
  - name: Devbox-ShellTools
  - name: Scenario
  - name: ScenarioScorer
  - name: accounts
  - name: agents
  - name: apikeys
  - name: axons
  - name: executions
  - name: gateway-configs
  - name: mcp-configs
  - name: network-policies
  - name: objects
  - name: restricted_keys
  - name: secrets
  - name: streaming
paths:
  /v1/devboxes/watch_evictions:
    get:
      summary: Stream infrastructure eviction warnings for the account via SSE.
      description: >-
        Subscribe, via server-sent events, to pending infrastructure evictions
        for every Devbox in the account. On connect the stream emits one event
        per Devbox that currently has a pending eviction, then one event as each
        further eviction is scheduled. Best-effort and advisory: a Devbox stays
        running until its deadline, and delivery is not guaranteed.
      operationId: watchDevboxEvictions
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DevboxEvictionEventView'
          headers:
            Content-Type:
              description: text/event-stream
              schema:
                type: string
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Runloop from '@runloop/api-client';


            const client = new Runloop({
              bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
            });


            const devboxEvictionEventView = await
            client.devboxes.watchEvictions();


            console.log(devboxEvictionEventView.devbox_id);
        - lang: Python
          source: |-
            import os
            from runloop_api_client import Runloop

            client = Runloop(
                bearer_token=os.environ.get("RUNLOOP_API_KEY"),  # This is the default and can be omitted
            )
            for devbox in client.devboxes.watch_evictions():
              print(devbox)
components:
  schemas:
    DevboxEvictionEventView:
      type: object
      properties:
        devbox_id:
          type: string
          description: The ID of the Devbox with a pending eviction.
        eviction_deadline_ms:
          type: integer
          format: int64
          description: >-
            Unix timestamp (milliseconds) after which the Devbox will be
            suspended. Advisory and best-effort.
      required:
        - devbox_id
        - eviction_deadline_ms
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````