Agents

Write an agent environment file

Changed on

Copies inline bytes or a Files API file into a connected execution environment, replacing an existing regular file at the same path. Upload between turns and wait for success before starting the next turn. See environment files.

post/agents/environments/{environment_id}/files

Request

  • Base URL
    https://api.openai.com/v1
  • URL
    https://api.openai.com/v1/agents/environments/{environment_id}/files
  • Auth
    HTTP bearer

Path parameters

environment_idstring required

The ID of the environment.

Request body

OR

Response

The written live environment file.

object'agent.environment.file' required

The object type. Always agent.environment.file.

environment_idstring required

The ID of the environment containing this file.

pathstring required

The absolute file path inside the environment's workspace.

size_bytesinteger required

The file size in bytes.

Changes