Generated from
trpc-methods.json. Runpnpm trpc:buildthenpnpm docs:methodsto refresh. Do not edit this page manually – use the generator instead.
Namespace ai
ai.generateText
ai.generateTextExecutes guarded text generation with system prompt protection, token metering, and BYOK handling for authenticated and public callers.
- content string
- systemPrompt string
- provider enumoptionalAllowed values
anthropicopenaigoogleopenrouter - apiKey stringoptional
- metadata objectoptional
- name stringoptional
- type stringoptional
-
- options objectoptional
- model stringoptional
- maxTokens numberoptionaldefault
- temperature numberoptional
-
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"content": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"systemPrompt": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"provider": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"anthropic",
"openai",
"google",
"openrouter"
]
}
},
"apiKey": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
},
"metadata": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"name": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
},
"type": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}
}
},
"options": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"model": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
},
"maxTokens": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "default",
"description": null,
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
}
},
"temperature": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
}
}
}
}
}
}- success boolean
- data any
- tokenUsage objectoptional
- tokensUsed number
- tokensCharged number
- platformFee numbernullable
- remainingBalance numbernullable
-
- usageInfo objectoptional
- tokensUsed number
- estimatedCostUsd number
-
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"success": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
},
"data": {
"type": "ZodAny",
"description": null,
"_source": null,
"jsType": "any"
},
"tokenUsage": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"tokensUsed": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
},
"tokensCharged": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
},
"platformFee": {
"type": "ZodNullable",
"description": null,
"_source": null,
"nullable": true,
"innerType": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
},
"remainingBalance": {
"type": "ZodNullable",
"description": null,
"_source": null,
"nullable": true,
"innerType": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
}
}
}
},
"usageInfo": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"tokensUsed": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
},
"estimatedCostUsd": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
}
}
}
}
}Examples
const { data } = await client.ai.generateText.mutate({
content: 'Compose a friendly onboarding email for new engineers.',
systemPrompt: 'You are a helpful onboarding assistant.',
});
console.log(data.success, data.data?.usage?.totalTokens);ai.getRegistryHealth
ai.getRegistryHealthReports availability and summary metrics for the registry integration, falling back to error details when checks fail.
{
"type": "ZodVoid",
"description": null,
"_source": null,
"jsType": "void"
}ai.listAllowedModels
ai.listAllowedModelsList allowed models for a provider (respects model restrictions) Returns production-ready model IDs that can be used directly with AI SDKs
- provider enumoptionalAllowed values
anthropicopenaigoogleopenrouter
{
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"provider": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"anthropic",
"openai",
"google",
"openrouter"
]
}
}
}
}
}ai.listProviders
ai.listProvidersReturns the providers currently registered in the model registry along with metadata about the registry source.
{
"type": "ZodVoid",
"description": null,
"_source": null,
"jsType": "void"
}ai.listProvidersBYOK
ai.listProvidersBYOKFilters the provider catalog to only those eligible for user-supplied API keys.
{
"type": "ZodVoid",
"description": null,
"_source": null,
"jsType": "void"
}ai.validateProvider
ai.validateProviderPerforms lightweight API key validation for supported providers to catch obvious misconfigurations.
- provider enumAllowed values
anthropicopenaigoogle - apiKey string
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"provider": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"anthropic",
"openai",
"google"
]
},
"apiKey": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}Namespace mcp
mcp.apiDocumentationPrompt
mcp.apiDocumentationPromptGenerate comprehensive API documentation from code
- code stringAPI code to document
- format enumdefaultOutput formatAllowed values
markdownopenapijson
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"code": {
"type": "ZodString",
"description": "API code to document",
"_source": null,
"jsType": "string"
},
"format": {
"type": "default",
"description": "Output format",
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"markdown",
"openapi",
"json"
]
}
}
}
}cURL
curl -X POST http://localhost:8000/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "mcp.apiDocumentationPrompt",
"params": { /* ... */ },
"id": "request-1"
}'tRPC Client
const result = await client.mcp.apiDocumentationPrompt.query({
/* ... */
});
console.log(result);mcp.codeReviewPrompt
mcp.codeReviewPromptComprehensive code review with security, performance, and maintainability analysis
- code stringCode to review
- language stringProgramming language
- focusArea stringoptionalFocus area
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"code": {
"type": "ZodString",
"description": "Code to review",
"_source": null,
"jsType": "string"
},
"language": {
"type": "ZodString",
"description": "Programming language",
"_source": null,
"jsType": "string"
},
"focusArea": {
"type": "ZodOptional",
"description": "Focus area",
"_source": null,
"optional": true,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}
}mcp.currentSystemTime
mcp.currentSystemTimeGet the current system time
- format enumdefaultTime formatAllowed values
isotimestamplocale
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"format": {
"type": "default",
"description": "Time format",
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"iso",
"timestamp",
"locale"
]
}
}
}
}mcp.echo
mcp.echoEcho back a message
- message stringMessage to echo back
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"message": {
"type": "ZodString",
"description": "Message to echo back",
"_source": null,
"jsType": "string"
}
}
}mcp.explainConceptPrompt
mcp.explainConceptPromptExplain technical concepts clearly at different skill levels
- concept stringConcept to explain
- level enumSkill levelAllowed values
beginnerintermediateadvanced - includeExamples enumdefaultInclude examplesAllowed values
yesno
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"concept": {
"type": "ZodString",
"description": "Concept to explain",
"_source": null,
"jsType": "string"
},
"level": {
"type": "ZodEnum",
"description": "Skill level",
"_source": null,
"jsType": "enum",
"enum": [
"beginner",
"intermediate",
"advanced"
]
},
"includeExamples": {
"type": "default",
"description": "Include examples",
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"yes",
"no"
]
}
}
}
}mcp.getResources
mcp.getResourcesList available MCP resources with metadata
- category stringoptionalFilter resources by category
- search stringoptionalSearch resources by name or description
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"category": {
"type": "ZodOptional",
"description": "Filter resources by category",
"_source": null,
"optional": true,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
},
"search": {
"type": "ZodOptional",
"description": "Search resources by name or description",
"_source": null,
"optional": true,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}
}- resources array
- total number
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"resources": {
"type": "ZodArray",
"description": null,
"_source": null,
"jsType": "array",
"items": {
"type": "String",
"description": null,
"_source": null
}
},
"total": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
}
}mcp.greeting
mcp.greetingGenerate a friendly greeting in the specified language
- name stringName to greet
- language enumdefaultLanguage for the greetingAllowed values
enesfrde
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"name": {
"type": "ZodString",
"description": "Name to greet",
"_source": null,
"jsType": "string"
},
"language": {
"type": "default",
"description": "Language for the greeting",
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"en",
"es",
"fr",
"de"
]
}
}
}
}mcp.incidentResponsePrompt
mcp.incidentResponsePromptGuide incident response procedures and provide action steps
- description stringIncident description
- severity enumSeverity levelAllowed values
criticalhighmediumlow - status stringoptionalCurrent status
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"description": {
"type": "ZodString",
"description": "Incident description",
"_source": null,
"jsType": "string"
},
"severity": {
"type": "ZodEnum",
"description": "Severity level",
"_source": null,
"jsType": "enum",
"enum": [
"critical",
"high",
"medium",
"low"
]
},
"status": {
"type": "ZodOptional",
"description": "Current status",
"_source": null,
"optional": true,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}
}cURL
curl -X POST http://localhost:8000/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "mcp.incidentResponsePrompt",
"params": { /* ... */ },
"id": "request-1"
}'tRPC Client
const result = await client.mcp.incidentResponsePrompt.query({
/* ... */
});
console.log(result);mcp.readResource
mcp.readResourceRead the content of a specific MCP resource
- uri stringURI of the resource to read
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"uri": {
"type": "ZodString",
"description": "URI of the resource to read",
"_source": null,
"jsType": "string"
}
}
}- content any
- mimeType string
- uri string
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"content": {
"type": "ZodAny",
"description": null,
"_source": null,
"jsType": "any"
},
"mimeType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"uri": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}Namespace admin
admin.clearCache
admin.clearCacheClear caches and reset services
Clear system caches and reset services
- target enumdefaultAllowed values
allmemorytokensusage
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"target": {
"type": "default",
"description": null,
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"all",
"memory",
"tokens",
"usage"
]
}
}
}
}admin.getConfig
admin.getConfigSystem configuration management
Get current system configuration
- section enumdefaultAllowed values
allserverauthaibilling
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"section": {
"type": "default",
"description": null,
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"all",
"server",
"auth",
"ai",
"billing"
]
}
}
}
}admin.getUserInfo
admin.getUserInfoGet user information (admin only)
Get detailed user information and permissions
- userId stringUser ID to lookup
- includePermissions booleandefaultInclude detailed permissions
- includeUsage booleandefaultInclude usage statistics
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"userId": {
"type": "ZodString",
"description": "User ID to lookup",
"_source": null,
"jsType": "string"
},
"includePermissions": {
"type": "default",
"description": "Include detailed permissions",
"_source": null,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
},
"includeUsage": {
"type": "default",
"description": "Include usage statistics",
"_source": null,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
}
}
}admin.healthCheck
admin.healthCheckSystem health checks
Run comprehensive health checks on all services
admin.statistics
admin.statisticsGet system statistics
Get detailed system statistics and metrics
- days numberdefaultNumber of days for statistics
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"days": {
"type": "default",
"description": "Number of days for statistics",
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
}
}
}admin.status
admin.statusServer status with detailed information
Get detailed server status and health information
- detailed booleandefaultInclude detailed system information
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"detailed": {
"type": "default",
"description": "Include detailed system information",
"_source": null,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
}
}
}- status string
- uptime number
- memory object
- used number
- total number
- percentage number
-
- system objectoptional
- platform string
- arch string
- nodeVersion string
-
- timestamp string
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"status": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"uptime": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
},
"memory": {
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"used": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
},
"total": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
},
"percentage": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
}
},
"system": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"platform": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"arch": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"nodeVersion": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}
},
"timestamp": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}Namespace auth
auth.deleteUserKey
auth.deleteUserKeyDelete user API key
- email string
- provider enumAllowed values
anthropicopenaigoogle
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"email": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"provider": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"anthropic",
"openai",
"google"
]
}
}
}auth.getUserKey
auth.getUserKeyGet user API key status (without exposing the key)
- email string
- provider enumAllowed values
anthropicopenaigoogle
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"email": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"provider": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"anthropic",
"openai",
"google"
]
}
}
}auth.getUserProviders
auth.getUserProvidersGet all configured providers for a user
- email string
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"email": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}auth.rotateUserKey
auth.rotateUserKeyRotate (update) user API key
- email string
- provider enumAllowed values
anthropicopenaigoogle - newApiKey string
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"email": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"provider": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"anthropic",
"openai",
"google"
]
},
"newApiKey": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}auth.storeUserKey
auth.storeUserKeyStore user API key (BYOK)
- email string
- provider enumAllowed values
anthropicopenaigoogle - apiKey string
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"email": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"provider": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"anthropic",
"openai",
"google"
]
},
"apiKey": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}auth.validateUserKey
auth.validateUserKeyValidate user API key
- email string
- provider enumAllowed values
anthropicopenaigoogle
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"email": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"provider": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"anthropic",
"openai",
"google"
]
}
}
}Namespace billing
billing.getConsumptionHistory
billing.getConsumptionHistoryGet consumption history for user
- limit numberdefault
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"limit": {
"type": "default",
"description": null,
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
}
}
}cURL
curl -X POST http://localhost:8000/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "billing.getConsumptionHistory",
"params": { /* ... */ },
"id": "request-1"
}'tRPC Client
const result = await client.billing.getConsumptionHistory.query({
/* ... */
});
console.log(result);billing.getPurchaseHistory
billing.getPurchaseHistoryGet user's purchase history (both subscription and one-time)
- limit numberdefault
- type enumdefaultAllowed values
allsubscriptionone_time
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"limit": {
"type": "default",
"description": null,
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
},
"type": {
"type": "default",
"description": null,
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"all",
"subscription",
"one_time"
]
}
}
}
}cURL
curl -X POST http://localhost:8000/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "billing.getPurchaseHistory",
"params": { /* ... */ },
"id": "request-1"
}'tRPC Client
const result = await client.billing.getPurchaseHistory.query({
/* ... */
});
console.log(result);billing.getTokenBalance
billing.getTokenBalanceGet user's token balance (requires authentication)
{
"type": "ZodVoid",
"description": null,
"_source": null,
"jsType": "void"
}billing.getTopupHistory
billing.getTopupHistoryGet user's token purchase history (requires authentication)
- limit numberdefault
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"limit": {
"type": "default",
"description": null,
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
}
}
}billing.getUsageAnalytics
billing.getUsageAnalyticsGet user's complete usage analytics (for both subscription and BYOK users)
- days numberdefault
- includeHistory booleandefault
- historyLimit numberdefault
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"days": {
"type": "default",
"description": null,
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
},
"includeHistory": {
"type": "default",
"description": null,
"_source": null,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
},
"historyLimit": {
"type": "default",
"description": null,
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
}
}
}cURL
curl -X POST http://localhost:8000/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "billing.getUsageAnalytics",
"params": { /* ... */ },
"id": "request-1"
}'tRPC Client
const result = await client.billing.getUsageAnalytics.query({
/* ... */
});
console.log(result);billing.getUsageHistory
billing.getUsageHistoryGet user's token usage history (requires authentication)
- limit numberdefault
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"limit": {
"type": "default",
"description": null,
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
}
}
}billing.getUserTokenBalances
billing.getUserTokenBalancesGet user's token balances (all types)
{
"type": "ZodVoid",
"description": null,
"_source": null,
"jsType": "void"
}billing.planConsumption
billing.planConsumptionPlan token consumption for a request (preview before execution)
- estimatedTokens number
- hasApiKey booleandefault
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"estimatedTokens": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
},
"hasApiKey": {
"type": "default",
"description": null,
"_source": null,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
}
}
}Namespace system
system.addServerWorkspace
system.addServerWorkspaceAdd a new server workspace configuration
Add a new server workspace configuration for file operations
- id stringUnique identifier for the workspace folder
- config object
- path stringAbsolute path to the workspace folder
- name stringoptionalDisplay name for the workspace folder
- description stringoptionalDescription of the workspace folder purpose
- readOnly booleandefaultWhether this server workspace is read-only
- allowedPaths arrayoptionalAllowed path patterns (glob)
- blockedPaths arrayoptionalBlocked path patterns (glob)
- maxFileSize numberoptionalMaximum file size in bytes
- allowedExtensions arrayoptionalAllowed file extensions
- blockedExtensions arrayoptionalBlocked file extensions
- followSymlinks booleandefaultWhether to follow symbolic links
- enableWatching booleandefaultWhether to watch for file changes
-
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"id": {
"type": "ZodString",
"description": "Unique identifier for the workspace folder",
"_source": null,
"jsType": "string"
},
"config": {
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"path": {
"type": "ZodString",
"description": "Absolute path to the workspace folder",
"_source": null,
"jsType": "string"
},
"name": {
"type": "ZodOptional",
"description": "Display name for the workspace folder",
"_source": null,
"optional": true,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
},
"description": {
"type": "ZodOptional",
"description": "Description of the workspace folder purpose",
"_source": null,
"optional": true,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
},
"readOnly": {
"type": "default",
"description": "Whether this server workspace is read-only",
"_source": null,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
},
"allowedPaths": {
"type": "ZodOptional",
"description": "Allowed path patterns (glob)",
"_source": null,
"optional": true,
"innerType": {
"type": "ZodArray",
"description": null,
"_source": null,
"jsType": "array",
"items": {
"type": "String",
"description": null,
"_source": null
}
}
},
"blockedPaths": {
"type": "ZodOptional",
"description": "Blocked path patterns (glob)",
"_source": null,
"optional": true,
"innerType": {
"type": "ZodArray",
"description": null,
"_source": null,
"jsType": "array",
"items": {
"type": "String",
"description": null,
"_source": null
}
}
},
"maxFileSize": {
"type": "ZodOptional",
"description": "Maximum file size in bytes",
"_source": null,
"optional": true,
"innerType": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
},
"allowedExtensions": {
"type": "ZodOptional",
"description": "Allowed file extensions",
"_source": null,
"optional": true,
"innerType": {
"type": "ZodArray",
"description": null,
"_source": null,
"jsType": "array",
"items": {
"type": "String",
"description": null,
"_source": null
}
}
},
"blockedExtensions": {
"type": "ZodOptional",
"description": "Blocked file extensions",
"_source": null,
"optional": true,
"innerType": {
"type": "ZodArray",
"description": null,
"_source": null,
"jsType": "array",
"items": {
"type": "String",
"description": null,
"_source": null
}
}
},
"followSymlinks": {
"type": "default",
"description": "Whether to follow symbolic links",
"_source": null,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
},
"enableWatching": {
"type": "default",
"description": "Whether to watch for file changes",
"_source": null,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
}
}
}
}
}- success boolean
- id string
- message string
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"success": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
},
"id": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"message": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}cURL
curl -X POST http://localhost:8000/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "system.addServerWorkspace",
"params": { /* ... */ },
"id": "request-1"
}'tRPC Client
const result = await client.system.addServerWorkspace.mutate({
/* ... */
});
console.log(result);system.getServerWorkspaces
system.getServerWorkspacesGet configured server workspaces for client applications
Get all configured server workspaces with accessibility status
{
"type": "ZodVoid",
"description": null,
"_source": null,
"jsType": "void"
}{
"type": "ZodRecord",
"description": null,
"_source": null
}system.health
system.healthHealth check procedure
{
"type": "ZodVoid",
"description": null,
"_source": null,
"jsType": "void"
}system.listClientWorkspaces
system.listClientWorkspacesList registered client workspaces (MCP client roots) This is separate from server workspaces and MCP roots/list
List all registered client workspace folders
{
"type": "ZodVoid",
"description": null,
"_source": null,
"jsType": "void"
}{
"type": "ZodArray",
"description": null,
"_source": null,
"jsType": "array",
"items": {
"type": "String",
"description": null,
"_source": null
}
}system.listFiles
system.listFilesList files and directories in a configured root folder
- workspaceId enumServer workspace IDAllowed values
default - path stringdefaultRelative path within workspace folder
- recursive booleandefaultInclude subdirectories recursively
- includeDirectories booleandefaultInclude directories in results
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"workspaceId": {
"type": "ZodEnum",
"description": "Server workspace ID",
"_source": null,
"jsType": "enum",
"enum": [
"default"
]
},
"path": {
"type": "default",
"description": "Relative path within workspace folder",
"_source": null,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
},
"recursive": {
"type": "default",
"description": "Include subdirectories recursively",
"_source": null,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
},
"includeDirectories": {
"type": "default",
"description": "Include directories in results",
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
}
}
}{
"type": "ZodArray",
"description": null,
"_source": null,
"jsType": "array",
"items": {
"type": "String",
"description": null,
"_source": null
}
}system.pathExists
system.pathExistsCheck if a file or directory exists in a configured root folder
- workspaceId enumServer workspace IDAllowed values
default - path stringRelative path within workspace folder
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"workspaceId": {
"type": "ZodEnum",
"description": "Server workspace ID",
"_source": null,
"jsType": "enum",
"enum": [
"default"
]
},
"path": {
"type": "ZodString",
"description": "Relative path within workspace folder",
"_source": null,
"jsType": "string"
}
}
}- exists boolean
- path string
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"exists": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
},
"path": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}system.readFile
system.readFileRead the content of a file from a configured root folder
- workspaceId enumServer workspace IDAllowed values
default - path stringRelative file path within workspace folder
- encoding enumdefaultFile encodingAllowed values
utf8base64binary
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"workspaceId": {
"type": "ZodEnum",
"description": "Server workspace ID",
"_source": null,
"jsType": "enum",
"enum": [
"default"
]
},
"path": {
"type": "ZodString",
"description": "Relative file path within workspace folder",
"_source": null,
"jsType": "string"
},
"encoding": {
"type": "default",
"description": "File encoding",
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"utf8",
"base64",
"binary"
]
}
}
}
}- content string
- size number
- encoding string
- mimeType stringoptional
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"content": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"size": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
},
"encoding": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"mimeType": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}
}system.registerClientWorkspace
system.registerClientWorkspaceRegister a client workspace (MCP client root) This allows MCP clients to dynamically register their workspace folders
Register a client workspace folder for MCP access
- id stringUnique identifier for the client workspace
- uri stringFile URI of the client workspace (e.g., file:///path/to/folder)
- name stringoptionalDisplay name for the workspace
- description stringoptionalDescription of the workspace
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"id": {
"type": "ZodString",
"description": "Unique identifier for the client workspace",
"_source": null,
"jsType": "string"
},
"uri": {
"type": "ZodString",
"description": "File URI of the client workspace (e.g., file:///path/to/folder)",
"_source": null,
"jsType": "string"
},
"name": {
"type": "ZodOptional",
"description": "Display name for the workspace",
"_source": null,
"optional": true,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
},
"description": {
"type": "ZodOptional",
"description": "Description of the workspace",
"_source": null,
"optional": true,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}
}- success boolean
- id string
- message string
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"success": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
},
"id": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"message": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}cURL
curl -X POST http://localhost:8000/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "system.registerClientWorkspace",
"params": { /* ... */ },
"id": "request-1"
}'tRPC Client
const result = await client.system.registerClientWorkspace.mutate({
/* ... */
});
console.log(result);system.removeServerWorkspace
system.removeServerWorkspaceRemove a server workspace configuration
- id stringServer workspace ID to remove
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"id": {
"type": "ZodString",
"description": "Server workspace ID to remove",
"_source": null,
"jsType": "string"
}
}
}- success boolean
- id string
- message string
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"success": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
},
"id": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"message": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}cURL
curl -X POST http://localhost:8000/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "system.removeServerWorkspace",
"params": { /* ... */ },
"id": "request-1"
}'tRPC Client
const result = await client.system.removeServerWorkspace.mutate({
/* ... */
});
console.log(result);system.test
system.testSimple test procedure with minimal Zod schema
Just a echo test endpoint
- message stringoptionaldefault
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"message": {
"type": "default",
"description": null,
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}
}
}- message string
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"message": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}system.unregisterClientWorkspace
system.unregisterClientWorkspaceUnregister a client workspace (MCP client root)
Unregister a client workspace folder
- id stringClient workspace ID to unregister
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"id": {
"type": "ZodString",
"description": "Client workspace ID to unregister",
"_source": null,
"jsType": "string"
}
}
}- success boolean
- id string
- message string
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"success": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
},
"id": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"message": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
}
}
}cURL
curl -X POST http://localhost:8000/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "system.unregisterClientWorkspace",
"params": { /* ... */ },
"id": "request-1"
}'tRPC Client
const result = await client.system.unregisterClientWorkspace.mutate({
/* ... */
});
console.log(result);system.writeFile
system.writeFileWrite content to a file in a configured root folder
- workspaceId enumServer workspace IDAllowed values
default - path stringRelative file path within workspace folder
- content stringFile content to write
- encoding enumdefaultContent encodingAllowed values
utf8base64binary
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"workspaceId": {
"type": "ZodEnum",
"description": "Server workspace ID",
"_source": null,
"jsType": "enum",
"enum": [
"default"
]
},
"path": {
"type": "ZodString",
"description": "Relative file path within workspace folder",
"_source": null,
"jsType": "string"
},
"content": {
"type": "ZodString",
"description": "File content to write",
"_source": null,
"jsType": "string"
},
"encoding": {
"type": "default",
"description": "Content encoding",
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodEnum",
"description": null,
"_source": null,
"jsType": "enum",
"enum": [
"utf8",
"base64",
"binary"
]
}
}
}
}- success boolean
- path string
- size number
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"success": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
},
"path": {
"type": "ZodString",
"description": null,
"_source": null,
"jsType": "string"
},
"size": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
}
}Namespace user
user.checkRequestEligibility
user.checkRequestEligibilityCheck if user can make AI requests (subscription users need tokens, BYOK users need API key)
- estimatedTokens numberdefault
- hasApiKey booleandefault
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"estimatedTokens": {
"type": "default",
"description": null,
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
},
"hasApiKey": {
"type": "default",
"description": null,
"_source": null,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
}
}
}cURL
curl -X POST http://localhost:8000/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "user.checkRequestEligibility",
"params": { /* ... */ },
"id": "request-1"
}'tRPC Client
const result = await client.user.checkRequestEligibility.query({
/* ... */
});
console.log(result);user.configureBYOK
user.configureBYOKConfigure BYOK providers for user (SECURE - API keys stored server-side)
- providers record
- enabled booleandefault
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"providers": {
"type": "ZodRecord",
"description": null,
"_source": null
},
"enabled": {
"type": "default",
"description": null,
"_source": null,
"hasDefault": true,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
}
}
}user.getBYOKStatus
user.getBYOKStatusGet BYOK configuration status (without exposing API keys)
{
"type": "ZodVoid",
"description": null,
"_source": null,
"jsType": "void"
}user.getUserProfile
user.getUserProfileGet user profile with capabilities and preferences (hybrid users)
{
"type": "ZodVoid",
"description": null,
"_source": null,
"jsType": "void"
}user.getUserStatus
user.getUserStatusGet user status (subscription vs BYOK, purchase history)
{
"type": "ZodVoid",
"description": null,
"_source": null,
"jsType": "void"
}user.updateUserPreferences
user.updateUserPreferencesUpdate user consumption preferences
- consumptionOrder arrayoptional
- byokEnabled booleanoptional
- byokProviders recordoptional
- notifyTokenLowThreshold numberoptional
- notifyFallbackToByok booleanoptional
- notifyOneTimeConsumed booleanoptional
{
"type": "ZodObject",
"description": null,
"_source": null,
"jsType": "object",
"properties": {
"consumptionOrder": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodArray",
"description": null,
"_source": null,
"jsType": "array",
"items": {
"type": "String",
"description": null,
"_source": null
}
}
},
"byokEnabled": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
},
"byokProviders": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodRecord",
"description": null,
"_source": null
}
},
"notifyTokenLowThreshold": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodNumber",
"description": null,
"_source": null,
"jsType": "number"
}
},
"notifyFallbackToByok": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
},
"notifyOneTimeConsumed": {
"type": "ZodOptional",
"description": null,
"_source": null,
"optional": true,
"innerType": {
"type": "ZodBoolean",
"description": null,
"_source": null,
"jsType": "boolean"
}
}
}
}cURL
curl -X POST http://localhost:8000/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "user.updateUserPreferences",
"params": { /* ... */ },
"id": "request-1"
}'tRPC Client
const result = await client.user.updateUserPreferences.mutate({
/* ... */
});
console.log(result);