Read an automation's AI credit use
Returns the AI credits the automation's AI and code steps spent in the workspace's current usage period (settled charges plus holds still settling) and its monthly AI budget, or null when it has none. One credit is $0.001 of model or sandbox cost. Requires the `automations:read` permission plus view access to the automation.
apiKeyAuthorizationBearer <snoze_sk_…>Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.
workspaceId*stringautomationId*stringSuccess
application/json- response
data*curl -X GET 'https://api.snoze.dev/v1/workspaces/string/automations/string/ai-usage'{ "data": { "automationId": "string", "periodStart": "string", "periodEnd": "string", "usedMicrousd": 0, "usedCredits": 0, "monthlyBudgetMicrousd": 0, "monthlyBudgetCredits": 0 }}Replay one node execution from a finished run
Queues a new run that starts at the selected node with the original run's context restored. Requires the `automations:write` permission plus edit access; the original run must have finished and the selected node execution must itself be completed, failed, or cancelled, otherwise the request is rejected with a run error. Send an `Idempotency-Key` header to make retries safe; a replay within the window returns the original response.
Set an automation's monthly AI budget
Sets the most AI credits the automation may spend per usage period (1 to 1,000,000), or removes the ceiling with null. Once spent, its next AI or code step fails without retrying until the budget is raised or the period resets; the workspace allowance still applies either way. Requires the `automations:write` permission plus edit access; the change is recorded in the workspace activity log and does not touch the automation's draft. Send an `Idempotency-Key` header to make retries safe.