Create an agent environment
beta.agents.environments.create(EnvironmentCreateParams**kwargs) -> EnvironmentInfo
POST/agents/environments
Creates an OpenAI-hosted environment before creating a session. Requires access to the prewarming beta.
Create an agent environment
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
environment_info = client.beta.agents.environments.create(
environment={
"type": "openai_hosted"
},
)
print(environment_info.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"
}