# IaGenify in Python

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

`pip install iagenify`

A synchronous Python client with Python keywords, direct return values, and no await. Python equivalents are included alongside the JavaScript SDK examples; what Python does not have is marked in the Python blocks.

Status: Python 3.10+ · synchronous · iagenify 0.2.0

## Install {#install}

```bash
python -m pip install iagenify
```

## A model session {#quickstart}

```python
import os
from iagenify import IaGenify

with IaGenify(api_key=os.environ["IAGENIFY_API_KEY"]) as api:
    assistant = api.models.create(
        model="gemini-3.5-flash",
        settings={"instructions": "Answer in French, in at most three sentences."},
    )
    result = assistant.generate(
        inputs=[{"type": "text", "content": "Résume ce contrat."}]
    )
    print(result["outputs"])
    print(result["usage"]["credits"])
```

## The Python spelling {#syntax}

| JavaScript SDK | Python SDK |
| --- | --- |
| new IaGenify({ apiKey }) | IaGenify(api_key=...) |
| await api.models.create({ model }) | api.models.create(model=...) |
| await assistant.generate({ inputs }) | assistant.generate(inputs=...) |
| api.getUser() | api.get_user() |
| api.getStorage() | api.get_storage() |
| onText | on_text |
| onPermission | on_permission |
| maxSteps | max_steps |

## Resources {#resources}

The Python client exposes auth, keys, models, memory, files, storage, cloud, search, fetch, convert, agents, workflows, domains, mail, hosts, compute, MCP, and brand. See the [Python resource reference](/sdk/python/resources).

## Where it runs {#runtimes}

Use it in Python scripts, notebooks, CLI tools, or backend applications such as Flask, Django, and FastAPI. The client is synchronous. In async handlers, call it in a worker thread. It is not a React-style UI library, and IaGenify Hosts currently deploys static sites and edge JavaScript modules rather than persistent Python servers.

## SDK feature parity {#parity}

> **What Python 0.2.0 does**
>
> The Python package includes synchronous resource clients and a Python-native local agent with durable local sessions recorded on the account, image inputs, checkpoints and rewind, MCP injection, custom tools, skills and subagent delegation, shell, storage, document and workflow tools, image, video, voice and music generation, agent.queue() to write while it works, and the platform-service tools of the JavaScript engine: deploy, mail, send_mail (HTML, Bcc and attachments), domain, cloud, document, generate, brand, iagenify_docs and mcp. Permissions follow the JavaScript rules: sending, publishing and spending credits are asked on every call, in every mode. A session started with memory can be reopened on another machine from the account, text only. Python estimates context size for clearing and compaction; it reads the model context window from the catalogue when available. Every guide page has a JavaScript / Python switch on its code blocks.

## Errors {#errors}

```python
from iagenify import IaGenifyError, NotEnoughCredits

try:
    answer = assistant.generate(inputs=[{"type": "text", "content": "Hello"}])
except NotEnoughCredits as error:
    print(error.required, error.available)
except IaGenifyError as error:
    print(error.status, error.code, error.details)
```
