Get an API key
Concepts

Machines are storages

The machine running the SDK registers itself on your account the first time it exchanges a key. That is what gives an agent somewhere to work, and it is why its files never leave the machine.

registered on first callfiles stay local
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

The idea

A storage is anywhere your data lives, and the list is deliberately mixed: a computer, a browser device, managed cloud storage, and databases or buckets you connect with your own credentials. They differ in where the bytes are — not in how you reach them.

KindWhere its data isReached with
computeron that machine, under ~/.iagenify/filesstorage.files
phonein that browsera files bridge you supply
IaGenify Cloudmanaged for youstorage.run()
connected database or bucketwith your provider, your credentialsstorage.run()

How a machine arrives

You do not register it. On the first key exchange the SDK reports the machine id, the environment and the detected resources, and the machine appears in the list. It keeps the same identity afterwards because the storage id is cached with the session.

const pc = await api.storage.get();   // this machine

pc.id;
pc.type;        // "filesystem"
pc.hostname;
pc.isDefault;

await api.storage.list();             // every storage on the account
pc = api.storage.get()   # this machine

pc.id
pc.type          # "filesystem"
pc.machine_id
pc.is_default

api.storage.list()       # every storage on the account

Why a computer keeps its files

A computer storage holds no bytes on the server, and that is enforced rather than merely intended: an upload aimed at one is refused with storage_is_local. An agent working there reads and writes through the machine itself.

// Refused — a computer is not a destination for an upload
await api.files.create({ name: "notes.md", content }).save({ localOnly: false });
// IaGenifyError: storage_is_local

// This is the way: the file is written on the machine
await pc.files.write("notes.md", content);
# Refused — a computer is not a destination for an upload
api.files.create(name="notes.md", content=content).save(local_only=False)
# IaGenifyError: storage_is_local

# This is the way: the file is written on the machine
pc.files.write("notes.md", content)

The default storage

Every account has one, and it is where a save with no destination goes. A computer is a poor default for that reason — it cannot receive one — so the default normally points at managed cloud storage.

await api.getStorage();              // the default
await api.storage.remove(id);        // allowed even for the default
                                     // another storage inherits the flag
api.get_storage()             # the default
api.storage.remove(storage_id)  # allowed even for the default:
                                # another storage inherits the flag