From Specification to Service: Accelerating API-First Development Using Multi-Agent Systems
Saurabh Chauhan, Zeeshan Rasheed, Malik Abdul Sami, Kai-Kristian Kemell, Muhammad Waseem, Zheying Zhang, Jussi Rasku, Mika Saari, Pekka Abrahamsson
TL;DR
The paper presents an end-to-end LLM-based multi-agent system that automates the OpenAPI-first development lifecycle for RESTful microservices by autonomously generating OpenAPI specifications, producing server code, and refining outputs through a runtime log-driven feedback loop. The system operates locally, enabling environment-specific validation and fixes via function-calling-enabled LLM agents, and is evaluated using the PRAB benchmark. Results show 100% accuracy in OpenAPI spec generation for the tested PRAB specs, with all seven specifications eventually yielding aligned server code; five of seven projects ran in Docker containers on first attempt, while two required fixes. The work demonstrates a practical, automated pathway for API-first development and highlights areas for improvement, such as stricter conformance to folder structures and scaling to larger specifications, with open-source code and benchmarks available for validation.
Abstract
This paper presents a system that uses Large Language Models (LLMs)-based agents to automate the API-first development of RESTful microservices. This system helps to create an OpenAPI specification, generate server code from it, and refine the code through a feedback loop that analyzes execution logs and error messages. The integration of log analysis enables the LLM to detect and address issues efficiently, reducing the number of iterations required to produce functional and robust services. This study's main goal is to advance API-first development automation for RESTful web services and test the capability of LLM-based multi-agent systems in supporting the API-first development approach. To test the proposed system's potential, we utilized the PRAB benchmark. The results indicate that if we keep the OpenAPI specification small and focused, LLMs are capable of generating complete functional code with business logic that aligns to the specification. The code for the system is publicly available at https://github.com/sirbh/code-gen
