Papers
Topics
Authors
Recent
2000 character limit reached

From Specification to Service: Accelerating API-First Development Using Multi-Agent Systems (2510.19274v1)

Published 22 Oct 2025 in cs.SE

Abstract: This paper presents a system that uses 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

Summary

  • The paper demonstrates a multi-agent approach that translates natural language API specifications into functional RESTful microservices.
  • It utilizes LLM-generated OpenAPI specs, server code conversion, and Docker deployment for systematic automation.
  • The system's iterative feedback loop effectively refines code, reducing manual debugging and improving alignment with benchmark specifications.

From Specification to Service: Accelerating API-First Development Using Multi-Agent Systems

This essay explores the effective use of LLMs within a multi-agent system framework to automate the lifecycle of API-first development. It demonstrates the capabilities of such systems in translating natural language requirements into functioning RESTful microservices while addressing potential real-world challenges in deployment environments.

System Overview and Objectives

The core objective of the system is to automate the transformation of natural language specifications into deployable RESTful microservices using an API-first approach. The system emphasizes microservice architecture for scalability and modularity, leveraging OpenAPI specifications to design endpoints before implementation. This process ensures consistency across API interactions, encourages reusability of service logic, and supports efficient integration.

Microservice Architecture Visualization:

Figure 1

Figure 1: A diagram illustrating the components and communication structure in a microservice architecture.

The system employs LLM-based multi-agent architecture where each agent specializes in a unique task. These tasks include specification generation, server code generation, and iterative code refinement. By processing OpenAPI specifications, agents produce and update server code capable of CRUD operations via RESTful services.

Technical Implementation

OpenAPI Specification Generation

Initially, the system utilizes an LLM to interpret high-level service requirements and create an OpenAPI specification. The specification adheres to RESTful principles, facilitating endpoint design with defined data models and operations.

Specification Generation Process:

Figure 2

Figure 2: Steps involved in generating OpenAPI specifications from natural language.

Code Generation and Deployment

Once the specification is confirmed, a multi-agent workflow generates server-side code. The workflow includes:

  • Server Code Generation: Converts OpenAPI into structured JSON reflecting the server's codebase.
  • JSON Cleanup: Ensures parsed JSON integrity before file system creation.
  • Deployment: Utilizes Docker to containerize and execute the server code.

Server Code Generation Process:

Figure 3

Figure 3: Illustrates the stages of converting OpenAPI specifications into executable server code.

Log Analysis and Iterative Feedback

The system integrates a feedback loop for runtime validation. Execution logs and error traces guide the LLM in refining code, offering fixes that the developers can automatically apply, drastically reducing manual debugging efforts.

Server Interaction and Feedback Loop:

Figure 4

Figure 4: Demonstrates the interaction between developers and running server for testing and code fixation.

Performance Evaluation

The system was tested using the PRAB benchmark to validate its ability to generate complete and functional APIs. Through iterative corrections, it successfully aligned generated specifications with ground truth.

OpenAPI Specification Testing

The system achieved high accuracy in generating OpenAPI definitions that closely matched benchmark specifications. The structural differences reduced over iterative improvements until functional equivalency was reached.

Specification Testing Results:

Figure 5

Figure 5: Structural differences over iteration cycles showing convergence to true specifications.

Code Generation Testing

Initial code generation attempts met partial success. While code largely adhered to intended API paths, initial runtime issues required system-led corrections. Subsequent refinements led to successful executions post-correction.

Code Execution and Correction:

Figure 6

Figure 6: Results from testing specification generation showcasing decreasing differences.

Implications and Future Work

The study illustrates a viable pathway for LLMs in software engineering automation. The ability of these systems to generate specifications and code efficiently prompts exploration into their role in broader software development tasks.

Future enhancements might focus on expanding the scope for larger specifications and integrating supervisor agents for component development. Additionally, refining prompts and broadening function-specific capabilities in function calling will improve the system's adaptability to complex command environments.

Conclusion

The proposed multi-agent system demonstrates significant strides in streamlining API-first microservice development. Through automated generation and iterative refinement, it offers a glimpse into how AI-driven systems may soon redefine software development, augmenting human capabilities with precision and speed.

Whiteboard

Open Problems

We found no open problems mentioned in this paper.

Collections

Sign up for free to add this paper to one or more collections.