# Reference

The Reference section provides documentation of Mastra's API, including parameters, types and usage examples.

- [Agent Class](https://mastra.ai/reference/agents/agent)
- [Channels](https://mastra.ai/reference/agents/channels)
- [.generate()](https://mastra.ai/reference/agents/generate)
- [.generateLegacy()](https://mastra.ai/reference/agents/generateLegacy)
- [.getDefaultGenerateOptionsLegacy()](https://mastra.ai/reference/agents/getDefaultGenerateOptions)
- [.getDefaultOptions()](https://mastra.ai/reference/agents/getDefaultOptions)
- [.getDefaultStreamOptionsLegacy()](https://mastra.ai/reference/agents/getDefaultStreamOptions)
- [.getDescription()](https://mastra.ai/reference/agents/getDescription)
- [.getInstructions()](https://mastra.ai/reference/agents/getInstructions)
- [.getLLM()](https://mastra.ai/reference/agents/getLLM)
- [.getMemory()](https://mastra.ai/reference/agents/getMemory)
- [.getModel()](https://mastra.ai/reference/agents/getModel)
- [.getTools()](https://mastra.ai/reference/agents/getTools)
- [.getVoice()](https://mastra.ai/reference/agents/getVoice)
- [.listAgents()](https://mastra.ai/reference/agents/listAgents)
- [.listScorers()](https://mastra.ai/reference/agents/listScorers)
- [.listTools()](https://mastra.ai/reference/agents/listTools)
- [.listWorkflows()](https://mastra.ai/reference/agents/listWorkflows)
- [.network()](https://mastra.ai/reference/agents/network)
- [chatRoute()](https://mastra.ai/reference/ai-sdk/chat-route)
- [handleChatStream()](https://mastra.ai/reference/ai-sdk/handle-chat-stream)
- [handleNetworkStream()](https://mastra.ai/reference/ai-sdk/handle-network-stream)
- [handleWorkflowStream()](https://mastra.ai/reference/ai-sdk/handle-workflow-stream)
- [networkRoute()](https://mastra.ai/reference/ai-sdk/network-route)
- [toAISdkMessages()](https://mastra.ai/reference/ai-sdk/to-ai-sdk-messages)
- [toAISdkStream()](https://mastra.ai/reference/ai-sdk/to-ai-sdk-stream)
- [toAISdkV4Messages()](https://mastra.ai/reference/ai-sdk/to-ai-sdk-v4-messages)
- [toAISdkV5Messages()](https://mastra.ai/reference/ai-sdk/to-ai-sdk-v5-messages)
- [withMastra()](https://mastra.ai/reference/ai-sdk/with-mastra)
- [workflowRoute()](https://mastra.ai/reference/ai-sdk/workflow-route)
- [Auth0](https://mastra.ai/reference/auth/auth0)
- [Better Auth](https://mastra.ai/reference/auth/better-auth)
- [Clerk](https://mastra.ai/reference/auth/clerk)
- [Firebase](https://mastra.ai/reference/auth/firebase)
- [JSON Web Token](https://mastra.ai/reference/auth/jwt)
- [Okta](https://mastra.ai/reference/auth/okta)
- [Supabase](https://mastra.ai/reference/auth/supabase)
- [WorkOS](https://mastra.ai/reference/auth/workos)
- [AgentBrowser](https://mastra.ai/reference/browser/agent-browser)
- [MastraBrowser Class](https://mastra.ai/reference/browser/mastra-browser)
- [StagehandBrowser](https://mastra.ai/reference/browser/stagehand-browser)
- [create-mastra](https://mastra.ai/reference/cli/create-mastra)
- [mastra](https://mastra.ai/reference/cli/mastra)
- [Agents API](https://mastra.ai/reference/client-js/agents)
- [Conversations API](https://mastra.ai/reference/client-js/conversations)
- [Error Handling](https://mastra.ai/reference/client-js/error-handling)
- [Logs API](https://mastra.ai/reference/client-js/logs)
- [Mastra Client SDK](https://mastra.ai/reference/client-js/mastra-client)
- [Memory API](https://mastra.ai/reference/client-js/memory)
- [Observability API](https://mastra.ai/reference/client-js/observability)
- [Responses API](https://mastra.ai/reference/client-js/responses)
- [Telemetry API](https://mastra.ai/reference/client-js/telemetry)
- [Tools API](https://mastra.ai/reference/client-js/tools)
- [Vectors API](https://mastra.ai/reference/client-js/vectors)
- [Workflows API](https://mastra.ai/reference/client-js/workflows)
- [Mastra Class](https://mastra.ai/reference/core/mastra-class)
- [MastraModelGateway](https://mastra.ai/reference/core/mastra-model-gateway)
- [.addGateway()](https://mastra.ai/reference/core/addGateway)
- [.getAgent()](https://mastra.ai/reference/core/getAgent)
- [.getAgentById()](https://mastra.ai/reference/core/getAgentById)
- [.getDeployer()](https://mastra.ai/reference/core/getDeployer)
- [.getEditor()](https://mastra.ai/reference/core/getEditor)
- [.getGateway()](https://mastra.ai/reference/core/getGateway)
- [.getGatewayById()](https://mastra.ai/reference/core/getGatewayById)
- [.getLogger()](https://mastra.ai/reference/core/getLogger)
- [.getMCPServer()](https://mastra.ai/reference/core/getMCPServer)
- [.getMCPServerById()](https://mastra.ai/reference/core/getMCPServerById)
- [.getMemory()](https://mastra.ai/reference/core/getMemory)
- [.getScorer()](https://mastra.ai/reference/core/getScorer)
- [.getScorerById()](https://mastra.ai/reference/core/getScorerById)
- [.getServer()](https://mastra.ai/reference/core/getServer)
- [.getStorage()](https://mastra.ai/reference/core/getStorage)
- [.getTelemetry()](https://mastra.ai/reference/core/getTelemetry)
- [.getVector()](https://mastra.ai/reference/core/getVector)
- [.getWorkflow()](https://mastra.ai/reference/core/getWorkflow)
- [.listAgents()](https://mastra.ai/reference/core/listAgents)
- [.listGateways()](https://mastra.ai/reference/core/listGateways)
- [.listLogs()](https://mastra.ai/reference/core/listLogs)
- [.listLogsByRunId()](https://mastra.ai/reference/core/listLogsByRunId)
- [.listMCPServers()](https://mastra.ai/reference/core/listMCPServers)
- [.listMemory()](https://mastra.ai/reference/core/listMemory)
- [.listScorers()](https://mastra.ai/reference/core/listScorers)
- [.listVectors()](https://mastra.ai/reference/core/listVectors)
- [.listWorkflows()](https://mastra.ai/reference/core/listWorkflows)
- [.setLogger()](https://mastra.ai/reference/core/setLogger)
- [.setStorage()](https://mastra.ai/reference/core/setStorage)
- [Cloudflare](https://mastra.ai/reference/deployer/cloudflare)
- [Deployer](https://mastra.ai/reference/deployer)
- [Netlify](https://mastra.ai/reference/deployer/netlify)
- [Vercel](https://mastra.ai/reference/deployer/vercel)
- [MastraEditor Class](https://mastra.ai/reference/editor/mastra-editor)
- [ToolProvider](https://mastra.ai/reference/editor/tool-provider)
- [createScorer()](https://mastra.ai/reference/evals/create-scorer)
- [MastraScorer](https://mastra.ai/reference/evals/mastra-scorer)
- [runEvals()](https://mastra.ai/reference/evals/run-evals)
- [Scorer Utils](https://mastra.ai/reference/evals/scorer-utils)
- [Answer Relevancy Scorer](https://mastra.ai/reference/evals/answer-relevancy)
- [Answer Similarity Scorer](https://mastra.ai/reference/evals/answer-similarity)
- [Bias](https://mastra.ai/reference/evals/bias)
- [Completeness](https://mastra.ai/reference/evals/completeness)
- [Content Similarity Scorer](https://mastra.ai/reference/evals/content-similarity)
- [Context Precision Scorer](https://mastra.ai/reference/evals/context-precision)
- [Context Relevance Scorer](https://mastra.ai/reference/evals/context-relevance)
- [Faithfulness](https://mastra.ai/reference/evals/faithfulness)
- [Hallucination](https://mastra.ai/reference/evals/hallucination)
- [Keyword Coverage Scorer](https://mastra.ai/reference/evals/keyword-coverage)
- [Noise Sensitivity Scorer](https://mastra.ai/reference/evals/noise-sensitivity)
- [Prompt Alignment Scorer](https://mastra.ai/reference/evals/prompt-alignment)
- [Textual Difference Scorer](https://mastra.ai/reference/evals/textual-difference)
- [Tone Consistency Scorer](https://mastra.ai/reference/evals/tone-consistency)
- [Tool Call Accuracy Scorers](https://mastra.ai/reference/evals/tool-call-accuracy)
- [Toxicity](https://mastra.ai/reference/evals/toxicity)
- [Trajectory Accuracy Scorers](https://mastra.ai/reference/evals/trajectory-accuracy)
- [Dataset Class](https://mastra.ai/reference/datasets/dataset)
- [DatasetsManager Class](https://mastra.ai/reference/datasets/datasets-manager)
- [.addItem()](https://mastra.ai/reference/datasets/addItem)
- [.addItems()](https://mastra.ai/reference/datasets/addItems)
- [.compareExperiments()](https://mastra.ai/reference/datasets/compareExperiments)
- [.create()](https://mastra.ai/reference/datasets/create)
- [.delete()](https://mastra.ai/reference/datasets/delete)
- [.deleteExperiment()](https://mastra.ai/reference/datasets/deleteExperiment)
- [.deleteItem()](https://mastra.ai/reference/datasets/deleteItem)
- [.deleteItems()](https://mastra.ai/reference/datasets/deleteItems)
- [.get()](https://mastra.ai/reference/datasets/get)
- [.getDetails()](https://mastra.ai/reference/datasets/getDetails)
- [.getExperiment()](https://mastra.ai/reference/datasets/getExperiment)
- [.getItem()](https://mastra.ai/reference/datasets/getItem)
- [.getItemHistory()](https://mastra.ai/reference/datasets/getItemHistory)
- [.list()](https://mastra.ai/reference/datasets/list)
- [.listExperimentResults()](https://mastra.ai/reference/datasets/listExperimentResults)
- [.listExperiments()](https://mastra.ai/reference/datasets/listExperiments)
- [.listItems()](https://mastra.ai/reference/datasets/listItems)
- [.listVersions()](https://mastra.ai/reference/datasets/listVersions)
- [.startExperiment()](https://mastra.ai/reference/datasets/startExperiment)
- [.startExperimentAsync()](https://mastra.ai/reference/datasets/startExperimentAsync)
- [.update()](https://mastra.ai/reference/datasets/update)
- [.updateItem()](https://mastra.ai/reference/datasets/updateItem)
- [Harness Class](https://mastra.ai/reference/harness/harness-class)
- [API Reference](https://mastra.ai/reference/mastra-platform/api)
- [Cloned Thread Utilities](https://mastra.ai/reference/memory/clone-utilities)
- [Memory Class](https://mastra.ai/reference/memory/memory-class)
- [Observational Memory](https://mastra.ai/reference/memory/observational-memory)
- [.cloneThread()](https://mastra.ai/reference/memory/cloneThread)
- [.createThread()](https://mastra.ai/reference/memory/createThread)
- [.deleteMessages()](https://mastra.ai/reference/memory/deleteMessages)
- [.getThreadById()](https://mastra.ai/reference/memory/getThreadById)
- [.listThreads()](https://mastra.ai/reference/memory/listThreads)
- [.recall()](https://mastra.ai/reference/memory/recall)
- [PinoLogger](https://mastra.ai/reference/logging/pino-logger)
- [Automatic Metrics](https://mastra.ai/reference/observability/metrics/automatic-metrics)
- [Configuration](https://mastra.ai/reference/observability/tracing/configuration)
- [Instances](https://mastra.ai/reference/observability/tracing/instances)
- [Interfaces](https://mastra.ai/reference/observability/tracing/interfaces)
- [Span filtering](https://mastra.ai/reference/observability/tracing/span-filtering)
- [Spans](https://mastra.ai/reference/observability/tracing/spans)
- [BatchPartsProcessor](https://mastra.ai/reference/processors/batch-parts-processor)
- [LanguageDetector](https://mastra.ai/reference/processors/language-detector)
- [MessageHistory](https://mastra.ai/reference/processors/message-history-processor)
- [ModerationProcessor](https://mastra.ai/reference/processors/moderation-processor)
- [PIIDetector](https://mastra.ai/reference/processors/pii-detector)
- [PrefillErrorHandler](https://mastra.ai/reference/processors/prefill-error-handler)
- [Processor Interface](https://mastra.ai/reference/processors/processor-interface)
- [PromptInjectionDetector](https://mastra.ai/reference/processors/prompt-injection-detector)
- [SemanticRecall](https://mastra.ai/reference/processors/semantic-recall-processor)
- [SkillSearchProcessor](https://mastra.ai/reference/processors/skill-search-processor)
- [SystemPromptScrubber](https://mastra.ai/reference/processors/system-prompt-scrubber)
- [TokenLimiterProcessor](https://mastra.ai/reference/processors/token-limiter-processor)
- [ToolCallFilter](https://mastra.ai/reference/processors/tool-call-filter)
- [ToolSearchProcessor](https://mastra.ai/reference/processors/tool-search-processor)
- [UnicodeNormalizer](https://mastra.ai/reference/processors/unicode-normalizer)
- [WorkingMemory](https://mastra.ai/reference/processors/working-memory-processor)
- [DatabaseConfig](https://mastra.ai/reference/rag/database-config)
- [Embed](https://mastra.ai/reference/rag/embeddings)
- [ExtractParams](https://mastra.ai/reference/rag/extract-params)
- [GraphRAG](https://mastra.ai/reference/rag/graph-rag)
- [MDocument](https://mastra.ai/reference/rag/document)
- [Metadata Filters](https://mastra.ai/reference/rag/metadata-filters)
- [rerank()](https://mastra.ai/reference/rag/rerank)
- [rerankWithScorer()](https://mastra.ai/reference/rag/rerankWithScorer)
- [.chunk()](https://mastra.ai/reference/rag/chunk)
- [createRoute()](https://mastra.ai/reference/server/create-route)
- [Express Adapter](https://mastra.ai/reference/server/express-adapter)
- [Fastify Adapter](https://mastra.ai/reference/server/fastify-adapter)
- [Hono Adapter](https://mastra.ai/reference/server/hono-adapter)
- [Koa Adapter](https://mastra.ai/reference/server/koa-adapter)
- [MastraServer](https://mastra.ai/reference/server/mastra-server)
- [registerApiRoute()](https://mastra.ai/reference/server/register-api-route)
- [Server Routes](https://mastra.ai/reference/server/routes)
- [Overview](https://mastra.ai/reference/storage/overview)
- [Cloudflare D1 Storage](https://mastra.ai/reference/storage/cloudflare-d1)
- [Cloudflare KV Storage](https://mastra.ai/reference/storage/cloudflare)
- [Composite Storage](https://mastra.ai/reference/storage/composite)
- [Convex Storage](https://mastra.ai/reference/storage/convex)
- [DynamoDB Storage](https://mastra.ai/reference/storage/dynamodb)
- [LanceDB Storage](https://mastra.ai/reference/storage/lance)
- [libSQL Storage](https://mastra.ai/reference/storage/libsql)
- [MongoDB Storage](https://mastra.ai/reference/storage/mongodb)
- [MSSQL Storage](https://mastra.ai/reference/storage/mssql)
- [PostgreSQL Storage](https://mastra.ai/reference/storage/postgresql)
- [Upstash Storage](https://mastra.ai/reference/storage/upstash)
- [ChunkType](https://mastra.ai/reference/streaming/ChunkType)
- [MastraModelOutput](https://mastra.ai/reference/streaming/agents/MastraModelOutput)
- [.stream()](https://mastra.ai/reference/streaming/agents/stream)
- [.streamLegacy()](https://mastra.ai/reference/streaming/agents/streamLegacy)
- [.observeStream()](https://mastra.ai/reference/streaming/workflows/observeStream)
- [.resumeStream()](https://mastra.ai/reference/streaming/workflows/resumeStream)
- [.stream()](https://mastra.ai/reference/streaming/workflows/stream)
- [.timeTravelStream()](https://mastra.ai/reference/streaming/workflows/timeTravelStream)
- [Overview](https://mastra.ai/reference/templates/overview)
- [createDocumentChunkerTool()](https://mastra.ai/reference/tools/document-chunker-tool)
- [createGraphRAGTool()](https://mastra.ai/reference/tools/graph-rag-tool)
- [createTool()](https://mastra.ai/reference/tools/create-tool)
- [createVectorQueryTool()](https://mastra.ai/reference/tools/vector-query-tool)
- [MCPClient](https://mastra.ai/reference/tools/mcp-client)
- [MCPServer](https://mastra.ai/reference/tools/mcp-server)
- [Amazon S3 Vector Store](https://mastra.ai/reference/vectors/s3vectors)
- [Astra Vector Store](https://mastra.ai/reference/vectors/astra)
- [Chroma Vector Store](https://mastra.ai/reference/vectors/chroma)
- [Cloudflare Vector Store](https://mastra.ai/reference/vectors/vectorize)
- [Convex Vector Store](https://mastra.ai/reference/vectors/convex)
- [Couchbase Vector Store](https://mastra.ai/reference/vectors/couchbase)
- [DuckDB Vector Store](https://mastra.ai/reference/vectors/duckdb)
- [ElasticSearch Vector Store](https://mastra.ai/reference/vectors/elasticsearch)
- [Lance Vector Store](https://mastra.ai/reference/vectors/lance)
- [libSQL Vector Store](https://mastra.ai/reference/vectors/libsql)
- [MongoDB Vector Store](https://mastra.ai/reference/vectors/mongodb)
- [OpenSearch Vector Store](https://mastra.ai/reference/vectors/opensearch)
- [PG Vector Store](https://mastra.ai/reference/vectors/pg)
- [Pinecone Vector Store](https://mastra.ai/reference/vectors/pinecone)
- [Qdrant Vector Store](https://mastra.ai/reference/vectors/qdrant)
- [Turbopuffer Vector Store](https://mastra.ai/reference/vectors/turbopuffer)
- [Upstash Vector Store](https://mastra.ai/reference/vectors/upstash)
- [Azure](https://mastra.ai/reference/voice/azure)
- [Cloudflare](https://mastra.ai/reference/voice/cloudflare)
- [Composite Voice](https://mastra.ai/reference/voice/composite-voice)
- [Deepgram](https://mastra.ai/reference/voice/deepgram)
- [ElevenLabs](https://mastra.ai/reference/voice/elevenlabs)
- [Events](https://mastra.ai/reference/voice/voice.events)
- [Google](https://mastra.ai/reference/voice/google)
- [Google Gemini Live](https://mastra.ai/reference/voice/google-gemini-live)
- [Mastra Voice](https://mastra.ai/reference/voice/mastra-voice)
- [Murf](https://mastra.ai/reference/voice/murf)
- [OpenAI](https://mastra.ai/reference/voice/openai)
- [OpenAI Realtime](https://mastra.ai/reference/voice/openai-realtime)
- [PlayAI](https://mastra.ai/reference/voice/playai)
- [Sarvam](https://mastra.ai/reference/voice/sarvam)
- [Speechify](https://mastra.ai/reference/voice/speechify)
- [.addInstructions()](https://mastra.ai/reference/voice/voice.addInstructions)
- [.addTools()](https://mastra.ai/reference/voice/voice.addTools)
- [.answer()](https://mastra.ai/reference/voice/voice.answer)
- [.close()](https://mastra.ai/reference/voice/voice.close)
- [.connect()](https://mastra.ai/reference/voice/voice.connect)
- [.getSpeakers()](https://mastra.ai/reference/voice/voice.getSpeakers)
- [.listen()](https://mastra.ai/reference/voice/voice.listen)
- [.off()](https://mastra.ai/reference/voice/voice.off)
- [.on()](https://mastra.ai/reference/voice/voice.on)
- [.send()](https://mastra.ai/reference/voice/voice.send)
- [.speak()](https://mastra.ai/reference/voice/voice.speak)
- [.updateConfig()](https://mastra.ai/reference/voice/voice.updateConfig)
- [Run Class](https://mastra.ai/reference/workflows/run)
- [Step Class](https://mastra.ai/reference/workflows/step)
- [Workflow Class](https://mastra.ai/reference/workflows/workflow)
- [.branch()](https://mastra.ai/reference/workflows/workflow-methods/branch)
- [.commit()](https://mastra.ai/reference/workflows/workflow-methods/commit)
- [.createRun()](https://mastra.ai/reference/workflows/workflow-methods/create-run)
- [.dountil()](https://mastra.ai/reference/workflows/workflow-methods/dountil)
- [.dowhile()](https://mastra.ai/reference/workflows/workflow-methods/dowhile)
- [.foreach()](https://mastra.ai/reference/workflows/workflow-methods/foreach)
- [.map()](https://mastra.ai/reference/workflows/workflow-methods/map)
- [.parallel()](https://mastra.ai/reference/workflows/workflow-methods/parallel)
- [.sleep()](https://mastra.ai/reference/workflows/workflow-methods/sleep)
- [.sleepUntil()](https://mastra.ai/reference/workflows/workflow-methods/sleepUntil)
- [.then()](https://mastra.ai/reference/workflows/workflow-methods/then)
- [.cancel()](https://mastra.ai/reference/workflows/run-methods/cancel)
- [.restart()](https://mastra.ai/reference/workflows/run-methods/restart)
- [.resume()](https://mastra.ai/reference/workflows/run-methods/resume)
- [.start()](https://mastra.ai/reference/workflows/run-methods/start)
- [.startAsync()](https://mastra.ai/reference/workflows/run-methods/startAsync)
- [.timeTravel()](https://mastra.ai/reference/workflows/run-methods/timeTravel)
- [AgentFSFilesystem](https://mastra.ai/reference/workspace/agentfs-filesystem)
- [BlaxelSandbox](https://mastra.ai/reference/workspace/blaxel-sandbox)
- [DaytonaSandbox](https://mastra.ai/reference/workspace/daytona-sandbox)
- [E2BSandbox](https://mastra.ai/reference/workspace/e2b-sandbox)
- [GCSFilesystem](https://mastra.ai/reference/workspace/gcs-filesystem)
- [LocalFilesystem](https://mastra.ai/reference/workspace/local-filesystem)
- [LocalSandbox](https://mastra.ai/reference/workspace/local-sandbox)
- [S3Filesystem](https://mastra.ai/reference/workspace/s3-filesystem)
- [SandboxProcessManager](https://mastra.ai/reference/workspace/process-manager)
- [VercelSandbox](https://mastra.ai/reference/workspace/vercel)
- [Workspace Class](https://mastra.ai/reference/workspace/workspace-class)
- [WorkspaceFilesystem](https://mastra.ai/reference/workspace/filesystem)
- [WorkspaceSandbox](https://mastra.ai/reference/workspace/sandbox)