telnyx 7.24.0 → 7.25.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 +7 -0
- package/client.d.mts +19 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +19 -4
- package/client.d.ts.map +1 -1
- package/client.js +15 -0
- package/client.js.map +1 -1
- package/client.mjs +15 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/ai/ai.d.mts +7 -6
- package/resources/ai/ai.d.mts.map +1 -1
- package/resources/ai/ai.d.ts +7 -6
- package/resources/ai/ai.d.ts.map +1 -1
- package/resources/ai/ai.js.map +1 -1
- package/resources/ai/ai.mjs.map +1 -1
- package/resources/ai/assistants/assistants.d.mts +320 -28
- package/resources/ai/assistants/assistants.d.mts.map +1 -1
- package/resources/ai/assistants/assistants.d.ts +320 -28
- 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 +36 -0
- package/resources/ai/assistants/versions.d.mts.map +1 -1
- package/resources/ai/assistants/versions.d.ts +36 -0
- package/resources/ai/assistants/versions.d.ts.map +1 -1
- package/resources/ai/chat.d.mts +7 -2
- package/resources/ai/chat.d.mts.map +1 -1
- package/resources/ai/chat.d.ts +7 -2
- package/resources/ai/chat.d.ts.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 +2 -2
- package/resources/ai/index.d.mts.map +1 -1
- package/resources/ai/index.d.ts +2 -2
- package/resources/ai/index.d.ts.map +1 -1
- package/resources/ai/index.js.map +1 -1
- 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 +1 -1
- package/resources/ai/memory/namespaces/index.d.mts.map +1 -1
- package/resources/ai/memory/namespaces/index.d.ts +1 -1
- 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 +60 -4
- package/resources/ai/memory/namespaces/namespaces.d.mts.map +1 -1
- package/resources/ai/memory/namespaces/namespaces.d.ts +60 -4
- 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/openai/chat.d.mts +7 -2
- package/resources/ai/openai/chat.d.mts.map +1 -1
- package/resources/ai/openai/chat.d.ts +7 -2
- package/resources/ai/openai/chat.d.ts.map +1 -1
- package/resources/ai/tools.d.mts +3 -4
- package/resources/ai/tools.d.mts.map +1 -1
- package/resources/ai/tools.d.ts +3 -4
- 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 +76 -17
- package/resources/calls/actions.d.mts.map +1 -1
- package/resources/calls/actions.d.ts +76 -17
- 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 +48 -11
- package/resources/calls/calls.d.mts.map +1 -1
- package/resources/calls/calls.d.ts +48 -11
- package/resources/calls/calls.d.ts.map +1 -1
- package/resources/calls/calls.js +3 -0
- package/resources/calls/calls.js.map +1 -1
- package/resources/calls/calls.mjs +3 -0
- package/resources/calls/calls.mjs.map +1 -1
- package/resources/dir/dir.d.mts +220 -28
- package/resources/dir/dir.d.mts.map +1 -1
- package/resources/dir/dir.d.ts +220 -28
- package/resources/dir/dir.d.ts.map +1 -1
- package/resources/dir/dir.js +77 -13
- package/resources/dir/dir.js.map +1 -1
- package/resources/dir/dir.mjs +77 -13
- 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 -4
- package/resources/dir/phone-numbers.d.mts.map +1 -1
- package/resources/dir/phone-numbers.d.ts +8 -4
- 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/enterprises/dir.d.mts +17 -1
- package/resources/enterprises/dir.d.mts.map +1 -1
- package/resources/enterprises/dir.d.ts +17 -1
- package/resources/enterprises/dir.d.ts.map +1 -1
- package/resources/enterprises/enterprises.d.mts +237 -23
- package/resources/enterprises/enterprises.d.mts.map +1 -1
- package/resources/enterprises/enterprises.d.ts +237 -23
- package/resources/enterprises/enterprises.d.ts.map +1 -1
- package/resources/enterprises/enterprises.js +26 -4
- package/resources/enterprises/enterprises.js.map +1 -1
- package/resources/enterprises/enterprises.mjs +26 -4
- package/resources/enterprises/enterprises.mjs.map +1 -1
- package/resources/enterprises/index.d.mts +1 -0
- package/resources/enterprises/index.d.mts.map +1 -1
- package/resources/enterprises/index.d.ts +1 -0
- 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/loa.d.mts +61 -1
- package/resources/enterprises/reputation/loa.d.mts.map +1 -1
- package/resources/enterprises/reputation/loa.d.ts +61 -1
- package/resources/enterprises/reputation/loa.d.ts.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/index.d.mts +4 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -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 +3 -0
- package/resources/llm-token-gateway/index.d.mts.map +1 -0
- package/resources/llm-token-gateway/index.d.ts +3 -0
- package/resources/llm-token-gateway/index.d.ts.map +1 -0
- package/resources/llm-token-gateway/index.js +9 -0
- package/resources/llm-token-gateway/index.js.map +1 -0
- package/resources/llm-token-gateway/index.mjs +4 -0
- package/resources/llm-token-gateway/index.mjs.map +1 -0
- package/resources/llm-token-gateway/llm-token-gateway.d.mts +10 -0
- package/resources/llm-token-gateway/llm-token-gateway.d.mts.map +1 -0
- package/resources/llm-token-gateway/llm-token-gateway.d.ts +10 -0
- package/resources/llm-token-gateway/llm-token-gateway.d.ts.map +1 -0
- package/resources/llm-token-gateway/llm-token-gateway.js +17 -0
- package/resources/llm-token-gateway/llm-token-gateway.js.map +1 -0
- package/resources/llm-token-gateway/llm-token-gateway.mjs +12 -0
- package/resources/llm-token-gateway/llm-token-gateway.mjs.map +1 -0
- package/resources/llm-token-gateway/usage.d.mts +260 -0
- package/resources/llm-token-gateway/usage.d.mts.map +1 -0
- package/resources/llm-token-gateway/usage.d.ts +260 -0
- package/resources/llm-token-gateway/usage.d.ts.map +1 -0
- package/resources/llm-token-gateway/usage.js +31 -0
- package/resources/llm-token-gateway/usage.js.map +1 -0
- package/resources/llm-token-gateway/usage.mjs +27 -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/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/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/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/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 +403 -5
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +403 -5
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/whatsapp/phone-numbers/calling-routing.d.mts +89 -0
- package/resources/whatsapp/phone-numbers/calling-routing.d.mts.map +1 -0
- package/resources/whatsapp/phone-numbers/calling-routing.d.ts +89 -0
- package/resources/whatsapp/phone-numbers/calling-routing.d.ts.map +1 -0
- package/resources/whatsapp/phone-numbers/calling-routing.js +65 -0
- package/resources/whatsapp/phone-numbers/calling-routing.js.map +1 -0
- package/resources/whatsapp/phone-numbers/calling-routing.mjs +61 -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/src/client.ts +55 -0
- package/src/resources/ai/ai.ts +13 -4
- package/src/resources/ai/assistants/assistants.ts +384 -28
- package/src/resources/ai/assistants/deleted.ts +86 -0
- package/src/resources/ai/assistants/index.ts +11 -0
- package/src/resources/ai/assistants/versions.ts +40 -0
- package/src/resources/ai/chat.ts +7 -2
- package/src/resources/ai/embeddings/embeddings.ts +1 -1
- package/src/resources/ai/index.ts +5 -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 +9 -1
- package/src/resources/ai/memory/namespaces/namespaces.ts +81 -3
- package/src/resources/ai/openai/chat.ts +7 -2
- package/src/resources/ai/tools.ts +6 -6
- package/src/resources/calls/actions.ts +76 -15
- package/src/resources/calls/calls.ts +49 -9
- package/src/resources/dir/dir.ts +263 -32
- package/src/resources/dir/index.ts +6 -0
- package/src/resources/dir/phone-numbers.ts +8 -4
- package/src/resources/dir/references.ts +9 -6
- package/src/resources/enterprises/dir.ts +19 -1
- package/src/resources/enterprises/enterprises.ts +250 -23
- package/src/resources/enterprises/index.ts +5 -0
- package/src/resources/enterprises/reputation/loa.ts +73 -1
- package/src/resources/enterprises/verify-email.ts +117 -0
- package/src/resources/index.ts +20 -0
- package/src/resources/infringement-claims.ts +4 -0
- package/src/resources/llm-token-gateway/index.ts +4 -0
- package/src/resources/llm-token-gateway/llm-token-gateway.ts +19 -0
- package/src/resources/llm-token-gateway/usage.ts +336 -0
- package/src/resources/llm-token-gateway.ts +3 -0
- package/src/resources/meeting-sessions/meeting-sessions.ts +8 -9
- 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/requirements.ts +2 -2
- 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/text-to-speech/text-to-speech.ts +4 -2
- package/src/resources/webhooks.ts +495 -2
- package/src/resources/whatsapp/phone-numbers/calling-routing.ts +113 -0
- package/src/resources/whatsapp/phone-numbers/index.ts +7 -0
- package/src/resources/whatsapp/phone-numbers/phone-numbers.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,428 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
import { path } from '../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Daily and monthly spend limits per product. A limit applies to the organization of the authenticated user, or to the user's own account when they belong to no organization; every user of the organization sees and changes the same limits.
|
|
10
|
+
*
|
|
11
|
+
* - **Periods.** `daily` covers the current UTC day and `monthly` the current UTC calendar month. The two limits are independent: you can set either, both or neither.
|
|
12
|
+
* - **Blocking.** When spend in a period goes above the limit (strictly greater), the product is blocked until the period ends: 00:00 UTC the next day for `daily`, 00:00 UTC on the 1st of the next month for `monthly`. A block appears within about 2 minutes (daily) or 10 minutes (monthly) of the spend being recorded.
|
|
13
|
+
* - **Changes apply immediately.** Creating, updating or deleting a limit checks the period's spend in the same request: raising the limit above the spend, or removing it, lifts that period's block, and lowering it below the spend blocks the product at once. The `evaluation` object in the response says what happened.
|
|
14
|
+
* - **Supported products.** Today only `inference` supports spend limits. A blocked account gets HTTP 403 with the error title `Inference spend limit reached` (code `10039`) on new billable chat completions, Responses, Anthropic Messages and classification requests; requests already running finish normally. Take the list of products from the list operation.
|
|
15
|
+
* - **Limits set by Telnyx.** Telnyx support can also set a limit on your account. It is listed with `origin: operator` and you can update or delete it like your own.
|
|
16
|
+
*/
|
|
17
|
+
export class SpendLimits extends APIResource {
|
|
18
|
+
/**
|
|
19
|
+
* Returns one entry per product and period you can set a limit on, with the limit,
|
|
20
|
+
* the spend so far in the period and whether the product is blocked. An entry
|
|
21
|
+
* without a limit is still listed (`limit: null`). When the spend cannot be read,
|
|
22
|
+
* the entry is returned with `spend_usd: null` and `spend_error` set. The list is
|
|
23
|
+
* not paginated.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const spendLimits = await client.spendLimits.list();
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
list(options?: RequestOptions): APIPromise<SpendLimitListResponse> {
|
|
31
|
+
return this._client.get('/spend_limits', options);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Sets a limit for a product and period that has none. Send exactly one of
|
|
36
|
+
* `amount` and `unlimited: true`. The period's spend is checked at once: if it is
|
|
37
|
+
* already above the new limit, the product is blocked immediately
|
|
38
|
+
* (`evaluation.blocked_now`). Returns 409 when a limit already exists for the
|
|
39
|
+
* product and period; update it instead.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const spendLimitResponse = await client.spendLimits.create({
|
|
44
|
+
* amount: 100,
|
|
45
|
+
* product: 'inference',
|
|
46
|
+
* period: 'daily',
|
|
47
|
+
* reason: 'Team budget',
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
create(body: SpendLimitCreateParams, options?: RequestOptions): APIPromise<SpendLimitResponse> {
|
|
52
|
+
return this._client.post('/spend_limits', { body, ...options });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Removes the limit for the product and period. For `inference`, which has no
|
|
57
|
+
* default limit, the product becomes unlimited for the period and the period's
|
|
58
|
+
* block is lifted (`evaluation.released`). The response carries `limit: null` and
|
|
59
|
+
* the `effective_limit_usd` that applies after the removal. Returns 404 when no
|
|
60
|
+
* limit is set.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const spendLimitResponse = await client.spendLimits.delete(
|
|
65
|
+
* 'inference',
|
|
66
|
+
* );
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
delete(
|
|
70
|
+
product: string,
|
|
71
|
+
params: SpendLimitDeleteParams | null | undefined = {},
|
|
72
|
+
options?: RequestOptions,
|
|
73
|
+
): APIPromise<SpendLimitResponse> {
|
|
74
|
+
const { period, reason } = params ?? {};
|
|
75
|
+
return this._client.delete(path`/spend_limits/${product}`, { query: { period, reason }, ...options });
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Replaces the value of the existing limit for the product and period. Send
|
|
80
|
+
* exactly one of `amount` and `unlimited: true`. The period's spend is checked at
|
|
81
|
+
* once: raising the limit above the spend lifts the period's block
|
|
82
|
+
* (`evaluation.released`), and lowering it below the spend blocks the product
|
|
83
|
+
* (`evaluation.blocked_now`). Returns 404 when no limit is set; create it instead.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* const spendLimitResponse = await client.spendLimits.update(
|
|
88
|
+
* 'inference',
|
|
89
|
+
* { amount: 250 },
|
|
90
|
+
* );
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
update(
|
|
94
|
+
product: string,
|
|
95
|
+
params: SpendLimitUpdateParams,
|
|
96
|
+
options?: RequestOptions,
|
|
97
|
+
): APIPromise<SpendLimitResponse> {
|
|
98
|
+
const { period, ...body } = params;
|
|
99
|
+
return this._client.patch(path`/spend_limits/${product}`, { query: { period }, body, ...options });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The spend limit, spend and block state of one product and period.
|
|
105
|
+
*/
|
|
106
|
+
export interface SpendLimit {
|
|
107
|
+
/**
|
|
108
|
+
* The active block of the period. `null` when the period is not blocked.
|
|
109
|
+
*/
|
|
110
|
+
block: SpendLimit.Block | null;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The product is blocked for this period. Always `false` in write responses; list
|
|
114
|
+
* the limits to read the block state.
|
|
115
|
+
*/
|
|
116
|
+
blocked: boolean;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The limit in USD that is enforced, as a decimal string. `null` means unlimited.
|
|
120
|
+
*/
|
|
121
|
+
effective_limit_usd: string | null;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The limit set on the account for the product and period, whoever set it. `null`
|
|
125
|
+
* when none is set.
|
|
126
|
+
*/
|
|
127
|
+
limit: SpendLimit.Limit | null;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* `daily` is the current UTC day; `monthly` is the current UTC calendar month.
|
|
131
|
+
*/
|
|
132
|
+
period: SpendLimitPeriod;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Exclusive end of the current period, a UTC date.
|
|
136
|
+
*/
|
|
137
|
+
period_end: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* First UTC day of the current period.
|
|
141
|
+
*/
|
|
142
|
+
period_start: string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Product the entry applies to.
|
|
146
|
+
*/
|
|
147
|
+
product: string;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Display name of the product.
|
|
151
|
+
*/
|
|
152
|
+
product_name: string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Identifies the type of the resource.
|
|
156
|
+
*/
|
|
157
|
+
record_type: string;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Set when `spend_usd` is `null`.
|
|
161
|
+
*/
|
|
162
|
+
spend_error: string | null;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Spend in USD so far in the period, as a decimal string. It can lag actual usage
|
|
166
|
+
* by about a minute. `null` when it could not be read.
|
|
167
|
+
*/
|
|
168
|
+
spend_usd: string | null;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* What a create, update or delete did to the period at once. Only present in write
|
|
172
|
+
* responses.
|
|
173
|
+
*/
|
|
174
|
+
evaluation?: SpendLimit.Evaluation;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export namespace SpendLimit {
|
|
178
|
+
/**
|
|
179
|
+
* The active block of the period. `null` when the period is not blocked.
|
|
180
|
+
*/
|
|
181
|
+
export interface Block {
|
|
182
|
+
/**
|
|
183
|
+
* Exclusive end of the block: it is lifted at 00:00 UTC on this date at the
|
|
184
|
+
* latest.
|
|
185
|
+
*/
|
|
186
|
+
blocked_until: string;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* When the block started.
|
|
190
|
+
*/
|
|
191
|
+
detected_at: string;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The limit in USD that the spend went above, as a decimal string.
|
|
195
|
+
*/
|
|
196
|
+
limit_usd: string;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Spend in USD when the block started, as a decimal string.
|
|
200
|
+
*/
|
|
201
|
+
spend_usd: string;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* The limit set on the account for the product and period, whoever set it. `null`
|
|
206
|
+
* when none is set.
|
|
207
|
+
*/
|
|
208
|
+
export interface Limit {
|
|
209
|
+
/**
|
|
210
|
+
* Limit in USD, as a decimal string. `null` when `unlimited` is true.
|
|
211
|
+
*/
|
|
212
|
+
amount: string | null;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* `self_service` when a user of the account set it, `operator` when Telnyx support
|
|
216
|
+
* did.
|
|
217
|
+
*/
|
|
218
|
+
origin: 'self_service' | 'operator';
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* True when the limit was set to explicitly no cap.
|
|
222
|
+
*/
|
|
223
|
+
unlimited: boolean;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* When the limit was last set or changed.
|
|
227
|
+
*/
|
|
228
|
+
updated_at: string;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* What a create, update or delete did to the period at once. Only present in write
|
|
233
|
+
* responses.
|
|
234
|
+
*/
|
|
235
|
+
export interface Evaluation {
|
|
236
|
+
/**
|
|
237
|
+
* The change blocked the product: the spend was already above the new limit.
|
|
238
|
+
*/
|
|
239
|
+
blocked_now: boolean;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* The spend could not be checked now. The change is saved and applied within a few
|
|
243
|
+
* minutes.
|
|
244
|
+
*/
|
|
245
|
+
evaluation_deferred: boolean;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* The change lifted a block of this period.
|
|
249
|
+
*/
|
|
250
|
+
released: boolean;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Spend in USD used for the check, as a decimal string. `null` when the spend was
|
|
254
|
+
* not checked.
|
|
255
|
+
*/
|
|
256
|
+
spend_usd: string | null;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* The other period has an active block, so the product stays blocked whatever this
|
|
260
|
+
* period's result.
|
|
261
|
+
*/
|
|
262
|
+
still_blocked_other_period: boolean;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* A block of this period remains because the spend is still above the new limit.
|
|
266
|
+
*/
|
|
267
|
+
still_over_limit: boolean;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Additional information about the result, when there is any.
|
|
271
|
+
*/
|
|
272
|
+
note?: string;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* `daily` is the current UTC day; `monthly` is the current UTC calendar month.
|
|
278
|
+
*/
|
|
279
|
+
export type SpendLimitPeriod = 'daily' | 'monthly';
|
|
280
|
+
|
|
281
|
+
export interface SpendLimitResponse {
|
|
282
|
+
/**
|
|
283
|
+
* The spend limit, spend and block state of one product and period.
|
|
284
|
+
*/
|
|
285
|
+
data: SpendLimit;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export interface SpendLimitListResponse {
|
|
289
|
+
data: Array<SpendLimit>;
|
|
290
|
+
|
|
291
|
+
meta?: SpendLimitListResponse.Meta;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export namespace SpendLimitListResponse {
|
|
295
|
+
export interface Meta {
|
|
296
|
+
page_number?: number;
|
|
297
|
+
|
|
298
|
+
page_size?: number;
|
|
299
|
+
|
|
300
|
+
total_pages?: number;
|
|
301
|
+
|
|
302
|
+
total_results?: number;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export type SpendLimitCreateParams =
|
|
307
|
+
| SpendLimitCreateParams.CreateSpendLimitWithAmount
|
|
308
|
+
| SpendLimitCreateParams.CreateSpendLimitUnlimited;
|
|
309
|
+
|
|
310
|
+
export declare namespace SpendLimitCreateParams {
|
|
311
|
+
export interface CreateSpendLimitWithAmount {
|
|
312
|
+
/**
|
|
313
|
+
* Limit in USD. `0` blocks at the first cent of spend.
|
|
314
|
+
*/
|
|
315
|
+
amount: number;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Product to limit, as returned in `product` by the list operation.
|
|
319
|
+
*/
|
|
320
|
+
product: string;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* `daily` is the current UTC day; `monthly` is the current UTC calendar month.
|
|
324
|
+
*/
|
|
325
|
+
period?: SpendLimitPeriod;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Why the limit is set or changed, kept for audit.
|
|
329
|
+
*/
|
|
330
|
+
reason?: string;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Optional; only `false` is allowed together with `amount`.
|
|
334
|
+
*/
|
|
335
|
+
unlimited?: false;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export interface CreateSpendLimitUnlimited {
|
|
339
|
+
/**
|
|
340
|
+
* Product to limit, as returned in `product` by the list operation.
|
|
341
|
+
*/
|
|
342
|
+
product: string;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* `true`: explicitly no cap.
|
|
346
|
+
*/
|
|
347
|
+
unlimited: true;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* `daily` is the current UTC day; `monthly` is the current UTC calendar month.
|
|
351
|
+
*/
|
|
352
|
+
period?: SpendLimitPeriod;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Why the limit is set or changed, kept for audit.
|
|
356
|
+
*/
|
|
357
|
+
reason?: string;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export interface SpendLimitDeleteParams {
|
|
362
|
+
/**
|
|
363
|
+
* Limit period. Defaults to `daily`; send it explicitly.
|
|
364
|
+
*/
|
|
365
|
+
period?: SpendLimitPeriod;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Why the limit is removed, kept for audit. At most 500 characters.
|
|
369
|
+
*/
|
|
370
|
+
reason?: string;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export type SpendLimitUpdateParams =
|
|
374
|
+
| SpendLimitUpdateParams.UpdateSpendLimitWithAmount
|
|
375
|
+
| SpendLimitUpdateParams.UpdateSpendLimitUnlimited;
|
|
376
|
+
|
|
377
|
+
export declare namespace SpendLimitUpdateParams {
|
|
378
|
+
export interface UpdateSpendLimitWithAmount {
|
|
379
|
+
/**
|
|
380
|
+
* Body param: Limit in USD. `0` blocks at the first cent of spend.
|
|
381
|
+
*/
|
|
382
|
+
amount: number;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Query param: Limit period. Defaults to `daily`; send it explicitly.
|
|
386
|
+
*/
|
|
387
|
+
period?: SpendLimitPeriod;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Body param: Why the limit is set or changed, kept for audit.
|
|
391
|
+
*/
|
|
392
|
+
reason?: string;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Body param: Optional; only `false` is allowed together with `amount`.
|
|
396
|
+
*/
|
|
397
|
+
unlimited?: false;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export interface UpdateSpendLimitUnlimited {
|
|
401
|
+
/**
|
|
402
|
+
* Body param: `true`: explicitly no cap.
|
|
403
|
+
*/
|
|
404
|
+
unlimited: true;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Query param: Limit period. Defaults to `daily`; send it explicitly.
|
|
408
|
+
*/
|
|
409
|
+
period?: SpendLimitPeriod;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Body param: Why the limit is set or changed, kept for audit.
|
|
413
|
+
*/
|
|
414
|
+
reason?: string;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export declare namespace SpendLimits {
|
|
419
|
+
export {
|
|
420
|
+
type SpendLimit as SpendLimit,
|
|
421
|
+
type SpendLimitPeriod as SpendLimitPeriod,
|
|
422
|
+
type SpendLimitResponse as SpendLimitResponse,
|
|
423
|
+
type SpendLimitListResponse as SpendLimitListResponse,
|
|
424
|
+
type SpendLimitCreateParams as SpendLimitCreateParams,
|
|
425
|
+
type SpendLimitDeleteParams as SpendLimitDeleteParams,
|
|
426
|
+
type SpendLimitUpdateParams as SpendLimitUpdateParams,
|
|
427
|
+
};
|
|
428
|
+
}
|
|
@@ -49,10 +49,19 @@ export type TosAgreementsDefaultFlatPagination = DefaultFlatPagination<TosAgreem
|
|
|
49
49
|
* their own identity.
|
|
50
50
|
*/
|
|
51
51
|
export interface TosAgreement {
|
|
52
|
+
/**
|
|
53
|
+
* The unique identifier of this recorded agreement.
|
|
54
|
+
*/
|
|
52
55
|
id?: string;
|
|
53
56
|
|
|
57
|
+
/**
|
|
58
|
+
* When you accepted this version of the terms.
|
|
59
|
+
*/
|
|
54
60
|
agreed_at?: string;
|
|
55
61
|
|
|
62
|
+
/**
|
|
63
|
+
* When this agreement record was created.
|
|
64
|
+
*/
|
|
56
65
|
created_at?: string;
|
|
57
66
|
|
|
58
67
|
/**
|
|
@@ -60,6 +69,9 @@ export interface TosAgreement {
|
|
|
60
69
|
*/
|
|
61
70
|
product_type?: TosProductType;
|
|
62
71
|
|
|
72
|
+
/**
|
|
73
|
+
* The version of the terms you accepted.
|
|
74
|
+
*/
|
|
63
75
|
terms_version?: string;
|
|
64
76
|
|
|
65
77
|
/**
|
|
@@ -61,10 +61,19 @@ export interface TermsOfServiceRetrieveInfoResponse {
|
|
|
61
61
|
|
|
62
62
|
export namespace TermsOfServiceRetrieveInfoResponse {
|
|
63
63
|
export interface Agreement {
|
|
64
|
+
/**
|
|
65
|
+
* The latest published version of these terms.
|
|
66
|
+
*/
|
|
64
67
|
current_version?: string;
|
|
65
68
|
|
|
69
|
+
/**
|
|
70
|
+
* A short summary of the product these terms cover.
|
|
71
|
+
*/
|
|
66
72
|
description?: string;
|
|
67
73
|
|
|
74
|
+
/**
|
|
75
|
+
* The date this version took effect.
|
|
76
|
+
*/
|
|
68
77
|
effective_date?: string;
|
|
69
78
|
|
|
70
79
|
/**
|
|
@@ -72,6 +81,9 @@ export namespace TermsOfServiceRetrieveInfoResponse {
|
|
|
72
81
|
*/
|
|
73
82
|
product_type?: AgreementsAPI.TosProductType;
|
|
74
83
|
|
|
84
|
+
/**
|
|
85
|
+
* A link to the full terms text.
|
|
86
|
+
*/
|
|
75
87
|
terms_url?: string;
|
|
76
88
|
}
|
|
77
89
|
}
|
|
@@ -111,6 +123,9 @@ export namespace TermsOfServiceRetrieveStatusResponse {
|
|
|
111
123
|
*/
|
|
112
124
|
product_type: AgreementsAPI.TosProductType;
|
|
113
125
|
|
|
126
|
+
/**
|
|
127
|
+
* When you accepted the terms, or null if you have not.
|
|
128
|
+
*/
|
|
114
129
|
agreed_at?: string | null;
|
|
115
130
|
|
|
116
131
|
/**
|
|
@@ -683,8 +683,10 @@ export namespace TextToSpeechGenerateSpeechParams {
|
|
|
683
683
|
sampling_rate?: number;
|
|
684
684
|
|
|
685
685
|
/**
|
|
686
|
-
* Voice speed multiplier.
|
|
687
|
-
*
|
|
686
|
+
* Voice speed multiplier. Telnyx `Ultra` voices accept values from 0.6 to 1.5 —
|
|
687
|
+
* requests outside that range are rejected by the synthesis engine. `KokoroTTS`
|
|
688
|
+
* and `Qwen3TTS` accept the field but do not apply it. `Bayan` and `Sukhan` don't
|
|
689
|
+
* support it.
|
|
688
690
|
*/
|
|
689
691
|
voice_speed?: number;
|
|
690
692
|
|