AurionAI Docs

Apply Voice Usage Internal

Debit prepaid voice credits after a call ends. Called by LiveKit Agent cleanup handler after writing the authoritative voice_minutes usage event. Best-effort — the reconciliation CronJob (Task 9) catches any missed debits. Requires X-Internal-Secret header (fail-closed). Issue #912 Task 8.

POST
/api/internal/prepaid-credits/apply-voice-usage

Debit prepaid voice credits after a call ends.

Called by LiveKit Agent cleanup handler after writing the authoritative voice_minutes usage event. Best-effort — the reconciliation CronJob (Task 9) catches any missed debits.

Requires X-Internal-Secret header (fail-closed). Issue #912 Task 8.

Header Parameters

X-Internal-Secret?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://loading/api/internal/prepaid-credits/apply-voice-usage" \  -H "Content-Type: application/json" \  -d '{    "billable_minutes": 0,    "call_session_id": "string",    "occurred_at": "2019-08-24T14:15:22Z",    "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0"  }'
{}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}