Sample - OpenAI API
GET/agents/environments/{environment_id}

Retrieve an agent environment

Retrieves an execution environment's connection status and safe installed metadata. See environment lifecycle.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter
environment_idstringrequired
The ID of the environment.

7 status codes
200The requested environment.
idstringrequired
The ID of the environment.
objectstringrequired
The object type. Always `agent.environment`.
Allowed:agent.environmentDefault:agent.environment
typestringrequired
Whether the environment is hosted by OpenAI or by the application.
Allowed:openai_hostedself_hosted
statusstringrequired
The current environment connection status.
Allowed:pendingconnecteddisconnectedexpiredfailed
filesarray<object>required
Files installed in the environment, without their contents.
skillsarray<object>required
Skills installed in the environment, without their archive contents.
pluginsarray<object>required
Plugins installed in the environment, without their archive contents.
400The request was invalid.
errorobjectrequired
The error returned by the API.
401Authentication or project context was missing.
errorobjectrequired
The error returned by the API.
404The requested session or event was not found.
errorobjectrequired
The error returned by the API.
409The request conflicted with the current session state.
errorobjectrequired
The error returned by the API.
500An internal error occurred.
errorobjectrequired
The error returned by the API.
503The service is temporarily unavailable.
errorobjectrequired
The error returned by the API.

Error handling

A 400 is returned: The request was invalid. A 401 is returned: Authentication or project context was missing. A 404 is returned: The requested session or event was not found. A 409 is returned: The request conflicted with the current session state. A 500 is returned: An internal error occurred. A 503 is returned: The service is temporarily unavailable.