← Latest papers
🤖 machine learning

Benchmarking Web API Integration Code Generation

This paper introduces WAPIIBench, a dataset and evaluation pipeline revealing that current open-source large language models struggle significantly with generating correct web API integration code, achieving less than 40% success due to issues like hallucinated endpoints and incorrect argument usage.

Original authors: Daniel Maninger, Leon Chemnitz, Amir Molzam Sharifloo, Jannis Brugger, Mira Mezini

Published 2026-07-07
📖 4 min read☕ Coffee break read

Original authors: Daniel Maninger, Leon Chemnitz, Amir Molzam Sharifloo, Jannis Brugger, Mira Mezini

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to teach a very smart, well-read robot how to order a specific meal from a massive, complex restaurant menu. The menu isn't just a list of dishes; it's a strict set of rules about how to write your order, which buttons to press, and exactly what ingredients to list. If you get even one detail wrong, the kitchen rejects the order.

This paper is about testing how well these "robots" (which are actually Large Language Models, or LLMs—the same technology behind AI chatbots) can write the code needed to send these orders to real-world web services (like Google Calendar, Slack, or Asana).

Here is a breakdown of what the researchers did and what they found, using simple analogies:

The Problem: The "Magic" Isn't Magic Yet

Developers use "Web APIs" to make different software talk to each other. It's like connecting Lego blocks. Usually, humans have to write the instructions to snap these blocks together. The hope was that AI could do this automatically.

The researchers asked: Can an AI look at a simple request like "Add a new event to my calendar" and write the perfect, error-free code to make that happen?

The Experiment: Building a "Driving Test" for AI

To find out, the team built a special test called WAPIIBench. Think of it as a driving test for AI code.

  1. The Course: They created 395 specific "driving scenarios" using four popular real-world services (Asana, Google Calendar, Google Sheets, and Slack).
  2. The Rules: They used the official "driver's manuals" (OpenAPI specifications) for these services to know exactly what a correct order looks like.
  3. The Test: They gave the AI a prompt (e.g., "Create a new calendar") and asked it to write the code.
  4. The Check: Instead of just reading the code to see if it looks right, they actually tried to run it in a safe, controlled sandbox. If the code tried to send an order to a non-existent address or used the wrong ingredients, the test failed.

The Results: The AI Gets Lost Often

The results were a bit disappointing for those hoping for instant automation.

  • The Score: Even the best open-source AI models only got about 30% to 40% of the tasks completely correct. The very best commercial model (GPT-4o) did better, hitting around 60-77%, but that still means it failed nearly a third of the time.
  • The "Hallucinations": This is the biggest issue. The AI often made things up.
    • Fake Addresses: The AI would invent URL addresses that didn't exist (like telling a taxi driver to go to "123 Fake Street" when the restaurant is actually at "456 Main St"). This happened in up to 39% of cases.
    • Wrong Ingredients: The AI would include parameters (ingredients) that the service didn't accept, or miss ones that were required.
  • Partial Success: The AI was good at remembering the general shape of the code (like knowing it needs to use the POST method, which is like knowing you need to "place an order" rather than "cancel one"). But when it came to the specific details of where to send it and exactly what to say, it struggled to put the pieces together correctly.

A Few Surprising Twists

  • Bigger Isn't Always Better: Sometimes, a medium-sized AI model performed worse than both a tiny one and a huge one. It's like a student who studied too hard for the wrong test and got confused.
  • Memory vs. Understanding: The AI seemed to have "memorized" parts of the manuals from its training data. It knew some URLs and argument names, but it couldn't reliably combine them to solve a new, specific problem. It was like a student who memorized the answers to last year's math test but couldn't solve this year's problems.
  • The "Fill-in-the-Blank" Trick: When the researchers gave the AI the correct address (URL) and just asked it to fill in the rest, the AI did much better. This suggests the AI knows how to follow instructions if it doesn't have to guess the destination first.

The Bottom Line

The paper concludes that while AI is getting good at writing code, it is not yet reliable enough to automatically connect software systems without human supervision. If you let an AI write code to connect your business apps to the internet right now, it will likely send your data to the wrong place or break the connection about 60% to 70% of the time.

The researchers say we need better safety checks and new ways to help the AI "look up" the rules in real-time (rather than relying on memory) before we can trust it to build these connections on its own.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →