Skip to content
中文

Upload Computer Attachment

Call Create computer first and replace cmp_123 with its returned ID.

POST/agent/v1/computers/{computer_id}/attachments● Supported

Request parameters

  • computer_idstringrequired

    path: Computer id (cmp_...), as returned by computers.create or computers.list.

  • namestringrequired

    query: Single filename, at most 255 UTF-8 bytes, excluding slash, dot segments and control characters.

Returns

201

Own-face superset: Managed Agents has no persistent Computer attachment directory. User uploads overwrite the same name; agents retain read-only access. Run-token uploads return 403 READ_ONLY. name is one filename of at most 255 UTF-8 bytes; MIME is inferred from the extension; custom Content-Type is not persisted and digest may be absent. Limit 16 MiB (413); invalid names return 400. Archived computers accept uploads; foreign computers return 404.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Request

curl
# Call Create computer first and replace cmp_123 with its returned ID.
curl -X POST "https://api.deepraxis.com/agent/v1/computers/cmp_123/attachments?name=sample.txt" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" -H "Content-Type: text/plain" --data-binary @sample.txt
Python
# Call Create computer first and replace cmp_123 with its returned ID.
import requests

opts = dict(
    base_url="https://api.deepraxis.com/agent",
    api_key="$PRAXIS_API_KEY",
)

with open("sample.txt", "rb") as file:
    resp = requests.post(f"{opts['base_url']}/v1/computers/cmp_123/attachments?name=sample.txt", headers={"Authorization": f"Bearer {opts['api_key']}", "Content-Type": "text/plain"}, data=file)
resp.raise_for_status()
print(resp.json())
TypeScript
// Call Create computer first and replace cmp_123 with its returned ID.
const opts = {
  baseURL: "https://api.deepraxis.com/agent",
  apiKey: "$PRAXIS_API_KEY",
};

const { readFile } = await import("node:fs/promises");
const resp = await fetch(`${opts.baseURL}/v1/computers/cmp_123/attachments?name=sample.txt`, { method: "POST", headers: { Authorization: `Bearer ${opts.apiKey}`, "Content-Type": "text/plain" }, body: await readFile("sample.txt") });
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json());

Response 201

{
  "path": "/attachments/sample.txt",
  "name": "sample.txt",
  "type": "file",
  "size": 11,
  "mime_type": "text/plain",
  "read_only": true,
  "digest": "17c8f4932d26f6434e3be45968859b3bac3f133b3ca024004659cc20af325ae2",
  "updated_at": "2026-10-11T10:34:57.989Z"
}

Response

HTTP 201

Computer result

application/json

Name Type Description
path string Absolute path of the entry on the computer.
name string Name of the entry or object.
type string Kind of entry: a file, a directory or a symbolic link.
size integer Size in bytes.
mime_type string MIME type of the file.
read_only boolean True when the entry cannot be modified through the API.
digest string | null Content digest of the file; null when not computed.
updated_at string | null RFC 3339 time at which the object was last modified.