# Custom Providers ## List Account Providers `client.aiGateway.customProviders.list(CustomProviderListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/ai-gateway/custom-providers` Lists all AI Gateway evaluator types configured for the account. ### Parameters - `params: CustomProviderListParams` - `account_id: string` Path param - `beta?: boolean` Query param - `enable?: boolean` Query param - `page?: number` Query param - `per_page?: number` Query param - `search?: string` Query param: Search by id, name, slug ### Returns - `CustomProviderListResponse` - `id: string` - `base_url: string` - `created_at: string` - `modified_at: string` - `name: string` - `slug: string` - `beta?: boolean` - `curl_example?: string` - `description?: string` - `enable?: boolean` - `headers?: string` - `js_example?: string` - `link?: string` - `logo?: string` - `position?: number` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const customProviderListResponse of client.aiGateway.customProviders.list({ account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', })) { console.log(customProviderListResponse.id); } ``` #### Response ```json { "result": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "base_url": "https://example.com", "created_at": "2019-12-27T18:11:19.117Z", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "slug": "slug", "beta": true, "curl_example": "curl_example", "description": "description", "enable": true, "headers": "headers", "js_example": "js_example", "link": "link", "logo": "logo", "position": 0 } ], "success": true } ``` ## Fetch a Account Provider `client.aiGateway.customProviders.get(stringid, CustomProviderGetParamsparams, RequestOptionsoptions?): CustomProviderGetResponse` **get** `/accounts/{account_id}/ai-gateway/custom-providers/{id}` Retrieves details for a specific AI Gateway dataset. ### Parameters - `id: string` - `params: CustomProviderGetParams` - `account_id: string` ### Returns - `CustomProviderGetResponse` - `id: string` - `base_url: string` - `created_at: string` - `modified_at: string` - `name: string` - `slug: string` - `beta?: boolean` - `curl_example?: string` - `description?: string` - `enable?: boolean` - `headers?: string` - `js_example?: string` - `link?: string` - `logo?: string` - `position?: number` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const customProvider = await client.aiGateway.customProviders.get( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, ); console.log(customProvider.id); ``` #### Response ```json { "result": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "base_url": "https://example.com", "created_at": "2019-12-27T18:11:19.117Z", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "slug": "slug", "beta": true, "curl_example": "curl_example", "description": "description", "enable": true, "headers": "headers", "js_example": "js_example", "link": "link", "logo": "logo", "position": 0 }, "success": true } ``` ## Create a new Account Provider `client.aiGateway.customProviders.create(CustomProviderCreateParamsparams, RequestOptionsoptions?): CustomProviderCreateResponse` **post** `/accounts/{account_id}/ai-gateway/custom-providers` Creates a new AI Gateway. ### Parameters - `params: CustomProviderCreateParams` - `account_id: string` Path param - `base_url: string` Body param - `name: string` Body param - `slug: string` Body param - `beta?: boolean` Body param - `curl_example?: string` Body param - `description?: string` Body param - `enable?: boolean` Body param - `headers?: string` Body param - `js_example?: string` Body param - `link?: string` Body param - `position?: number` Body param ### Returns - `CustomProviderCreateResponse` - `id: string` - `base_url: string` - `created_at: string` - `modified_at: string` - `name: string` - `slug: string` - `beta?: boolean` - `curl_example?: string` - `description?: string` - `enable?: boolean` - `headers?: string` - `js_example?: string` - `link?: string` - `logo?: string` - `position?: number` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const customProvider = await client.aiGateway.customProviders.create({ account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', base_url: 'https://example.com', name: 'name', slug: 'slug', }); console.log(customProvider.id); ``` #### Response ```json { "result": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "base_url": "https://example.com", "created_at": "2019-12-27T18:11:19.117Z", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "slug": "slug", "beta": true, "curl_example": "curl_example", "description": "description", "enable": true, "headers": "headers", "js_example": "js_example", "link": "link", "logo": "logo", "position": 0 }, "success": true } ``` ## Delete a Account Provider `client.aiGateway.customProviders.delete(stringid, CustomProviderDeleteParamsparams, RequestOptionsoptions?): CustomProviderDeleteResponse` **delete** `/accounts/{account_id}/ai-gateway/custom-providers/{id}` Deletes an AI Gateway dataset. ### Parameters - `id: string` - `params: CustomProviderDeleteParams` - `account_id: string` ### Returns - `CustomProviderDeleteResponse` - `id: string` - `base_url: string` - `created_at: string` - `modified_at: string` - `name: string` - `slug: string` - `beta?: boolean` - `curl_example?: string` - `description?: string` - `enable?: boolean` - `headers?: string` - `js_example?: string` - `link?: string` - `logo?: string` - `position?: number` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const customProvider = await client.aiGateway.customProviders.delete( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, ); console.log(customProvider.id); ``` #### Response ```json { "result": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "base_url": "https://example.com", "created_at": "2019-12-27T18:11:19.117Z", "modified_at": "2019-12-27T18:11:19.117Z", "name": "name", "slug": "slug", "beta": true, "curl_example": "curl_example", "description": "description", "enable": true, "headers": "headers", "js_example": "js_example", "link": "link", "logo": "logo", "position": 0 }, "success": true } ``` ## Domain Types ### Custom Provider List Response - `CustomProviderListResponse` - `id: string` - `base_url: string` - `created_at: string` - `modified_at: string` - `name: string` - `slug: string` - `beta?: boolean` - `curl_example?: string` - `description?: string` - `enable?: boolean` - `headers?: string` - `js_example?: string` - `link?: string` - `logo?: string` - `position?: number` ### Custom Provider Get Response - `CustomProviderGetResponse` - `id: string` - `base_url: string` - `created_at: string` - `modified_at: string` - `name: string` - `slug: string` - `beta?: boolean` - `curl_example?: string` - `description?: string` - `enable?: boolean` - `headers?: string` - `js_example?: string` - `link?: string` - `logo?: string` - `position?: number` ### Custom Provider Create Response - `CustomProviderCreateResponse` - `id: string` - `base_url: string` - `created_at: string` - `modified_at: string` - `name: string` - `slug: string` - `beta?: boolean` - `curl_example?: string` - `description?: string` - `enable?: boolean` - `headers?: string` - `js_example?: string` - `link?: string` - `logo?: string` - `position?: number` ### Custom Provider Delete Response - `CustomProviderDeleteResponse` - `id: string` - `base_url: string` - `created_at: string` - `modified_at: string` - `name: string` - `slug: string` - `beta?: boolean` - `curl_example?: string` - `description?: string` - `enable?: boolean` - `headers?: string` - `js_example?: string` - `link?: string` - `logo?: string` - `position?: number`