Open source by Apideck
Portman: Contract testing
for OpenAPI
Turn your spec into a tested Postman collection. Run it in CI. Catch API drift before launch.
- 685
- stars
- 20.7K
- weekly installs
- 27
- contributors
$ npx @apideck/portman -l openapi.yaml -c portman-config.json \ --runNewman -b http://localhost:3000 → List leads GET http://localhost:3000/crm/leads [200 OK, 1.2kB, 84ms] ✓ [GET]::/crm/leads - Status code is 2xx ✓ [GET]::/crm/leads - Content-Type is application/json ✗ [GET]::/crm/leads - Schema is valid data[0].email: must be string (got null) ✓ [GET]::/crm/leads - Response time is less than 300ms Collection run encountered failures. Failed assertions: 1; Failures: 1 # exit code 1 → the CI job failsBuilt for APIs that keep their promises
Everything between your OpenAPI spec and a green build.
Contract tests, generated
Status, content type, JSON body, schema validation and response time for every operation — derived from your spec.
Variations & fuzzing
Send invalid, missing and out-of-range inputs on purpose and assert your API rejects them correctly.
Gate every pull request
Runs with Newman in any pipeline. A failed assertion exits with code 1, so drift never reaches main.
Postman sync
Push the generated collection straight to your Postman workspace with one flag. Optional, never required.
Watch it in action
From spec to failing build in four steps.
openapi: 3.0.3info: title: CRM API version: 1.0.0paths: /crm/leads: get: operationId: leadsAll summary: List leads responses: '200': description: Leads content: application/json: schema: $ref: '#/components/schemas/GetLeadsResponse' post: operationId: leadsAdd summary: Create leadStart from a template
Ready-made Portman configs for the contract tests most teams need.
Baseline contract tests
Start contract testing every operation in your spec with one rule.
Strict response validation
Catch undocumented response fields, wrong content types and missing headers.
Response time budget
Fail the run when endpoints respond slower than an agreed budget.
Auth token chaining
Get an access token from a token endpoint and use it for every other request.
CRUD flow chaining
Create a record, then read, update and delete that same record.
Negative testing with variations
Verify that bad credentials and invalid input return the documented 4xx errors.
In orbit
Public projects running Portman in CI. Every row links to the workflow or config that proves it.
| Project | Runs Portman for | Repo stars | Last push | Source |
|---|---|---|---|---|
Tyk TykTechnologies/tyk | API gateway spec tests | ★ 10.9K | Oct 31, 2026 | source |
PostgresAI postgres-ai/database-lab-engine | DBLab API Postman collection | ★ 2.8K | Nov 11, 2026 | source |
jsDelivr jsdelivr/globalping | Contract tests in CI | ★ 623 | Oct 30, 2026 | source |
VTEX vtex/openapi-schemas | Public OpenAPI schemas | ★ 118 | Oct 30, 2026 | source |
Terminal terminal-api/postman | Public Postman collection | — | Oct 30, 2026 | source |
Ed-Fi Ed-Fi-Alliance-OSS/Ed-Fi-API-Specifications | Auto-generated API tests | ★ 4 | Oct 29, 2026 | source |
Radix DLT radixdlt/babylon-gateway | Gateway API CI | ★ 16 | Sep 7, 2026 | source |
Twikey twikey/development-kit | Release pipeline | ★ 10 | Apr 1, 2026 | source |
Fraunhofer-Chalmers Centre FraunhoferChalmersCentre/real-estate-api | Real-estate API contract tests | — | Sep 1, 2025 | source |
Engineers from these teams helped shape Portman
Through issues, discussions and pull requests.
- Siemens#661
- Checkout.comPR #308
- Workday#662
- KlarnaPR #115
- T-Mobile#686
- EquipmentSharePR #520
- Tyler TechnologiesPR #490
- HiBob#253
- n8n#174
- Nord Security#185
- Wolt#136
- Visma#631
- Comarch#472
- adorsys#438
- adesso#305
- Open FabricPR #248
- Claap#424
- Fieldguide#256
- Nitor Energy#335
- Aarhus UniversityPR #525
Affiliations as listed on contributors’ public GitHub profiles. Not an endorsement.
- testsuite-contract-tests/Status codes, schemas and response validation.
- testsuite-variation-tests/Variations for different inputs and edge cases.
- testsuite-fuzzing-tests/Fuzzed requests to test error handling.
- testsuite-overwrites/Change headers, query params and bodies.
- testsuite-assign-variables/Chain requests with values from responses.
- testsuite-pre-request-scripts/Inject scripts for auth and setup.
- postman-to-k6/Reuse the generated collection for load tests.
Ready for your coding agent
Let agents write configs and run contract tests — then hold their code to your spec.
Agent skill
Teach Claude Code, Cursor and other agents how to configure and run Portman.
$ npx skills add apideck/api-skills --skill apideck-portmanMCP server
Agents generate collections, maintain your Portman config and explain failing contract tests — over MCP.
The crew
Portman is built in the open by 25 contributors. Thank you for every issue, fix and feature.
More from the crew
Open-source tools from the Portman maintainers that complete your API workflow.
Inspectr
Inspect API requests, MCP server calls and webhook events in real time. Ships with an MCP server.
openapi-format
Format, sort and filter OpenAPI documents. Powers Portman’s operation filtering.
postman-to-k6
Convert Postman collections to k6 scripts — reuse your Portman collection for load tests.
Questions
Everything you need before liftoff.
What is Portman?
Portman is an open-source CLI by Apideck that converts an OpenAPI document into a Postman collection and injects contract tests, variation tests and fuzzing tests. It can run the collection with Newman, so you can validate a live API against its spec from your terminal or CI pipeline.
Is Portman free?
Yes. Portman is open source under the Apache 2.0 license and free for commercial use.
Do I need a Postman account?
No. Portman generates a standard Postman collection file and runs it locally with Newman. Uploading to a Postman workspace with --syncPostman is optional and only needs a Postman API key if you choose to use it.
What does a contract test check?
Out of the box: success status codes, Content-Type, the presence of a JSON body, JSON Schema validation of the response against your spec, required headers and response time. You enable each check per operation or with wildcards in portman-config.json.
How do I run Portman in CI?
Run npx @apideck/portman -l openapi.yaml --runNewman -b <base-url> as a step in GitHub Actions, GitLab CI or any pipeline after your API starts. When any assertion fails, Portman exits with code 1, so contract drift fails the job and blocks the merge.
Can I go beyond schema checks?
Yes. Content tests assert on specific response values, overwrites change request bodies, headers and query params, assignVariables chains requests together, and variation and fuzzing tests exercise error handling with invalid inputs.
How is Portman different from Postman’s own OpenAPI import?
Postman’s import gives you requests. Portman gives you requests plus generated, maintainable tests, driven by a config file you keep in version control and regenerate every time the spec changes.
Launch your first contract test
One command. No account. Apache 2.0.
# 1. Generate a collection with contract testsnpx @apideck/portman -l ./openapi.yaml -o ./collection.json # 2. Or generate and run against your API in one gonpx @apideck/portman -l ./openapi.yaml --runNewman -b http://localhost:3000 # 3. Set up CLI options interactivelynpx @apideck/portman --init