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
Query parameters
Read this revision instead of the latest. List them with List revisions.
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, mode, session_id, lazy, and screenshot_max_width. Field meanings are on Create an environment.
The ETag response header holds the revision you read, for example "3". Send it back as If-Match to update only if nobody changed the environment since.
Bound vault.
Browser profile loaded at start.
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. Also sent for an unknown revision, or an id:N pin in the path: read a revision with ?revision=N instead. |
410 | The revision’s stored spec fails current validation. |
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
}