Retrieve the preparation status and safe installed metadata of an environment by ID.
Endpoint
GET /agents/environments/{environment_id}
Returns the current status and safe metadata of the specified environment. A successful call returns 200.
Path parameters
| Field | Required | Type | Description |
|---|---|---|---|
environment_id | Yes | string | Environment ID from the create response; not a session ID, template ID, or sandbox ID |
Request example
Response example
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Environment ID |
object | string | Environment object type, fixed as agent.environment |
type | string | Environment type, fixed as openai_hosted |
status | string | Environment status: pending, ready, connected, disconnected, suspended, expired, or failed |
files | array | Safe metadata for installed files; file content is not returned. |
files[].id | string | Environment file ID |
files[].type | string | File reference type, fixed as file_id |
files[].path | string | File path in the environment |
files[].size_bytes | integer | File size in bytes |
files[].file_id | string | Original source file ID |
skills | array | Safe metadata for installed skills; package content is not returned. |
skills[].type | string | Skill reference type, fixed as skill_reference |
skills[].name | string | Skill name |
skills[].description | string | Skill description |
skills[].skill_id | string | Skill resource ID |
skills[].version | string | Frozen version |
plugins | array | Plugin list; currently [] for managed environments; plugin fields in historical records do not mean plugins can be created |
ready means preparation is complete and a session can reference the environment. connected means the instance is connected, which does not guarantee that every subsequent command succeeds.
Error codes
| HTTP status | Error type / code | Solution |
|---|---|---|
404 | not_found_error / not_found_error | Use an environment ID that exists and is visible in the current workspace |
503 | server_error / environment_unavailable | Retry later. If it keeps failing, submit a ticket with x-request-id |
{"error":{"type","code","message","param"}}. Gateway errors can use a different structure. Keep the HTTP status, x-request-id, and environment ID for troubleshooting.