Skip to content

Commit f458e02

Browse files
committed
feat(ai-gateway): add CustomProviders, 1 sub-resource
1 parent e708464 commit f458e02

6 files changed

Lines changed: 519 additions & 11 deletions

File tree

src/resources/ai-gateway/ai-gateway.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
import { APIResource } from '../../resource';
44
import * as Core from '../../core';
5+
import * as CustomProvidersAPI from './custom-providers';
6+
import {
7+
CustomProviderCreateParams,
8+
CustomProviderCreateResponse,
9+
CustomProviderDeleteParams,
10+
CustomProviderDeleteResponse,
11+
CustomProviderGetParams,
12+
CustomProviderGetResponse,
13+
CustomProviderListParams,
14+
CustomProviderListResponse,
15+
CustomProviderListResponsesV4PagePaginationArray,
16+
CustomProviders,
17+
} from './custom-providers';
518
import * as DatasetsAPI from './datasets';
619
import {
720
DatasetCreateParams,
@@ -105,6 +118,7 @@ import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../p
105118

106119
export class AIGateway extends APIResource {
107120
evaluationTypes: EvaluationTypesAPI.EvaluationTypes = new EvaluationTypesAPI.EvaluationTypes(this._client);
121+
customProviders: CustomProvidersAPI.CustomProviders = new CustomProvidersAPI.CustomProviders(this._client);
108122
logs: LogsAPI.Logs = new LogsAPI.Logs(this._client);
109123
datasets: DatasetsAPI.Datasets = new DatasetsAPI.Datasets(this._client);
110124
evaluations: EvaluationsAPI.Evaluations = new EvaluationsAPI.Evaluations(this._client);
@@ -1865,6 +1879,8 @@ export interface AIGatewayGetParams {
18651879
AIGateway.AIGatewayListResponsesV4PagePaginationArray = AIGatewayListResponsesV4PagePaginationArray;
18661880
AIGateway.EvaluationTypes = EvaluationTypes;
18671881
AIGateway.EvaluationTypeListResponsesV4PagePaginationArray = EvaluationTypeListResponsesV4PagePaginationArray;
1882+
AIGateway.CustomProviders = CustomProviders;
1883+
AIGateway.CustomProviderListResponsesV4PagePaginationArray = CustomProviderListResponsesV4PagePaginationArray;
18681884
AIGateway.Logs = Logs;
18691885
AIGateway.LogListResponsesV4PagePaginationArray = LogListResponsesV4PagePaginationArray;
18701886
AIGateway.Datasets = Datasets;
@@ -1899,6 +1915,19 @@ export declare namespace AIGateway {
18991915
type EvaluationTypeListParams as EvaluationTypeListParams,
19001916
};
19011917

1918+
export {
1919+
CustomProviders as CustomProviders,
1920+
type CustomProviderCreateResponse as CustomProviderCreateResponse,
1921+
type CustomProviderListResponse as CustomProviderListResponse,
1922+
type CustomProviderDeleteResponse as CustomProviderDeleteResponse,
1923+
type CustomProviderGetResponse as CustomProviderGetResponse,
1924+
CustomProviderListResponsesV4PagePaginationArray as CustomProviderListResponsesV4PagePaginationArray,
1925+
type CustomProviderCreateParams as CustomProviderCreateParams,
1926+
type CustomProviderListParams as CustomProviderListParams,
1927+
type CustomProviderDeleteParams as CustomProviderDeleteParams,
1928+
type CustomProviderGetParams as CustomProviderGetParams,
1929+
};
1930+
19021931
export {
19031932
Logs as Logs,
19041933
type LogListResponse as LogListResponse,

src/resources/ai-gateway/api.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ Methods:
2626

2727
- <code title="get /accounts/{account_id}/ai-gateway/evaluation-types">client.aiGateway.evaluationTypes.<a href="./src/resources/ai-gateway/evaluation-types.ts">list</a>({ ...params }) -> EvaluationTypeListResponsesV4PagePaginationArray</code>
2828

29+
## CustomProviders
30+
31+
Types:
32+
33+
- <code><a href="./src/resources/ai-gateway/custom-providers.ts">CustomProviderCreateResponse</a></code>
34+
- <code><a href="./src/resources/ai-gateway/custom-providers.ts">CustomProviderListResponse</a></code>
35+
- <code><a href="./src/resources/ai-gateway/custom-providers.ts">CustomProviderDeleteResponse</a></code>
36+
- <code><a href="./src/resources/ai-gateway/custom-providers.ts">CustomProviderGetResponse</a></code>
37+
38+
Methods:
39+
40+
- <code title="post /accounts/{account_id}/ai-gateway/custom-providers">client.aiGateway.customProviders.<a href="./src/resources/ai-gateway/custom-providers.ts">create</a>({ ...params }) -> CustomProviderCreateResponse</code>
41+
- <code title="get /accounts/{account_id}/ai-gateway/custom-providers">client.aiGateway.customProviders.<a href="./src/resources/ai-gateway/custom-providers.ts">list</a>({ ...params }) -> CustomProviderListResponsesV4PagePaginationArray</code>
42+
- <code title="delete /accounts/{account_id}/ai-gateway/custom-providers/{id}">client.aiGateway.customProviders.<a href="./src/resources/ai-gateway/custom-providers.ts">delete</a>(id, { ...params }) -> CustomProviderDeleteResponse</code>
43+
- <code title="get /accounts/{account_id}/ai-gateway/custom-providers/{id}">client.aiGateway.customProviders.<a href="./src/resources/ai-gateway/custom-providers.ts">get</a>(id, { ...params }) -> CustomProviderGetResponse</code>
44+
2945
## Logs
3046

3147
Types:

src/resources/ai-gateway/billing/spending-limit.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,12 @@ import * as Core from '../../../core';
55

66
export class SpendingLimit extends APIResource {
77
/**
8-
* Configure a spending limit with amount, strategy, and duration.
8+
* Deprecated: spending limits can no longer be created, enabled, or modified and
9+
* this endpoint always responds 403. Use the new AI Gateway spend limits instead:
10+
* https://developers.cloudflare.com/ai-gateway/features/spend-limits/. Existing
11+
* limits can be removed via DELETE /spending-limit.
912
*
10-
* @example
11-
* ```ts
12-
* const spendingLimit =
13-
* await client.aiGateway.billing.spendingLimit.create({
14-
* account_id: 'account_id',
15-
* amount: 10000,
16-
* duration: 'monthly',
17-
* strategy: 'fixed',
18-
* });
19-
* ```
13+
* @deprecated
2014
*/
2115
create(
2216
params: SpendingLimitCreateParams,

0 commit comments

Comments
 (0)