MutagenT SDK
The MutagenT SDK (@mutagent/sdk v0.2.65) provides type-safe, async-first access to the MutagenT Platform. It is generated from the OpenAPI specification and ships as a dual ESM + CJS package.
Most developers should start with Integration packages, which provide automatic tracing for popular frameworks like LangChain, Mastra, Vercel AI, and OpenAI. The SDK is for programmatic access and advanced use cases like CI/CD pipelines, custom tooling, and automated workflows.
When to Use the SDK
The SDK is the right choice when you need:- Direct API access — Programmatic CRUD operations on prompts, agents, datasets, evaluations, and traces
- CI/CD pipelines — Automated prompt optimization, evaluation runs, or deployment scripts
- Custom tooling — Building internal tools, dashboards, or workflows on top of the MutagenT API
- Building your own integration — Creating a custom adapter for a framework not yet supported by the official integration packages
- Advanced tracing — Fine-grained manual instrumentation with
@trace(),withTrace(), or the low-level span API
Available SDKs
| Language | Status | Package | Version |
|---|---|---|---|
| TypeScript | Available | @mutagent/sdk | 0.2.65 |
| Python | Coming Soon | mutagent | — |
Design Principles
Type-Safe
Full TypeScript support with Zod validation on all request/response types
Async-First
All operations return Promises for modern async/await patterns
REST-Aligned
Method names mirror REST API resources for predictability
Minimal
Small bundle size, tree-shakeable, zero unnecessary dependencies
Quick Example
SDK Architecture
The SDK organizes operations by resource namespace:| Namespace | Description |
|---|---|
client.prompt | Prompt CRUD and versioning |
client.promptDatasets | Prompt dataset management |
client.promptDatasetItems | Dataset item operations |
client.promptEvaluations | Evaluation runs and results |
client.optimization | Prompt optimization jobs |
client.agents | Agent CRUD operations |
client.agentDatasets | Agent dataset management |
client.agentDatasetItems | Agent dataset item operations |
client.agentConversations | Agent conversation management |
client.agentChatStreaming | Streaming agent chat |
client.conversations | Conversation operations |
client.traces | Trace ingestion and querying |
client.workspaces | Workspace management |
client.organizations | Organization management |
client.providerConfigs | LLM provider configurations |
client.invitations | Team invitation management |
client.userProfile | Current user profile |
Error Handling
All API errors extendMutagentError, which exposes HTTP status code, body, headers, and the raw Response object.
Next Steps
TypeScript Setup
Install and configure the TypeScript SDK
Tracing Module
Custom instrumentation with the tracing API
Integrations
Framework adapters with automatic tracing
Python SDK
Python SDK status and preview