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.
List budgets applicable to the project
Returns the non-archived budgets in the caller's organization across all seven scope types, with live spent_usd from the spend ledger. Takes a project key or an organization key; requires gatewayBudgets:view at the key's project, or at the organization for a key that names no project.
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
Comma-separated subset of the scope types, lowercase.
Exact match on the resource's external_id.
The response appears below.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/gateway/v1/budgets"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "X-Auth-Token": api_key,}response = requests.get( origin + path, headers=headers,)print(response.json())const url = "https://app.langwatch.ai/api/gateway/v1/budgets";const response = await fetch(url, { method: "GET", headers: { "X-Auth-Token": process.env.LANGWATCH_API_KEY!, },});const data = await response.json();curl --request GET \ --url 'https://app.langwatch.ai/api/gateway/v1/budgets' \ --header "X-Auth-Token: $LANGWATCH_API_KEY"Call the LangWatch API from this project: List budgets.Request: GET https://app.langwatch.ai/api/gateway/v1/budgetsReference: https://langwatch.ai/docs/api-reference/gateway-budgets/list-budgets-applicable-to-the-project.mdAuthentication: send the X-Auth-Token header, read from the LANGWATCH_API_KEY environment variable. Never hard-code the key.Use the HTTP client this project already uses, handle non-2xx responses, and show me the parsed result.Success
application/json · Generated from schema
{ "data": [ { "id": "string", "organization_id": "string", "scope_type": "organization", "scope_id": "string", "name": "string", "description": "string", "window": "minute", "on_breach": "block", "limit_usd": "string", "limit_nano_usd": -9007199254740991, "spent_usd": "string", "spent_nano_usd": -9007199254740991, "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": -9007199254740991, "end_users_seen": -9007199254740991, "end_users_over": -9007199254740991, "scope_reach": "reachable" } ], "spend_available": false, "next_cursor": "string"}Bad Request
application/json · Generated from schema
{ "type": "string", "code": "string", "message": "string", "retryable": false, "meta": {}, "trace_id": "string", "span_id": "string", "trace": { "traceId": "string", "spanId": "string", "traceUrl": "string", "logsUrl": "string" }, "tips": [ "string" ], "docs_url": "string", "fault": "customer", "reasons": [ null ]}Unauthorized
application/json · Generated from schema
{ "type": "string", "code": "string", "message": "string", "retryable": false, "meta": {}, "trace_id": "string", "span_id": "string", "trace": { "traceId": "string", "spanId": "string", "traceUrl": "string", "logsUrl": "string" }, "tips": [ "string" ], "docs_url": "string", "fault": "customer", "reasons": [ null ]}Forbidden
application/json · Generated from schema
{ "type": "string", "code": "string", "message": "string", "retryable": false, "meta": {}, "trace_id": "string", "span_id": "string", "trace": { "traceId": "string", "spanId": "string", "traceUrl": "string", "logsUrl": "string" }, "tips": [ "string" ], "docs_url": "string", "fault": "customer", "reasons": [ null ]}Internal Server Error
application/json · Generated from schema
{ "type": "string", "code": "string", "message": "string", "retryable": false, "meta": {}, "trace_id": "string", "span_id": "string", "trace": { "traceId": "string", "spanId": "string", "traceUrl": "string", "logsUrl": "string" }, "tips": [ "string" ], "docs_url": "string", "fault": "customer", "reasons": [ null ]}Query parameters
cursorstringlimitintegerscope_typestringComma-separated subset of the scope types, lowercase.
external_idstringExact match on the resource's external_id.
Responses
200Success
application/json
dataobject[]requiredspend_availablebooleanrequirednext_cursorstring | nullrequiredPass back as cursor for the next page. Null means the walk is exhausted.
400Bad Request
application/json
typestringrequiredcodestringrequiredmessagestringrequiredretryablebooleanrequiredmetaobjecttrace_idstringspan_idstringtraceobjecttipsstring[]docs_urlstringfaultstring"customer""platform""provider""presumed_platform"reasonsany[]401Unauthorized
application/json
typestringrequiredcodestringrequiredmessagestringrequiredretryablebooleanrequiredmetaobjecttrace_idstringspan_idstringtraceobjecttipsstring[]docs_urlstringfaultstring"customer""platform""provider""presumed_platform"reasonsany[]403Forbidden
application/json
typestringrequiredcodestringrequiredmessagestringrequiredretryablebooleanrequiredmetaobjecttrace_idstringspan_idstringtraceobjecttipsstring[]docs_urlstringfaultstring"customer""platform""provider""presumed_platform"reasonsany[]500Internal Server Error
application/json
typestringrequiredcodestringrequiredmessagestringrequiredretryablebooleanrequiredmetaobjecttrace_idstringspan_idstringtraceobjecttipsstring[]docs_urlstringfaultstring"customer""platform""provider""presumed_platform"reasonsany[]