---
title: "AI + Python in Excel with xlwings Lite - LLM API Calls | Part 3"
slug: ai-python-excel-xlwings-lite-llm-api-calls-part-3
date_published: 2025-04-07T11:07:15.504Z
original_url: https://www.tigzig.com/post/ai-python-excel-xlwings-lite-llm-api-calls-part-3
source: migrated
processed_at: 2025-12-02T10:00:00.000Z
---

# AI + Python in Excel with xlwings Lite - LLM API Calls | Part 3

Ability to make API calls from xlwings Lite gives it superpowers.

Check out dedicated xlwings LIte info page on [REX AI Co Analyst](https://tigzig.com/xlwings-llm-api) site

* Full templates
* How-to guides
* Backend code
* Technical breakdowns
* Resource Links

**Detailed info , source codes, how-to guides, resources and templates available on REX**

Call LLMs and AI Agents. Parse. Analyze. Automate. All from Excel.

Previously showed how to connect Excel to Postgres, run SQL, perform analysis, EDA, and build an XGBoost model - all inside Excel with xlwings Lite. Now showing how to use API calls to LLMs for schema detection (column names, types) to automate workflows.

## In this example

* Gemini (2.0-Flash) and OpenAI (GPT-4o) with structured output - JSON
* Schema detection followed by EDA tables and plots
* API call with requests / httpx… earlier pyFetch
* Best start: Gemini -free - fast - no card needed - aistudio.google.com
* Recent months Flash better than 4o for schema detection
* LLM vs Python for schema detect - my experience

## AI + API powered Excel - few use cases

* Automated workflows connected to API backends
* Web scraping in/out of Excel - AI & non-AI
* AI-enabled web research into Excel
* Automated text classification and summarization
* Text-to-SQL with Excel as frontend (see Part 2)
* AI agent integration via API

## How I use LLM API calls in projects

Half my client projects are automation-focused, with many requiring LLM API calls with structured output as part of the workflow. Use cases include schema detection, data extraction, non-standard file cleanup, and OCR-based web scraping.

I've shared some live apps (open source) on tigzig.com. The Mutual Fund Processor app uses schema detection to identify column structure, data placement, and validation totals to convert messy monthly MF Excel files to CSV, with a choice of LLM model selection. The REX Co-Analyst app includes file upload to a remote database, using schema detection to identify field names and types for table creation before upload.

Feel free to try them out. No API key or DB credentials required. How-to links below.

## xlwings Lite

Embedded mini code editor, console logs, robust object model - run complex workflows, add packages, make API calls - all from Excel. Created by [Felix Zumstein](https://www.linkedin.com/in/felix-zumstein/) - free, simple, and powerful Python-in-Excel.

## Useful Links

* **Montecarlo simulation. With superbly designed dashboards.** Check out this excellent share by FRANCO SIVILA. [https://lnkd.in/ghAsXgW5](https://lnkd.in/ghAsXgW5)

* **xlwings Lite | Part 2 | - API, SQL, DBs, ML in Excel** [xlwings Practice Lab](/xlwings-starter)

* **Excellent docs at:** [lite.xlwings.com](https://lite.xlwings.com)



xlwings Lite official site: [lite.xlwings.org](https://lite.xlwings.org)
