Documentation Index
Fetch the complete documentation index at: https://docs.mutagent.io/llms.txt
Use this file to discover all available pages before exploring further.
SDK Configuration
Client Options
BothMutagent (sync) and AsyncMutagent (async) accept the same constructor arguments:
Authentication
The SDK reads your API key from the constructor or from theMUTAGENT_API_KEY environment variable. If neither is provided, requests will be sent without authentication (resulting in 401 responses).
API Key (Recommended)
Environment Variables
| Variable | Description | Default |
|---|---|---|
MUTAGENT_API_KEY | Your MutagenT API key | None (unauthenticated) |
MUTAGENT_SERVER_URL | API endpoint for the client | http://localhost:3003 |
The default
server_url is http://localhost:3003 (local dev). For production, always set MUTAGENT_SERVER_URL=https://api.mutagent.io or pass it explicitly. The SDK enforces HTTPS for non-local hosts unless allow_insecure_http=True is passed.Timeout Configuration
Thetimeout parameter is in seconds (not milliseconds):
Context Manager (Recommended)
Use the client as a context manager to ensure the underlying HTTP connection pool is properly closed:Async context manager
Custom HTTP Client
For advanced use cases (proxies, custom TLS, request interceptors), provide your ownhttpx.Client:
Namespace Reference
The client exposes these namespaces. Each namespace groups related API methods:| Namespace | Access | Description |
|---|---|---|
prompt | client.prompt | Prompt CRUD and versioning |
prompt_datasets | client.prompt_datasets | Dataset management |
prompt_dataset_items | client.prompt_dataset_items | Dataset item management |
prompt_evaluations | client.prompt_evaluations | Evaluation management |
optimization | client.optimization | Optimization job control |
traces | client.traces | Trace ingestion and retrieval |
experiments | client.experiments | Experiment management |
organizations | client.organizations | Organization management |
workspaces | client.workspaces | Workspace management |