import requests
url = "https://app.langwatch.ai/api/gateway/v1/budgets/{id}"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Auth-Token': '<api-key>'}};
fetch('https://app.langwatch.ai/api/gateway/v1/budgets/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://app.langwatch.ai/api/gateway/v1/budgets/{id} \
--header 'X-Auth-Token: <api-key>'{
"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
},
"spend_available": true
}{
"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>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"meta": {},
"trace_id": "<string>",
"span_id": "<string>"
}
}Get budget
One budget, in exactly the row shape GET /budgets returns, including the live spend enrichment and the per-person end_users_seen / end_users_over standing on attributed-user templates. Archived budgets are not returned. spend_available: false means spend could not be totalled, and spent_usd / spent_nano_usd are null rather than a figure that cannot be told apart from zero spend. A per-person template reports null there too, because one allowance per person has no single total; each person’s figure is in GET /spend-summaries and the seat buckets.
import requests
url = "https://app.langwatch.ai/api/gateway/v1/budgets/{id}"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Auth-Token': '<api-key>'}};
fetch('https://app.langwatch.ai/api/gateway/v1/budgets/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://app.langwatch.ai/api/gateway/v1/budgets/{id} \
--header 'X-Auth-Token: <api-key>'{
"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
},
"spend_available": true
}{
"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>"
}
}{
"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
Was this page helpful?