import requests
url = "https://app.langwatch.ai/api/gateway/v1/budgets/{id}/reset"
payload = { "reason": "<string>" }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://app.langwatch.ai/api/gateway/v1/budgets/{id}/reset', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/gateway/v1/budgets/{id}/reset \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"reason": "<string>"
}
'{
"budget": {
"id": "<string>",
"organization_id": "<string>",
"scope_id": "<string>",
"name": "<string>",
"description": "<string>",
"limit_usd": "<string>",
"limit_nano_usd": 123,
"spent_usd": "<string>",
"spent_nano_usd": 123,
"timezone": "<string>",
"provider_key": "<string>",
"external_id": "<string>",
"metadata": {},
"current_period_started_at": "<string>",
"resets_at": "<string>",
"cycle_anchor_at": "<string>",
"last_reset_at": "<string>",
"archived_at": "<string>",
"created_at": "<string>",
"member_count": 123,
"end_users_seen": 123,
"end_users_over": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}Reset budget period
Moves the budget’s period boundary to now and recomputes the next reset; recorded spend is NEVER mutated (the ledger and every emitted billing event are immutable, so reconciliation is unaffected). On calendar windows this truncates the running period and the next boundary stays calendar; on manual windows the new period stays open until the next reset. For attributed-user templates, end_user_id resets ONE end-user bucket’s boundary and leaves the template period untouched.
import requests
url = "https://app.langwatch.ai/api/gateway/v1/budgets/{id}/reset"
payload = { "reason": "<string>" }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://app.langwatch.ai/api/gateway/v1/budgets/{id}/reset', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/gateway/v1/budgets/{id}/reset \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"reason": "<string>"
}
'{
"budget": {
"id": "<string>",
"organization_id": "<string>",
"scope_id": "<string>",
"name": "<string>",
"description": "<string>",
"limit_usd": "<string>",
"limit_nano_usd": 123,
"spent_usd": "<string>",
"spent_nano_usd": 123,
"timezone": "<string>",
"provider_key": "<string>",
"external_id": "<string>",
"metadata": {},
"current_period_started_at": "<string>",
"resets_at": "<string>",
"cycle_anchor_at": "<string>",
"last_reset_at": "<string>",
"archived_at": "<string>",
"created_at": "<string>",
"member_count": 123,
"end_users_seen": 123,
"end_users_over": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}Authorizations
Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.
Path Parameters
Query Parameters
Resets ONE end-user bucket on an attributed-user template, leaving the template period untouched.
1Body
Free-text operator note, audit-logged with the reset.
500Response
Reset
Show child attributes
Show child attributes
Was this page helpful?