Supported stacks
MergeCost records what each request does while your tests run. These are the frameworks and libraries it understands today.
Python
| Area | Supported | Endpoint key example |
|---|---|---|
| Django & DRF | pytest + pytest-django, or manage.py test | "GET api/posts/<int:pk>/" |
| FastAPI / Starlette | TestClient, httpx ASGITransport; mounted sub-apps | "GET /posts/{post_id}" |
| Flask | app.test_client() | "GET /posts/<int:post_id>" |
| Celery | eager tasks; a task outside a request is priced on its own | "TASK app.tasks.send_email" |
| Databases | Django ORM, SQLAlchemy (sync and async) — any database they support | |
| HTTP clients | requests, httpx, httpx2 | |
| LLM SDKs | OpenAI (chat completions, responses), Anthropic (messages) |
Django with manage.py test: set test_command: "python manage.py test --testrunner pytest_mergecost.django_runner.MergeCostDiscoverRunner" (automatic setup does this for you).
Node.js
| Area | Supported | Endpoint key example |
|---|---|---|
| Express | supertest, sub-routers | "GET /posts/:id" |
| Fastify | fastify.inject (Fastify 4; Fastify 5 needs Jest ESM support) | "GET /posts/:id" |
| NestJS | on the Express or Fastify adapter | "GET /posts/:id" |
| Test runners | Jest, Vitest | |
| Databases | pg, mysql2, better-sqlite3, Prisma — and ORMs built on these drivers (knex, Sequelize, TypeORM, Drizzle) | |
| HTTP | global fetch, http/https (axios, got, node-fetch) | |
| LLM SDKs | OpenAI, Anthropic | |
| Logs | console.*, pino, winston and anything writing to stdout/stderr |
Jest and Vitest configuration
// jest.config.js
let withMergeCost = (c) => c;
try { ({ withMergeCost } = require('@mergecost/node/jest')); } catch (e) {}
module.exports = withMergeCost({ testEnvironment: 'node' });
// vitest.config.ts
import { withMergeCost } from '@mergecost/node/vitest';
export default withMergeCost(defineConfig({ /* your config */ }));
Recording only happens when MERGECOST=1, which the MergeCost job sets. Local test runs are unaffected.
CI and cloud
- CI: GitHub Actions. GitLab CI and Bitbucket are planned.
- Cloud prices: AWS (CloudWatch Logs, data transfer, RDS/Aurora). GCP and Azure are planned.
Static scan
Changed Python, JavaScript and TypeScript files are also scanned for database, HTTP, LLM and log calls added inside loops. These appear as “possible risks” without a dollar amount, because untested code cannot be measured.
Not supported yet
- Rails, Laravel/PHP, Java/Spring and Go (planned).
- Streamlit, Gradio and other UI frameworks without HTTP endpoints.
- Repositories without API tests — MergeCost measures; it does not guess.
- Koa, Hapi and Next.js route handlers (requests appear as
<unresolved>); MongoDB.
Want your stack next? Tell us.