Evaluating and Mitigating Errors in LLM-Generated Web API Integrations

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Maninger, Daniel, Chemnitz, Leon, Sharifloo, Amir Molzam, Lamba, Tushar, Brugger, Jannis, Mezini, Mira
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866911324774072320
author Maninger, Daniel
Chemnitz, Leon
Sharifloo, Amir Molzam
Lamba, Tushar
Brugger, Jannis
Mezini, Mira
author_facet Maninger, Daniel
Chemnitz, Leon
Sharifloo, Amir Molzam
Lamba, Tushar
Brugger, Jannis
Mezini, Mira
contents API integration is a cornerstone of our digital infrastructure, enabling software systems to connect and interact. However, as shown by many studies, writing or generating correct code to invoke APIs, particularly web APIs, is challenging. Although large language models (LLMs) have become popular in software development, their effectiveness in automating the generation of web API integration code remains unexplored. In order to address this, we present WAPIIBench, a dataset and evaluation pipeline designed to assess the ability of LLMs to generate web API invocation code. Our experiments with several open-source LLMs reveal that generating API invocations poses a significant challenge, resulting in hallucinated endpoints, incorrect argument usage, and other errors. None of the evaluated open-source models was able to solve more than 40% of the tasks. Motivated by those findings, we explore the potential of constrained decoding for generating API invocations. To this end, we propose an automatic translation from API specifications to constraints. Our approach prevents violations of API usage rules and significantly increases the overall correctness of the generated code, on average by 90% and 135%, depending on the provided starter code.
format Preprint
id arxiv_https___arxiv_org_abs_2509_20172
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Evaluating and Mitigating Errors in LLM-Generated Web API Integrations
Maninger, Daniel
Chemnitz, Leon
Sharifloo, Amir Molzam
Lamba, Tushar
Brugger, Jannis
Mezini, Mira
Software Engineering
Machine Learning
API integration is a cornerstone of our digital infrastructure, enabling software systems to connect and interact. However, as shown by many studies, writing or generating correct code to invoke APIs, particularly web APIs, is challenging. Although large language models (LLMs) have become popular in software development, their effectiveness in automating the generation of web API integration code remains unexplored. In order to address this, we present WAPIIBench, a dataset and evaluation pipeline designed to assess the ability of LLMs to generate web API invocation code. Our experiments with several open-source LLMs reveal that generating API invocations poses a significant challenge, resulting in hallucinated endpoints, incorrect argument usage, and other errors. None of the evaluated open-source models was able to solve more than 40% of the tasks. Motivated by those findings, we explore the potential of constrained decoding for generating API invocations. To this end, we propose an automatic translation from API specifications to constraints. Our approach prevents violations of API usage rules and significantly increases the overall correctness of the generated code, on average by 90% and 135%, depending on the provided starter code.
title Evaluating and Mitigating Errors in LLM-Generated Web API Integrations
topic Software Engineering
Machine Learning
url https://arxiv.org/abs/2509.20172