{"library":"runloop-api-client","title":"Runloop API Client","description":"The `runloop-api-client` is the official Python library for interacting with the Runloop API, providing convenient access to its REST API from any Python 3.9+ application. It offers both synchronous (`RunloopSDK`) and asynchronous (`AsyncRunloopSDK`) clients, enabling programmatic management of Devboxes, Blueprints, Snapshots, and Storage Objects. The library is actively maintained with frequent releases, adding new features and bug fixes.","language":"python","status":"active","last_verified":"Fri May 15","install":{"commands":["pip install runloop_api_client"],"cli":null},"imports":["from runloop_api_client import RunloopSDK","from runloop_api_client import AsyncRunloopSDK","from runloop_api_client import Runloop"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import asyncio\nimport os\nfrom runloop_api_client import AsyncRunloopSDK\n\nasync def run_example():\n    # API Key is auto-loaded from \"RUNLOOP_API_KEY\" env var by default.\n    # Ensure RUNLOOP_API_KEY is set in your environment (e.g., export RUNLOOP_API_KEY=\"your_api_key_here\")\n    # or pass it explicitly: AsyncRunloopSDK(bearer_token=\"your_api_key_here\")\n    runloop = AsyncRunloopSDK(bearer_token=os.environ.get('RUNLOOP_API_KEY', ''))\n\n    devbox = None # Initialize devbox to None for finally block\n    try:\n        # Create a devbox and wait for it to be ready\n        devbox = await runloop.devbox.create()\n        print(f'Created Runloop Devbox: {devbox.id}')\n\n        # Execute a command and wait for it to complete\n        result = await devbox.cmd.exec(command=\"echo 'Hello from Runloop!!'\")\n        print(f'Output: {await result.stdout()}')\n        print(f'Exit code: {result.exit_code}')\n\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n    finally:\n        if devbox:\n            print(f'Shutting down Devbox: {devbox.id}')\n            await devbox.shutdown()\n\nif __name__ == \"__main__\":\n    # Ensure the RUNLOOP_API_KEY environment variable is set.\n    if not os.environ.get('RUNLOOP_API_KEY'):\n        print(\"Warning: RUNLOOP_API_KEY environment variable is not set.\")\n        print(\"Please set it (e.g., export RUNLOOP_API_KEY='your_api_key_here') before running.\")\n    asyncio.run(run_example())\n","lang":"python","description":"This quickstart demonstrates how to initialize the `AsyncRunloopSDK` client, create a Devbox, execute a command within it, and then properly shut down the Devbox. Ensure your `RUNLOOP_API_KEY` is set as an environment variable for authentication.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-15","installed_version":"1.21.0","pypi_latest":"1.21.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":4.4,"avg_import_s":1.1,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"runloop_api_client","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.91,"mem_mb":19.1,"disk_size":"39.0M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"runloop_api_client","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5,"import_time_s":0.66,"mem_mb":19.1,"disk_size":"38M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"runloop_api_client","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.29,"mem_mb":20.9,"disk_size":"42.3M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"runloop_api_client","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":4.2,"import_time_s":1.19,"mem_mb":20.9,"disk_size":"41M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"runloop_api_client","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.38,"mem_mb":20.7,"disk_size":"33.8M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"runloop_api_client","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.6,"import_time_s":1.33,"mem_mb":20.7,"disk_size":"33M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"runloop_api_client","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1.3,"mem_mb":21.6,"disk_size":"33.5M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"runloop_api_client","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.8,"import_time_s":1.24,"mem_mb":21.6,"disk_size":"33M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"runloop_api_client","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.9,"mem_mb":19.2,"disk_size":"38.1M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"runloop_api_client","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.6,"import_time_s":0.83,"mem_mb":19.2,"disk_size":"37M"}]}}