Environments
Retrieve an environment
Retrieve one environment’s full spec by ID, including pre-built h/ ones.
GET
/
api
/
v2
/
environments
/
{id}
from hai_agents import Client
client = Client()
environment = client.environments.get_environment("h/browser")
print(environment)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const environment = await client.environments.getEnvironment({ id: "h/browser" });
console.log(environment);
curl "https://agp.eu.hcompany.ai/api/v2/environments/h/browser" \
-H "Authorization: Bearer $HAI_API_KEY"
{
"id": "h/browser",
"kind": "web",
"host": "cloud",
"start_url": "https://www.bing.com",
"headless": false,
"session_id": null,
"mode": {"type": "visual", "width": 1200, "height": 1200, "markdown": false},
"lazy": false,
"settle_s": 1.0,
"vault_id": null,
"browser_profile_id": null,
"use_default_browser_profile": false,
"persist_browser_profile": false,
"network": null
}
Path parameters
string
required
The environment’s
id, for example h/browser or my-browser.Response
200 with the environment object, also returned by create, list, update, and patch. A browser (kind: "web") carries the fields below. A desktop (kind: "desktop") carries only id, kind, host, session_id, lazy, settle_s, and screenshot_max_width. Field meanings are on Create an environment.
string
Catalog identifier.
h/ IDs are H’s reserved, read-only environments.string
web or desktop.string
cloud or user_device.string
Initial URL.
boolean
Whether the browser runs without a visible window.
string | null
Existing browser session to attach to.
object
{"type": "visual", "width", "height", "markdown"} or {"type": "text", "chunk_size"}.boolean
Whether the browser starts on first use.
number
Seconds the agent waits after each action.
string | null
Browser profile loaded at start.
boolean
Whether your default browser profile is loaded.
boolean
Whether the final browser state is saved back into the profile.
from hai_agents import Client
client = Client()
environment = client.environments.get_environment("h/browser")
print(environment)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const environment = await client.environments.getEnvironment({ id: "h/browser" });
console.log(environment);
curl "https://agp.eu.hcompany.ai/api/v2/environments/h/browser" \
-H "Authorization: Bearer $HAI_API_KEY"
{
"id": "h/browser",
"kind": "web",
"host": "cloud",
"start_url": "https://www.bing.com",
"headless": false,
"session_id": null,
"mode": {"type": "visual", "width": 1200, "height": 1200, "markdown": false},
"lazy": false,
"settle_s": 1.0,
"vault_id": null,
"browser_profile_id": null,
"use_default_browser_profile": false,
"persist_browser_profile": false,
"network": null
}
Errors
| Status | Cause |
|---|---|
404 | Not found, or not in your organization. |
Was this page helpful?
⌘I
from hai_agents import Client
client = Client()
environment = client.environments.get_environment("h/browser")
print(environment)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const environment = await client.environments.getEnvironment({ id: "h/browser" });
console.log(environment);
curl "https://agp.eu.hcompany.ai/api/v2/environments/h/browser" \
-H "Authorization: Bearer $HAI_API_KEY"
{
"id": "h/browser",
"kind": "web",
"host": "cloud",
"start_url": "https://www.bing.com",
"headless": false,
"session_id": null,
"mode": {"type": "visual", "width": 1200, "height": 1200, "markdown": false},
"lazy": false,
"settle_s": 1.0,
"vault_id": null,
"browser_profile_id": null,
"use_default_browser_profile": false,
"persist_browser_profile": false,
"network": null
}