Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Retrieve an agent environment

EnvironmentInfo beta().agents().environments().retrieve(EnvironmentRetrieveParamsparams = EnvironmentRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/agents/environments/{environment_id}

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

ParametersExpand Collapse
EnvironmentRetrieveParams params
Optional<String> environmentId
minLength0
maxLength1048576
ReturnsExpand Collapse
class EnvironmentInfo:

Safe metadata for a first-class execution environment.

String id

The ID of the environment.

minLength0

Files installed in the environment, without their contents.

JsonValue; object_ "agent.environment"constant"agent.environment"constant

The object type. Always agent.environment.

List<HostedPlugin> plugins

Plugins installed in the environment, without their archive contents.

List<HostedSkill> skills

Skills installed in the environment, without their archive contents.

Status status

The current environment connection status.

Type type

Whether the environment is hosted by OpenAI or by the application.

Retrieve an agent environment

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.agents.environments.EnvironmentInfo;
import com.openai.models.beta.agents.environments.EnvironmentRetrieveParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        EnvironmentInfo environmentInfo = client.beta().agents().environments().retrieve("environment_id");
    }
}
{
  "id": "id",
  "files": [
    {
      "id": "id",
      "file_id": "file_id",
      "path": "path",
      "size_bytes": 0,
      "type": "file_id"
    }
  ],
  "object": "agent.environment",
  "plugins": [
    {
      "description": "description",
      "name": "name",
      "type": "inline"
    }
  ],
  "skills": [
    {
      "description": "description",
      "name": "name",
      "skill_id": "skill_id",
      "type": "skill_reference",
      "version": "version"
    }
  ],
  "status": "pending",
  "type": "openai_hosted"
}
Returns Examples
{
  "id": "id",
  "files": [
    {
      "id": "id",
      "file_id": "file_id",
      "path": "path",
      "size_bytes": 0,
      "type": "file_id"
    }
  ],
  "object": "agent.environment",
  "plugins": [
    {
      "description": "description",
      "name": "name",
      "type": "inline"
    }
  ],
  "skills": [
    {
      "description": "description",
      "name": "name",
      "skill_id": "skill_id",
      "type": "skill_reference",
      "version": "version"
    }
  ],
  "status": "pending",
  "type": "openai_hosted"
}