Class: DatadogAPIClient::V2::AIGatewayAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v2/api/ai_gateway_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ AIGatewayAPI

Returns a new instance of AIGatewayAPI.



22
23
24
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 22

def initialize(api_client = DatadogAPIClient::APIClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_client ⇒ Object

Returns the value of attribute api_client.



20
21
22
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

#bulk_create_ai_gateway_models(provider_id, body, opts = {}) ⇒ Object

Add multiple models to an AI Gateway provider.



29
30
31
32
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 29

def bulk_create_ai_gateway_models(provider_id, body, opts = {})
  data, _status_code, _headers = bulk_create_ai_gateway_models_with_http_info(provider_id, body, opts)
  data
end

#bulk_create_ai_gateway_models_with_http_info(provider_id, body, opts = {}) ⇒ Array<(AiGatewayModelCatalogEntryListResponse, Integer, Hash)>

Add multiple models to an AI Gateway provider.

Requires ai_gateway_config_write and provider Edit. Models and pricing inherit provider access. Add multiple manually managed model catalog entries to a provider in a single request. Manually managed entries are not modified by automatic catalog synchronization.

Parameters:

Returns:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 44

def bulk_create_ai_gateway_models_with_http_info(provider_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.bulk_create_ai_gateway_models".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.bulk_create_ai_gateway_models")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.bulk_create_ai_gateway_models"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.bulk_create_ai_gateway_models ...'
  end
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    fail ArgumentError, "Missing the required parameter 'provider_id' when calling AIGatewayAPI.bulk_create_ai_gateway_models"
  end
  if @api_client.config.client_side_validation && provider_id < 1
    fail ArgumentError, 'invalid value for "provider_id" when calling AIGatewayAPI.bulk_create_ai_gateway_models, must be greater than or equal to 1.'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.bulk_create_ai_gateway_models"
  end
  # resource path
  local_var_path = '/api/v2/providers/{provider_id}/models/bulk'.sub('{provider_id}', CGI.escape(provider_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayModelCatalogEntryListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :bulk_create_ai_gateway_models,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#bulk_create_ai_gateway_models\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_ai_gateway_budget(body, opts = {}) ⇒ Object

Create an AI Gateway budget.



112
113
114
115
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 112

def create_ai_gateway_budget(body, opts = {})
  data, _status_code, _headers = create_ai_gateway_budget_with_http_info(body, opts)
  data
end

#create_ai_gateway_budget_with_http_info(body, opts = {}) ⇒ Array<(AiGatewayBudgetResponse, Integer, Hash)>

Create an AI Gateway budget.

Create a spend budget. Scope tags may include provider, model, and custom dimensions. Reserved metadata keys are rejected.

Parameters:

Returns:

  • (Array<(AiGatewayBudgetResponse, Integer, Hash)>) —

    AiGatewayBudgetResponse data, response status code and response headers



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 125

def create_ai_gateway_budget_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_ai_gateway_budget".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_ai_gateway_budget")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_ai_gateway_budget"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.create_ai_gateway_budget ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.create_ai_gateway_budget"
  end
  # resource path
  local_var_path = '/api/v2/budgets'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayBudgetResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_ai_gateway_budget,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#create_ai_gateway_budget\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_ai_gateway_data_capture_override(body, opts = {}) ⇒ Object

Create an AI Gateway data capture override.



186
187
188
189
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 186

def create_ai_gateway_data_capture_override(body, opts = {})
  data, _status_code, _headers = create_ai_gateway_data_capture_override_with_http_info(body, opts)
  data
end

#create_ai_gateway_data_capture_override_with_http_info(body, opts = {}) ⇒ Array<(AiGatewayCaptureOverrideResponse, Integer, Hash)>

Create an AI Gateway data capture override.

Create a scoped override with a client-generated UUID and the current configuration_revision. If the override can enable full capture for more traffic, set confirm_full_capture to true. Returns HTTP 409 when configuration_revision is stale, the UUID already exists, or the organization has 100 overrides. Missing configuration_revision or required full-capture confirmation returns HTTP 400. Retrying an accepted create with the same UUID returns HTTP 409. To undo a create, read the current configuration revision and delete the override using its returned override revision. Requires ai_gateway_config_write. Restriction policies are saved separately after the returned UUID and revision acknowledge creation. A lost response is an unknown outcome; absence from a filtered configuration response does not prove creation failed.

Parameters:

Returns:



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 198

def create_ai_gateway_data_capture_override_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_ai_gateway_data_capture_override".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_ai_gateway_data_capture_override")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_ai_gateway_data_capture_override"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.create_ai_gateway_data_capture_override ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.create_ai_gateway_data_capture_override"
  end
  # resource path
  local_var_path = '/api/v2/data-capture/overrides'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayCaptureOverrideResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_ai_gateway_data_capture_override,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#create_ai_gateway_data_capture_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_ai_gateway_model(provider_id, body, opts = {}) ⇒ Object

Add a model to an AI Gateway provider.



259
260
261
262
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 259

def create_ai_gateway_model(provider_id, body, opts = {})
  data, _status_code, _headers = create_ai_gateway_model_with_http_info(provider_id, body, opts)
  data
end

#create_ai_gateway_model_group(body, opts = {}) ⇒ Object

Create an AI Gateway model group.



342
343
344
345
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 342

def create_ai_gateway_model_group(body, opts = {})
  data, _status_code, _headers = create_ai_gateway_model_group_with_http_info(body, opts)
  data
end

#create_ai_gateway_model_group_with_http_info(body, opts = {}) ⇒ Array<(AiGatewayModelGroupResponse, Integer, Hash)>

Create an AI Gateway model group.

Create an AI Gateway model group from a name and any combination of model catalog entries, providers, and routing rules, with optional fast-mode and reasoning limits. Include initial access bindings when creating a restricted policy. If the bindings cannot be applied, the policy is not created. To update sharing on an existing policy, use the restriction policy API. If a creation request fails without confirming whether the policy was created, check the policy list before retrying to avoid duplicates.

Parameters:

Returns:

  • (Array<(AiGatewayModelGroupResponse, Integer, Hash)>) —

    AiGatewayModelGroupResponse data, response status code and response headers



358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 358

def create_ai_gateway_model_group_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_ai_gateway_model_group".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_ai_gateway_model_group")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_ai_gateway_model_group"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.create_ai_gateway_model_group ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.create_ai_gateway_model_group"
  end
  # resource path
  local_var_path = '/api/v2/model-groups'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayModelGroupResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_ai_gateway_model_group,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#create_ai_gateway_model_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_ai_gateway_model_with_http_info(provider_id, body, opts = {}) ⇒ Array<(AiGatewayModelCatalogEntryResponse, Integer, Hash)>

Add a model to an AI Gateway provider.

Requires ai_gateway_config_write and provider Edit. Models and pricing inherit provider access. Add a manually managed model catalog entry to a provider. Manually managed entries are not modified by automatic catalog synchronization.

Parameters:

Returns:



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 274

def create_ai_gateway_model_with_http_info(provider_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_ai_gateway_model".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_ai_gateway_model")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_ai_gateway_model"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.create_ai_gateway_model ...'
  end
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    fail ArgumentError, "Missing the required parameter 'provider_id' when calling AIGatewayAPI.create_ai_gateway_model"
  end
  if @api_client.config.client_side_validation && provider_id < 1
    fail ArgumentError, 'invalid value for "provider_id" when calling AIGatewayAPI.create_ai_gateway_model, must be greater than or equal to 1.'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.create_ai_gateway_model"
  end
  # resource path
  local_var_path = '/api/v2/providers/{provider_id}/models'.sub('{provider_id}', CGI.escape(provider_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayModelCatalogEntryResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_ai_gateway_model,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#create_ai_gateway_model\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_ai_gateway_provider(body, opts = {}) ⇒ Object

Create an AI Gateway provider.



419
420
421
422
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 419

def create_ai_gateway_provider(body, opts = {})
  data, _status_code, _headers = create_ai_gateway_provider_with_http_info(body, opts)
  data
end

#create_ai_gateway_provider_with_http_info(body, opts = {}) ⇒ Array<(AiGatewayProviderResponse, Integer, Hash)>

Create an AI Gateway provider.

Creating a provider requires ai_gateway_config_write. No provider View check applies before creation. Create a provider and its initial model catalog. All discovered models are enabled; optional models are added as manually managed entries. The slug is the immutable routing identifier. Provider and initial catalog rows are saved in one transaction. Initial sharing is unavailable: supplying initial_bindings returns 503 with stage initial_permissions and outcome not_saved. A failed database commit can return 503 with stage database_commit and outcome unknown; check the provider list before retrying. Creation without initial_bindings keeps normal unrestricted defaults.

Parameters:

Returns:

  • (Array<(AiGatewayProviderResponse, Integer, Hash)>) —

    AiGatewayProviderResponse data, response status code and response headers



437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 437

def create_ai_gateway_provider_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_ai_gateway_provider".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_ai_gateway_provider")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_ai_gateway_provider"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.create_ai_gateway_provider ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.create_ai_gateway_provider"
  end
  # resource path
  local_var_path = '/api/v2/providers'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayProviderResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_ai_gateway_provider,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#create_ai_gateway_provider\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_ai_gateway_rate_limit(body, opts = {}) ⇒ Object

Create an AI Gateway rate limit.



498
499
500
501
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 498

def create_ai_gateway_rate_limit(body, opts = {})
  data, _status_code, _headers = create_ai_gateway_rate_limit_with_http_info(body, opts)
  data
end

#create_ai_gateway_rate_limit_with_http_info(body, opts = {}) ⇒ Array<(AiGatewayRateLimitResponse, Integer, Hash)>

Create an AI Gateway rate limit.

Create a rate limit. All requests matching its scope share one allowance, unless a selector makes it a template, which gives each matched user, Team, or value its own allowance. Every matching rate limit applies. Returns 409 when another active rate limit has the same user, Team, tags, and selector, or when the organization already has the maximum number of rate limits.

Parameters:

Returns:

  • (Array<(AiGatewayRateLimitResponse, Integer, Hash)>) —

    AiGatewayRateLimitResponse data, response status code and response headers



510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 510

def create_ai_gateway_rate_limit_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_ai_gateway_rate_limit".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_ai_gateway_rate_limit")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_ai_gateway_rate_limit"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.create_ai_gateway_rate_limit ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.create_ai_gateway_rate_limit"
  end
  # resource path
  local_var_path = '/api/v2/rate-limits'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayRateLimitResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_ai_gateway_rate_limit,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#create_ai_gateway_rate_limit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_ai_gateway_routing_rule(body, opts = {}) ⇒ Object

Create an AI Gateway routing rule.



571
572
573
574
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 571

def create_ai_gateway_routing_rule(body, opts = {})
  data, _status_code, _headers = create_ai_gateway_routing_rule_with_http_info(body, opts)
  data
end

#create_ai_gateway_routing_rule_with_http_info(body, opts = {}) ⇒ Array<(AiGatewayRoutingRuleResponse, Integer, Hash)>

Create an AI Gateway routing rule.

Create an organization-owned route with ai_gateway_config_write. New provider/model and route references require View. New routes use standard unrestricted defaults. To restrict configuration access, create the route and then apply a restriction policy using its numeric route_id. Sharing follows standard restriction-policy propagation and does not grant or revoke policy-authorized inference. Data capture overrides are managed independently. Each tier has an ordering, which defaults to configured. A weighted_affinity tier distributes first-choice assignments by relative target weights (1 to 10000, default 1) and accepts only distinct model targets with an explicit provider. Weights need not total 100. Configured tiers must omit weights or set them to null.

Parameters:

Returns:



583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 583

def create_ai_gateway_routing_rule_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.create_ai_gateway_routing_rule".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_ai_gateway_routing_rule")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_ai_gateway_routing_rule"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.create_ai_gateway_routing_rule ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.create_ai_gateway_routing_rule"
  end
  # resource path
  local_var_path = '/api/v2/routing-rules'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayRoutingRuleResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_ai_gateway_routing_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#create_ai_gateway_routing_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ai_gateway_budget(id, opts = {}) ⇒ Object

Archive an AI Gateway budget.



644
645
646
647
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 644

def delete_ai_gateway_budget(id, opts = {})
  delete_ai_gateway_budget_with_http_info(id, opts)
  nil
end

#delete_ai_gateway_budget_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Archive an AI Gateway budget.

Archive a spend budget by ID while retaining its accounting history.

Parameters:

  • id (UUID) —

    Budget UUID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 656

def delete_ai_gateway_budget_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_gateway_budget".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_gateway_budget")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_gateway_budget"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.delete_ai_gateway_budget ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.delete_ai_gateway_budget"
  end
  # resource path
  local_var_path = '/api/v2/budgets/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_ai_gateway_budget,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#delete_ai_gateway_budget\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ai_gateway_data_capture_override(id, body, opts = {}) ⇒ Object

Delete an AI Gateway data capture override.



715
716
717
718
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 715

def delete_ai_gateway_data_capture_override(id, body, opts = {})
  delete_ai_gateway_data_capture_override_with_http_info(id, body, opts)
  nil
end

#delete_ai_gateway_data_capture_override_with_http_info(id, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an AI Gateway data capture override.

Delete an override using its revision and the current configuration_revision. If deleting the override can enable full capture for affected traffic, set confirm_full_capture to true. Returns HTTP 409 when configuration_revision or the override revision is stale, including a concurrent change during deletion. Missing revisions or required full-capture confirmation returns HTTP 400. Requires ai_gateway_config_write and View and Edit access to this override. Hidden overrides return HTTP 404; visible overrides without Edit return HTTP 403. Authorization failures return HTTP 503. If permission cleanup fails after the deletion is committed, the response is HTTP 500 with code deletion_permission_cleanup_failed, meta.configuration_deleted=true, and meta.permissions_cleanup_failed=true. Do not retry the deletion.

Parameters:

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 728

def delete_ai_gateway_data_capture_override_with_http_info(id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_gateway_data_capture_override".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_gateway_data_capture_override")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_gateway_data_capture_override"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.delete_ai_gateway_data_capture_override ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.delete_ai_gateway_data_capture_override"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.delete_ai_gateway_data_capture_override"
  end
  # resource path
  local_var_path = '/api/v2/data-capture/overrides/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_ai_gateway_data_capture_override,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#delete_ai_gateway_data_capture_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ai_gateway_model(provider_id, canonical, opts = {}) ⇒ Object

Delete a model from an AI Gateway provider.



793
794
795
796
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 793

def delete_ai_gateway_model(provider_id, canonical, opts = {})
  delete_ai_gateway_model_with_http_info(provider_id, canonical, opts)
  nil
end

#delete_ai_gateway_model_by_canonical(provider_id, canonical, opts = {}) ⇒ Object

Delete a provider model by canonical ID.



877
878
879
880
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 877

def delete_ai_gateway_model_by_canonical(provider_id, canonical, opts = {})
  delete_ai_gateway_model_by_canonical_with_http_info(provider_id, canonical, opts)
  nil
end

#delete_ai_gateway_model_by_canonical_with_http_info(provider_id, canonical, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a provider model by canonical ID.

Delete a manually managed model catalog entry, naming the model in the canonical query parameter. Discovered entries are read-only. Unlike the endpoint that takes the canonical ID in the path, this one accepts canonical IDs that contain /. Requires ai_gateway_config_write and provider Edit. Models and pricing inherit provider access.

Parameters:

  • provider_id (Integer) —

    Provider ID.

  • canonical (String) —

    Canonical model identifier. It can contain /, such as openai/gpt-4o.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 890

def delete_ai_gateway_model_by_canonical_with_http_info(provider_id, canonical, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_gateway_model_by_canonical".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_gateway_model_by_canonical")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_gateway_model_by_canonical"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.delete_ai_gateway_model_by_canonical ...'
  end
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    fail ArgumentError, "Missing the required parameter 'provider_id' when calling AIGatewayAPI.delete_ai_gateway_model_by_canonical"
  end
  if @api_client.config.client_side_validation && provider_id < 1
    fail ArgumentError, 'invalid value for "provider_id" when calling AIGatewayAPI.delete_ai_gateway_model_by_canonical, must be greater than or equal to 1.'
  end
  # verify the required parameter 'canonical' is set
  if @api_client.config.client_side_validation && canonical.nil?
    fail ArgumentError, "Missing the required parameter 'canonical' when calling AIGatewayAPI.delete_ai_gateway_model_by_canonical"
  end
  if @api_client.config.client_side_validation && canonical.to_s.length > 256
    fail ArgumentError, 'invalid value for "canonical" when calling AIGatewayAPI.delete_ai_gateway_model_by_canonical, the character length must be smaller than or equal to 256.'
  end
  # resource path
  local_var_path = '/api/v2/providers/{provider_id}/model'.sub('{provider_id}', CGI.escape(provider_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'canonical'] = canonical

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_ai_gateway_model_by_canonical,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#delete_ai_gateway_model_by_canonical\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ai_gateway_model_group(id, opts = {}) ⇒ Object

Delete an AI Gateway model group.



960
961
962
963
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 960

def delete_ai_gateway_model_group(id, opts = {})
  delete_ai_gateway_model_group_with_http_info(id, opts)
  nil
end

#delete_ai_gateway_model_group_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an AI Gateway model group.

Delete a named model group. The organization-wide policy cannot be deleted. Requires configuration write permission and edit access to the group.

Parameters:

  • id (String) —

    Model group ID, or "default" for the explicit organization-wide access policy.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 972

def delete_ai_gateway_model_group_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_gateway_model_group".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_gateway_model_group")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_gateway_model_group"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.delete_ai_gateway_model_group ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.delete_ai_gateway_model_group"
  end
  # resource path
  local_var_path = '/api/v2/model-groups/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_ai_gateway_model_group,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#delete_ai_gateway_model_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ai_gateway_model_pricing(provider_id, canonical, opts = {}) ⇒ Object

Delete a model pricing override.



1031
1032
1033
1034
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1031

def delete_ai_gateway_model_pricing(provider_id, canonical, opts = {})
  delete_ai_gateway_model_pricing_with_http_info(provider_id, canonical, opts)
  nil
end

#delete_ai_gateway_model_pricing_by_canonical(provider_id, canonical, opts = {}) ⇒ Object

Delete a model pricing override by canonical ID.



1113
1114
1115
1116
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1113

def delete_ai_gateway_model_pricing_by_canonical(provider_id, canonical, opts = {})
  delete_ai_gateway_model_pricing_by_canonical_with_http_info(provider_id, canonical, opts)
  nil
end

#delete_ai_gateway_model_pricing_by_canonical_with_http_info(provider_id, canonical, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a model pricing override by canonical ID.

Clear a provider model's pricing override, naming the model in the canonical query parameter. Unlike the endpoint that takes the canonical ID in the path, this one accepts canonical IDs that contain /. Requires ai_gateway_config_write and provider Edit. Models and pricing inherit provider access.

Parameters:

  • provider_id (Integer) —

    Provider ID.

  • canonical (String) —

    Canonical model identifier. It can contain /, such as openai/gpt-4o.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1126

def delete_ai_gateway_model_pricing_by_canonical_with_http_info(provider_id, canonical, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_gateway_model_pricing_by_canonical".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_gateway_model_pricing_by_canonical")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_gateway_model_pricing_by_canonical"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.delete_ai_gateway_model_pricing_by_canonical ...'
  end
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    fail ArgumentError, "Missing the required parameter 'provider_id' when calling AIGatewayAPI.delete_ai_gateway_model_pricing_by_canonical"
  end
  if @api_client.config.client_side_validation && provider_id < 1
    fail ArgumentError, 'invalid value for "provider_id" when calling AIGatewayAPI.delete_ai_gateway_model_pricing_by_canonical, must be greater than or equal to 1.'
  end
  # verify the required parameter 'canonical' is set
  if @api_client.config.client_side_validation && canonical.nil?
    fail ArgumentError, "Missing the required parameter 'canonical' when calling AIGatewayAPI.delete_ai_gateway_model_pricing_by_canonical"
  end
  if @api_client.config.client_side_validation && canonical.to_s.length > 256
    fail ArgumentError, 'invalid value for "canonical" when calling AIGatewayAPI.delete_ai_gateway_model_pricing_by_canonical, the character length must be smaller than or equal to 256.'
  end
  # resource path
  local_var_path = '/api/v2/providers/{provider_id}/model-pricing'.sub('{provider_id}', CGI.escape(provider_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'canonical'] = canonical

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_ai_gateway_model_pricing_by_canonical,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#delete_ai_gateway_model_pricing_by_canonical\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ai_gateway_model_pricing_with_http_info(provider_id, canonical, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a model pricing override.

Clear a custom provider model's pricing override. A canonical ID that contains / can't be sent in the path; use the /api/v2/providers/{provider_id}/model-pricing endpoint with the canonical query parameter instead. Requires ai_gateway_config_write and provider Edit. Models and pricing inherit provider access.

Parameters:

  • provider_id (Integer) —

    Provider ID.

  • canonical (String) —

    Canonical model identifier.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1044

def delete_ai_gateway_model_pricing_with_http_info(provider_id, canonical, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_gateway_model_pricing".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_gateway_model_pricing")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_gateway_model_pricing"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.delete_ai_gateway_model_pricing ...'
  end
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    fail ArgumentError, "Missing the required parameter 'provider_id' when calling AIGatewayAPI.delete_ai_gateway_model_pricing"
  end
  if @api_client.config.client_side_validation && provider_id < 1
    fail ArgumentError, 'invalid value for "provider_id" when calling AIGatewayAPI.delete_ai_gateway_model_pricing, must be greater than or equal to 1.'
  end
  # verify the required parameter 'canonical' is set
  if @api_client.config.client_side_validation && canonical.nil?
    fail ArgumentError, "Missing the required parameter 'canonical' when calling AIGatewayAPI.delete_ai_gateway_model_pricing"
  end
  if @api_client.config.client_side_validation && canonical.to_s.length > 256
    fail ArgumentError, 'invalid value for "canonical" when calling AIGatewayAPI.delete_ai_gateway_model_pricing, the character length must be smaller than or equal to 256.'
  end
  # resource path
  local_var_path = '/api/v2/providers/{provider_id}/models/{canonical}/pricing'.sub('{provider_id}', CGI.escape(provider_id.to_s).gsub('%2F', '/')).sub('{canonical}', CGI.escape(canonical.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_ai_gateway_model_pricing,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#delete_ai_gateway_model_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ai_gateway_model_with_http_info(provider_id, canonical, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a model from an AI Gateway provider.

Requires ai_gateway_config_write and provider Edit. Models and pricing inherit provider access. Delete a manually managed model catalog entry by its canonical model ID. Discovered entries are read-only. A canonical ID that contains / can't be sent in the path; use the /api/v2/providers/{provider_id}/model endpoint with the canonical query parameter instead.

Parameters:

  • provider_id (Integer) —

    Provider ID.

  • canonical (String) —

    Canonical model identifier.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 808

def delete_ai_gateway_model_with_http_info(provider_id, canonical, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_gateway_model".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_gateway_model")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_gateway_model"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.delete_ai_gateway_model ...'
  end
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    fail ArgumentError, "Missing the required parameter 'provider_id' when calling AIGatewayAPI.delete_ai_gateway_model"
  end
  if @api_client.config.client_side_validation && provider_id < 1
    fail ArgumentError, 'invalid value for "provider_id" when calling AIGatewayAPI.delete_ai_gateway_model, must be greater than or equal to 1.'
  end
  # verify the required parameter 'canonical' is set
  if @api_client.config.client_side_validation && canonical.nil?
    fail ArgumentError, "Missing the required parameter 'canonical' when calling AIGatewayAPI.delete_ai_gateway_model"
  end
  if @api_client.config.client_side_validation && canonical.to_s.length > 256
    fail ArgumentError, 'invalid value for "canonical" when calling AIGatewayAPI.delete_ai_gateway_model, the character length must be smaller than or equal to 256.'
  end
  # resource path
  local_var_path = '/api/v2/providers/{provider_id}/models/{canonical}'.sub('{provider_id}', CGI.escape(provider_id.to_s).gsub('%2F', '/')).sub('{canonical}', CGI.escape(canonical.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_ai_gateway_model,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#delete_ai_gateway_model\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ai_gateway_policy(inbound, opts = {}) ⇒ Object

Delete an AI Gateway routing policy.



1196
1197
1198
1199
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1196

def delete_ai_gateway_policy(inbound, opts = {})
  delete_ai_gateway_policy_with_http_info(inbound, opts)
  nil
end

#delete_ai_gateway_policy_with_http_info(inbound, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an AI Gateway routing policy.

Delete the routing policy document for a specific inbound pattern.

Parameters:

  • inbound (String) —

    Inbound routing pattern.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :user_id (UUID) —

    Filter or scope policies to a specific user. Omit for organization-wide policies.

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1209

def delete_ai_gateway_policy_with_http_info(inbound, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_gateway_policy".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_gateway_policy")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_gateway_policy"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.delete_ai_gateway_policy ...'
  end
  # verify the required parameter 'inbound' is set
  if @api_client.config.client_side_validation && inbound.nil?
    fail ArgumentError, "Missing the required parameter 'inbound' when calling AIGatewayAPI.delete_ai_gateway_policy"
  end
  if @api_client.config.client_side_validation && inbound.to_s.length > 256
    fail ArgumentError, 'invalid value for "inbound" when calling AIGatewayAPI.delete_ai_gateway_policy, the character length must be smaller than or equal to 256.'
  end
  # resource path
  local_var_path = '/api/v2/policies/{inbound}'.sub('{inbound}', CGI.escape(inbound.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'user_id'] = opts[:'user_id'] if !opts[:'user_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_ai_gateway_policy,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#delete_ai_gateway_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ai_gateway_provider(id, opts = {}) ⇒ Object

Delete an AI Gateway provider.



1272
1273
1274
1275
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1272

def delete_ai_gateway_provider(id, opts = {})
  delete_ai_gateway_provider_with_http_info(id, opts)
  nil
end

#delete_ai_gateway_provider_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an AI Gateway provider.

Requires ai_gateway_config_write and provider View/Edit. Models and pricing inherit provider access. Every affected route and policy membership requires the corresponding Edit permission; force=true never bypasses authorization. Providers used by routing rules return provider_in_use with HTTP 409. Each JSON:API error item's meta contains blocked, restricted_dependencies, policies, rules_to_delete, and rules_to_update. Visible policy entries contain id, name, and editable; visible route entries contain id, slug, and editable. Hidden dependencies are omitted from every collection and reported only by restricted_dependencies. A blocked response changes no configuration; an authorized editor must first remove the blocking references. Retry with force=true to confirm an authorized cascade that removes provider targets and deletes rules left without targets. Surviving tiers keep their ordering and weights. A deletion that would rewrite a surviving tier with an unknown ordering_issue fails with HTTP 409 and code routing_rule_unknown_ordering until that rule is replaced or deleted.

Parameters:

  • id (Integer) —

    Provider ID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :force (Boolean) —

    Apply the routing rule changes returned by provider_in_use. Defaults to false.

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1285

def delete_ai_gateway_provider_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_gateway_provider".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_gateway_provider")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_gateway_provider"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.delete_ai_gateway_provider ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.delete_ai_gateway_provider"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling AIGatewayAPI.delete_ai_gateway_provider, must be greater than or equal to 1.'
  end
  # resource path
  local_var_path = '/api/v2/providers/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'force'] = opts[:'force'] if !opts[:'force'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_ai_gateway_provider,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#delete_ai_gateway_provider\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ai_gateway_rate_limit(id, opts = {}) ⇒ Object

Archive an AI Gateway rate limit.



1348
1349
1350
1351
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1348

def delete_ai_gateway_rate_limit(id, opts = {})
  delete_ai_gateway_rate_limit_with_http_info(id, opts)
  nil
end

#delete_ai_gateway_rate_limit_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Archive an AI Gateway rate limit.

Archive a rate limit by ID. An archived rate limit no longer appears in lists or lookups, and its alert monitor is deleted.

Parameters:

  • id (UUID) —

    Rate limit UUID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1360

def delete_ai_gateway_rate_limit_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_gateway_rate_limit".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_gateway_rate_limit")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_gateway_rate_limit"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.delete_ai_gateway_rate_limit ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.delete_ai_gateway_rate_limit"
  end
  # resource path
  local_var_path = '/api/v2/rate-limits/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_ai_gateway_rate_limit,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#delete_ai_gateway_rate_limit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_ai_gateway_routing_rule(slug, opts = {}) ⇒ Object

Delete an AI Gateway routing rule.



1419
1420
1421
1422
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1419

def delete_ai_gateway_routing_rule(slug, opts = {})
  delete_ai_gateway_routing_rule_with_http_info(slug, opts)
  nil
end

#delete_ai_gateway_routing_rule_with_http_info(slug, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete an AI Gateway routing rule.

Delete a route with ai_gateway_config_write and route View/Edit. Every affected route and policy membership requires the corresponding Edit permission. The force=true parameter confirms impact and never bypasses authorization. A denied or unavailable check changes no configuration. Visible dependencies include editable; hidden dependencies are omitted and reported only by restricted_dependencies. A blocked response means an authorized editor must first remove blocking references. Each JSON:API error item's meta contains blocked, restricted_dependencies, policies, rules_to_delete, and rules_to_update. Visible policy entries contain id, name, and editable. Route deletion entries contain rule, reason, and editable; update entries contain rule, removed_tiers, and editable. Each rule contains route_id, slug, tiers, created_at, and updated_at with hidden nested selections redacted. The removed_tiers array identifies original tier numbers removed entirely by the cascade. Already-authorized in-flight operations may finish. Referenced rules require force=true. Surviving tiers keep their ordering and weights. A deletion that would rewrite a surviving tier with an unknown ordering_issue fails with HTTP 409 and code routing_rule_unknown_ordering until that rule is replaced or deleted. Restriction cleanup occurs only after confirmed deletion. Cleanup failure returns 500 with configuration_deleted=true and permissions_cleanup_failed=true; refresh instead of assuming the route still exists.

Parameters:

  • slug (String) —

    Organization-unique routing rule slug.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :force (Boolean) —

    Delete referencing tiers and recursively delete parent rules left without tiers.

Returns:

  • (Array<(nil, Integer, Hash)>) —

    nil, response status code and response headers



1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1432

def delete_ai_gateway_routing_rule_with_http_info(slug, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_gateway_routing_rule".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_gateway_routing_rule")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_gateway_routing_rule"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.delete_ai_gateway_routing_rule ...'
  end
  # verify the required parameter 'slug' is set
  if @api_client.config.client_side_validation && slug.nil?
    fail ArgumentError, "Missing the required parameter 'slug' when calling AIGatewayAPI.delete_ai_gateway_routing_rule"
  end
  if @api_client.config.client_side_validation && slug.to_s.length > 128
    fail ArgumentError, 'invalid value for "slug" when calling AIGatewayAPI.delete_ai_gateway_routing_rule, the character length must be smaller than or equal to 128.'
  end
  # resource path
  local_var_path = '/api/v2/routing-rules'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'slug'] = slug
  query_params[:'force'] = opts[:'force'] if !opts[:'force'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_ai_gateway_routing_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#delete_ai_gateway_routing_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ai_gateway_budget(id, opts = {}) ⇒ Object

Get an AI Gateway budget.



1496
1497
1498
1499
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1496

def get_ai_gateway_budget(id, opts = {})
  data, _status_code, _headers = get_ai_gateway_budget_with_http_info(id, opts)
  data
end

#get_ai_gateway_budget_current_period(id, opts = {}) ⇒ Object

Get an AI Gateway budget's current period.



1567
1568
1569
1570
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1567

def get_ai_gateway_budget_current_period(id, opts = {})
  data, _status_code, _headers = get_ai_gateway_budget_current_period_with_http_info(id, opts)
  data
end

#get_ai_gateway_budget_current_period_with_http_info(id, opts = {}) ⇒ Array<(AiGatewayBudgetPeriodResponse, Integer, Hash)>

Get an AI Gateway budget's current period.

Get the active accounting window, enforced capacity, and current spend.

Parameters:

  • id (UUID) —

    Budget UUID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1579

def get_ai_gateway_budget_current_period_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_gateway_budget_current_period".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_gateway_budget_current_period")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_gateway_budget_current_period"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.get_ai_gateway_budget_current_period ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.get_ai_gateway_budget_current_period"
  end
  # resource path
  local_var_path = '/api/v2/budgets/{id}/current-period'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayBudgetPeriodResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_ai_gateway_budget_current_period,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#get_ai_gateway_budget_current_period\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ai_gateway_budget_instances_summary(id, opts = {}) ⇒ Object

Get an AI Gateway budget instance summary.



1638
1639
1640
1641
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1638

def get_ai_gateway_budget_instances_summary(id, opts = {})
  data, _status_code, _headers = get_ai_gateway_budget_instances_summary_with_http_info(id, opts)
  data
end

#get_ai_gateway_budget_instances_summary_with_http_info(id, opts = {}) ⇒ Array<(AiGatewayBudgetInstancesSummaryResponse, Integer, Hash)>

Get an AI Gateway budget instance summary.

Aggregate counters for an accounting window, including total spend and the numbers of instances at or above the warning threshold and capacity. Use split_dim to aggregate only counters that match every given dimension value.

Parameters:

  • id (UUID) —

    Budget UUID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :window (Time) —

    RFC3339 timestamp inside the desired accounting window. Omit to use the current window.

  • :split_dim (Array<String>) —

    Keep only instance counters whose split dimension equals a value, written as <dim>=<value>, such as split_dim=user_id=<uuid>&split_dim=tag:env=prod. Dimensions use the split_dims names user_id, team_id, model, provider, and tag:<key>. Repeat the parameter to filter on several dimensions; a counter must match all of them. Each dimension may appear once and must be a per-value dimension of the budget.

Returns:



1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1652

def get_ai_gateway_budget_instances_summary_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_gateway_budget_instances_summary".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_gateway_budget_instances_summary")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_gateway_budget_instances_summary"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.get_ai_gateway_budget_instances_summary ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.get_ai_gateway_budget_instances_summary"
  end
  # resource path
  local_var_path = '/api/v2/budgets/{id}/instances/summary'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'window'] = opts[:'window'] if !opts[:'window'].nil?
  query_params[:'split_dim'] = @api_client.build_collection_param(opts[:'split_dim'], :multi) if !opts[:'split_dim'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayBudgetInstancesSummaryResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_ai_gateway_budget_instances_summary,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )
  new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#get_ai_gateway_budget_instances_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ai_gateway_budget_with_http_info(id, opts = {}) ⇒ Array<(AiGatewayBudgetResponse, Integer, Hash)>

Get an AI Gateway budget.

Get a spend budget by ID, including its capacity, scope, reset window, warning threshold, and enforcement mode.

Parameters:

  • id (UUID) —

    Budget UUID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(AiGatewayBudgetResponse, Integer, Hash)>) —

    AiGatewayBudgetResponse data, response status code and response headers



1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1508

def get_ai_gateway_budget_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_gateway_budget".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_gateway_budget")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_gateway_budget"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.get_ai_gateway_budget ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.get_ai_gateway_budget"
  end
  # resource path
  local_var_path = '/api/v2/budgets/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayBudgetResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_ai_gateway_budget,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#get_ai_gateway_budget\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ai_gateway_data_capture_configuration(opts = {}) ⇒ Object

Get the AI Gateway data capture configuration.



1714
1715
1716
1717
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1714

def get_ai_gateway_data_capture_configuration(opts = {})
  data, _status_code, _headers = get_ai_gateway_data_capture_configuration_with_http_info(opts)
  data
end

#get_ai_gateway_data_capture_configuration_with_http_info(opts = {}) ⇒ Array<(AiGatewayCaptureConfigurationResponse, Integer, Hash)>

Get the AI Gateway data capture configuration.

Get the organization default mode, scoped capture overrides, and configuration revision. Requires ai_gateway_config_read. Only overrides the caller can View are returned. Hidden overrides remain effective and contribute to configuration_revision. An override missing from the response is not necessarily deleted.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1725

def get_ai_gateway_data_capture_configuration_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_gateway_data_capture_configuration".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_gateway_data_capture_configuration")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_gateway_data_capture_configuration"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.get_ai_gateway_data_capture_configuration ...'
  end
  # resource path
  local_var_path = '/api/v2/data-capture/configuration'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayCaptureConfigurationResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_ai_gateway_data_capture_configuration,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#get_ai_gateway_data_capture_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ai_gateway_governance(opts = {}) ⇒ Object

Get AI Gateway governance controls.



1780
1781
1782
1783
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1780

def get_ai_gateway_governance(opts = {})
  data, _status_code, _headers = get_ai_gateway_governance_with_http_info(opts)
  data
end

#get_ai_gateway_governance_with_http_info(opts = {}) ⇒ Array<(AiGatewayGovernanceResponse, Integer, Hash)>

Get AI Gateway governance controls.

Get the organization-wide AI Gateway governance settings, which are the default data capture mode and whether requests must reach providers covered by a zero data retention agreement.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(AiGatewayGovernanceResponse, Integer, Hash)>) —

    AiGatewayGovernanceResponse data, response status code and response headers



1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1791

def get_ai_gateway_governance_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_gateway_governance".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_gateway_governance")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_gateway_governance"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.get_ai_gateway_governance ...'
  end
  # resource path
  local_var_path = '/api/v2/governance'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayGovernanceResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_ai_gateway_governance,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#get_ai_gateway_governance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ai_gateway_model_group(id, opts = {}) ⇒ Object

Get an AI Gateway model group.



1846
1847
1848
1849
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1846

def get_ai_gateway_model_group(id, opts = {})
  data, _status_code, _headers = get_ai_gateway_model_group_with_http_info(id, opts)
  data
end

#get_ai_gateway_model_group_with_http_info(id, opts = {}) ⇒ Array<(AiGatewayModelGroupResponse, Integer, Hash)>

Get an AI Gateway model group.

Get a named policy or the explicit organization-wide policy by id "default". Requires configuration read permission and policy View, including for the default policy. Hidden policies are omitted from lists and return the same not-found response as missing policies. Provider selections cover current and future models and are returned separately from individual model selections.

Parameters:

  • id (String) —

    Model group ID, or "default" for the explicit organization-wide access policy.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(AiGatewayModelGroupResponse, Integer, Hash)>) —

    AiGatewayModelGroupResponse data, response status code and response headers



1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1858

def get_ai_gateway_model_group_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_gateway_model_group".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_gateway_model_group")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_gateway_model_group"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.get_ai_gateway_model_group ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.get_ai_gateway_model_group"
  end
  # resource path
  local_var_path = '/api/v2/model-groups/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayModelGroupResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_ai_gateway_model_group,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#get_ai_gateway_model_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ai_gateway_model_pricing(provider_id, canonical, opts = {}) ⇒ Object

Get a model pricing override.



1917
1918
1919
1920
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1917

def get_ai_gateway_model_pricing(provider_id, canonical, opts = {})
  data, _status_code, _headers = get_ai_gateway_model_pricing_with_http_info(provider_id, canonical, opts)
  data
end

#get_ai_gateway_model_pricing_by_canonical(provider_id, canonical, opts = {}) ⇒ Object

Get a model pricing override by canonical ID.



1999
2000
2001
2002
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1999

def get_ai_gateway_model_pricing_by_canonical(provider_id, canonical, opts = {})
  data, _status_code, _headers = get_ai_gateway_model_pricing_by_canonical_with_http_info(provider_id, canonical, opts)
  data
end

#get_ai_gateway_model_pricing_by_canonical_with_http_info(provider_id, canonical, opts = {}) ⇒ Array<(AiGatewayModelPricingResponse, Integer, Hash)>

Get a model pricing override by canonical ID.

Get a provider model's pricing override and effective pricing source, naming the model in the canonical query parameter. Unlike the endpoint that takes the canonical ID in the path, this one accepts canonical IDs that contain /. Requires ai_gateway_config_read and provider View. Catalog and pricing metadata inherit provider access. Direct reads of hidden resources return 404.

Parameters:

  • provider_id (Integer) —

    Provider ID.

  • canonical (String) —

    Canonical model identifier. It can contain /, such as openai/gpt-4o.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2012

def get_ai_gateway_model_pricing_by_canonical_with_http_info(provider_id, canonical, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_gateway_model_pricing_by_canonical".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_gateway_model_pricing_by_canonical")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_gateway_model_pricing_by_canonical"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.get_ai_gateway_model_pricing_by_canonical ...'
  end
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    fail ArgumentError, "Missing the required parameter 'provider_id' when calling AIGatewayAPI.get_ai_gateway_model_pricing_by_canonical"
  end
  if @api_client.config.client_side_validation && provider_id < 1
    fail ArgumentError, 'invalid value for "provider_id" when calling AIGatewayAPI.get_ai_gateway_model_pricing_by_canonical, must be greater than or equal to 1.'
  end
  # verify the required parameter 'canonical' is set
  if @api_client.config.client_side_validation && canonical.nil?
    fail ArgumentError, "Missing the required parameter 'canonical' when calling AIGatewayAPI.get_ai_gateway_model_pricing_by_canonical"
  end
  if @api_client.config.client_side_validation && canonical.to_s.length > 256
    fail ArgumentError, 'invalid value for "canonical" when calling AIGatewayAPI.get_ai_gateway_model_pricing_by_canonical, the character length must be smaller than or equal to 256.'
  end
  # resource path
  local_var_path = '/api/v2/providers/{provider_id}/model-pricing'.sub('{provider_id}', CGI.escape(provider_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'canonical'] = canonical

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayModelPricingResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_ai_gateway_model_pricing_by_canonical,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#get_ai_gateway_model_pricing_by_canonical\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ai_gateway_model_pricing_with_http_info(provider_id, canonical, opts = {}) ⇒ Array<(AiGatewayModelPricingResponse, Integer, Hash)>

Get a model pricing override.

Get a custom provider model's pricing override and effective pricing source. A canonical ID that contains / can't be sent in the path; use the /api/v2/providers/{provider_id}/model-pricing endpoint with the canonical query parameter instead. Requires ai_gateway_config_read and provider View. Catalog and pricing metadata inherit provider access. Lists omit hidden entries; direct reads of hidden resources return 404.

Parameters:

  • provider_id (Integer) —

    Provider ID.

  • canonical (String) —

    Canonical model identifier.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 1930

def get_ai_gateway_model_pricing_with_http_info(provider_id, canonical, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_gateway_model_pricing".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_gateway_model_pricing")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_gateway_model_pricing"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.get_ai_gateway_model_pricing ...'
  end
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    fail ArgumentError, "Missing the required parameter 'provider_id' when calling AIGatewayAPI.get_ai_gateway_model_pricing"
  end
  if @api_client.config.client_side_validation && provider_id < 1
    fail ArgumentError, 'invalid value for "provider_id" when calling AIGatewayAPI.get_ai_gateway_model_pricing, must be greater than or equal to 1.'
  end
  # verify the required parameter 'canonical' is set
  if @api_client.config.client_side_validation && canonical.nil?
    fail ArgumentError, "Missing the required parameter 'canonical' when calling AIGatewayAPI.get_ai_gateway_model_pricing"
  end
  if @api_client.config.client_side_validation && canonical.to_s.length > 256
    fail ArgumentError, 'invalid value for "canonical" when calling AIGatewayAPI.get_ai_gateway_model_pricing, the character length must be smaller than or equal to 256.'
  end
  # resource path
  local_var_path = '/api/v2/providers/{provider_id}/models/{canonical}/pricing'.sub('{provider_id}', CGI.escape(provider_id.to_s).gsub('%2F', '/')).sub('{canonical}', CGI.escape(canonical.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayModelPricingResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_ai_gateway_model_pricing,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#get_ai_gateway_model_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ai_gateway_policy(inbound, opts = {}) ⇒ Object

Get an AI Gateway routing policy.



2082
2083
2084
2085
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2082

def get_ai_gateway_policy(inbound, opts = {})
  data, _status_code, _headers = get_ai_gateway_policy_with_http_info(inbound, opts)
  data
end

#get_ai_gateway_policy_with_http_info(inbound, opts = {}) ⇒ Array<(AiGatewayPolicyResponse, Integer, Hash)>

Get an AI Gateway routing policy.

Get the routing policy document for a specific inbound pattern.

Parameters:

  • inbound (String) —

    Inbound routing pattern.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :user_id (UUID) —

    Filter or scope policies to a specific user. Omit for organization-wide policies.

Returns:

  • (Array<(AiGatewayPolicyResponse, Integer, Hash)>) —

    AiGatewayPolicyResponse data, response status code and response headers



2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2095

def get_ai_gateway_policy_with_http_info(inbound, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_gateway_policy".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_gateway_policy")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_gateway_policy"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.get_ai_gateway_policy ...'
  end
  # verify the required parameter 'inbound' is set
  if @api_client.config.client_side_validation && inbound.nil?
    fail ArgumentError, "Missing the required parameter 'inbound' when calling AIGatewayAPI.get_ai_gateway_policy"
  end
  if @api_client.config.client_side_validation && inbound.to_s.length > 256
    fail ArgumentError, 'invalid value for "inbound" when calling AIGatewayAPI.get_ai_gateway_policy, the character length must be smaller than or equal to 256.'
  end
  # resource path
  local_var_path = '/api/v2/policies/{inbound}'.sub('{inbound}', CGI.escape(inbound.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'user_id'] = opts[:'user_id'] if !opts[:'user_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayPolicyResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_ai_gateway_policy,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#get_ai_gateway_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ai_gateway_provider(id, opts = {}) ⇒ Object

Get an AI Gateway provider.



2158
2159
2160
2161
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2158

def get_ai_gateway_provider(id, opts = {})
  data, _status_code, _headers = get_ai_gateway_provider_with_http_info(id, opts)
  data
end

#get_ai_gateway_provider_with_http_info(id, opts = {}) ⇒ Array<(AiGatewayProviderResponse, Integer, Hash)>

Get an AI Gateway provider.

Get a provider by ID, including its routing slug, integration account, and cost multiplier. Credentials stay in the integration account and are never returned. Requires ai_gateway_config_read and provider View. Catalog and pricing metadata inherit provider access. Lists omit hidden entries; direct reads of hidden resources return 404.

Parameters:

  • id (Integer) —

    Provider ID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(AiGatewayProviderResponse, Integer, Hash)>) —

    AiGatewayProviderResponse data, response status code and response headers



2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2170

def get_ai_gateway_provider_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_gateway_provider".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_gateway_provider")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_gateway_provider"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.get_ai_gateway_provider ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.get_ai_gateway_provider"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling AIGatewayAPI.get_ai_gateway_provider, must be greater than or equal to 1.'
  end
  # resource path
  local_var_path = '/api/v2/providers/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayProviderResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_ai_gateway_provider,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#get_ai_gateway_provider\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ai_gateway_rate_limit(id, opts = {}) ⇒ Object

Get an AI Gateway rate limit.



2232
2233
2234
2235
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2232

def get_ai_gateway_rate_limit(id, opts = {})
  data, _status_code, _headers = get_ai_gateway_rate_limit_with_http_info(id, opts)
  data
end

#get_ai_gateway_rate_limit_instances_summary(id, opts = {}) ⇒ Object

Get an AI Gateway rate limit counter summary.



2303
2304
2305
2306
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2303

def get_ai_gateway_rate_limit_instances_summary(id, opts = {})
  data, _status_code, _headers = get_ai_gateway_rate_limit_instances_summary_with_http_info(id, opts)
  data
end

#get_ai_gateway_rate_limit_instances_summary_with_http_info(id, opts = {}) ⇒ Array<(AiGatewayRateLimitInstancesSummaryResponse, Integer, Hash)>

Get an AI Gateway rate limit counter summary.

Aggregate a template rate limit's hot counters, including how many there are, how many are near or at their limit, and the fullest counter's utilization. Hot counters are those that reached 80% or more of a limit, or that limited or would have limited a request, in the last hour. Use split_dim to aggregate only counters that match every given dimension value. When the caller can't see the template's selector, every count is zero and scope_restricted is true. Summaries are cached for up to 15 seconds. Returns 503 when counter usage can't be read.

Parameters:

  • id (UUID) —

    Rate limit UUID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :split_dim (Array<String>) —

    Keep only counters whose split dimension equals a value, written as <dim>=<value>, such as split_dim=user_id=<uuid>&split_dim=model=gpt-4o. Dimensions use the split_dims names user_id, team_id, model, provider, and tag:<key>. Repeat the parameter to filter on several dimensions; a counter must match all of them. Each dimension may appear once and must be a per-value dimension of the rate limit.

Returns:



2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2316

def get_ai_gateway_rate_limit_instances_summary_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_gateway_rate_limit_instances_summary".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_gateway_rate_limit_instances_summary")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_gateway_rate_limit_instances_summary"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.get_ai_gateway_rate_limit_instances_summary ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.get_ai_gateway_rate_limit_instances_summary"
  end
  # resource path
  local_var_path = '/api/v2/rate-limits/{id}/instances/summary'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'split_dim'] = @api_client.build_collection_param(opts[:'split_dim'], :multi) if !opts[:'split_dim'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayRateLimitInstancesSummaryResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_ai_gateway_rate_limit_instances_summary,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )
  new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#get_ai_gateway_rate_limit_instances_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ai_gateway_rate_limit_usage(opts = {}) ⇒ Object

Get AI Gateway rate limit usage.



2377
2378
2379
2380
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2377

def get_ai_gateway_rate_limit_usage(opts = {})
  data, _status_code, _headers = get_ai_gateway_rate_limit_usage_with_http_info(opts)
  data
end

#get_ai_gateway_rate_limit_usage_with_http_info(opts = {}) ⇒ Array<(AiGatewayRateLimitUsageListResponse, Integer, Hash)>

Get AI Gateway rate limit usage.

Get live usage for the organization's rate limits. Returns requests and tokens counted in the rolling one-minute window and requests limited in the last 15 minutes for each enabled rate limit, plus untracked (traffic no enforced rate limit covers) and total (all gateway traffic).

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2388

def get_ai_gateway_rate_limit_usage_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_gateway_rate_limit_usage".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_gateway_rate_limit_usage")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_gateway_rate_limit_usage"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.get_ai_gateway_rate_limit_usage ...'
  end
  # resource path
  local_var_path = '/api/v2/rate-limits/usage'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayRateLimitUsageListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_ai_gateway_rate_limit_usage,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#get_ai_gateway_rate_limit_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ai_gateway_rate_limit_with_http_info(id, opts = {}) ⇒ Array<(AiGatewayRateLimitResponse, Integer, Hash)>

Get an AI Gateway rate limit.

Get a rate limit by ID, including its scope, per-minute request and token limits, and whether it is enabled.

Parameters:

  • id (UUID) —

    Rate limit UUID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(AiGatewayRateLimitResponse, Integer, Hash)>) —

    AiGatewayRateLimitResponse data, response status code and response headers



2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2244

def get_ai_gateway_rate_limit_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_gateway_rate_limit".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_gateway_rate_limit")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_gateway_rate_limit"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.get_ai_gateway_rate_limit ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.get_ai_gateway_rate_limit"
  end
  # resource path
  local_var_path = '/api/v2/rate-limits/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayRateLimitResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_ai_gateway_rate_limit,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#get_ai_gateway_rate_limit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_ai_gateway_routing_rule(slug, opts = {}) ⇒ Object

Get an AI Gateway routing rule.



2443
2444
2445
2446
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2443

def get_ai_gateway_routing_rule(slug, opts = {})
  data, _status_code, _headers = get_ai_gateway_routing_rule_with_http_info(slug, opts)
  data
end

#get_ai_gateway_routing_rule_with_http_info(slug, opts = {}) ⇒ Array<(AiGatewayRoutingRuleResponse, Integer, Hash)>

Get an AI Gateway routing rule.

Get a routing rule by slug with ai_gateway_config_read and route View. Hidden and missing routes both return 404. Hidden target identities are omitted; parent-local target IDs remain available for retention.

Parameters:

  • slug (String) —

    Organization-unique routing rule slug.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2455

def get_ai_gateway_routing_rule_with_http_info(slug, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_gateway_routing_rule".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_gateway_routing_rule")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_gateway_routing_rule"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.get_ai_gateway_routing_rule ...'
  end
  # verify the required parameter 'slug' is set
  if @api_client.config.client_side_validation && slug.nil?
    fail ArgumentError, "Missing the required parameter 'slug' when calling AIGatewayAPI.get_ai_gateway_routing_rule"
  end
  if @api_client.config.client_side_validation && slug.to_s.length > 128
    fail ArgumentError, 'invalid value for "slug" when calling AIGatewayAPI.get_ai_gateway_routing_rule, the character length must be smaller than or equal to 128.'
  end
  # resource path
  local_var_path = '/api/v2/routing-rules/get'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'slug'] = slug

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayRoutingRuleResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_ai_gateway_routing_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#get_ai_gateway_routing_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ai_gateway_budget_instance_dimensions(id, opts = {}) ⇒ Object

List AI Gateway budget instance dimension values.



2518
2519
2520
2521
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2518

def list_ai_gateway_budget_instance_dimensions(id, opts = {})
  data, _status_code, _headers = list_ai_gateway_budget_instance_dimensions_with_http_info(id, opts)
  data
end

#list_ai_gateway_budget_instance_dimensions_with_http_info(id, opts = {}) ⇒ Array<(AiGatewayBudgetInstanceDimensionListResponse, Integer, Hash)>

List AI Gateway budget instance dimension values.

Search the values that a template budget's split dimensions take across its instance counters in an accounting window. Each dimension returns its top values by spend, with counter counts. Use query or value to narrow results and limit to cap them. The truncated field reports whether more values matched. Each dimension's values are counted under the other dimensions' split_dim filters, so a dimension's own filter does not hide its alternatives. Legacy fixed-scope budgets return an empty list.

Parameters:

  • id (UUID) —

    Budget UUID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :window (Time) —

    RFC3339 timestamp inside the desired accounting window. Omit to use the current window.

  • :split_dim (Array<String>) —

    Keep only instance counters whose split dimension equals a value, written as <dim>=<value>, such as split_dim=user_id=<uuid>&split_dim=tag:env=prod. Dimensions use the split_dims names user_id, team_id, model, provider, and tag:<key>. Repeat the parameter to filter on several dimensions; a counter must match all of them. Each dimension may appear once and must be a per-value dimension of the budget.

  • :dim (Array<String>) —

    Return only these split dimensions, such as dim=user_id. Repeat the parameter for several dimensions. Omit it to return every split dimension of the budget.

  • :query (String) —

    Keep only values that contain this text, case-insensitively. It matches raw values, so User and Team values match their UUIDs; search their names elsewhere and pass the IDs as value.

  • :value (Array<String>) —

    Keep only these values. Repeat the parameter to check several candidates, such as User IDs found by name, and learn which of them have instance counters.

  • :limit (Integer) —

    Maximum number of values to return per dimension.

Returns:



2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2536

def list_ai_gateway_budget_instance_dimensions_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_gateway_budget_instance_dimensions".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_gateway_budget_instance_dimensions")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_gateway_budget_instance_dimensions"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.list_ai_gateway_budget_instance_dimensions ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.list_ai_gateway_budget_instance_dimensions"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AIGatewayAPI.list_ai_gateway_budget_instance_dimensions, must be smaller than or equal to 500.'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AIGatewayAPI.list_ai_gateway_budget_instance_dimensions, must be greater than or equal to 1.'
  end
  # resource path
  local_var_path = '/api/v2/budgets/{id}/instances/dimensions'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'window'] = opts[:'window'] if !opts[:'window'].nil?
  query_params[:'split_dim'] = @api_client.build_collection_param(opts[:'split_dim'], :multi) if !opts[:'split_dim'].nil?
  query_params[:'dim'] = @api_client.build_collection_param(opts[:'dim'], :multi) if !opts[:'dim'].nil?
  query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
  query_params[:'value'] = @api_client.build_collection_param(opts[:'value'], :multi) if !opts[:'value'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayBudgetInstanceDimensionListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_ai_gateway_budget_instance_dimensions,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )
  new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#list_ai_gateway_budget_instance_dimensions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ai_gateway_budget_instances(id, opts = {}) ⇒ Object

List AI Gateway budget instances.



2608
2609
2610
2611
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2608

def list_ai_gateway_budget_instances(id, opts = {})
  data, _status_code, _headers = list_ai_gateway_budget_instances_with_http_info(id, opts)
  data
end

#list_ai_gateway_budget_instances_with_http_info(id, opts = {}) ⇒ Array<(AiGatewayBudgetInstanceListResponse, Integer, Hash)>

List AI Gateway budget instances.

List instance counters for an accounting window. Legacy fixed-scope budgets return one pooled row with an empty instance_key. Omit window to use the current window. Use split_dim to keep only counters that match every given dimension value.

Parameters:

  • id (UUID) —

    Budget UUID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :window (Time) —

    RFC3339 timestamp inside the desired accounting window. Omit to use the current window.

  • :split_dim (Array<String>) —

    Keep only instance counters whose split dimension equals a value, written as <dim>=<value>, such as split_dim=user_id=<uuid>&split_dim=tag:env=prod. Dimensions use the split_dims names user_id, team_id, model, provider, and tag:<key>. Repeat the parameter to filter on several dimensions; a counter must match all of them. Each dimension may appear once and must be a per-value dimension of the budget.

  • :sort (AiGatewayBudgetInstanceSort) —

    Sort order for budget instance counters.

  • :limit (Integer) —

    Maximum number of budget instance counters to return.

  • :offset (Integer) —

    Number of budget instance counters to skip.

Returns:



2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2625

def list_ai_gateway_budget_instances_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_gateway_budget_instances".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_gateway_budget_instances")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_gateway_budget_instances"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.list_ai_gateway_budget_instances ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.list_ai_gateway_budget_instances"
  end
  allowable_values = ['spend_desc', 'spend_asc', 'key_asc']
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AIGatewayAPI.list_ai_gateway_budget_instances, must be smaller than or equal to 500.'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AIGatewayAPI.list_ai_gateway_budget_instances, must be greater than or equal to 1.'
  end
  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling AIGatewayAPI.list_ai_gateway_budget_instances, must be greater than or equal to 0.'
  end
  # resource path
  local_var_path = '/api/v2/budgets/{id}/instances'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'window'] = opts[:'window'] if !opts[:'window'].nil?
  query_params[:'split_dim'] = @api_client.build_collection_param(opts[:'split_dim'], :multi) if !opts[:'split_dim'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayBudgetInstanceListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_ai_gateway_budget_instances,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )
  new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#list_ai_gateway_budget_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ai_gateway_budgets(opts = {}) ⇒ Object

List AI Gateway budgets.



2703
2704
2705
2706
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2703

def list_ai_gateway_budgets(opts = {})
  data, _status_code, _headers = list_ai_gateway_budgets_with_http_info(opts)
  data
end

#list_ai_gateway_budgets_with_http_info(opts = {}) ⇒ Array<(AiGatewayBudgetListResponse, Integer, Hash)>

List AI Gateway budgets.

List spend budgets for the organization, including active-window spend and effective capacity.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(AiGatewayBudgetListResponse, Integer, Hash)>) —

    AiGatewayBudgetListResponse data, response status code and response headers



2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2714

def list_ai_gateway_budgets_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_gateway_budgets".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_gateway_budgets")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_gateway_budgets"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.list_ai_gateway_budgets ...'
  end
  # resource path
  local_var_path = '/api/v2/budgets'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayBudgetListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_ai_gateway_budgets,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#list_ai_gateway_budgets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ai_gateway_model_groups(opts = {}) ⇒ Object

List AI Gateway model groups.



2769
2770
2771
2772
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2769

def list_ai_gateway_model_groups(opts = {})
  data, _status_code, _headers = list_ai_gateway_model_groups_with_http_info(opts)
  data
end

#list_ai_gateway_model_groups_with_http_info(opts = {}) ⇒ Array<(AiGatewayModelGroupListResponse, Integer, Hash)>

List AI Gateway model groups.

List model groups the user can view. The organization-wide policy has id "default" and explicit model, provider, and route selections. Missing or empty selections grant no organization-wide access. Its audience is fixed to the organization; it cannot be renamed or deleted. Named policies retain their access bindings. Requires configuration read permission and policy View, including for the default policy. Hidden policies are omitted from lists and return the same not-found response as missing policies.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2780

def list_ai_gateway_model_groups_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_gateway_model_groups".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_gateway_model_groups")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_gateway_model_groups"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.list_ai_gateway_model_groups ...'
  end
  # resource path
  local_var_path = '/api/v2/model-groups'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayModelGroupListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_ai_gateway_model_groups,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#list_ai_gateway_model_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ai_gateway_models(provider_id, opts = {}) ⇒ Object

List models for an AI Gateway provider.



2835
2836
2837
2838
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2835

def list_ai_gateway_models(provider_id, opts = {})
  data, _status_code, _headers = list_ai_gateway_models_with_http_info(provider_id, opts)
  data
end

#list_ai_gateway_models_by_canonical(opts = {}) ⇒ Object

List AI Gateway models by canonical ID.



2909
2910
2911
2912
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2909

def list_ai_gateway_models_by_canonical(opts = {})
  data, _status_code, _headers = list_ai_gateway_models_by_canonical_with_http_info(opts)
  data
end

#list_ai_gateway_models_by_canonical_with_http_info(opts = {}) ⇒ Array<(AiGatewayModelsByCanonicalListResponse, Integer, Hash)>

List AI Gateway models by canonical ID.

List all model catalog entries grouped by canonical model ID. Requires ai_gateway_config_read and provider View. Catalog and pricing metadata inherit provider access. Lists omit hidden entries; direct reads of hidden resources return 404.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2920

def list_ai_gateway_models_by_canonical_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_gateway_models_by_canonical".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_gateway_models_by_canonical")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_gateway_models_by_canonical"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.list_ai_gateway_models_by_canonical ...'
  end
  # resource path
  local_var_path = '/api/v2/models'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayModelsByCanonicalListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_ai_gateway_models_by_canonical,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#list_ai_gateway_models_by_canonical\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ai_gateway_models_with_http_info(provider_id, opts = {}) ⇒ Array<(AiGatewayModelCatalogEntryListResponse, Integer, Hash)>

List models for an AI Gateway provider.

List all model catalog entries for a provider. Requires ai_gateway_config_read and provider View. Catalog and pricing metadata inherit provider access. Lists omit hidden entries; direct reads of hidden resources return 404.

Parameters:

  • provider_id (Integer) —

    Provider ID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2847

def list_ai_gateway_models_with_http_info(provider_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_gateway_models".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_gateway_models")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_gateway_models"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.list_ai_gateway_models ...'
  end
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    fail ArgumentError, "Missing the required parameter 'provider_id' when calling AIGatewayAPI.list_ai_gateway_models"
  end
  if @api_client.config.client_side_validation && provider_id < 1
    fail ArgumentError, 'invalid value for "provider_id" when calling AIGatewayAPI.list_ai_gateway_models, must be greater than or equal to 1.'
  end
  # resource path
  local_var_path = '/api/v2/providers/{provider_id}/models'.sub('{provider_id}', CGI.escape(provider_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayModelCatalogEntryListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_ai_gateway_models,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#list_ai_gateway_models\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ai_gateway_policies(opts = {}) ⇒ Object

List AI Gateway routing policies.



2975
2976
2977
2978
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2975

def list_ai_gateway_policies(opts = {})
  data, _status_code, _headers = list_ai_gateway_policies_with_http_info(opts)
  data
end

#list_ai_gateway_policies_with_http_info(opts = {}) ⇒ Array<(AiGatewayPolicyListResponse, Integer, Hash)>

List AI Gateway routing policies.

List all routing policy documents for the organization. Pass user_id to filter by user scope.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :user_id (UUID) —

    Filter or scope policies to a specific user. Omit for organization-wide policies.

Returns:

  • (Array<(AiGatewayPolicyListResponse, Integer, Hash)>) —

    AiGatewayPolicyListResponse data, response status code and response headers



2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 2987

def list_ai_gateway_policies_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_gateway_policies".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_gateway_policies")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_gateway_policies"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.list_ai_gateway_policies ...'
  end
  # resource path
  local_var_path = '/api/v2/policies'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'user_id'] = opts[:'user_id'] if !opts[:'user_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayPolicyListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_ai_gateway_policies,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#list_ai_gateway_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ai_gateway_provider_models(integration_type, integration_account_id, opts = {}) ⇒ Object

List models available from a provider integration.



3043
3044
3045
3046
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3043

def list_ai_gateway_provider_models(integration_type, , opts = {})
  data, _status_code, _headers = list_ai_gateway_provider_models_with_http_info(integration_type, , opts)
  data
end

#list_ai_gateway_provider_models_with_http_info(integration_type, integration_account_id, opts = {}) ⇒ Array<(AiGatewayDiscoveredModelListResponse, Integer, Hash)>

List models available from a provider integration.

List live models available to a provider integration account that supports model discovery.

Parameters:

  • integration_type (String) —

    Provider integration type.

  • integration_account_id (String) —

    Provider integration account ID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :project_id (String) —

    GCP project ID used for Gemini model discovery. Required for Gemini integrations.

  • :location (String) —

    Optional GCP location used for Gemini model discovery. Defaults to global.

  • :bedrock_region (String) —

    AWS region used for Bedrock model discovery. Required for Amazon Bedrock integrations.

  • :foundry_resource_id (String) —

    ARM resource ID of the Azure AI Foundry resource used for model discovery. Required for Azure AI Foundry integrations.

Returns:



3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3060

def list_ai_gateway_provider_models_with_http_info(integration_type, , opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_gateway_provider_models".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_gateway_provider_models")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_gateway_provider_models"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.list_ai_gateway_provider_models ...'
  end
  # verify the required parameter 'integration_type' is set
  if @api_client.config.client_side_validation && integration_type.nil?
    fail ArgumentError, "Missing the required parameter 'integration_type' when calling AIGatewayAPI.list_ai_gateway_provider_models"
  end
  # verify the required parameter 'integration_account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'integration_account_id' when calling AIGatewayAPI.list_ai_gateway_provider_models"
  end
  if @api_client.config.client_side_validation && .to_s.length > 256
    fail ArgumentError, 'invalid value for "integration_account_id" when calling AIGatewayAPI.list_ai_gateway_provider_models, the character length must be smaller than or equal to 256.'
  end
  # resource path
  local_var_path = '/api/v2/provider-models'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'integration_type'] = integration_type
  query_params[:'integration_account_id'] = 
  query_params[:'project_id'] = opts[:'project_id'] if !opts[:'project_id'].nil?
  query_params[:'location'] = opts[:'location'] if !opts[:'location'].nil?
  query_params[:'bedrock_region'] = opts[:'bedrock_region'] if !opts[:'bedrock_region'].nil?
  query_params[:'foundry_resource_id'] = opts[:'foundry_resource_id'] if !opts[:'foundry_resource_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayDiscoveredModelListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_ai_gateway_provider_models,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#list_ai_gateway_provider_models\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ai_gateway_providers(opts = {}) ⇒ Object

List AI Gateway providers.



3132
3133
3134
3135
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3132

def list_ai_gateway_providers(opts = {})
  data, _status_code, _headers = list_ai_gateway_providers_with_http_info(opts)
  data
end

#list_ai_gateway_providers_with_http_info(opts = {}) ⇒ Array<(AiGatewayProviderListResponse, Integer, Hash)>

List AI Gateway providers.

List the model providers connected to the organization. Credentials stay in each provider's integration account and are never returned. Requires ai_gateway_config_read and provider View. Catalog and pricing metadata inherit provider access. Lists omit hidden entries; direct reads of hidden resources return 404.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3143

def list_ai_gateway_providers_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_gateway_providers".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_gateway_providers")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_gateway_providers"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.list_ai_gateway_providers ...'
  end
  # resource path
  local_var_path = '/api/v2/providers'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayProviderListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_ai_gateway_providers,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#list_ai_gateway_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ai_gateway_rate_limit_instances(id, opts = {}) ⇒ Object

List AI Gateway rate limit counters.



3198
3199
3200
3201
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3198

def list_ai_gateway_rate_limit_instances(id, opts = {})
  data, _status_code, _headers = list_ai_gateway_rate_limit_instances_with_http_info(id, opts)
  data
end

#list_ai_gateway_rate_limit_instances_summaries(opts = {}) ⇒ Object

List AI Gateway rate limit counter summaries.



3291
3292
3293
3294
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3291

def list_ai_gateway_rate_limit_instances_summaries(opts = {})
  data, _status_code, _headers = list_ai_gateway_rate_limit_instances_summaries_with_http_info(opts)
  data
end

#list_ai_gateway_rate_limit_instances_summaries_with_http_info(opts = {}) ⇒ Array<(AiGatewayRateLimitInstancesSummaryListResponse, Integer, Hash)>

List AI Gateway rate limit counter summaries.

Aggregate the counters of every template rate limit in the organization in one call. The response has one summary per template, in the same order as the rate limit list. Each summary matches the response of the single-template counter summary endpoint without split_dim, including scope_restricted and truncated. Rate limits with one shared allowance aren't included. Summaries are cached for up to 15 seconds.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3302

def list_ai_gateway_rate_limit_instances_summaries_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_gateway_rate_limit_instances_summaries".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_gateway_rate_limit_instances_summaries")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_gateway_rate_limit_instances_summaries"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.list_ai_gateway_rate_limit_instances_summaries ...'
  end
  # resource path
  local_var_path = '/api/v2/rate-limits/instances/summary'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayRateLimitInstancesSummaryListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_ai_gateway_rate_limit_instances_summaries,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#list_ai_gateway_rate_limit_instances_summaries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ai_gateway_rate_limit_instances_with_http_info(id, opts = {}) ⇒ Array<(AiGatewayRateLimitInstanceListResponse, Integer, Hash)>

List AI Gateway rate limit counters.

List the hot counters of a template rate limit, one per matched user, Team, or value, with their live usage. The list includes only counters that, in the last hour, reached 80% or more of a limit or limited or would have limited a request. A counter appears within a few minutes of becoming hot. Usage is read for at most 200 counters per request; past that, rows carry usage_known false. Counters for a provider or model the caller can't see are left out, and when the caller can't see the template's selector, the list is empty. A rate limit with one shared allowance, including one whose selector has no per_value entry, returns an empty list. Returns 503 when counter usage can't be read.

Parameters:

  • id (UUID) —

    Rate limit UUID.

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Options Hash (opts):

  • :split_dim (Array<String>) —

    Keep only counters whose split dimension equals a value, written as <dim>=<value>, such as split_dim=user_id=<uuid>&split_dim=model=gpt-4o. Dimensions use the split_dims names user_id, team_id, model, provider, and tag:<key>. Repeat the parameter to filter on several dimensions; a counter must match all of them. Each dimension may appear once and must be a per-value dimension of the rate limit.

  • :sort (AiGatewayRateLimitInstanceSort) —

    Sort order for rate limit counters.

  • :limit (Integer) —

    Maximum number of rate limit counters to return.

  • :offset (Integer) —

    Number of rate limit counters to skip.

Returns:



3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3214

def list_ai_gateway_rate_limit_instances_with_http_info(id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_gateway_rate_limit_instances".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_gateway_rate_limit_instances")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_gateway_rate_limit_instances"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.list_ai_gateway_rate_limit_instances ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.list_ai_gateway_rate_limit_instances"
  end
  allowable_values = ['utilization_desc', 'last_seen_desc', 'key_asc']
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AIGatewayAPI.list_ai_gateway_rate_limit_instances, must be smaller than or equal to 500.'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AIGatewayAPI.list_ai_gateway_rate_limit_instances, must be greater than or equal to 1.'
  end
  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling AIGatewayAPI.list_ai_gateway_rate_limit_instances, must be greater than or equal to 0.'
  end
  # resource path
  local_var_path = '/api/v2/rate-limits/{id}/instances'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'split_dim'] = @api_client.build_collection_param(opts[:'split_dim'], :multi) if !opts[:'split_dim'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayRateLimitInstanceListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_ai_gateway_rate_limit_instances,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )
  new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#list_ai_gateway_rate_limit_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ai_gateway_rate_limits(opts = {}) ⇒ Object

List AI Gateway rate limits.



3357
3358
3359
3360
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3357

def list_ai_gateway_rate_limits(opts = {})
  data, _status_code, _headers = list_ai_gateway_rate_limits_with_http_info(opts)
  data
end

#list_ai_gateway_rate_limits_with_http_info(opts = {}) ⇒ Array<(AiGatewayRateLimitListResponse, Integer, Hash)>

List AI Gateway rate limits.

List the organization's AI Gateway rate limits.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3368

def list_ai_gateway_rate_limits_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_gateway_rate_limits".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_gateway_rate_limits")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_gateway_rate_limits"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.list_ai_gateway_rate_limits ...'
  end
  # resource path
  local_var_path = '/api/v2/rate-limits'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayRateLimitListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_ai_gateway_rate_limits,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#list_ai_gateway_rate_limits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_ai_gateway_routing_rules(opts = {}) ⇒ Object

List AI Gateway routing rules.



3423
3424
3425
3426
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3423

def list_ai_gateway_routing_rules(opts = {})
  data, _status_code, _headers = list_ai_gateway_routing_rules_with_http_info(opts)
  data
end

#list_ai_gateway_routing_rules_with_http_info(opts = {}) ⇒ Array<(AiGatewayRoutingRuleListResponse, Integer, Hash)>

List AI Gateway routing rules.

List the organization's routing rules that the caller has View access to. Requires ai_gateway_config_read. Hidden route references are omitted from nested targets.

Parameters:

  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3434

def list_ai_gateway_routing_rules_with_http_info(opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_gateway_routing_rules".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_gateway_routing_rules")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_gateway_routing_rules"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.list_ai_gateway_routing_rules ...'
  end
  # resource path
  local_var_path = '/api/v2/routing-rules'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayRoutingRuleListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_ai_gateway_routing_rules,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#list_ai_gateway_routing_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#override_ai_gateway_budget_instance_capacity(id, body, opts = {}) ⇒ Object

Override a budget instance's capacity.



3489
3490
3491
3492
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3489

def override_ai_gateway_budget_instance_capacity(id, body, opts = {})
  data, _status_code, _headers = override_ai_gateway_budget_instance_capacity_with_http_info(id, body, opts)
  data
end

#override_ai_gateway_budget_instance_capacity_with_http_info(id, body, opts = {}) ⇒ Array<(AiGatewayBudgetInstanceResponse, Integer, Hash)>

Override a budget instance's capacity.

Override active-period capacity for one instance of a template budget, identified by its instance_key. Other instances and the budget's default capacity are unchanged. The override is retained in the budget adjustment audit history. Returns 404 when the instance has no counter in the active period. Not supported for legacy fixed-scope budgets.

Parameters:

Returns:



3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3502

def override_ai_gateway_budget_instance_capacity_with_http_info(id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.override_ai_gateway_budget_instance_capacity".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.override_ai_gateway_budget_instance_capacity")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.override_ai_gateway_budget_instance_capacity"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.override_ai_gateway_budget_instance_capacity ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.override_ai_gateway_budget_instance_capacity"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.override_ai_gateway_budget_instance_capacity"
  end
  # resource path
  local_var_path = '/api/v2/budgets/{id}/instances/capacity'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayBudgetInstanceResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :override_ai_gateway_budget_instance_capacity,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#override_ai_gateway_budget_instance_capacity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reset_ai_gateway_budget_instance_spend(id, body, opts = {}) ⇒ Object

Reset a budget instance's spend.



3567
3568
3569
3570
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3567

def reset_ai_gateway_budget_instance_spend(id, body, opts = {})
  data, _status_code, _headers = reset_ai_gateway_budget_instance_spend_with_http_info(id, body, opts)
  data
end

#reset_ai_gateway_budget_instance_spend_with_http_info(id, body, opts = {}) ⇒ Array<(AiGatewayBudgetInstanceResponse, Integer, Hash)>

Reset a budget instance's spend.

Reset active-period spend for one instance of a template budget, identified by its instance_key. The reset is retained in the budget adjustment audit history. Returns 404 when the instance has no counter in the active period. Not supported for legacy fixed-scope budgets.

Parameters:

Returns:



3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3580

def reset_ai_gateway_budget_instance_spend_with_http_info(id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.reset_ai_gateway_budget_instance_spend".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.reset_ai_gateway_budget_instance_spend")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.reset_ai_gateway_budget_instance_spend"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.reset_ai_gateway_budget_instance_spend ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.reset_ai_gateway_budget_instance_spend"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.reset_ai_gateway_budget_instance_spend"
  end
  # resource path
  local_var_path = '/api/v2/budgets/{id}/instances/reset'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayBudgetInstanceResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :reset_ai_gateway_budget_instance_spend,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#reset_ai_gateway_budget_instance_spend\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_ai_gateway_budget(id, body, opts = {}) ⇒ Object

Update an AI Gateway budget.



3645
3646
3647
3648
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3645

def update_ai_gateway_budget(id, body, opts = {})
  data, _status_code, _headers = update_ai_gateway_budget_with_http_info(id, body, opts)
  data
end

#update_ai_gateway_budget_with_http_info(id, body, opts = {}) ⇒ Array<(AiGatewayBudgetResponse, Integer, Hash)>

Update an AI Gateway budget.

Update a budget's mutable definition. Capacity changes apply to future accounting periods unless apply_to_current_period is true.

Parameters:

Returns:

  • (Array<(AiGatewayBudgetResponse, Integer, Hash)>) —

    AiGatewayBudgetResponse data, response status code and response headers



3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3659

def update_ai_gateway_budget_with_http_info(id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_ai_gateway_budget".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_ai_gateway_budget")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_ai_gateway_budget"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.update_ai_gateway_budget ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.update_ai_gateway_budget"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.update_ai_gateway_budget"
  end
  # resource path
  local_var_path = '/api/v2/budgets/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayBudgetResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_ai_gateway_budget,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#update_ai_gateway_budget\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_ai_gateway_data_capture_override(id, body, opts = {}) ⇒ Object

Replace an AI Gateway data capture override.



3724
3725
3726
3727
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3724

def update_ai_gateway_data_capture_override(id, body, opts = {})
  data, _status_code, _headers = update_ai_gateway_data_capture_override_with_http_info(id, body, opts)
  data
end

#update_ai_gateway_data_capture_override_with_http_info(id, body, opts = {}) ⇒ Array<(AiGatewayCaptureOverrideResponse, Integer, Hash)>

Replace an AI Gateway data capture override.

Replace an override using its revision and the current configuration_revision. Changes to capture overrides don't affect routing rules. Returns HTTP 409 when configuration_revision or the override revision is stale, including a concurrent change during replacement. Missing revisions or required full-capture confirmation returns HTTP 400. Requires ai_gateway_config_write and View and Edit access to this override. Hidden overrides return HTTP 404; visible overrides without Edit return HTTP 403. Authorization failures return HTTP 503. The returned UUID and revision acknowledge the saved configuration even if the caller can no longer list it. Restriction policies are saved separately.

Parameters:

Returns:



3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3737

def update_ai_gateway_data_capture_override_with_http_info(id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_ai_gateway_data_capture_override".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_ai_gateway_data_capture_override")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_ai_gateway_data_capture_override"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.update_ai_gateway_data_capture_override ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.update_ai_gateway_data_capture_override"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.update_ai_gateway_data_capture_override"
  end
  # resource path
  local_var_path = '/api/v2/data-capture/overrides/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayCaptureOverrideResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_ai_gateway_data_capture_override,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#update_ai_gateway_data_capture_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_ai_gateway_governance(body, opts = {}) ⇒ Object

Replace AI Gateway governance controls.



3802
3803
3804
3805
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3802

def update_ai_gateway_governance(body, opts = {})
  data, _status_code, _headers = update_ai_gateway_governance_with_http_info(body, opts)
  data
end

#update_ai_gateway_governance_with_http_info(body, opts = {}) ⇒ Array<(AiGatewayGovernanceResponse, Integer, Hash)>

Replace AI Gateway governance controls.

Replace the organization-wide AI Gateway governance settings, which are the default data capture mode and whether requests must reach providers covered by a zero data retention agreement.

Parameters:

Returns:

  • (Array<(AiGatewayGovernanceResponse, Integer, Hash)>) —

    AiGatewayGovernanceResponse data, response status code and response headers



3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3814

def update_ai_gateway_governance_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_ai_gateway_governance".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_ai_gateway_governance")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_ai_gateway_governance"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.update_ai_gateway_governance ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.update_ai_gateway_governance"
  end
  # resource path
  local_var_path = '/api/v2/governance'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayGovernanceResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_ai_gateway_governance,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#update_ai_gateway_governance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_ai_gateway_model(provider_id, canonical, body, opts = {}) ⇒ Object

Update a model for an AI Gateway provider.



3875
3876
3877
3878
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3875

def update_ai_gateway_model(provider_id, canonical, body, opts = {})
  data, _status_code, _headers = update_ai_gateway_model_with_http_info(provider_id, canonical, body, opts)
  data
end

#update_ai_gateway_model_by_canonical(provider_id, canonical, body, opts = {}) ⇒ Object

Update a provider model by canonical ID.



3964
3965
3966
3967
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3964

def update_ai_gateway_model_by_canonical(provider_id, canonical, body, opts = {})
  data, _status_code, _headers = update_ai_gateway_model_by_canonical_with_http_info(provider_id, canonical, body, opts)
  data
end

#update_ai_gateway_model_by_canonical_with_http_info(provider_id, canonical, body, opts = {}) ⇒ Array<(AiGatewayModelCatalogEntryResponse, Integer, Hash)>

Update a provider model by canonical ID.

Update a manually managed model catalog entry, naming the model in the canonical query parameter. Discovered entries are read-only. Unlike the endpoint that takes the canonical ID in the path, this one accepts canonical IDs that contain /. Requires ai_gateway_config_write and provider Edit. Models and pricing inherit provider access.

Parameters:

  • provider_id (Integer) —

    Provider ID.

  • canonical (String) —

    Canonical model identifier. It can contain /, such as openai/gpt-4o.

  • body (AiGatewayModelUpdateRequest)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3978

def update_ai_gateway_model_by_canonical_with_http_info(provider_id, canonical, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_ai_gateway_model_by_canonical".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_ai_gateway_model_by_canonical")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_ai_gateway_model_by_canonical"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.update_ai_gateway_model_by_canonical ...'
  end
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    fail ArgumentError, "Missing the required parameter 'provider_id' when calling AIGatewayAPI.update_ai_gateway_model_by_canonical"
  end
  if @api_client.config.client_side_validation && provider_id < 1
    fail ArgumentError, 'invalid value for "provider_id" when calling AIGatewayAPI.update_ai_gateway_model_by_canonical, must be greater than or equal to 1.'
  end
  # verify the required parameter 'canonical' is set
  if @api_client.config.client_side_validation && canonical.nil?
    fail ArgumentError, "Missing the required parameter 'canonical' when calling AIGatewayAPI.update_ai_gateway_model_by_canonical"
  end
  if @api_client.config.client_side_validation && canonical.to_s.length > 256
    fail ArgumentError, 'invalid value for "canonical" when calling AIGatewayAPI.update_ai_gateway_model_by_canonical, the character length must be smaller than or equal to 256.'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.update_ai_gateway_model_by_canonical"
  end
  # resource path
  local_var_path = '/api/v2/providers/{provider_id}/model'.sub('{provider_id}', CGI.escape(provider_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'canonical'] = canonical

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayModelCatalogEntryResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_ai_gateway_model_by_canonical,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#update_ai_gateway_model_by_canonical\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_ai_gateway_model_group(id, body, opts = {}) ⇒ Object

Update an AI Gateway model group.



4054
4055
4056
4057
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 4054

def update_ai_gateway_model_group(id, body, opts = {})
  data, _status_code, _headers = update_ai_gateway_model_group_with_http_info(id, body, opts)
  data
end

#update_ai_gateway_model_group_with_http_info(id, body, opts = {}) ⇒ Array<(AiGatewayModelGroupResponse, Integer, Hash)>

Update an AI Gateway model group.

Update a model group. For id "default", save membership and request options atomically with expected_revision. Empty selections grant no organization-wide access. Applicable authorized named policies override organization-wide request options; a rejected named-policy request cannot fall back to organization-wide options. The organization-wide audience is fixed and grants resource use only. Requires configuration write permission and policy View and Edit, including for the default policy. Management visibility does not change the inference audience or Run access.

Parameters:

  • id (String) —

    Model group ID, or "default" for the explicit organization-wide access policy.

  • body (AiGatewayModelGroupUpdateRequest)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

  • (Array<(AiGatewayModelGroupResponse, Integer, Hash)>) —

    AiGatewayModelGroupResponse data, response status code and response headers



4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 4067

def update_ai_gateway_model_group_with_http_info(id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_ai_gateway_model_group".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_ai_gateway_model_group")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_ai_gateway_model_group"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.update_ai_gateway_model_group ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.update_ai_gateway_model_group"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.update_ai_gateway_model_group"
  end
  # resource path
  local_var_path = '/api/v2/model-groups/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayModelGroupResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_ai_gateway_model_group,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#update_ai_gateway_model_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_ai_gateway_model_pricing(provider_id, canonical, body, opts = {}) ⇒ Object

Set a model pricing override.



4132
4133
4134
4135
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 4132

def update_ai_gateway_model_pricing(provider_id, canonical, body, opts = {})
  data, _status_code, _headers = update_ai_gateway_model_pricing_with_http_info(provider_id, canonical, body, opts)
  data
end

#update_ai_gateway_model_pricing_by_canonical(provider_id, canonical, body, opts = {}) ⇒ Object

Set a model pricing override by canonical ID.



4221
4222
4223
4224
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 4221

def update_ai_gateway_model_pricing_by_canonical(provider_id, canonical, body, opts = {})
  data, _status_code, _headers = update_ai_gateway_model_pricing_by_canonical_with_http_info(provider_id, canonical, body, opts)
  data
end

#update_ai_gateway_model_pricing_by_canonical_with_http_info(provider_id, canonical, body, opts = {}) ⇒ Array<(AiGatewayModelPricingResponse, Integer, Hash)>

Set a model pricing override by canonical ID.

Set a provider model's pricing override, naming the model in the canonical query parameter. Unlike the endpoint that takes the canonical ID in the path, this one accepts canonical IDs that contain /. Requires ai_gateway_config_write and provider Edit. Models and pricing inherit provider access.

Parameters:

  • provider_id (Integer) —

    Provider ID.

  • canonical (String) —

    Canonical model identifier. It can contain /, such as openai/gpt-4o.

  • body (AiGatewayModelPricingRequest)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 4235

def update_ai_gateway_model_pricing_by_canonical_with_http_info(provider_id, canonical, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_ai_gateway_model_pricing_by_canonical".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_ai_gateway_model_pricing_by_canonical")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_ai_gateway_model_pricing_by_canonical"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.update_ai_gateway_model_pricing_by_canonical ...'
  end
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    fail ArgumentError, "Missing the required parameter 'provider_id' when calling AIGatewayAPI.update_ai_gateway_model_pricing_by_canonical"
  end
  if @api_client.config.client_side_validation && provider_id < 1
    fail ArgumentError, 'invalid value for "provider_id" when calling AIGatewayAPI.update_ai_gateway_model_pricing_by_canonical, must be greater than or equal to 1.'
  end
  # verify the required parameter 'canonical' is set
  if @api_client.config.client_side_validation && canonical.nil?
    fail ArgumentError, "Missing the required parameter 'canonical' when calling AIGatewayAPI.update_ai_gateway_model_pricing_by_canonical"
  end
  if @api_client.config.client_side_validation && canonical.to_s.length > 256
    fail ArgumentError, 'invalid value for "canonical" when calling AIGatewayAPI.update_ai_gateway_model_pricing_by_canonical, the character length must be smaller than or equal to 256.'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.update_ai_gateway_model_pricing_by_canonical"
  end
  # resource path
  local_var_path = '/api/v2/providers/{provider_id}/model-pricing'.sub('{provider_id}', CGI.escape(provider_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'canonical'] = canonical

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayModelPricingResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_ai_gateway_model_pricing_by_canonical,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#update_ai_gateway_model_pricing_by_canonical\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_ai_gateway_model_pricing_with_http_info(provider_id, canonical, body, opts = {}) ⇒ Array<(AiGatewayModelPricingResponse, Integer, Hash)>

Set a model pricing override.

Set a custom provider model's pricing override. A canonical ID that contains / can't be sent in the path; use the /api/v2/providers/{provider_id}/model-pricing endpoint with the canonical query parameter instead. Requires ai_gateway_config_write and provider Edit. Models and pricing inherit provider access.

Parameters:

  • provider_id (Integer) —

    Provider ID.

  • canonical (String) —

    Canonical model identifier.

  • body (AiGatewayModelPricingRequest)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 4146

def update_ai_gateway_model_pricing_with_http_info(provider_id, canonical, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_ai_gateway_model_pricing".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_ai_gateway_model_pricing")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_ai_gateway_model_pricing"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.update_ai_gateway_model_pricing ...'
  end
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    fail ArgumentError, "Missing the required parameter 'provider_id' when calling AIGatewayAPI.update_ai_gateway_model_pricing"
  end
  if @api_client.config.client_side_validation && provider_id < 1
    fail ArgumentError, 'invalid value for "provider_id" when calling AIGatewayAPI.update_ai_gateway_model_pricing, must be greater than or equal to 1.'
  end
  # verify the required parameter 'canonical' is set
  if @api_client.config.client_side_validation && canonical.nil?
    fail ArgumentError, "Missing the required parameter 'canonical' when calling AIGatewayAPI.update_ai_gateway_model_pricing"
  end
  if @api_client.config.client_side_validation && canonical.to_s.length > 256
    fail ArgumentError, 'invalid value for "canonical" when calling AIGatewayAPI.update_ai_gateway_model_pricing, the character length must be smaller than or equal to 256.'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.update_ai_gateway_model_pricing"
  end
  # resource path
  local_var_path = '/api/v2/providers/{provider_id}/models/{canonical}/pricing'.sub('{provider_id}', CGI.escape(provider_id.to_s).gsub('%2F', '/')).sub('{canonical}', CGI.escape(canonical.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayModelPricingResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_ai_gateway_model_pricing,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#update_ai_gateway_model_pricing\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_ai_gateway_model_with_http_info(provider_id, canonical, body, opts = {}) ⇒ Array<(AiGatewayModelCatalogEntryResponse, Integer, Hash)>

Update a model for an AI Gateway provider.

Update a manually managed model catalog entry. Discovered entries are read-only. A canonical ID that contains / can't be sent in the path; use the /api/v2/providers/{provider_id}/model endpoint with the canonical query parameter instead. Requires ai_gateway_config_write and provider Edit. Models and pricing inherit provider access.

Parameters:

  • provider_id (Integer) —

    Provider ID.

  • canonical (String) —

    Canonical model identifier.

  • body (AiGatewayModelUpdateRequest)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 3889

def update_ai_gateway_model_with_http_info(provider_id, canonical, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_ai_gateway_model".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_ai_gateway_model")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_ai_gateway_model"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.update_ai_gateway_model ...'
  end
  # verify the required parameter 'provider_id' is set
  if @api_client.config.client_side_validation && provider_id.nil?
    fail ArgumentError, "Missing the required parameter 'provider_id' when calling AIGatewayAPI.update_ai_gateway_model"
  end
  if @api_client.config.client_side_validation && provider_id < 1
    fail ArgumentError, 'invalid value for "provider_id" when calling AIGatewayAPI.update_ai_gateway_model, must be greater than or equal to 1.'
  end
  # verify the required parameter 'canonical' is set
  if @api_client.config.client_side_validation && canonical.nil?
    fail ArgumentError, "Missing the required parameter 'canonical' when calling AIGatewayAPI.update_ai_gateway_model"
  end
  if @api_client.config.client_side_validation && canonical.to_s.length > 256
    fail ArgumentError, 'invalid value for "canonical" when calling AIGatewayAPI.update_ai_gateway_model, the character length must be smaller than or equal to 256.'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.update_ai_gateway_model"
  end
  # resource path
  local_var_path = '/api/v2/providers/{provider_id}/models/{canonical}'.sub('{provider_id}', CGI.escape(provider_id.to_s).gsub('%2F', '/')).sub('{canonical}', CGI.escape(canonical.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayModelCatalogEntryResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_ai_gateway_model,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#update_ai_gateway_model\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_ai_gateway_provider(id, body, opts = {}) ⇒ Object

Update an AI Gateway provider.



4311
4312
4313
4314
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 4311

def update_ai_gateway_provider(id, body, opts = {})
  data, _status_code, _headers = update_ai_gateway_provider_with_http_info(id, body, opts)
  data
end

#update_ai_gateway_provider_with_http_info(id, body, opts = {}) ⇒ Array<(AiGatewayProviderResponse, Integer, Hash)>

Update an AI Gateway provider.

Update a provider's display name or cost multiplier. Provider type, integration settings, and slug are immutable. Requires ai_gateway_config_write and provider Edit. Models and pricing inherit provider access.

Parameters:

Returns:

  • (Array<(AiGatewayProviderResponse, Integer, Hash)>) —

    AiGatewayProviderResponse data, response status code and response headers



4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 4324

def update_ai_gateway_provider_with_http_info(id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_ai_gateway_provider".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_ai_gateway_provider")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_ai_gateway_provider"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.update_ai_gateway_provider ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.update_ai_gateway_provider"
  end
  if @api_client.config.client_side_validation && id < 1
    fail ArgumentError, 'invalid value for "id" when calling AIGatewayAPI.update_ai_gateway_provider, must be greater than or equal to 1.'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.update_ai_gateway_provider"
  end
  # resource path
  local_var_path = '/api/v2/providers/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayProviderResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_ai_gateway_provider,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#update_ai_gateway_provider\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_ai_gateway_rate_limit(id, body, opts = {}) ⇒ Object

Update an AI Gateway rate limit.



4392
4393
4394
4395
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 4392

def update_ai_gateway_rate_limit(id, body, opts = {})
  data, _status_code, _headers = update_ai_gateway_rate_limit_with_http_info(id, body, opts)
  data
end

#update_ai_gateway_rate_limit_with_http_info(id, body, opts = {}) ⇒ Array<(AiGatewayRateLimitResponse, Integer, Hash)>

Update an AI Gateway rate limit.

Update a rate limit. Only the attributes sent are changed, and changes never reset current usage. Scope stays editable, except on a template rate limit, whose user_id, team_id, and tags are rejected with 400. Returns 409 when the rule was changed concurrently or the new scope duplicates another rule.

Parameters:

Returns:

  • (Array<(AiGatewayRateLimitResponse, Integer, Hash)>) —

    AiGatewayRateLimitResponse data, response status code and response headers



4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 4405

def update_ai_gateway_rate_limit_with_http_info(id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_ai_gateway_rate_limit".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_ai_gateway_rate_limit")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_ai_gateway_rate_limit"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.update_ai_gateway_rate_limit ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling AIGatewayAPI.update_ai_gateway_rate_limit"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.update_ai_gateway_rate_limit"
  end
  # resource path
  local_var_path = '/api/v2/rate-limits/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayRateLimitResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_ai_gateway_rate_limit,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#update_ai_gateway_rate_limit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_ai_gateway_routing_rule(slug, body, opts = {}) ⇒ Object

Update an AI Gateway routing rule.



4470
4471
4472
4473
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 4470

def update_ai_gateway_routing_rule(slug, body, opts = {})
  data, _status_code, _headers = update_ai_gateway_routing_rule_with_http_info(slug, body, opts)
  data
end

#update_ai_gateway_routing_rule_with_http_info(slug, body, opts = {}) ⇒ Array<(AiGatewayRoutingRuleResponse, Integer, Hash)>

Update an AI Gateway routing rule.

Update a route with ai_gateway_config_write and route View/Edit. The slug is immutable; data capture is managed independently. Omitting tiers preserves the entire graph. When tiers are supplied, saved parent-local target IDs retain omitted destination and reasoning, weight, rubric, and default settings. Omitted ordering/classifier settings preserve the saved same-position tier. Explicit null resets nullable settings. New references require View on their resources. A hidden target omitted from tiers must be explicitly listed in removed_target_ids, otherwise the update fails without changes. expected_updated_at rejects stale updates with 409. Sharing-only saves do not replace target rows. Hidden and missing routes return the same 404; visible non-editors receive 403. Inference authorization is unchanged.

Parameters:

Returns:



4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 4483

def update_ai_gateway_routing_rule_with_http_info(slug, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.update_ai_gateway_routing_rule".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_ai_gateway_routing_rule")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_ai_gateway_routing_rule"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.update_ai_gateway_routing_rule ...'
  end
  # verify the required parameter 'slug' is set
  if @api_client.config.client_side_validation && slug.nil?
    fail ArgumentError, "Missing the required parameter 'slug' when calling AIGatewayAPI.update_ai_gateway_routing_rule"
  end
  if @api_client.config.client_side_validation && slug.to_s.length > 128
    fail ArgumentError, 'invalid value for "slug" when calling AIGatewayAPI.update_ai_gateway_routing_rule, the character length must be smaller than or equal to 128.'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.update_ai_gateway_routing_rule"
  end
  # resource path
  local_var_path = '/api/v2/routing-rules'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'slug'] = slug

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayRoutingRuleResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_ai_gateway_routing_rule,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#update_ai_gateway_routing_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upsert_ai_gateway_policy(body, opts = {}) ⇒ Object

Create or replace an AI Gateway routing policy.



4552
4553
4554
4555
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 4552

def upsert_ai_gateway_policy(body, opts = {})
  data, _status_code, _headers = upsert_ai_gateway_policy_with_http_info(body, opts)
  data
end

#upsert_ai_gateway_policy_with_http_info(body, opts = {}) ⇒ Array<(AiGatewayPolicyResponse, Integer, Hash)>

Create or replace an AI Gateway routing policy.

Create or replace the routing policy document for an inbound pattern. Pass user_id to scope the policy to a user.

Parameters:

Options Hash (opts):

  • :user_id (UUID) —

    Filter or scope policies to a specific user. Omit for organization-wide policies.

Returns:

  • (Array<(AiGatewayPolicyResponse, Integer, Hash)>) —

    AiGatewayPolicyResponse data, response status code and response headers



4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
# File 'lib/datadog_api_client/v2/api/ai_gateway_api.rb', line 4565

def upsert_ai_gateway_policy_with_http_info(body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.upsert_ai_gateway_policy".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.upsert_ai_gateway_policy")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.upsert_ai_gateway_policy"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AIGatewayAPI.upsert_ai_gateway_policy ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling AIGatewayAPI.upsert_ai_gateway_policy"
  end
  # resource path
  local_var_path = '/api/v2/policies'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'user_id'] = opts[:'user_id'] if !opts[:'user_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'AiGatewayPolicyResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :upsert_ai_gateway_policy,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

  data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AIGatewayAPI#upsert_ai_gateway_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end