Configure and validate performance tests using the Postman CLI
With performance tests, you can simulate user traffic and observe how your API behaves under load. Using the Postman CLI, you can run performance tests for Postman Collections locally, as part of your CI/CD pipeline, or on Postman’s managed cloud infrastructure. This enables your team to automatically detect performance regressions during development and deployment workflows.
The postman performance run command runs a configured performance test for a collection and makes the results available in Postman. You can use the command to validate performance tests locally, automate them in your CI/CD pipeline, and compare test results across runs to identify performance regressions.
To use the postman performance run command, sign in to Postman with the postman login command.
Performance tests aren’t supported with the Postman web app.
Prepare a collection for performance testing
Before running a performance test with the Postman CLI, prepare a collection that represents the API traffic you’d like to test. You can create a new collection for performance testing, or reuse an existing collection and modify it for load testing scenarios.
When preparing your collection, choose requests that reflect real API usage patterns and critical workflows. For example, you may want to include commonly used endpoints, authentication flows, or requests that are sensitive to latency and throughput. You can also add pm.test() assertions to validate response status codes, response times, and other performance-related behaviors during load testing.
You can also use Agent Mode to generate a collection for performance testing. For best results, describe the API workflows, endpoints, variables, and assertions you’d like to include in the collection.
For example, you can ask Agent Mode the following:
Generate the CLI command and run tests locally
After preparing your collection, configure the performance test in Postman and generate the Postman CLI command. You can run the command locally first to make sure the performance test works as expected before adding it to your CI/CD pipeline.
- Click the
Items tab in the sidebar.
- Click Collections, then select the collection you’d like to run a performance test for.
- Click
Run.
- Click the Performance tab.
- Under Run, select Postman CLI.
- Configure the load profile, virtual user count, and test duration.
- Optionally, select a dataset and view to use as test data.
- Configure a pass/fail condition for the performance test. This determines whether the performance test passes or fails based on metrics such as percentile response times. You can use this condition in your CI/CD pipeline to prevent deployments that don’t meet your performance requirements.
- Optionally, use the Setup and Teardown dropdowns to attach collections that run once before and/or after the test. Learn more about running setup and teardown collections.
- Under Install Postman CLI, click
Copy to clipboard to copy the Postman CLI installation command.
- Install the Postman CLI on your local machine.
- Under Run the performance test, click Add API key. Do one of the following:
- Click Generate Key to create a new API key. Enter a name for the API key and click Generate. Click
Copy to copy the key and save it somewhere safe.
- Click Use Existing Key and enter a valid API key.
- Click Generate Key to create a new API key. Enter a name for the API key and click Generate. Click
- Click Insert Key.
- Click
Copy to clipboard to copy the
loginandperformancecommands. - Enter the commands into your terminal and run them locally.
The generated commands include the postman login command and the postman performance run command. For example:
While the test is running, you can view performance metrics in real time from the terminal. To learn how to view performance test results in the Postman app during and after the test run, see View results in Postman.
Run performance tests in your CI/CD pipeline
After you verify that the performance test runs locally, add the postman performance run command to your CI/CD pipeline. This enables your team to run performance tests automatically when changes are pushed to your repository.
The following example uses GitHub Actions to install the Postman CLI, authenticate with Postman, and run a performance test when changes are pushed to a GitHub repository. The collection ID is stored as a GitHub Actions variable, and the Postman API key is stored as a GitHub Actions secret.
After adding the workflow file to your repository, commit and push your changes. GitHub Actions starts the workflow and runs the performance test with the Postman CLI. You can use performance tests to prevent deployments that don’t meet your performance requirements. In this example, if the performance test exceeds the configured --pass-if threshold, the CI/CD workflow fails. You can use the failed run to investigate performance regressions before merging or deploying your changes.
To learn how to view performance test results in the Postman app during and after the test run, see View results in Postman.
Run setup and teardown collections
Setup and teardown collections let you run preparation and cleanup steps once for a performance test, so CI/CD workflows don’t have to manage those steps with external scripts or build them into the workload collection. The setup collection runs once before the test starts, and the teardown collection runs once after the test ends, on every outcome. Setup and teardown collections require the --runner postman-cloud option. Learn more about how setup and teardown run.
Add the --setup-collection and --teardown-collection options to the postman performance run command. Specify each collection by its ID — collection names aren’t supported. You can use either option on its own, and you can use the same collection for both.
Setup, the performance test, and teardown share state through environment variables, so specify an environment with --environment. Variables the setup collection writes are passed to the virtual users and to the teardown collection. Learn more about passing state between phases and the --setup-collection and --teardown-collection options.
Run a performance test on Postman Cloud
Running a performance test on Postman Cloud from the CLI requires cloud performance tests to be available on your plan.
By default, postman performance run generates load from the machine that invokes it, whether that’s your local machine or a CI/CD runner. Add the --runner postman-cloud option to originate the load from Postman’s managed cloud infrastructure instead, with no change to the collection, the test configuration, or how results are reported.
Use a cloud runner to generate load beyond what your local machine or CI/CD runner can produce, without moving the test out of your existing pipeline. The --runner option is repeatable, so a single run can originate load from more than one runner. Learn more about the --runner option.
View results in Postman
You can review performance test results in Postman to analyze metrics such as response times, requests processed over time, error rates, and percentile-based performance measurements.
If you’re on a Postman paid plan, you can view live performance metrics in the Postman app while the Postman CLI test is running. Real-time visibility helps you monitor slow response times, failed assertions, and request errors as they occur during local or CI/CD test runs. If the API becomes unstable under load, you can stop the test, adjust your configuration or API, and rerun the test without waiting for the full run to complete.
After the test completes, all Postman plans can view detailed performance test results in the Postman app. Comparing results across runs can help you identify regressions and validate performance improvements.
To view performance test results, do the following:
- Click the
Items tab in the sidebar.
- Click Collections, then select the collection you’d like to view performance test results for.
- Click the Runs tab, then click the Performance tab.
- Select a performance test run to view detailed metrics.
To learn more, see View metrics for performance tests.

Example of a successful run
As an example, a performance test passes when the API remains within the configured --pass-if threshold. For example, a workflow using --pass-if "less_than(p90, 500)" passes if 90% of requests complete in less than 500 ms. Successful runs can help confirm that recent changes didn’t negatively affect API performance.
Example of a failed run
As an example, a performance test fails when the API exceeds the configured --pass-if threshold. For example, changing the threshold to --pass-if "less_than(p90, 10)" may cause the workflow to fail if the API can’t consistently respond within 10 ms. Comparing the failed run with an earlier successful run can help identify regressions, increased response times, or higher error rates introduced by recent changes.