Use case
Every sandbox exposes a set of path-based URLs underapi.declaw.ai
for interacting with its filesystem, ports, and MCP endpoint. This
example exercises each URL helper and round-trips a 50 MiB payload
through the upload/download endpoints to verify streaming works
end-to-end.
All URLs are path-based under
api.declaw.ai. Subdomain-style
URLs (<id>.api.declaw.ai) are not supported.What you’ll learn
- Using
envd_api_urlto get the base namespace URL for a sandbox - Building download and upload URLs with
download_url(path)/upload_url(path) - Using
get_host(port)for port-based reverse-proxy URLs - Using
get_mcp_url()for the MCP convenience endpoint - Round-tripping a large payload through
upload_url+download_urlwith SHA-256 verification
Prerequisites
Code walkthrough
Create a sandbox and print all five URL helpers:get_host():
Expected output
Full source
Seecookbook/examples/url-helpers/main.py in the repo.