/v1/ai-credits/{resourceId}When to use
Raise or lower the monthly AI credit limit of one Business Action or operation.
For agents
Requires view access to the resource and the Change AI limits permission on its workspace (workspace.manage_ai_credits). Workspace admin access includes the permission, including an API key with admin access on all resources, and regular members have both through the workspace's default access. To grant the permission without other admin rights, call client.permissions.create with resourceType 'workspace', the workspace ID, level 'admin' and operations ['workspace.read', 'workspace.manage_ai_credits']; the grantee also needs view access to the Business Actions and operations, for example a read grant on resourceType 'businessAction' or 'operation' with resourceId '*'. Through the API the limit can be at most 5,000 credits, and a higher value returns 403 forbidden; only organization admins can set more, on the action's page or the operation's Config tab in the web app. A limit of 0 blocks every AI call. Pass monthlyCredits: null to return to the 2,000-credit default. The organization's limit comes from its plan and cannot be changed here.
Example
import { PermuteClient } from '@permute/sdk';
const orgClient = new PermuteClient({
apiKey: process.env.PERMUTE_API_KEY!,
});
const client = orgClient.withWorkspace(process.env.PERMUTE_WORKSPACE_ID!);
const result = await client.aiCredits.setLimit('oper_abcdefghijklmnopqrstuvwx', {"monthlyCredits":5000});Request body
{
"monthlyCredits": 5000
}Response
{
"data": {
"resourceId": "oper_abcdefghijklmnopqrstuvwx",
"period": "2026-11",
"usedCredits": 120,
"monthlyLimit": 5000,
"isDefaultLimit": false,
"aiCallsEnabled": true,
"canEditLimit": true,
"maxSettableLimit": 5000
}
}