List agent environments
client.Beta.Agents.Environments.List(ctx, query) (*CursorPage[EnvironmentInfo], error)
GET
/agents/environmentsLists OpenAI-hosted environments owned by the authenticated principal. Requires access to the prewarming beta.
List agent environments
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Beta.Agents.Environments.List(context.TODO(), openai.BetaAgentEnvironmentListParams{
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
200 example
{
"data": [
{
"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"
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id",
"object": "list"
}Returns Examples
200 example
{
"data": [
{
"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"
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id",
"object": "list"
}