Beato Docs

Python

Beato API client and runnable example for Python.

Download the Python SDK

Run the example

Extract the archive and run these commands inside its directory. The example lists public models by default. To submit a job, set BEATO_API_KEY and BEATO_IDEMPOTENCY_KEY in your environment.

python3 example.py

Example source

import json
import os
import time

from beato import Beato

client = Beato(os.getenv("BEATO_API_KEY", ""), os.getenv("BEATO_API_BASE_URL", "https://api.beato.app"))
key = os.getenv("BEATO_IDEMPOTENCY_KEY")
if key:
    result = client.create_job({"model": "nano-banana", "prompt": "A watercolor of a rainy street"}, key)
    for _ in range(60):
        if result["status"] in {"succeeded", "failed"}:
            break
        time.sleep(5)
        result = client.get_job(result["id"])
else:
    result = client.models()
print(json.dumps(result))