# Resource reference

Canonical URL: https://developers.iagenify.com/sdk/python/resources/
Language: en

Python method names and call shapes for resources on IaGenify(api_key=...). Optional arguments are keyword arguments; results are returned synchronously.

Status: snake_case callbacks · keyword arguments · no await

## Client methods {#client}

```python
api.get_user()
api.catalogue()
api.get_storage()
api.session()
```

## Models {#models}

```python
assistant = api.models.create(model="gemini-3.5-flash", settings={"instructions": "Be concise."})
assistant.generate(inputs=[{"type": "text", "content": "Hello"}])
assistant.get_history()
api.models.turn(model="gemini-3.5-flash", messages=[{"role": "user", "content": "Hello"}])
api.models.list(limit=30)
api.models.get(assistant.id)
```

### Images and structured input

```python
# Keep each input part explicit. Image URLs and workspace paths use the same
# server-side input contract as the JavaScript SDK.
result = assistant.generate(inputs=[
    {"type": "text", "content": "Compare these two versions."},
    {"type": "image", "url": "https://example.com/before.png"},
    {"type": "image", "path": "./after.png"},
])

# A vision input already held by the application can be sent as base64.
result = assistant.generate(inputs=[
    {"type": "text", "content": "Describe this image."},
    {"type": "image", "content": png_base64, "mime": "image/png"},
])

# Models that accept passage ranking use a passages part.
ranked = assistant.generate(inputs=[
    {"type": "text", "content": "Which passage answers the question?"},
    {"type": "passages", "content": [chunk_a, chunk_b, chunk_c]},
])
```

### File objects

```python
from pathlib import Path

document = api.files.create(
    name="brief.md",
    content=Path("brief.md").read_bytes(),
    mime_type="text/markdown",
)
saved = document.save(storage_id=storage_id)
print(document.source_id, document.location, saved.get("ok"))

loaded = api.files.get(document.source_id)
print(loaded.name, loaded.content)
loaded.content = b"Updated brief\n"
loaded.update()
api.files.delete(document.source_id)
```

### Search, fetch and conversion

```python
results = api.search.search(query="Python packaging standards")
page = api.fetch.fetch(url="https://example.com/guide")

with open("report.docx", "rb") as source:
    markdown = api.convert.convert(
        from_format="docx",
        to="markdown",
        file=source,
    )
```

### Connected storage

```python
storage = api.storage.get()  # the default connected storage
if storage is not None:
    summary = storage.run(action="overview")
    print(summary)

storages = api.storage.list()
usage = api.cloud.usage()
```

## Agents {#agent}

```python
agent = api.agents.create(runtime="local", model="gemini-3.5-flash", machine=api.storage.get(), mode="ask", on_permission=lambda request: "once")
result = agent.run(message="Read the project README and summarize it.")
```

### Server agent

```python
model = api.models.create(model="gemini-3.5-flash", memory=False)
agent = api.agents.create(
    model=model,
    tools={"search": api.tools.search},
    max_steps=8,
    budget=30,
)
result = agent.run(
    inputs=[{"type": "text", "content": "Find recent Python packaging guidance."}],
    on_step=lambda step: print(step),
)
```

## Resource method inventory {#services}

| Python resource | Methods and child resources |
| --- | --- |
| auth / keys | `auth.logout()`, `auth.revoke_session(id)`, `auth.update_profile(...)`; `keys.list()`, `keys.revoke(id)` |
| models / memory | `models.create/get/list/turn()`; session `generate/get_history/destroy()`; `memory.list/save/delete()` |
| files / storage | `files.create/get/list/delete()`; file `save/update()`; storage `connect/create/device/get/list/local/remove()`; connected storage `run()` |
| cloud / tools | `cloud.usage()`, `cloud.addons.buy()`; `search.search()`, `fetch.fetch()`, `convert.convert()`; `tools.search/fetch/screenshot/convert/list_documents/read_document/write_document/create_folder/move_document/delete_document/query_storage` |
| agents | `agents.create/get/list()`; server agent `run/stop/destroy()`; local agent `run/get_history/compact/checkpoints/rewind/stop/destroy()`; `agents.skills` and `agents.subagents` libraries. |
| workflows | `workflows.create/get/get_run/list()`; workflow `run/runs/run_step/update/destroy()`; run `refresh/wait/resume/retry/cancel()` |
| domains | `domains.add/expiring/get/list/remove/search/servers/tlds()`; domain `attach/attachments/check/detach/migration/owner/serve/tls/unserve/verify/remove()`; child `records`, `dnssec`, `redirects`, `mail` |
| mail | `mail.create/get/list/remove/usage()`; mailbox `send/update/forward/remove()`; child `aliases`, `messages`, `contacts` |
| hosts / compute | `hosts.create/get/kinds/list/remove/usage()`; host `deploy/deploys/update/rollback/usage/remove()`; `compute.status/exec()` and `compute.terminals` |
| MCP | `mcp.connect/list/get/update/call/disconnect/for_agent/tools()`; standalone `McpClient.initialize/list_tools/call/close()` |

## Python helper exports {#functions}

```python
from iagenify import (
    AGENT_MODES, MEDIA_OPTIONS, PROMPT_OPTIONS,
    parse_prompt, parse_token_count, storage_slug,
    sanitize_schema, tool_name_for, create_mcp_tools,
    LocalFiles, LocalTerminals, LocalLibrary, AccountLibrary,
)

tokens = parse_token_count("1.5M")
options = MEDIA_OPTIONS["image"]
```

## Agent tool behavior {#tools}

> **Tool declarations and local execution are different surfaces**
>
> Python's api.tools.image/video/voice/music entries are agent-only declarations, matching the JS SDK contract; they do not call standalone image or media routes. The Python local agent executes workspace and shell tools, web search and fetch, storage and document actions, memory, workflow, MCP, skills, bounded subagents, custom Python tools, and media generation. Autonomous mail, DNS, and deployment actions are not included in Python 0.1.0.

> **This is a 0.2 reference, not a promise of complete parity**
>
> The Python resource reference lists the callable Python surface. See the relevant Python example beside each JavaScript example for its Python equivalent or a clearly marked runtime limitation.

## Brands {#brand}

```python
brand = api.brand.create(name="Qahwa Lab", logos=[{"path": "logo.svg", "main": True}])
brand.update(identity={"tagline": "Roasted every morning"})
brand.palette.set([{"hex": "#6B3E26", "role": "primary"}])
brand.assets.add({"cloud": "Brand/storefront.jpg", "role": "hero"})
brand.logos.main, brand.palette.role("primary"), brand.completeness
api.brand.list(); api.brand.get(brand.id); api.brand.remove(brand.id)
```

## Writing while the agent works {#queue}

`agent.run()` blocks, so `agent.queue()` is called from another thread. It is thread-safe, and answers like the JavaScript call.

```python
import threading

worker = threading.Thread(target=lambda: agent.run(message="Clean up the Notes folder"))
worker.start()
agent.queue("Also keep a copy of plan.md")   # {"queued": True, "id": "u1", "position": 1}
worker.join()
```
