/agents/environments/{environment_id}/filesWrite a file to an agent environment
Writes a file to a connected agent execution environment, using either inline base64 data or a file uploaded through the Files API. Choose the inline or file_id body variant and provide the absolute destination path; writing to an existing regular file at that path replaces it. Upload the file between turns and wait for success before starting the next turn.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
A file to materialize in the environment, supplied either as an uploaded Files API file or as standard-base64-encoded inline data.
A 400 is returned when the request is invalid; a 401 when authentication or project context is missing; a 403 when the API key lacks the required permission; a 404 when the requested session or event is not found; and a 409 when the request conflicts with the current session state. A 429 indicates that the Files API rate limit for your user has been exceeded; a 500 indicates an internal error; and a 503 indicates that the service is temporarily unavailable. The body must match one of its two variants: type must be file_id with file_id and path, or inline with data and path.