Skip to main content
Experimental API Lab now offers a set of AI-powered features designed to simplify core stages of the API development lifecycle. These include renaming of API requests, generation of structured request payloads, and scripting capabilities for pre-request logic and test cases.

Enable AI-powered features

To activate AI-powered features, follow these steps:
  1. Open the Settings page within the API Lab application.
  2. Scroll to the Experiments section.
  3. Toggle the AI Experiments option to enable the features.

Rename API Requests

When saving an API request to a collection, click the Modify with AI icon ( .⟡⁺ ) next to the request name field to have the system automatically assign a name based on the request’s context and properties. Alternatively, you can use this feature to rename the pre-saved requests. You can even customize the naming convention (e.g., CamelCase, PascalCase) through the Request Naming Style dropdown located in the Experiments section of the Settings page.

Generate Request Body

Dynamically generate structured request payloads:
  1. Click the Modify with AI icon ( .⟡⁺ ) in the Request Body section.
  2. Define constraints or provide input for the desired structure.
  3. Validate the generated body and select Accept Change to populate the request body field.

Generate Pre-request Scripts

Generate pre-request scripts to handle necessary setup operations before sending the request:
  1. Click the Modify with AI icon ( .⟡⁺ ) within the Pre-request Script section.
  2. Enter specific logic or conditions required for the pre-request phase.
  3. After reviewing the generated script, click Accept Change to apply it to the pre-request script section of your API request.

Generate Test Scripts

Develop test cases for your API workflow:
  1. Click the Modify with AI icon ( .⟡⁺ ) in the Tests section.
  2. Specify the test parameters or expected outcomes.
  3. Select Accept Change to integrate it into the test script editor for execution.

Generate Test Cases

Develop can generate test cases for your API with option modal or custom prompt.
  1. Click the Test Cases tab on toolbar to show test cases tab.
  2. Click the Generate with AI icon ( ⟡⁺ ) to open option modal. 3a. Select Option Modal to generate test cases with option modal. 3b. Select Custom Prompt to generate test cases with custom prompt.
  3. Select Accept Change to integrate it into the test case editor for execution.
  4. After accepting the test cases, you can run it by clicking the Run icon ( ▶️ ).

Generate K6 Script

User can generate k6 script for your API with configure modal or custom prompt.
  1. Click the K6 Script tab on toolbar to show k6 script tab.
  2. Click the Configure icon ( ⚙️ ) to open modal. 3a. Select Option to setup the executor type, load profile, stages,… 3b. Select Rules to add sleep time and correlation rules. 3c. Select Advanced to add custom check and setup the environment variables.
  3. Click Apply to generate k6 script.
  4. After generating the K6 Script, user can run on the distributed cloud which provided by k6.io
Current API Lab only support generate K6 script for API requests. We will support the distributed cloud for performance testing in the future.