telnyx 7.24.0 → 7.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/client.d.mts +27 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +27 -6
- package/client.d.ts.map +1 -1
- package/client.js +21 -0
- package/client.js.map +1 -1
- package/client.mjs +21 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/ai/ai.d.mts +16 -6
- package/resources/ai/ai.d.mts.map +1 -1
- package/resources/ai/ai.d.ts +16 -6
- package/resources/ai/ai.d.ts.map +1 -1
- package/resources/ai/ai.js +4 -0
- package/resources/ai/ai.js.map +1 -1
- package/resources/ai/ai.mjs +4 -0
- package/resources/ai/ai.mjs.map +1 -1
- package/resources/ai/assistants/assistants.d.mts +551 -33
- package/resources/ai/assistants/assistants.d.mts.map +1 -1
- package/resources/ai/assistants/assistants.d.ts +551 -33
- package/resources/ai/assistants/assistants.d.ts.map +1 -1
- package/resources/ai/assistants/assistants.js +79 -2
- package/resources/ai/assistants/assistants.js.map +1 -1
- package/resources/ai/assistants/assistants.mjs +79 -2
- package/resources/ai/assistants/assistants.mjs.map +1 -1
- package/resources/ai/assistants/deleted.d.mts +60 -0
- package/resources/ai/assistants/deleted.d.mts.map +1 -0
- package/resources/ai/assistants/deleted.d.ts +60 -0
- package/resources/ai/assistants/deleted.d.ts.map +1 -0
- package/resources/ai/assistants/deleted.js +49 -0
- package/resources/ai/assistants/deleted.js.map +1 -0
- package/resources/ai/assistants/deleted.mjs +45 -0
- package/resources/ai/assistants/deleted.mjs.map +1 -0
- package/resources/ai/assistants/index.d.mts +2 -1
- package/resources/ai/assistants/index.d.mts.map +1 -1
- package/resources/ai/assistants/index.d.ts +2 -1
- package/resources/ai/assistants/index.d.ts.map +1 -1
- package/resources/ai/assistants/index.js +3 -1
- package/resources/ai/assistants/index.js.map +1 -1
- package/resources/ai/assistants/index.mjs +1 -0
- package/resources/ai/assistants/index.mjs.map +1 -1
- package/resources/ai/assistants/versions.d.mts +48 -0
- package/resources/ai/assistants/versions.d.mts.map +1 -1
- package/resources/ai/assistants/versions.d.ts +48 -0
- package/resources/ai/assistants/versions.d.ts.map +1 -1
- package/resources/ai/avatars.d.mts +187 -0
- package/resources/ai/avatars.d.mts.map +1 -0
- package/resources/ai/avatars.d.ts +187 -0
- package/resources/ai/avatars.d.ts.map +1 -0
- package/resources/ai/avatars.js +93 -0
- package/resources/ai/avatars.js.map +1 -0
- package/resources/ai/avatars.mjs +89 -0
- package/resources/ai/avatars.mjs.map +1 -0
- package/resources/ai/chat.d.mts +21 -2
- package/resources/ai/chat.d.mts.map +1 -1
- package/resources/ai/chat.d.ts +21 -2
- package/resources/ai/chat.d.ts.map +1 -1
- package/resources/ai/conversations/conversations.d.mts +8 -0
- package/resources/ai/conversations/conversations.d.mts.map +1 -1
- package/resources/ai/conversations/conversations.d.ts +8 -0
- package/resources/ai/conversations/conversations.d.ts.map +1 -1
- package/resources/ai/conversations/conversations.js.map +1 -1
- package/resources/ai/conversations/conversations.mjs.map +1 -1
- package/resources/ai/embeddings/embeddings.d.mts +1 -1
- package/resources/ai/embeddings/embeddings.d.ts +1 -1
- package/resources/ai/embeddings/embeddings.js +1 -1
- package/resources/ai/embeddings/embeddings.mjs +1 -1
- package/resources/ai/index.d.mts +3 -2
- package/resources/ai/index.d.mts.map +1 -1
- package/resources/ai/index.d.ts +3 -2
- package/resources/ai/index.d.ts.map +1 -1
- package/resources/ai/index.js +3 -1
- package/resources/ai/index.js.map +1 -1
- package/resources/ai/index.mjs +1 -0
- package/resources/ai/index.mjs.map +1 -1
- package/resources/ai/memory/index.d.mts +1 -1
- package/resources/ai/memory/index.d.mts.map +1 -1
- package/resources/ai/memory/index.d.ts +1 -1
- package/resources/ai/memory/index.d.ts.map +1 -1
- package/resources/ai/memory/index.js.map +1 -1
- package/resources/ai/memory/index.mjs +1 -1
- package/resources/ai/memory/index.mjs.map +1 -1
- package/resources/ai/memory/memory.d.mts +2 -2
- package/resources/ai/memory/memory.d.mts.map +1 -1
- package/resources/ai/memory/memory.d.ts +2 -2
- package/resources/ai/memory/memory.d.ts.map +1 -1
- package/resources/ai/memory/memory.js.map +1 -1
- package/resources/ai/memory/memory.mjs +1 -1
- package/resources/ai/memory/memory.mjs.map +1 -1
- package/resources/ai/memory/namespaces/index.d.mts +2 -2
- package/resources/ai/memory/namespaces/index.d.mts.map +1 -1
- package/resources/ai/memory/namespaces/index.d.ts +2 -2
- package/resources/ai/memory/namespaces/index.d.ts.map +1 -1
- package/resources/ai/memory/namespaces/index.js.map +1 -1
- package/resources/ai/memory/namespaces/index.mjs +1 -1
- package/resources/ai/memory/namespaces/index.mjs.map +1 -1
- package/resources/ai/memory/namespaces/namespaces.d.mts +62 -6
- package/resources/ai/memory/namespaces/namespaces.d.mts.map +1 -1
- package/resources/ai/memory/namespaces/namespaces.d.ts +62 -6
- package/resources/ai/memory/namespaces/namespaces.d.ts.map +1 -1
- package/resources/ai/memory/namespaces/namespaces.js +41 -3
- package/resources/ai/memory/namespaces/namespaces.js.map +1 -1
- package/resources/ai/memory/namespaces/namespaces.mjs +41 -3
- package/resources/ai/memory/namespaces/namespaces.mjs.map +1 -1
- package/resources/ai/memory/namespaces/profiles/index.d.mts +1 -1
- package/resources/ai/memory/namespaces/profiles/index.d.mts.map +1 -1
- package/resources/ai/memory/namespaces/profiles/index.d.ts +1 -1
- package/resources/ai/memory/namespaces/profiles/index.d.ts.map +1 -1
- package/resources/ai/memory/namespaces/profiles/index.js.map +1 -1
- package/resources/ai/memory/namespaces/profiles/index.mjs.map +1 -1
- package/resources/ai/memory/namespaces/profiles/profiles.d.mts +54 -1
- package/resources/ai/memory/namespaces/profiles/profiles.d.mts.map +1 -1
- package/resources/ai/memory/namespaces/profiles/profiles.d.ts +54 -1
- package/resources/ai/memory/namespaces/profiles/profiles.d.ts.map +1 -1
- package/resources/ai/memory/namespaces/profiles/profiles.js +31 -0
- package/resources/ai/memory/namespaces/profiles/profiles.js.map +1 -1
- package/resources/ai/memory/namespaces/profiles/profiles.mjs +31 -0
- package/resources/ai/memory/namespaces/profiles/profiles.mjs.map +1 -1
- package/resources/ai/openai/chat.d.mts +21 -2
- package/resources/ai/openai/chat.d.mts.map +1 -1
- package/resources/ai/openai/chat.d.ts +21 -2
- package/resources/ai/openai/chat.d.ts.map +1 -1
- package/resources/ai/tools.d.mts +20 -5
- package/resources/ai/tools.d.mts.map +1 -1
- package/resources/ai/tools.d.ts +20 -5
- package/resources/ai/tools.d.ts.map +1 -1
- package/resources/ai/tools.js +5 -2
- package/resources/ai/tools.js.map +1 -1
- package/resources/ai/tools.mjs +5 -2
- package/resources/ai/tools.mjs.map +1 -1
- package/resources/calls/actions.d.mts +135 -30
- package/resources/calls/actions.d.mts.map +1 -1
- package/resources/calls/actions.d.ts +135 -30
- package/resources/calls/actions.d.ts.map +1 -1
- package/resources/calls/actions.js +31 -0
- package/resources/calls/actions.js.map +1 -1
- package/resources/calls/actions.mjs +31 -0
- package/resources/calls/actions.mjs.map +1 -1
- package/resources/calls/calls.d.mts +72 -25
- package/resources/calls/calls.d.mts.map +1 -1
- package/resources/calls/calls.d.ts +72 -25
- package/resources/calls/calls.d.ts.map +1 -1
- package/resources/calls/calls.js +11 -0
- package/resources/calls/calls.js.map +1 -1
- package/resources/calls/calls.mjs +11 -0
- package/resources/calls/calls.mjs.map +1 -1
- package/resources/calls/index.d.mts +1 -1
- package/resources/calls/index.d.mts.map +1 -1
- package/resources/calls/index.d.ts +1 -1
- package/resources/calls/index.d.ts.map +1 -1
- package/resources/calls/index.js.map +1 -1
- package/resources/calls/index.mjs.map +1 -1
- package/resources/dir/dir.d.mts +226 -31
- package/resources/dir/dir.d.mts.map +1 -1
- package/resources/dir/dir.d.ts +226 -31
- package/resources/dir/dir.d.ts.map +1 -1
- package/resources/dir/dir.js +78 -14
- package/resources/dir/dir.js.map +1 -1
- package/resources/dir/dir.mjs +78 -14
- package/resources/dir/dir.mjs.map +1 -1
- package/resources/dir/index.d.mts +1 -1
- package/resources/dir/index.d.mts.map +1 -1
- package/resources/dir/index.d.ts +1 -1
- package/resources/dir/index.d.ts.map +1 -1
- package/resources/dir/index.js.map +1 -1
- package/resources/dir/index.mjs.map +1 -1
- package/resources/dir/phone-numbers.d.mts +8 -8
- package/resources/dir/phone-numbers.d.mts.map +1 -1
- package/resources/dir/phone-numbers.d.ts +8 -8
- package/resources/dir/phone-numbers.d.ts.map +1 -1
- package/resources/dir/phone-numbers.js +4 -4
- package/resources/dir/phone-numbers.mjs +4 -4
- package/resources/dir/references.d.mts +9 -6
- package/resources/dir/references.d.mts.map +1 -1
- package/resources/dir/references.d.ts +9 -6
- package/resources/dir/references.d.ts.map +1 -1
- package/resources/email-templates.d.mts +109 -18
- package/resources/email-templates.d.mts.map +1 -1
- package/resources/email-templates.d.ts +109 -18
- package/resources/email-templates.d.ts.map +1 -1
- package/resources/email-templates.js +5 -1
- package/resources/email-templates.js.map +1 -1
- package/resources/email-templates.mjs +5 -1
- package/resources/email-templates.mjs.map +1 -1
- package/resources/enterprises/dir.d.mts +25 -3
- package/resources/enterprises/dir.d.mts.map +1 -1
- package/resources/enterprises/dir.d.ts +25 -3
- package/resources/enterprises/dir.d.ts.map +1 -1
- package/resources/enterprises/dir.js +8 -2
- package/resources/enterprises/dir.js.map +1 -1
- package/resources/enterprises/dir.mjs +8 -2
- package/resources/enterprises/dir.mjs.map +1 -1
- package/resources/enterprises/enterprises.d.mts +244 -28
- package/resources/enterprises/enterprises.d.mts.map +1 -1
- package/resources/enterprises/enterprises.d.ts +244 -28
- package/resources/enterprises/enterprises.d.ts.map +1 -1
- package/resources/enterprises/enterprises.js +31 -7
- package/resources/enterprises/enterprises.js.map +1 -1
- package/resources/enterprises/enterprises.mjs +31 -7
- package/resources/enterprises/enterprises.mjs.map +1 -1
- package/resources/enterprises/index.d.mts +2 -1
- package/resources/enterprises/index.d.mts.map +1 -1
- package/resources/enterprises/index.d.ts +2 -1
- package/resources/enterprises/index.d.ts.map +1 -1
- package/resources/enterprises/index.js +3 -1
- package/resources/enterprises/index.js.map +1 -1
- package/resources/enterprises/index.mjs +1 -0
- package/resources/enterprises/index.mjs.map +1 -1
- package/resources/enterprises/reputation/external-verification.d.mts +94 -0
- package/resources/enterprises/reputation/external-verification.d.mts.map +1 -0
- package/resources/enterprises/reputation/external-verification.d.ts +94 -0
- package/resources/enterprises/reputation/external-verification.d.ts.map +1 -0
- package/resources/enterprises/reputation/external-verification.js +54 -0
- package/resources/enterprises/reputation/external-verification.js.map +1 -0
- package/resources/enterprises/reputation/external-verification.mjs +50 -0
- package/resources/enterprises/reputation/external-verification.mjs.map +1 -0
- package/resources/enterprises/reputation/index.d.mts +3 -2
- package/resources/enterprises/reputation/index.d.mts.map +1 -1
- package/resources/enterprises/reputation/index.d.ts +3 -2
- package/resources/enterprises/reputation/index.d.ts.map +1 -1
- package/resources/enterprises/reputation/index.js +3 -1
- package/resources/enterprises/reputation/index.js.map +1 -1
- package/resources/enterprises/reputation/index.mjs +1 -0
- package/resources/enterprises/reputation/index.mjs.map +1 -1
- package/resources/enterprises/reputation/loa.d.mts +64 -3
- package/resources/enterprises/reputation/loa.d.mts.map +1 -1
- package/resources/enterprises/reputation/loa.d.ts +64 -3
- package/resources/enterprises/reputation/loa.d.ts.map +1 -1
- package/resources/enterprises/reputation/numbers.d.mts +197 -4
- package/resources/enterprises/reputation/numbers.d.mts.map +1 -1
- package/resources/enterprises/reputation/numbers.d.ts +197 -4
- package/resources/enterprises/reputation/numbers.d.ts.map +1 -1
- package/resources/enterprises/reputation/numbers.js +58 -2
- package/resources/enterprises/reputation/numbers.js.map +1 -1
- package/resources/enterprises/reputation/numbers.mjs +58 -2
- package/resources/enterprises/reputation/numbers.mjs.map +1 -1
- package/resources/enterprises/reputation/remediation.d.mts +3 -2
- package/resources/enterprises/reputation/remediation.d.mts.map +1 -1
- package/resources/enterprises/reputation/remediation.d.ts +3 -2
- package/resources/enterprises/reputation/remediation.d.ts.map +1 -1
- package/resources/enterprises/reputation/reputation.d.mts +39 -3
- package/resources/enterprises/reputation/reputation.d.mts.map +1 -1
- package/resources/enterprises/reputation/reputation.d.ts +39 -3
- package/resources/enterprises/reputation/reputation.d.ts.map +1 -1
- package/resources/enterprises/reputation/reputation.js +22 -0
- package/resources/enterprises/reputation/reputation.js.map +1 -1
- package/resources/enterprises/reputation/reputation.mjs +22 -0
- package/resources/enterprises/reputation/reputation.mjs.map +1 -1
- package/resources/enterprises/verify-email.d.mts +91 -0
- package/resources/enterprises/verify-email.d.mts.map +1 -0
- package/resources/enterprises/verify-email.d.ts +91 -0
- package/resources/enterprises/verify-email.d.ts.map +1 -0
- package/resources/enterprises/verify-email.js +55 -0
- package/resources/enterprises/verify-email.js.map +1 -0
- package/resources/enterprises/verify-email.mjs +51 -0
- package/resources/enterprises/verify-email.mjs.map +1 -0
- package/resources/global-ip-assignment-health.d.mts +4 -4
- package/resources/global-ip-assignment-health.d.mts.map +1 -1
- package/resources/global-ip-assignment-health.d.ts +4 -4
- package/resources/global-ip-assignment-health.d.ts.map +1 -1
- package/resources/global-ip-assignments-usage.d.mts +4 -4
- package/resources/global-ip-assignments-usage.d.mts.map +1 -1
- package/resources/global-ip-assignments-usage.d.ts +4 -4
- package/resources/global-ip-assignments-usage.d.ts.map +1 -1
- package/resources/index.d.mts +6 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/infringement-claims.d.mts +4 -0
- package/resources/infringement-claims.d.mts.map +1 -1
- package/resources/infringement-claims.d.ts +4 -0
- package/resources/infringement-claims.d.ts.map +1 -1
- package/resources/llm-token-gateway/index.d.mts +6 -0
- package/resources/llm-token-gateway/index.d.mts.map +1 -0
- package/resources/llm-token-gateway/index.d.ts +6 -0
- package/resources/llm-token-gateway/index.d.ts.map +1 -0
- package/resources/llm-token-gateway/index.js +15 -0
- package/resources/llm-token-gateway/index.js.map +1 -0
- package/resources/llm-token-gateway/index.mjs +7 -0
- package/resources/llm-token-gateway/index.mjs.map +1 -0
- package/resources/llm-token-gateway/llm-token-gateway.d.mts +22 -0
- package/resources/llm-token-gateway/llm-token-gateway.d.mts.map +1 -0
- package/resources/llm-token-gateway/llm-token-gateway.d.ts +22 -0
- package/resources/llm-token-gateway/llm-token-gateway.d.ts.map +1 -0
- package/resources/llm-token-gateway/llm-token-gateway.js +29 -0
- package/resources/llm-token-gateway/llm-token-gateway.js.map +1 -0
- package/resources/llm-token-gateway/llm-token-gateway.mjs +24 -0
- package/resources/llm-token-gateway/llm-token-gateway.mjs.map +1 -0
- package/resources/llm-token-gateway/spend.d.mts +223 -0
- package/resources/llm-token-gateway/spend.d.mts.map +1 -0
- package/resources/llm-token-gateway/spend.d.ts +223 -0
- package/resources/llm-token-gateway/spend.d.ts.map +1 -0
- package/resources/llm-token-gateway/spend.js +56 -0
- package/resources/llm-token-gateway/spend.js.map +1 -0
- package/resources/llm-token-gateway/spend.mjs +52 -0
- package/resources/llm-token-gateway/spend.mjs.map +1 -0
- package/resources/llm-token-gateway/token-groups.d.mts +577 -0
- package/resources/llm-token-gateway/token-groups.d.mts.map +1 -0
- package/resources/llm-token-gateway/token-groups.d.ts +577 -0
- package/resources/llm-token-gateway/token-groups.d.ts.map +1 -0
- package/resources/llm-token-gateway/token-groups.js +139 -0
- package/resources/llm-token-gateway/token-groups.js.map +1 -0
- package/resources/llm-token-gateway/token-groups.mjs +135 -0
- package/resources/llm-token-gateway/token-groups.mjs.map +1 -0
- package/resources/llm-token-gateway/token-keys.d.mts +318 -0
- package/resources/llm-token-gateway/token-keys.d.mts.map +1 -0
- package/resources/llm-token-gateway/token-keys.d.ts +318 -0
- package/resources/llm-token-gateway/token-keys.d.ts.map +1 -0
- package/resources/llm-token-gateway/token-keys.js +127 -0
- package/resources/llm-token-gateway/token-keys.js.map +1 -0
- package/resources/llm-token-gateway/token-keys.mjs +123 -0
- package/resources/llm-token-gateway/token-keys.mjs.map +1 -0
- package/resources/llm-token-gateway/usage.d.mts +319 -0
- package/resources/llm-token-gateway/usage.d.mts.map +1 -0
- package/resources/llm-token-gateway/usage.d.ts +319 -0
- package/resources/llm-token-gateway/usage.d.ts.map +1 -0
- package/resources/llm-token-gateway/usage.js +63 -0
- package/resources/llm-token-gateway/usage.js.map +1 -0
- package/resources/llm-token-gateway/usage.mjs +59 -0
- package/resources/llm-token-gateway/usage.mjs.map +1 -0
- package/resources/llm-token-gateway.d.mts +2 -0
- package/resources/llm-token-gateway.d.mts.map +1 -0
- package/resources/llm-token-gateway.d.ts +2 -0
- package/resources/llm-token-gateway.d.ts.map +1 -0
- package/resources/llm-token-gateway.js +6 -0
- package/resources/llm-token-gateway.js.map +1 -0
- package/resources/llm-token-gateway.mjs +3 -0
- package/resources/llm-token-gateway.mjs.map +1 -0
- package/resources/meeting-sessions/meeting-sessions.d.mts +8 -9
- package/resources/meeting-sessions/meeting-sessions.d.mts.map +1 -1
- package/resources/meeting-sessions/meeting-sessions.d.ts +8 -9
- package/resources/meeting-sessions/meeting-sessions.d.ts.map +1 -1
- package/resources/meeting-sessions/meeting-sessions.js +6 -6
- package/resources/meeting-sessions/meeting-sessions.js.map +1 -1
- package/resources/meeting-sessions/meeting-sessions.mjs +6 -6
- package/resources/meeting-sessions/meeting-sessions.mjs.map +1 -1
- package/resources/phone-numbers/jobs.d.mts +17 -5
- package/resources/phone-numbers/jobs.d.mts.map +1 -1
- package/resources/phone-numbers/jobs.d.ts +17 -5
- package/resources/phone-numbers/jobs.d.ts.map +1 -1
- package/resources/phone-numbers/jobs.js +4 -3
- package/resources/phone-numbers/jobs.js.map +1 -1
- package/resources/phone-numbers/jobs.mjs +4 -3
- package/resources/phone-numbers/jobs.mjs.map +1 -1
- package/resources/porting-orders/phone-number-blocks.d.mts +1 -1
- package/resources/porting-orders/phone-number-blocks.d.mts.map +1 -1
- package/resources/porting-orders/phone-number-blocks.d.ts +1 -1
- package/resources/porting-orders/phone-number-blocks.d.ts.map +1 -1
- package/resources/porting-orders/porting-orders.d.mts +1 -1
- package/resources/porting-orders/porting-orders.d.mts.map +1 -1
- package/resources/porting-orders/porting-orders.d.ts +1 -1
- package/resources/porting-orders/porting-orders.d.ts.map +1 -1
- package/resources/porting-orders/porting-orders.js.map +1 -1
- package/resources/porting-orders/porting-orders.mjs.map +1 -1
- package/resources/porting-phone-numbers.d.mts +1 -1
- package/resources/porting-phone-numbers.d.mts.map +1 -1
- package/resources/porting-phone-numbers.d.ts +1 -1
- package/resources/porting-phone-numbers.d.ts.map +1 -1
- package/resources/reputation/numbers.d.mts +10 -0
- package/resources/reputation/numbers.d.mts.map +1 -1
- package/resources/reputation/numbers.d.ts +10 -0
- package/resources/reputation/numbers.d.ts.map +1 -1
- package/resources/requirements.d.mts +2 -2
- package/resources/requirements.d.mts.map +1 -1
- package/resources/requirements.d.ts +2 -2
- package/resources/requirements.d.ts.map +1 -1
- package/resources/sip-registration-status.d.mts +149 -0
- package/resources/sip-registration-status.d.mts.map +1 -0
- package/resources/sip-registration-status.d.ts +149 -0
- package/resources/sip-registration-status.d.ts.map +1 -0
- package/resources/sip-registration-status.js +32 -0
- package/resources/sip-registration-status.js.map +1 -0
- package/resources/sip-registration-status.mjs +28 -0
- package/resources/sip-registration-status.mjs.map +1 -0
- package/resources/spend-limits.d.mts +335 -0
- package/resources/spend-limits.d.mts.map +1 -0
- package/resources/spend-limits.d.ts +335 -0
- package/resources/spend-limits.d.ts.map +1 -0
- package/resources/spend-limits.js +91 -0
- package/resources/spend-limits.js.map +1 -0
- package/resources/spend-limits.mjs +87 -0
- package/resources/spend-limits.mjs.map +1 -0
- package/resources/terms-of-service/agreements.d.mts +12 -0
- package/resources/terms-of-service/agreements.d.mts.map +1 -1
- package/resources/terms-of-service/agreements.d.ts +12 -0
- package/resources/terms-of-service/agreements.d.ts.map +1 -1
- package/resources/terms-of-service/terms-of-service.d.mts +15 -0
- package/resources/terms-of-service/terms-of-service.d.mts.map +1 -1
- package/resources/terms-of-service/terms-of-service.d.ts +15 -0
- package/resources/terms-of-service/terms-of-service.d.ts.map +1 -1
- package/resources/terms-of-service/terms-of-service.js.map +1 -1
- package/resources/terms-of-service/terms-of-service.mjs.map +1 -1
- package/resources/texml/texml.d.mts +7 -3
- package/resources/texml/texml.d.mts.map +1 -1
- package/resources/texml/texml.d.ts +7 -3
- package/resources/texml/texml.d.ts.map +1 -1
- package/resources/texml/texml.js +4 -2
- package/resources/texml/texml.js.map +1 -1
- package/resources/texml/texml.mjs +4 -2
- package/resources/texml/texml.mjs.map +1 -1
- package/resources/text-to-speech/text-to-speech.d.mts +4 -2
- package/resources/text-to-speech/text-to-speech.d.mts.map +1 -1
- package/resources/text-to-speech/text-to-speech.d.ts +4 -2
- package/resources/text-to-speech/text-to-speech.d.ts.map +1 -1
- package/resources/webhooks.d.mts +967 -6
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +967 -6
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs.map +1 -1
- package/resources/whatsapp/index.d.mts +1 -0
- package/resources/whatsapp/index.d.mts.map +1 -1
- package/resources/whatsapp/index.d.ts +1 -0
- package/resources/whatsapp/index.d.ts.map +1 -1
- package/resources/whatsapp/index.js +3 -1
- package/resources/whatsapp/index.js.map +1 -1
- package/resources/whatsapp/index.mjs +1 -0
- package/resources/whatsapp/index.mjs.map +1 -1
- package/resources/whatsapp/phone-numbers/calling-routing.d.mts +90 -0
- package/resources/whatsapp/phone-numbers/calling-routing.d.mts.map +1 -0
- package/resources/whatsapp/phone-numbers/calling-routing.d.ts +90 -0
- package/resources/whatsapp/phone-numbers/calling-routing.d.ts.map +1 -0
- package/resources/whatsapp/phone-numbers/calling-routing.js +66 -0
- package/resources/whatsapp/phone-numbers/calling-routing.js.map +1 -0
- package/resources/whatsapp/phone-numbers/calling-routing.mjs +62 -0
- package/resources/whatsapp/phone-numbers/calling-routing.mjs.map +1 -0
- package/resources/whatsapp/phone-numbers/index.d.mts +1 -0
- package/resources/whatsapp/phone-numbers/index.d.mts.map +1 -1
- package/resources/whatsapp/phone-numbers/index.d.ts +1 -0
- package/resources/whatsapp/phone-numbers/index.d.ts.map +1 -1
- package/resources/whatsapp/phone-numbers/index.js +3 -1
- package/resources/whatsapp/phone-numbers/index.js.map +1 -1
- package/resources/whatsapp/phone-numbers/index.mjs +1 -0
- package/resources/whatsapp/phone-numbers/index.mjs.map +1 -1
- package/resources/whatsapp/phone-numbers/phone-numbers.d.mts +4 -0
- package/resources/whatsapp/phone-numbers/phone-numbers.d.mts.map +1 -1
- package/resources/whatsapp/phone-numbers/phone-numbers.d.ts +4 -0
- package/resources/whatsapp/phone-numbers/phone-numbers.d.ts.map +1 -1
- package/resources/whatsapp/phone-numbers/phone-numbers.js +4 -0
- package/resources/whatsapp/phone-numbers/phone-numbers.js.map +1 -1
- package/resources/whatsapp/phone-numbers/phone-numbers.mjs +4 -0
- package/resources/whatsapp/phone-numbers/phone-numbers.mjs.map +1 -1
- package/resources/whatsapp/signup.d.mts +128 -0
- package/resources/whatsapp/signup.d.mts.map +1 -0
- package/resources/whatsapp/signup.d.ts +128 -0
- package/resources/whatsapp/signup.d.ts.map +1 -0
- package/resources/whatsapp/signup.js +42 -0
- package/resources/whatsapp/signup.js.map +1 -0
- package/resources/whatsapp/signup.mjs +38 -0
- package/resources/whatsapp/signup.mjs.map +1 -0
- package/resources/whatsapp/whatsapp.d.mts +4 -0
- package/resources/whatsapp/whatsapp.d.mts.map +1 -1
- package/resources/whatsapp/whatsapp.d.ts +4 -0
- package/resources/whatsapp/whatsapp.d.ts.map +1 -1
- package/resources/whatsapp/whatsapp.js +4 -0
- package/resources/whatsapp/whatsapp.js.map +1 -1
- package/resources/whatsapp/whatsapp.mjs +4 -0
- package/resources/whatsapp/whatsapp.mjs.map +1 -1
- package/src/client.ts +83 -0
- package/src/resources/ai/ai.ts +48 -4
- package/src/resources/ai/assistants/assistants.ts +676 -33
- package/src/resources/ai/assistants/deleted.ts +86 -0
- package/src/resources/ai/assistants/index.ts +13 -0
- package/src/resources/ai/assistants/versions.ts +54 -0
- package/src/resources/ai/avatars.ts +238 -0
- package/src/resources/ai/chat.ts +21 -2
- package/src/resources/ai/conversations/conversations.ts +9 -0
- package/src/resources/ai/embeddings/embeddings.ts +1 -1
- package/src/resources/ai/index.ts +18 -1
- package/src/resources/ai/memory/index.ts +9 -1
- package/src/resources/ai/memory/memory.ts +13 -1
- package/src/resources/ai/memory/namespaces/index.ts +11 -1
- package/src/resources/ai/memory/namespaces/namespaces.ts +85 -3
- package/src/resources/ai/memory/namespaces/profiles/index.ts +2 -0
- package/src/resources/ai/memory/namespaces/profiles/profiles.ts +71 -0
- package/src/resources/ai/openai/chat.ts +21 -2
- package/src/resources/ai/tools.ts +25 -7
- package/src/resources/calls/actions.ts +141 -25
- package/src/resources/calls/calls.ts +73 -17
- package/src/resources/calls/index.ts +1 -0
- package/src/resources/dir/dir.ts +269 -35
- package/src/resources/dir/index.ts +6 -0
- package/src/resources/dir/phone-numbers.ts +9 -10
- package/src/resources/dir/references.ts +9 -6
- package/src/resources/email-templates.ts +121 -19
- package/src/resources/enterprises/dir.ts +27 -3
- package/src/resources/enterprises/enterprises.ts +257 -26
- package/src/resources/enterprises/index.ts +6 -0
- package/src/resources/enterprises/reputation/external-verification.ts +125 -0
- package/src/resources/enterprises/reputation/index.ts +12 -0
- package/src/resources/enterprises/reputation/loa.ts +76 -3
- package/src/resources/enterprises/reputation/numbers.ts +256 -3
- package/src/resources/enterprises/reputation/remediation.ts +3 -2
- package/src/resources/enterprises/reputation/reputation.ts +70 -0
- package/src/resources/enterprises/verify-email.ts +117 -0
- package/src/resources/global-ip-assignment-health.ts +4 -4
- package/src/resources/global-ip-assignments-usage.ts +4 -4
- package/src/resources/index.ts +31 -0
- package/src/resources/infringement-claims.ts +4 -0
- package/src/resources/llm-token-gateway/index.ts +41 -0
- package/src/resources/llm-token-gateway/llm-token-gateway.ts +101 -0
- package/src/resources/llm-token-gateway/spend.ts +309 -0
- package/src/resources/llm-token-gateway/token-groups.ts +724 -0
- package/src/resources/llm-token-gateway/token-keys.ts +422 -0
- package/src/resources/llm-token-gateway/usage.ts +460 -0
- package/src/resources/llm-token-gateway.ts +3 -0
- package/src/resources/meeting-sessions/meeting-sessions.ts +8 -9
- package/src/resources/phone-numbers/jobs.ts +18 -5
- package/src/resources/porting-orders/phone-number-blocks.ts +9 -1
- package/src/resources/porting-orders/porting-orders.ts +9 -1
- package/src/resources/porting-phone-numbers.ts +9 -1
- package/src/resources/reputation/numbers.ts +12 -0
- package/src/resources/requirements.ts +2 -2
- package/src/resources/sip-registration-status.ts +188 -0
- package/src/resources/spend-limits.ts +428 -0
- package/src/resources/terms-of-service/agreements.ts +12 -0
- package/src/resources/terms-of-service/terms-of-service.ts +15 -0
- package/src/resources/texml/texml.ts +7 -3
- package/src/resources/text-to-speech/text-to-speech.ts +4 -2
- package/src/resources/webhooks.ts +1460 -228
- package/src/resources/whatsapp/index.ts +7 -0
- package/src/resources/whatsapp/phone-numbers/calling-routing.ts +114 -0
- package/src/resources/whatsapp/phone-numbers/index.ts +7 -0
- package/src/resources/whatsapp/phone-numbers/phone-numbers.ts +18 -0
- package/src/resources/whatsapp/signup.ts +188 -0
- package/src/resources/whatsapp/whatsapp.ts +18 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
2
|
+
import * as UsageAPI from "./usage.mjs";
|
|
3
|
+
import { APIPromise } from "../../core/api-promise.mjs";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Manage and report AI Gateway usage.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Usage extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Gateway reference/enforcement usage, not invoice truth or BYOK provider charges.
|
|
11
|
+
* Requires the dedicated llm_token_gateway.usage.read V2 action for combined spend
|
|
12
|
+
* and guardrail reporting; existing spend.read and guardrail_events.read grants do
|
|
13
|
+
* not grant this endpoint. All totals, UTC daily buckets, models and latest 20
|
|
14
|
+
* guardrail events share one database snapshot. UTC half-open dates, at most 31
|
|
15
|
+
* days. Zero-filled days; at most 1000 models (503 rather than truncation on
|
|
16
|
+
* overflow/timeout). Known tokens sum independently known categories across latest
|
|
17
|
+
* attempt evidence, including corrections; unknown spend is excluded and
|
|
18
|
+
* unknown_requests/reserved_spend remain explicit. Guardrail counts count events,
|
|
19
|
+
* not distinct requests. No raw spend events, prompts or secrets. This read-only
|
|
20
|
+
* report creates no pagination snapshot and accepts no pagination parameters.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const response =
|
|
25
|
+
* await client.llmTokenGateway.usage.retrieveSummary({
|
|
26
|
+
* end_date: '2019-12-27',
|
|
27
|
+
* start_date: '2019-12-27',
|
|
28
|
+
* token_group_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
retrieveSummary(query: UsageRetrieveSummaryParams, options?: RequestOptions): APIPromise<UsageRetrieveSummaryResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Durable, replayable, content-free usage export for customer pipelines. Requires
|
|
35
|
+
* the dedicated llm_token_gateway.usage_export.read V2 action; spend.read and
|
|
36
|
+
* usage.read do not grant it. Records are inference.request (one per immutable
|
|
37
|
+
* ledger revision; a correction adds a new id with supersedes, keep the highest
|
|
38
|
+
* revision per request_id) and guardrail.evaluation (one per guardrail event,
|
|
39
|
+
* including blocked prompts with no inference record; correlate on request_id).
|
|
40
|
+
* Delivery is at least once in commit order: deduplicate on id. Records appear
|
|
41
|
+
* after settlement and after every older database transaction has finished
|
|
42
|
+
* (meta.horizon_lag_seconds); keep polling with next_cursor, which is always
|
|
43
|
+
* returned and is reusable after has_more is false. After a logical database
|
|
44
|
+
* restore, restart from start_time and deduplicate on id; a cursor from before it
|
|
45
|
+
* may return 409 cursor_expired (no Retry-After). Retention promise 30 days. No
|
|
46
|
+
* prompts, responses, provider credentials, supplier or customer rates. Gateway
|
|
47
|
+
* reference/enforcement usage, not invoice truth or BYOK provider charges.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const response =
|
|
52
|
+
* await client.llmTokenGateway.usage.retrieveExport();
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
retrieveExport(query?: UsageRetrieveExportParams | null | undefined, options?: RequestOptions): APIPromise<UsageRetrieveExportResponse>;
|
|
56
|
+
}
|
|
57
|
+
export interface GuardrailFinding {
|
|
58
|
+
action: 'flag' | 'block';
|
|
59
|
+
code: string;
|
|
60
|
+
count: number;
|
|
61
|
+
detector: 'secrets' | 'dlp' | 'safety';
|
|
62
|
+
}
|
|
63
|
+
export interface UsageRetrieveExportResponse {
|
|
64
|
+
data: Array<UsageRetrieveExportResponse.UsageExportInferenceRequest | UsageRetrieveExportResponse.UsageExportGuardrailEvaluation>;
|
|
65
|
+
meta: UsageRetrieveExportResponse.Meta;
|
|
66
|
+
}
|
|
67
|
+
export declare namespace UsageRetrieveExportResponse {
|
|
68
|
+
interface UsageExportInferenceRequest {
|
|
69
|
+
/**
|
|
70
|
+
* Deterministic: req\_{request_id}\_r{revision}. Deduplicate on id.
|
|
71
|
+
*/
|
|
72
|
+
id: string;
|
|
73
|
+
attempts: number;
|
|
74
|
+
biller: 'telnyx' | 'provider' | 'none';
|
|
75
|
+
cache_hit: boolean;
|
|
76
|
+
configuration_version: number;
|
|
77
|
+
/**
|
|
78
|
+
* USD decimal string with exactly 6 places, 0 to 1000000000.000000 (the Money
|
|
79
|
+
* bound); enforcement basis, not invoice truth.
|
|
80
|
+
*/
|
|
81
|
+
cost: string | null;
|
|
82
|
+
end_user_id: string | null;
|
|
83
|
+
input_tokens: number | null;
|
|
84
|
+
/**
|
|
85
|
+
* Customer request tags captured at admission; {} when untagged.
|
|
86
|
+
*/
|
|
87
|
+
metadata: {
|
|
88
|
+
[key: string]: string | number | boolean;
|
|
89
|
+
};
|
|
90
|
+
model: string;
|
|
91
|
+
output_tokens: number | null;
|
|
92
|
+
protocol: 'openai' | 'anthropic';
|
|
93
|
+
provider: string;
|
|
94
|
+
provider_key_id: string | null;
|
|
95
|
+
provider_model: string;
|
|
96
|
+
rate_version: string;
|
|
97
|
+
request_id: string;
|
|
98
|
+
revision: number;
|
|
99
|
+
route_mode: 'managed' | 'byok' | 'cache';
|
|
100
|
+
schema_version: 1;
|
|
101
|
+
status: 'succeeded' | 'failed' | 'partial' | 'unknown';
|
|
102
|
+
stream: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Previous revision id; keep the highest revision per request_id.
|
|
105
|
+
*/
|
|
106
|
+
supersedes: string | null;
|
|
107
|
+
timings: UsageExportInferenceRequest.Timings;
|
|
108
|
+
token_group_id: string;
|
|
109
|
+
token_key_id: string;
|
|
110
|
+
token_user_id: string | null;
|
|
111
|
+
type: 'inference.request';
|
|
112
|
+
usage_source: 'provider' | 'gateway_tokenizer' | 'operator' | null;
|
|
113
|
+
usage_status: 'known' | 'unknown' | 'reconciled';
|
|
114
|
+
}
|
|
115
|
+
namespace UsageExportInferenceRequest {
|
|
116
|
+
interface Timings {
|
|
117
|
+
admitted_at: string;
|
|
118
|
+
completed_at: string | null;
|
|
119
|
+
first_attempt_at: string | null;
|
|
120
|
+
/**
|
|
121
|
+
* completed_at - admitted_at as recorded by the ledger; not time to first token.
|
|
122
|
+
*/
|
|
123
|
+
gateway_duration_ms: number | null;
|
|
124
|
+
settled_at: string;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
interface UsageExportGuardrailEvaluation {
|
|
128
|
+
id: string;
|
|
129
|
+
created_at: string;
|
|
130
|
+
end_user_id: string | null;
|
|
131
|
+
evaluation_input_tokens: number | null;
|
|
132
|
+
evaluation_output_tokens: number | null;
|
|
133
|
+
findings: Array<UsageAPI.GuardrailFinding>;
|
|
134
|
+
/**
|
|
135
|
+
* Customer request tags from the x-ltg-metadata header: up to 5 entries. Keys are
|
|
136
|
+
* case-sensitive; keys starting with ltg*, telnyx*, litellm* or cf* (any case) are
|
|
137
|
+
* reserved. Values are strings (1-256 characters, no control or format
|
|
138
|
+
* characters), integers within +/-9007199254740991, or booleans; floats, null,
|
|
139
|
+
* objects and arrays are rejected. Values that look like credentials are rejected.
|
|
140
|
+
* Tags are attribution only: never forwarded upstream, never part of the response
|
|
141
|
+
* cache key, never used for budgets or routing. An untagged request reports {}.
|
|
142
|
+
*/
|
|
143
|
+
metadata: {
|
|
144
|
+
[key: string]: string | number | boolean;
|
|
145
|
+
};
|
|
146
|
+
model: string;
|
|
147
|
+
outcome: 'evaluated' | 'flagged' | 'blocked' | 'unevaluated';
|
|
148
|
+
request_id: string;
|
|
149
|
+
schema_version: 1;
|
|
150
|
+
stage: 'prompt' | 'response';
|
|
151
|
+
token_group_id: string;
|
|
152
|
+
token_key_id: string;
|
|
153
|
+
token_user_id: string | null;
|
|
154
|
+
type: 'guardrail.evaluation';
|
|
155
|
+
}
|
|
156
|
+
interface Meta {
|
|
157
|
+
has_more: boolean;
|
|
158
|
+
horizon_lag_seconds: number;
|
|
159
|
+
next_cursor: string;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
export interface UsageRetrieveSummaryResponse {
|
|
163
|
+
data: UsageRetrieveSummaryResponse.Data;
|
|
164
|
+
meta: UsageRetrieveSummaryResponse.Meta;
|
|
165
|
+
}
|
|
166
|
+
export declare namespace UsageRetrieveSummaryResponse {
|
|
167
|
+
interface Data {
|
|
168
|
+
by_day: Array<Data.ByDay>;
|
|
169
|
+
by_model: Array<Data.ByModel>;
|
|
170
|
+
guardrails: Data.Guardrails;
|
|
171
|
+
totals: Data.Totals;
|
|
172
|
+
}
|
|
173
|
+
namespace Data {
|
|
174
|
+
interface ByDay {
|
|
175
|
+
cache_hits: number;
|
|
176
|
+
date: string;
|
|
177
|
+
failed_requests: number;
|
|
178
|
+
input_tokens: number;
|
|
179
|
+
output_tokens: number;
|
|
180
|
+
partial_requests: number;
|
|
181
|
+
requests: number;
|
|
182
|
+
/**
|
|
183
|
+
* USD, decimal precision at most 6 places; parse exactly to integer micro-USD,
|
|
184
|
+
* never binary float accounting.
|
|
185
|
+
*/
|
|
186
|
+
reserved_spend: number;
|
|
187
|
+
/**
|
|
188
|
+
* USD, decimal precision at most 6 places; parse exactly to integer micro-USD,
|
|
189
|
+
* never binary float accounting.
|
|
190
|
+
*/
|
|
191
|
+
spend: number;
|
|
192
|
+
succeeded_requests: number;
|
|
193
|
+
unknown_requests: number;
|
|
194
|
+
}
|
|
195
|
+
interface ByModel {
|
|
196
|
+
cache_hits: number;
|
|
197
|
+
failed_requests: number;
|
|
198
|
+
input_tokens: number;
|
|
199
|
+
model: string;
|
|
200
|
+
output_tokens: number;
|
|
201
|
+
partial_requests: number;
|
|
202
|
+
requests: number;
|
|
203
|
+
/**
|
|
204
|
+
* USD, decimal precision at most 6 places; parse exactly to integer micro-USD,
|
|
205
|
+
* never binary float accounting.
|
|
206
|
+
*/
|
|
207
|
+
reserved_spend: number;
|
|
208
|
+
/**
|
|
209
|
+
* USD, decimal precision at most 6 places; parse exactly to integer micro-USD,
|
|
210
|
+
* never binary float accounting.
|
|
211
|
+
*/
|
|
212
|
+
spend: number;
|
|
213
|
+
succeeded_requests: number;
|
|
214
|
+
unknown_requests: number;
|
|
215
|
+
}
|
|
216
|
+
interface Guardrails {
|
|
217
|
+
blocked_events: number;
|
|
218
|
+
flagged_events: number;
|
|
219
|
+
recent_events: Array<Guardrails.RecentEvent>;
|
|
220
|
+
}
|
|
221
|
+
namespace Guardrails {
|
|
222
|
+
interface RecentEvent {
|
|
223
|
+
id: string;
|
|
224
|
+
created_at: string;
|
|
225
|
+
end_user_id: string | null;
|
|
226
|
+
evaluation_input_tokens: number | null;
|
|
227
|
+
evaluation_output_tokens: number | null;
|
|
228
|
+
findings: Array<UsageAPI.GuardrailFinding>;
|
|
229
|
+
/**
|
|
230
|
+
* Customer request tags from the x-ltg-metadata header: up to 5 entries. Keys are
|
|
231
|
+
* case-sensitive; keys starting with ltg*, telnyx*, litellm* or cf* (any case) are
|
|
232
|
+
* reserved. Values are strings (1-256 characters, no control or format
|
|
233
|
+
* characters), integers within +/-9007199254740991, or booleans; floats, null,
|
|
234
|
+
* objects and arrays are rejected. Values that look like credentials are rejected.
|
|
235
|
+
* Tags are attribution only: never forwarded upstream, never part of the response
|
|
236
|
+
* cache key, never used for budgets or routing. An untagged request reports {}.
|
|
237
|
+
*/
|
|
238
|
+
metadata: {
|
|
239
|
+
[key: string]: string | number | boolean;
|
|
240
|
+
};
|
|
241
|
+
model: string;
|
|
242
|
+
outcome: 'evaluated' | 'flagged' | 'blocked' | 'unevaluated';
|
|
243
|
+
record_type: 'guardrail_event';
|
|
244
|
+
request_id: string;
|
|
245
|
+
stage: 'prompt' | 'response';
|
|
246
|
+
token_group_id: string;
|
|
247
|
+
token_key_id: string;
|
|
248
|
+
token_user_id: string | null;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
interface Totals {
|
|
252
|
+
cache_hits: number;
|
|
253
|
+
failed_requests: number;
|
|
254
|
+
input_tokens: number;
|
|
255
|
+
output_tokens: number;
|
|
256
|
+
partial_requests: number;
|
|
257
|
+
requests: number;
|
|
258
|
+
/**
|
|
259
|
+
* USD, decimal precision at most 6 places; parse exactly to integer micro-USD,
|
|
260
|
+
* never binary float accounting.
|
|
261
|
+
*/
|
|
262
|
+
reserved_spend: number;
|
|
263
|
+
/**
|
|
264
|
+
* USD, decimal precision at most 6 places; parse exactly to integer micro-USD,
|
|
265
|
+
* never binary float accounting.
|
|
266
|
+
*/
|
|
267
|
+
spend: number;
|
|
268
|
+
succeeded_requests: number;
|
|
269
|
+
unknown_requests: number;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
interface Meta {
|
|
273
|
+
end_date: string;
|
|
274
|
+
/**
|
|
275
|
+
* The metadata[<key>] filters applied to every section; {} when unfiltered.
|
|
276
|
+
*/
|
|
277
|
+
metadata: {
|
|
278
|
+
[key: string]: string;
|
|
279
|
+
};
|
|
280
|
+
start_date: string;
|
|
281
|
+
token_group_id: string;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
export interface UsageRetrieveSummaryParams {
|
|
285
|
+
end_date: string;
|
|
286
|
+
start_date: string;
|
|
287
|
+
token_group_id: string;
|
|
288
|
+
/**
|
|
289
|
+
* Request tag filters as metadata[<key>]=<value>, at most 5, combined with AND. A
|
|
290
|
+
* value matches the tag's text form exactly (booleans as true/false, integers in
|
|
291
|
+
* decimal), so metadata[flag]=true matches both boolean true and the string
|
|
292
|
+
* "true". Keys are case-sensitive; reserved-prefix keys are rejected. Unindexed:
|
|
293
|
+
* bounded by the account, the date range and the report timeout.
|
|
294
|
+
*/
|
|
295
|
+
metadata?: {
|
|
296
|
+
[key: string]: string;
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
export interface UsageRetrieveExportParams {
|
|
300
|
+
/**
|
|
301
|
+
* Opaque next_cursor from a previous page; not combinable with start_time. Bound
|
|
302
|
+
* to the requested types; the account always comes from the credential.
|
|
303
|
+
*/
|
|
304
|
+
cursor?: string;
|
|
305
|
+
limit?: number;
|
|
306
|
+
/**
|
|
307
|
+
* First page only: RFC 3339 with offset, at most 30 days ago and not in the
|
|
308
|
+
* future; default now - 24h.
|
|
309
|
+
*/
|
|
310
|
+
start_time?: string;
|
|
311
|
+
/**
|
|
312
|
+
* Comma-separated subset of inference.request,guardrail.evaluation; default both.
|
|
313
|
+
*/
|
|
314
|
+
types?: string;
|
|
315
|
+
}
|
|
316
|
+
export declare namespace Usage {
|
|
317
|
+
export { type GuardrailFinding as GuardrailFinding, type UsageRetrieveExportResponse as UsageRetrieveExportResponse, type UsageRetrieveSummaryResponse as UsageRetrieveSummaryResponse, type UsageRetrieveSummaryParams as UsageRetrieveSummaryParams, type UsageRetrieveExportParams as UsageRetrieveExportParams, };
|
|
318
|
+
}
|
|
319
|
+
//# sourceMappingURL=usage.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.d.mts","sourceRoot":"","sources":["../../src/resources/llm-token-gateway/usage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAEhE;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,eAAe,CACb,KAAK,EAAE,0BAA0B,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,4BAA4B,CAAC;IAI3C;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,cAAc,CACZ,KAAK,GAAE,yBAAyB,GAAG,IAAI,GAAG,SAAc,EACxD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,2BAA2B,CAAC;CAG3C;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAEzB,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,CAAC;IAEd,QAAQ,EAAE,SAAS,GAAG,KAAK,GAAG,QAAQ,CAAC;CACxC;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,KAAK,CACP,2BAA2B,CAAC,2BAA2B,GACvD,2BAA2B,CAAC,8BAA8B,CAC7D,CAAC;IAEF,IAAI,EAAE,2BAA2B,CAAC,IAAI,CAAC;CACxC;AAED,yBAAiB,2BAA2B,CAAC;IAC3C,UAAiB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AE,MAAM,CAAC;YAE3B,gBAAgB,EAAE,MAAM,CAAC;SAC1B;KACF;IAED,UAAiB,IAAI;QACnB,QAAQ,EAAE,MAAM,CAAC;QAEjB;;WAEG;QACH,QAAQ,EAAE;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;QAEpC,UAAU,EAAE,MAAM,CAAC;QAEnB,cAAc,EAAE,MAAM,CAAC;KACxB;CACF;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAC;IAEjB,UAAU,EAAE,MAAM,CAAC;IAEnB,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACtC;AAED,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as UsageAPI from "./usage.js";
|
|
3
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
4
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Manage and report AI Gateway usage.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Usage extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Gateway reference/enforcement usage, not invoice truth or BYOK provider charges.
|
|
11
|
+
* Requires the dedicated llm_token_gateway.usage.read V2 action for combined spend
|
|
12
|
+
* and guardrail reporting; existing spend.read and guardrail_events.read grants do
|
|
13
|
+
* not grant this endpoint. All totals, UTC daily buckets, models and latest 20
|
|
14
|
+
* guardrail events share one database snapshot. UTC half-open dates, at most 31
|
|
15
|
+
* days. Zero-filled days; at most 1000 models (503 rather than truncation on
|
|
16
|
+
* overflow/timeout). Known tokens sum independently known categories across latest
|
|
17
|
+
* attempt evidence, including corrections; unknown spend is excluded and
|
|
18
|
+
* unknown_requests/reserved_spend remain explicit. Guardrail counts count events,
|
|
19
|
+
* not distinct requests. No raw spend events, prompts or secrets. This read-only
|
|
20
|
+
* report creates no pagination snapshot and accepts no pagination parameters.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const response =
|
|
25
|
+
* await client.llmTokenGateway.usage.retrieveSummary({
|
|
26
|
+
* end_date: '2019-12-27',
|
|
27
|
+
* start_date: '2019-12-27',
|
|
28
|
+
* token_group_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
retrieveSummary(query: UsageRetrieveSummaryParams, options?: RequestOptions): APIPromise<UsageRetrieveSummaryResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Durable, replayable, content-free usage export for customer pipelines. Requires
|
|
35
|
+
* the dedicated llm_token_gateway.usage_export.read V2 action; spend.read and
|
|
36
|
+
* usage.read do not grant it. Records are inference.request (one per immutable
|
|
37
|
+
* ledger revision; a correction adds a new id with supersedes, keep the highest
|
|
38
|
+
* revision per request_id) and guardrail.evaluation (one per guardrail event,
|
|
39
|
+
* including blocked prompts with no inference record; correlate on request_id).
|
|
40
|
+
* Delivery is at least once in commit order: deduplicate on id. Records appear
|
|
41
|
+
* after settlement and after every older database transaction has finished
|
|
42
|
+
* (meta.horizon_lag_seconds); keep polling with next_cursor, which is always
|
|
43
|
+
* returned and is reusable after has_more is false. After a logical database
|
|
44
|
+
* restore, restart from start_time and deduplicate on id; a cursor from before it
|
|
45
|
+
* may return 409 cursor_expired (no Retry-After). Retention promise 30 days. No
|
|
46
|
+
* prompts, responses, provider credentials, supplier or customer rates. Gateway
|
|
47
|
+
* reference/enforcement usage, not invoice truth or BYOK provider charges.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const response =
|
|
52
|
+
* await client.llmTokenGateway.usage.retrieveExport();
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
retrieveExport(query?: UsageRetrieveExportParams | null | undefined, options?: RequestOptions): APIPromise<UsageRetrieveExportResponse>;
|
|
56
|
+
}
|
|
57
|
+
export interface GuardrailFinding {
|
|
58
|
+
action: 'flag' | 'block';
|
|
59
|
+
code: string;
|
|
60
|
+
count: number;
|
|
61
|
+
detector: 'secrets' | 'dlp' | 'safety';
|
|
62
|
+
}
|
|
63
|
+
export interface UsageRetrieveExportResponse {
|
|
64
|
+
data: Array<UsageRetrieveExportResponse.UsageExportInferenceRequest | UsageRetrieveExportResponse.UsageExportGuardrailEvaluation>;
|
|
65
|
+
meta: UsageRetrieveExportResponse.Meta;
|
|
66
|
+
}
|
|
67
|
+
export declare namespace UsageRetrieveExportResponse {
|
|
68
|
+
interface UsageExportInferenceRequest {
|
|
69
|
+
/**
|
|
70
|
+
* Deterministic: req\_{request_id}\_r{revision}. Deduplicate on id.
|
|
71
|
+
*/
|
|
72
|
+
id: string;
|
|
73
|
+
attempts: number;
|
|
74
|
+
biller: 'telnyx' | 'provider' | 'none';
|
|
75
|
+
cache_hit: boolean;
|
|
76
|
+
configuration_version: number;
|
|
77
|
+
/**
|
|
78
|
+
* USD decimal string with exactly 6 places, 0 to 1000000000.000000 (the Money
|
|
79
|
+
* bound); enforcement basis, not invoice truth.
|
|
80
|
+
*/
|
|
81
|
+
cost: string | null;
|
|
82
|
+
end_user_id: string | null;
|
|
83
|
+
input_tokens: number | null;
|
|
84
|
+
/**
|
|
85
|
+
* Customer request tags captured at admission; {} when untagged.
|
|
86
|
+
*/
|
|
87
|
+
metadata: {
|
|
88
|
+
[key: string]: string | number | boolean;
|
|
89
|
+
};
|
|
90
|
+
model: string;
|
|
91
|
+
output_tokens: number | null;
|
|
92
|
+
protocol: 'openai' | 'anthropic';
|
|
93
|
+
provider: string;
|
|
94
|
+
provider_key_id: string | null;
|
|
95
|
+
provider_model: string;
|
|
96
|
+
rate_version: string;
|
|
97
|
+
request_id: string;
|
|
98
|
+
revision: number;
|
|
99
|
+
route_mode: 'managed' | 'byok' | 'cache';
|
|
100
|
+
schema_version: 1;
|
|
101
|
+
status: 'succeeded' | 'failed' | 'partial' | 'unknown';
|
|
102
|
+
stream: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Previous revision id; keep the highest revision per request_id.
|
|
105
|
+
*/
|
|
106
|
+
supersedes: string | null;
|
|
107
|
+
timings: UsageExportInferenceRequest.Timings;
|
|
108
|
+
token_group_id: string;
|
|
109
|
+
token_key_id: string;
|
|
110
|
+
token_user_id: string | null;
|
|
111
|
+
type: 'inference.request';
|
|
112
|
+
usage_source: 'provider' | 'gateway_tokenizer' | 'operator' | null;
|
|
113
|
+
usage_status: 'known' | 'unknown' | 'reconciled';
|
|
114
|
+
}
|
|
115
|
+
namespace UsageExportInferenceRequest {
|
|
116
|
+
interface Timings {
|
|
117
|
+
admitted_at: string;
|
|
118
|
+
completed_at: string | null;
|
|
119
|
+
first_attempt_at: string | null;
|
|
120
|
+
/**
|
|
121
|
+
* completed_at - admitted_at as recorded by the ledger; not time to first token.
|
|
122
|
+
*/
|
|
123
|
+
gateway_duration_ms: number | null;
|
|
124
|
+
settled_at: string;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
interface UsageExportGuardrailEvaluation {
|
|
128
|
+
id: string;
|
|
129
|
+
created_at: string;
|
|
130
|
+
end_user_id: string | null;
|
|
131
|
+
evaluation_input_tokens: number | null;
|
|
132
|
+
evaluation_output_tokens: number | null;
|
|
133
|
+
findings: Array<UsageAPI.GuardrailFinding>;
|
|
134
|
+
/**
|
|
135
|
+
* Customer request tags from the x-ltg-metadata header: up to 5 entries. Keys are
|
|
136
|
+
* case-sensitive; keys starting with ltg*, telnyx*, litellm* or cf* (any case) are
|
|
137
|
+
* reserved. Values are strings (1-256 characters, no control or format
|
|
138
|
+
* characters), integers within +/-9007199254740991, or booleans; floats, null,
|
|
139
|
+
* objects and arrays are rejected. Values that look like credentials are rejected.
|
|
140
|
+
* Tags are attribution only: never forwarded upstream, never part of the response
|
|
141
|
+
* cache key, never used for budgets or routing. An untagged request reports {}.
|
|
142
|
+
*/
|
|
143
|
+
metadata: {
|
|
144
|
+
[key: string]: string | number | boolean;
|
|
145
|
+
};
|
|
146
|
+
model: string;
|
|
147
|
+
outcome: 'evaluated' | 'flagged' | 'blocked' | 'unevaluated';
|
|
148
|
+
request_id: string;
|
|
149
|
+
schema_version: 1;
|
|
150
|
+
stage: 'prompt' | 'response';
|
|
151
|
+
token_group_id: string;
|
|
152
|
+
token_key_id: string;
|
|
153
|
+
token_user_id: string | null;
|
|
154
|
+
type: 'guardrail.evaluation';
|
|
155
|
+
}
|
|
156
|
+
interface Meta {
|
|
157
|
+
has_more: boolean;
|
|
158
|
+
horizon_lag_seconds: number;
|
|
159
|
+
next_cursor: string;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
export interface UsageRetrieveSummaryResponse {
|
|
163
|
+
data: UsageRetrieveSummaryResponse.Data;
|
|
164
|
+
meta: UsageRetrieveSummaryResponse.Meta;
|
|
165
|
+
}
|
|
166
|
+
export declare namespace UsageRetrieveSummaryResponse {
|
|
167
|
+
interface Data {
|
|
168
|
+
by_day: Array<Data.ByDay>;
|
|
169
|
+
by_model: Array<Data.ByModel>;
|
|
170
|
+
guardrails: Data.Guardrails;
|
|
171
|
+
totals: Data.Totals;
|
|
172
|
+
}
|
|
173
|
+
namespace Data {
|
|
174
|
+
interface ByDay {
|
|
175
|
+
cache_hits: number;
|
|
176
|
+
date: string;
|
|
177
|
+
failed_requests: number;
|
|
178
|
+
input_tokens: number;
|
|
179
|
+
output_tokens: number;
|
|
180
|
+
partial_requests: number;
|
|
181
|
+
requests: number;
|
|
182
|
+
/**
|
|
183
|
+
* USD, decimal precision at most 6 places; parse exactly to integer micro-USD,
|
|
184
|
+
* never binary float accounting.
|
|
185
|
+
*/
|
|
186
|
+
reserved_spend: number;
|
|
187
|
+
/**
|
|
188
|
+
* USD, decimal precision at most 6 places; parse exactly to integer micro-USD,
|
|
189
|
+
* never binary float accounting.
|
|
190
|
+
*/
|
|
191
|
+
spend: number;
|
|
192
|
+
succeeded_requests: number;
|
|
193
|
+
unknown_requests: number;
|
|
194
|
+
}
|
|
195
|
+
interface ByModel {
|
|
196
|
+
cache_hits: number;
|
|
197
|
+
failed_requests: number;
|
|
198
|
+
input_tokens: number;
|
|
199
|
+
model: string;
|
|
200
|
+
output_tokens: number;
|
|
201
|
+
partial_requests: number;
|
|
202
|
+
requests: number;
|
|
203
|
+
/**
|
|
204
|
+
* USD, decimal precision at most 6 places; parse exactly to integer micro-USD,
|
|
205
|
+
* never binary float accounting.
|
|
206
|
+
*/
|
|
207
|
+
reserved_spend: number;
|
|
208
|
+
/**
|
|
209
|
+
* USD, decimal precision at most 6 places; parse exactly to integer micro-USD,
|
|
210
|
+
* never binary float accounting.
|
|
211
|
+
*/
|
|
212
|
+
spend: number;
|
|
213
|
+
succeeded_requests: number;
|
|
214
|
+
unknown_requests: number;
|
|
215
|
+
}
|
|
216
|
+
interface Guardrails {
|
|
217
|
+
blocked_events: number;
|
|
218
|
+
flagged_events: number;
|
|
219
|
+
recent_events: Array<Guardrails.RecentEvent>;
|
|
220
|
+
}
|
|
221
|
+
namespace Guardrails {
|
|
222
|
+
interface RecentEvent {
|
|
223
|
+
id: string;
|
|
224
|
+
created_at: string;
|
|
225
|
+
end_user_id: string | null;
|
|
226
|
+
evaluation_input_tokens: number | null;
|
|
227
|
+
evaluation_output_tokens: number | null;
|
|
228
|
+
findings: Array<UsageAPI.GuardrailFinding>;
|
|
229
|
+
/**
|
|
230
|
+
* Customer request tags from the x-ltg-metadata header: up to 5 entries. Keys are
|
|
231
|
+
* case-sensitive; keys starting with ltg*, telnyx*, litellm* or cf* (any case) are
|
|
232
|
+
* reserved. Values are strings (1-256 characters, no control or format
|
|
233
|
+
* characters), integers within +/-9007199254740991, or booleans; floats, null,
|
|
234
|
+
* objects and arrays are rejected. Values that look like credentials are rejected.
|
|
235
|
+
* Tags are attribution only: never forwarded upstream, never part of the response
|
|
236
|
+
* cache key, never used for budgets or routing. An untagged request reports {}.
|
|
237
|
+
*/
|
|
238
|
+
metadata: {
|
|
239
|
+
[key: string]: string | number | boolean;
|
|
240
|
+
};
|
|
241
|
+
model: string;
|
|
242
|
+
outcome: 'evaluated' | 'flagged' | 'blocked' | 'unevaluated';
|
|
243
|
+
record_type: 'guardrail_event';
|
|
244
|
+
request_id: string;
|
|
245
|
+
stage: 'prompt' | 'response';
|
|
246
|
+
token_group_id: string;
|
|
247
|
+
token_key_id: string;
|
|
248
|
+
token_user_id: string | null;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
interface Totals {
|
|
252
|
+
cache_hits: number;
|
|
253
|
+
failed_requests: number;
|
|
254
|
+
input_tokens: number;
|
|
255
|
+
output_tokens: number;
|
|
256
|
+
partial_requests: number;
|
|
257
|
+
requests: number;
|
|
258
|
+
/**
|
|
259
|
+
* USD, decimal precision at most 6 places; parse exactly to integer micro-USD,
|
|
260
|
+
* never binary float accounting.
|
|
261
|
+
*/
|
|
262
|
+
reserved_spend: number;
|
|
263
|
+
/**
|
|
264
|
+
* USD, decimal precision at most 6 places; parse exactly to integer micro-USD,
|
|
265
|
+
* never binary float accounting.
|
|
266
|
+
*/
|
|
267
|
+
spend: number;
|
|
268
|
+
succeeded_requests: number;
|
|
269
|
+
unknown_requests: number;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
interface Meta {
|
|
273
|
+
end_date: string;
|
|
274
|
+
/**
|
|
275
|
+
* The metadata[<key>] filters applied to every section; {} when unfiltered.
|
|
276
|
+
*/
|
|
277
|
+
metadata: {
|
|
278
|
+
[key: string]: string;
|
|
279
|
+
};
|
|
280
|
+
start_date: string;
|
|
281
|
+
token_group_id: string;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
export interface UsageRetrieveSummaryParams {
|
|
285
|
+
end_date: string;
|
|
286
|
+
start_date: string;
|
|
287
|
+
token_group_id: string;
|
|
288
|
+
/**
|
|
289
|
+
* Request tag filters as metadata[<key>]=<value>, at most 5, combined with AND. A
|
|
290
|
+
* value matches the tag's text form exactly (booleans as true/false, integers in
|
|
291
|
+
* decimal), so metadata[flag]=true matches both boolean true and the string
|
|
292
|
+
* "true". Keys are case-sensitive; reserved-prefix keys are rejected. Unindexed:
|
|
293
|
+
* bounded by the account, the date range and the report timeout.
|
|
294
|
+
*/
|
|
295
|
+
metadata?: {
|
|
296
|
+
[key: string]: string;
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
export interface UsageRetrieveExportParams {
|
|
300
|
+
/**
|
|
301
|
+
* Opaque next_cursor from a previous page; not combinable with start_time. Bound
|
|
302
|
+
* to the requested types; the account always comes from the credential.
|
|
303
|
+
*/
|
|
304
|
+
cursor?: string;
|
|
305
|
+
limit?: number;
|
|
306
|
+
/**
|
|
307
|
+
* First page only: RFC 3339 with offset, at most 30 days ago and not in the
|
|
308
|
+
* future; default now - 24h.
|
|
309
|
+
*/
|
|
310
|
+
start_time?: string;
|
|
311
|
+
/**
|
|
312
|
+
* Comma-separated subset of inference.request,guardrail.evaluation; default both.
|
|
313
|
+
*/
|
|
314
|
+
types?: string;
|
|
315
|
+
}
|
|
316
|
+
export declare namespace Usage {
|
|
317
|
+
export { type GuardrailFinding as GuardrailFinding, type UsageRetrieveExportResponse as UsageRetrieveExportResponse, type UsageRetrieveSummaryResponse as UsageRetrieveSummaryResponse, type UsageRetrieveSummaryParams as UsageRetrieveSummaryParams, type UsageRetrieveExportParams as UsageRetrieveExportParams, };
|
|
318
|
+
}
|
|
319
|
+
//# sourceMappingURL=usage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/resources/llm-token-gateway/usage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,QAAQ,mBAAgB;AACpC,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAEhE;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,eAAe,CACb,KAAK,EAAE,0BAA0B,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,4BAA4B,CAAC;IAI3C;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,cAAc,CACZ,KAAK,GAAE,yBAAyB,GAAG,IAAI,GAAG,SAAc,EACxD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,2BAA2B,CAAC;CAG3C;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAEzB,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,CAAC;IAEd,QAAQ,EAAE,SAAS,GAAG,KAAK,GAAG,QAAQ,CAAC;CACxC;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,KAAK,CACP,2BAA2B,CAAC,2BAA2B,GACvD,2BAA2B,CAAC,8BAA8B,CAC7D,CAAC;IAEF,IAAI,EAAE,2BAA2B,CAAC,IAAI,CAAC;CACxC;AAED,yBAAiB,2BAA2B,CAAC;IAC3C,UAAiB,2BAA2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