Update a spend limit
Replaces the value of the existing limit for the product and period. Send exactly one of amount and unlimited: true. The period’s spend is checked at once: raising the limit above the spend lifts the period’s block (evaluation.released), and lowering it below the spend blocks the product (evaluation.blocked_now). Returns 404 when no limit is set; create it instead. With the credential_id query parameter, the request changes that API key’s limit; it needs an amount, and it can be at most the period’s total limit. Lowering the total limit below the period’s highest API key limit is refused.
PATCH
/
spend_limits
/
{product}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const SpendLimit = await client.spendLimits.update('product');
console.log(SpendLimit.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
spend_limit = client.spend_limits.update(
product="product",
)
print(spend_limit.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
spendLimit, err := client.SpendLimits.Update(
context.TODO(),
"product",
telnyx.SpendLimitUpdateParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", spendLimit.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.spendLimits.SpendLimitUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
SpendLimitUpdateParams params = SpendLimitUpdateParams.builder()
.build();
var response = client.spendLimits().update("product", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
spend_limit = telnyx.spend_limits.update("product")
puts(spend_limit)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$spend_limit = $client->spendLimits->update(
'product',
);
var_dump($spend_limit);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx spend-limits update \
--api-key 'My API Key' \
--product inferencecurl --request PATCH \
--url https://api.telnyx.com/v2/spend_limits/{product} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"amount": 250
}'{
"data": {
"record_type": "spend_limit",
"product": "inference",
"product_name": "Inference",
"period": "daily",
"period_start": "2026-09-24",
"period_end": "2026-09-25",
"limit": {
"amount": "250",
"unlimited": false,
"origin": "self_service",
"updated_at": "2026-09-24T09:12:03.412Z"
},
"effective_limit_usd": "250",
"spend_usd": "37.41",
"spend_error": null,
"blocked": false,
"block": null,
"evaluation": {
"spend_usd": "112.50",
"released": true,
"blocked_now": false,
"still_over_limit": false,
"still_blocked_other_period": false,
"evaluation_deferred": false
}
}
}Authorizations
Path Parameters
Query Parameters
Body
application/json
- Amount
- Unlimited
Send exactly one of amount and unlimited: true.
Response
The limit was updated. evaluation says whether the change lifted or started a block.
Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const SpendLimit = await client.spendLimits.update('product');
console.log(SpendLimit.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
spend_limit = client.spend_limits.update(
product="product",
)
print(spend_limit.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
spendLimit, err := client.SpendLimits.Update(
context.TODO(),
"product",
telnyx.SpendLimitUpdateParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", spendLimit.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.spendLimits.SpendLimitUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
SpendLimitUpdateParams params = SpendLimitUpdateParams.builder()
.build();
var response = client.spendLimits().update("product", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
spend_limit = telnyx.spend_limits.update("product")
puts(spend_limit)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$spend_limit = $client->spendLimits->update(
'product',
);
var_dump($spend_limit);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx spend-limits update \
--api-key 'My API Key' \
--product inferencecurl --request PATCH \
--url https://api.telnyx.com/v2/spend_limits/{product} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"amount": 250
}'{
"data": {
"record_type": "spend_limit",
"product": "inference",
"product_name": "Inference",
"period": "daily",
"period_start": "2026-09-24",
"period_end": "2026-09-25",
"limit": {
"amount": "250",
"unlimited": false,
"origin": "self_service",
"updated_at": "2026-09-24T09:12:03.412Z"
},
"effective_limit_usd": "250",
"spend_usd": "37.41",
"spend_error": null,
"blocked": false,
"block": null,
"evaluation": {
"spend_usd": "112.50",
"released": true,
"blocked_now": false,
"still_over_limit": false,
"still_blocked_other_period": false,
"evaluation_deferred": false
}
}
}