Schemathesis
Catch API bugs before your users do.
Schemathesis tests OpenAPI and GraphQL APIs by generating inputs from your schema, adapting to server responses, and chaining operations into realistic workflows.
Finding bugs that manual testing missed
Try it now
# Test a demo API - finds real bugs in 30 seconds
uvx schemathesis run https://example.schemathesis.io/openapi.json
# Test your own API
uvx schemathesis run https://your-api.com/openapi.json
What problems does it solve?
- 💥 500 errors that crash your API on edge case inputs
- 📋 Schema violations where your API returns different data than documented
- 🚪 Validation bypasses where invalid data gets accepted
- 🔗 Integration failures when responses don't match client expectations
- 🔄 Stateful bugs where operations work individually but fail in realistic workflows
What can it do?
- ⚙️ Config file - auth, phases, and per-operation overrides in
schemathesis.toml. No Python. - 🔐 Authentication - static headers, Basic, per-security-scheme credentials, or custom refresh logic.
- 🔗 Stateful testing - operation links inferred from your schema, no manual wiring.
- 🧠 Adaptive testing - learns constraints, ids, and auth from responses, reusing them mid-run.
- ✅ Custom checks - assert your own business rules next to the built-in ones.
- 📖 Fuzz dictionaries - mix real ids, wordlists, or LLM-generated payloads into generated data.
- 🐌 Rate limiting - cap the request rate, or use
autoto followRetry-Afteron 429. - 📊 Reports - JUnit, VCR, HAR, NDJSON, JSON, and Allure.
- 🎯 Schema coverage - keyword-level coverage report showing which constraints your tests exercised.
- 🔁 Replay & baseline - re-run past failures and fail CI only on new ones.
⚠️ Upgrading from older versions? Check our Migration Guide for key changes.
Installation & Usage
Command Line:
uv pip install schemathesis
schemathesis run https://your-api.com/openapi.json
Config file (schemathesis.toml, no Python needed):
headers = { Authorization = "Bearer ${API_TOKEN}" }
generation.max-examples = 500
rate-limit = "auto"
Python Tests:
import schemathesis
schema = schemathesis.openapi.from_url("https://your-api.com/openapi.json")
@schema.parametrize()
def test_api(case):
# Tests with random data, edge cases, and invalid inputs
case.call_and_validate()
# Stateful testing: Tests workflows like: create user -> get user -> delete user
APIWorkflow = schema.as_state_machine()
# Creates a test class for pytest/unittest
TestAPI = APIWorkflow.TestCase
CI/CD:
- uses: schemathesis/action@v3
with:
schema: "https://your-api.com/openapi.json"
Who uses it
Used by teams at Spotify, WordPress, JetBrains, Red Hat, and dozens of other companies.
"Schemathesis is the best tool for fuzz testing of REST APIs on the market. We at Red Hat use it for examining our applications in functional and integration testing levels." - Dmitry Misharov, RedHat
See it in action
🔬 Live Benchmarks showing continuous testing results from real-world APIs:
- Code & API schema coverage achieved
- Issues found with detailed categorization
- Performance across different fuzzing strategies
Documentation
📚 Documentation with guides, examples, and API reference.
Get Help
Contributing
We welcome contributions! See our contributing guidelines and join discussions in issues or Discord.
Acknowledgements
Schemathesis is built on top of Hypothesis, a powerful property-based testing library for Python.
License
This project is licensed under the terms of the MIT license.
Release files for schemathesis 4.27.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| schemathesis-4.27.5.tar.gz | 2.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| schemathesis-4.27.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.7 MB
Release files / schemathesis-4.27.5.tar.gz
| Download URL | schemathesis-4.27.5.tar.gz |
|---|---|
| Size | 2.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53e255c920ba55ab869232c308ab22255c8a4343c09eab60ed322b35238b4b90
|
|
BLAKE2b-256 checksum How to use checksums |
6772562392f4948ad0cbbfb9abdc8ae3ee2ea26c7f633cd4abbc40649c87fee2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logRelease files / schemathesis-4.27.5-py3-none-any.whl
| Download URL | schemathesis-4.27.5-py3-none-any.whl |
|---|---|
| Size | 960.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92026770a9d02b33541816cfb9fdd7bb7dd93bfb6870ac997f959302fe9390c0
|
|
BLAKE2b-256 checksum How to use checksums |
260f400bb719c9198c04f17d49373283c7e5aef782b2c2b4575e2b2ec41a7885
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency log