AI-Assisted API Creation
The Create API with AI option allows you to quickly and easily create REST APIs with the help of artificial intelligence. It is an ideal feature for developers who want to save time and effort when creating APIs and optimize their workflow.
On this page, you will find everything about how this option works and how to use it.
Creating a new API with AI assistance
To create a new API with the help of artificial intelligence, click the + Create API button located in the upper right corner of the API Catalog screen and select the Create API with AI option.
For this feature to be available in your environment, request its activation from the product team through the support channel. |
The next screen will start a process consisting of five steps for API creation:
You can move forward through the steps using the Next button or go back to previous steps by clicking the Back button, both located in the lower right corner of the screens (when applicable). If there is any required field not filled in on the screen, the Next button will be disabled.
See below for information about each step.
Context
This is an optional step, where you can provide information about the context of the API you want to create. This is done by submitting links and files that will serve as knowledge sources for the AI model, helping it better understand your needs. You can add, for example, documents and links containing definitions of processes, nomenclatures, data structures, and relevant business rules. It is possible to add multiple links and files.
Links correspond to external knowledge sources (web page URLs). To add a new link, follow these steps:
-
Click the Add Link button, located in the upper right corner of the screen.
-
In the modal window that opens, enter the desired URL in the URL field.
-
Click the Save button to add the link.
Added links are displayed as cards in the Links section of the screen, with each card containing:
-
part of the entered URL;
-
date the link was added (Created at);
-
available actions:
-
copy the link;
-
edit it;
-
delete it.
-
Files correspond to documents you can upload to provide context to the AI model. Accepted formats are PDF, TXT, DOCX, and SQL, with a maximum size of 5MB per file. To add a new file, follow these steps:
-
Click the Add File button, located in the upper right corner of the screen.
-
In the modal window that opens, give a name for this context by typing it in the Context Name field and click the Select File button to select the desired file from your machine.
-
Click the Save button to upload the file.
Added files are displayed as cards in the Files section of the screen, with each card containing:
-
the context name;
-
the date the file was added (Created at);
-
file type (File type);
-
available actions:
-
edit it;
-
delete it.
-
Prompt
The second step in the API creation flow, Prompt, is required and allows you to provide a detailed description of the business requirements for the API to be generated. The content entered will be interpreted by the AI to generate the API structure, including endpoints, journeys, and the contract.
Enter the corresponding description text in the field on the screen. The entered text must be between 40 and 2000 characters. It is important to be as clear and specific as possible in the description so that the AI can understand your needs and generate an API that meets them. You can include details such as:
-
desired features;
-
use cases;
-
types of data the API should handle;
-
specific business rules;
-
integrations with other systems;
-
security requirements;
-
any other relevant information that helps the AI model understand your needs.
Journey
In the Journey step, you can view the business journeys of the API generated by the AI based on the information provided in the previous steps. Each journey represents a functional flow of the API (a resource), and its name and description will be used as the basis for defining the endpoints in the next step.
In this step, you can:
Journeys
The journeys identified by the AI are displayed in a list in the Journeys section of the screen. Each item represents a journey and contains:
-
journey name;
-
journey description;
-
available actions:
-
allows you to change the journey name or description;
-
deletes the journey.
-
In addition, there is the Add Journey button, located above the list of journeys on the right, which allows you to manually add a new journey to the list to cover flows not automatically detected by the AI.
Relevance Score
Below the Journeys section, there is the Relevance Score section, which displays the relevance level of the files and links provided as context in the Context step in relation to the entered prompt.
Each context is represented by a card containing:
-
context name;
-
relevance score.
This information is useful for assessing which contexts are most influential in generating the journeys. Higher scores indicate that the context content is more aligned with the prompt description, which can directly affect the quality of the generated journeys and endpoints.
Irrelevant or generic contexts can be discarded to avoid noise in the generation of journeys and endpoints. |
Endpoints
In the Endpoints step, you can view the endpoints generated by the AI based on the journeys created in the previous step. For each journey, one or more endpoints are generated. Each endpoint represents a specific operation that the API can perform and consists of an HTTP method, a path, and the corresponding description.
Each journey is displayed on the screen in a card containing:
-
Journey Name: identifies the journey;
-
Description: brief explanation of the journey’s purpose and features;
-
Endpoints table, with the following columns:
-
METHOD: HTTP method used (GET, POST, PATCH, etc.).
-
PATH: API route path representing the action.
-
SUMMARY: description of the endpoint’s purpose.
-
Below the endpoints table, there are also action buttons that allow you to:
-
modify or remove specific endpoints from the journey, as well as add new endpoints to it.
-
delete the journey and all its endpoints.
Contract
In the Contract step, you can view and download the API contract generated by the AI based on the information provided in the previous steps, as well as create the API directly in API Management.
The following contract metadata is displayed on the screen:
-
Contract: API name.
-
Version: Version of the generated contract.
-
OpenAPI: Version of the OpenAPI standard used to generate the contract.
-
Contract Description: Description of the contract.
Using the buttons located in the lower right corner, you can perform the following actions:
-
delete the contract.
-
view the contract in raw format (YAML).
-
view the contract as interactive documentation.
-
download the contract file.
-
Generate API: create the API in API Management based on the generated contract.
Share your suggestions with us!
Click here and then [+ Submit idea]