Generate a 3D model— in three steps

  1. Create a new flow.
  2. Wait until it is complete.
  3. Download the 3D model.
Read the Quickstart
quickstart.py
import base64
import requests
import time

API_KEY = "your-api-key-here"
BASE_URL = "https://flows.generio.ai"
headers = {"Authorization": f"Bearer {API_KEY}"}

payload = {
    "template": "model_generate_fromprompt",
    "parameters": {"quality": "high"},
    "inputs": [{"data": "A modern office chair"}],
}


### Create a new flow

flow = requests.post(
    f"{BASE_URL}/flows",
    headers=headers,
    json=payload
).json()

flow_url = f"{BASE_URL}/flows/{flow['flow_id']}"


### Wait until the flow is complete (polling)

while True:
    status = requests.get(flow_url, headers=headers).json()
    if status["state"] != "running":
        break
    time.sleep(5)

if status["state"] != "completed":
    raise SystemExit(status["state"])


### Download your 3D model

asset_id = requests.get(
    f"{flow_url}/outputs",
    headers=headers
).json()["outputs"][0]["asset_id"]

data = requests.get(
    f"{flow_url}/outputs/{asset_id}?include_data=true",
    headers=headers,
).json()["data"]

binary = base64.b64decode(data.split(",", 1)[1])
with open(f"model_{asset_id}.glb", "wb") as f:
    f.write(binary)

Community & Support

Join the community or reach out - we're here to help

Email Support

Stuck? Reach out directly. We will help you solve it.

Contact Us
Linkedin

Follow us on Linkedin and stay updated with our latest news.

Visit Linkedin
GitHub

Report issues, request features, or contribute to the ecosystem.

View on GitHub