Skip to content

Call Vexly from Python

Use Python when you want a small script, cron job, or backend worker to trigger Vexly runs.

Example

import os
import requests

base_url = os.getenv("VEXLY_BASE_URL", "https://api.vexly.io/api/v1/public")
token = os.environ["VEXLY_ACCESS_TOKEN"]

headers = {
    "Authorization": f"Bearer {token}",
    "Content-Type": "application/json",
}

run = requests.post(
    f"{base_url}/agent/runs",
    headers=headers,
    json={"prompt": "Review last week's performance across all connected services and return the top 5 changes or risks."},
    timeout=30,
).json()

status = requests.get(
    f"{base_url}/agent/runs/{run['run_id']}",
    headers=headers,
    timeout=30,
).json()

print(status)

Reference Repo