Skip to main content
This guide takes you from zero to a real .xlsx file on disk. You’ll get an API key, call POST /excel/generate, download the result, iterate on it with a second prompt, and learn how to skip polling entirely with a webhook.

Step 1: Get an API key

Step 2: Generate your first document

With OVERTEN_API_KEY set, submit a prompt and download the result. The call is synchronous by default and waits up to 300 seconds for the agent to finish.
import os, requests

API = "https://backend.overtenai.com/api/v1"
headers = {"Authorization": f"Bearer {os.environ['OVERTEN_API_KEY']}"}

# Submit the job
resp = requests.post(
    f"{API}/excel/generate",
    headers=headers,
    json={"prompt": "Create a sales report with summary statistics"},
)
resp.raise_for_status()
result = resp.json()
print(f"run_id={result['run_id']} credits_used={result['credits_used']}")

# Download the result
download = requests.get(result["download_url"])
with open("sales_report.xlsx", "wb") as f:
    f.write(download.content)
print("Saved to sales_report.xlsx")
Open sales_report.xlsx in any spreadsheet app — the agent will have built headers, filled rows, and added at least one summary or chart based on the prompt.

Step 3: Iterate on the same document

Pass the run_id from step 2 back to resume the same document. The agent already knows the sheet structure, so the second turn is significantly cheaper than the first:
resp2 = requests.post(
    f"{API}/excel/generate",
    headers=headers,
    json={
        "run_id": result["run_id"],
        "prompt": "Now add a chart comparing regions over the last 4 quarters",
    },
)
Resume works the same way across all three generation endpoints. See Runs and tasks for the full resume semantics.

Step 4: Skip polling with a webhook

If you don’t want to block on the sync response, submit with async: true and a webhook_url. The API returns immediately with a task_id, and posts the finished result to your endpoint when the run completes:
resp = requests.post(
    f"{API}/excel/generate",
    headers=headers,
    json={
        "prompt": "Create a Q3 sales report",
        "async": True,
        "webhook_url": "https://myapp.example.com/webhooks/overten",
    },
)
# → {"run_id": "run_...", "task_id": "task_...", "status": "queued"}
For the webhook payload shape and signature verification, see Webhooks.

What’s next

Format guides

Real-world examples for Word, Excel, and Slides.

Edit URL

Embed the Overten editor in your own app.

Preflight validation

How we catch bad requests before they cost credits.

API reference

Try every endpoint from the browser.