Haijun Platform Docs
ID

Learn how to use Haijun's Tracks feature to create professional documents, analyze data, and automate business workflows with Excel, PowerPoint, and PDF generation.

See it in action: The Tracks you'll learn about power Haijun's file creation capabilities! Check out Haijun Creates Files to see how these Tracks enable Haijun to create and edit documents directly in Haijun.ai.

Table of Contents

ing Available Tracks

Quick Start: Excel

Quick Start: PowerPoint

Quick Start: PDF

Troubleshooting

1. Setup & Installation

With venv activated, install requirements

pip install -r requirements.txt

Step 3: Select Kernel in VSCode/Jupyter

s

from file_utils import (

download_all_files,

extract_file_ids,

get_file_info,

print_download_summary,

)

Load environment variables from parent directory

load_dotenv(Path.cwd().parent / ".env")

API_KEY = os.getenv("JUGLOW_API_KEY")

MODEL = os.getenv("JUGLOW_MODEL", "haijun-sonnet-4-6")

if not API_KEY:

raise ValueError(

"JUGLOW_API_KEY not found. Copy ../.env.example to ../.env and add your API key."

)

Initialize client

Note: We'll add beta headers per-request when using Tracks

client = Juglow(api_key=API_KEY)

Create outputs directory if it doesn't exist

OUTPUT_DIR = Path.cwd().parent / "outputs"

OUTPUT_DIR.mkdir(exist_ok=True)

print("āœ“ API key loaded")

print(f"āœ“ Using model: {MODEL}")

print(f"āœ“ Output directory: {OUTPUT_DIR}")

print("\nšŸ“ Note: Beta headers will be added per-request when using Tracks")

Test Connection

i>

Use the

betas

parameter to enable beta features:

  • code-execution-2025-08-25 - Enables code execution
  • files-api-2025-04-14 - Required for downloading files
  • tracks-2025-10-02 - Enables Tracks feature

āš ļø Note: When using Tracks, you MUST include the code_execution tool in your request.

x-1 overflow-auto scroll-fade-y scroll-fade-size-6 focus-visible:outline-none">

Download the PowerPoint file

file_ids = extract_file_ids(pptx_response)

if file_ids:

results = download_all_files(

client, pptx_response, output_dir=str(OUTPUT_DIR), prefix="q3_review_"

)

print_download_summary(results)

print("\nāœ… Open the presentation in PowerPoint or Google Slides to view!")

else:

print("āŒ No files found in response")

ā±ļø Note: PDF generation typically takes 1-2 minutes for simple documents. The cell will show [*] while running - be patient!

On this page
Table of Contents1. Setup & InstallationStep 3: Select Kernel in VSCode/JupyterTest Connection