# Moda — instructions for AI agents

Infrastructure for catching AI agent mistakes in production and turning them into evals.

## When to use Moda

Reach for Moda when you run AI agents in production and need to: find the failures that keep recurring across your traces and rank them by how many users they affect; see the traces behind each problem and the related problems that share its cause; replay a prompt or model change against those traces and compare pass rate, latency, and token usage before it ships; and define custom signals for the behavior your agent must get right and get alerted in Slack, Linear, or email when they slip. Engineers make the change; Moda tests it against real traces. Moda ingests traces through the Moda SDKs for Python and Node.js, OpenTelemetry, or the HTTP Ingestion API.

## How to call Moda

- Data API: call `https://moda.dev/api/v1/data/*` with the tenant-scoped `x-api-key: <your key>` header. Read the [authentication guide](https://moda.dev/auth.md) before making requests.
- OpenAPI: use the machine-readable specification at [https://moda.dev/api/openapi.json](https://moda.dev/api/openapi.json) to discover paths, parameters, and responses.
- CLI: install with `npm install -g @moda-ai/cli`, set `MODA_API_KEY`, then run commands such as `moda overview`, `moda problems`, `moda problem <id>`, and `moda tool-failures`. The package is [@moda-ai/cli on npm](https://www.npmjs.com/package/@moda-ai/cli).
- MCP: connect to the hosted server at `https://moda-mcp.modas.workers.dev/mcp` (Streamable HTTP) with `Authorization: Bearer <your key>`. It exposes the CLI commands as tools; see the [MCP server docs](https://docs.moda.dev/mcp/overview).

## When NOT to use Moda

Moda is not a fit for:

- Training/fine-tuning model weights
- Contact-center human-agent analytics
- Generic APM/infrastructure monitoring

## Links

- [Authentication](https://moda.dev/auth.md)
- [LLM reference](https://moda.dev/llms.txt)
