Home / Servers / OpenAI API / create_agent_environment_file

Write an agent environment file

An MCP tool from the OpenAI API server, hosted on mcp.hjlabs.in.

Write an agent environment file 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… [POST /agents/environments/{environment_id}/files]

Name on the gateway: openai_api__create_agent_environment_file · may change things.

Parameters

NameTypeDescription
environment_id requiredstringThe ID of the environment.
type requiredfile_idThe type of the object. Always file_id.
file_id requiredstringThe ID of the uploaded file.
path requiredstringThe absolute destination path inside /workspace.

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "openai_api__create_agent_environment_file",
  "arguments": {
    "environment_id": "…",
    "type": "…",
    "file_id": "…",
    "path": "…"
  }
}

Or connect the OpenAI API server directly, which lists 371 tools including this one:

Run in your terminal
claude mcp add --transport http hj-openai-api https://mcp.hjlabs.in/mcp/openai-api \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the write an agent environment file tool with environment_id set to ….

More from OpenAI API