AI Gateway
Create an AI Gateway budget
Create a spend budget. Scope tags may include provider, model, and custom dimensions. Reserved metadata keys are rejected.
post/api/v2/budgets
Request
- Base URLhttps://api.datadoghq.com
- Auth
- API key in header DD-API-KEY and API key in header DD-APPLICATION-KEY
- or OAuth 2Authorization code/oauth2/v1/authorizeToken URL/oauth2/v1/tokenScopesai_gateway_config_write
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"data": {
"attributes": {
"capacity_microcents": 100000000,
"enforcement": "BLOCK",
"name": "Coding agents",
"selector": [
{
"dim": "user_id",
"per_value": true,
"values": [
"11111111-1111-1111-1111-111111111111"
]
}
],
"tags": {
"model": "gpt-5.2-codex"
},
"window_policy": "MONTHLY"
},
"type": "budgets"
}
}Response
Created
Example response
{
"data": {
"attributes": {
"capacity_microcents": 100000000,
"created_at": "2026-08-24T12:00:00Z",
"created_by": "admin@example.com",
"enabled": true,
"enforcement": "BLOCK",
"monitor_id": 12345678,
"name": "Coding agents",
"selector": [
{
"dim": "user_id",
"per_value": true,
"values": [
"11111111-1111-1111-1111-111111111111"
]
}
],
"tags": {
"model": "gpt-5.2-codex"
},
"updated_at": "2026-08-24T12:00:00Z",
"warning_threshold": 0.9,
"window_policy": "MONTHLY"
},
"id": "11111111-1111-1111-1111-111111111111",
"type": "budgets"
}
}Changes
Changes to this operation have not been checked yet.