# Provider Configs ## List Provider Configs `client.AIGateway.ProviderConfigs.List(ctx, gatewayID, params) (*V4PagePaginationArray[ProviderConfigListResponse], error)` **get** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs` Lists all AI Gateway evaluator types configured for the account. ### Parameters - `gatewayID string` gateway id - `params ProviderConfigListParams` - `AccountID param.Field[string]` Path param - `Page param.Field[int64]` Query param - `PerPage param.Field[int64]` Query param ### Returns - `type ProviderConfigListResponse struct{…}` - `ID string` - `Alias string` - `DefaultConfig bool` - `GatewayID string` gateway id - `ModifiedAt Time` - `ProviderSlug string` - `SecretID string` - `SecretPreview string` - `RateLimit float64` - `RateLimitPeriod float64` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ai_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.AIGateway.ProviderConfigs.List( context.TODO(), "my-gateway", ai_gateway.ProviderConfigListParams{ AccountID: cloudflare.F("3ebbcb006d4d46d7bb6a8c7f14676cb0"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "result": [ { "id": "id", "alias": "alias", "default_config": true, "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "provider_slug": "provider_slug", "secret_id": "secret_id", "secret_preview": "secret_preview", "rate_limit": 0, "rate_limit_period": 0 } ], "success": true } ``` ## Create a new Provider Configs `client.AIGateway.ProviderConfigs.New(ctx, gatewayID, params) (*ProviderConfigNewResponse, error)` **post** `/accounts/{account_id}/ai-gateway/gateways/{gateway_id}/provider_configs` Creates a new AI Gateway. ### Parameters - `gatewayID string` gateway id - `params ProviderConfigNewParams` - `AccountID param.Field[string]` Path param - `Alias param.Field[string]` Body param - `DefaultConfig param.Field[bool]` Body param - `ProviderSlug param.Field[string]` Body param - `Secret param.Field[string]` Body param - `SecretID param.Field[string]` Body param - `RateLimit param.Field[float64]` Body param - `RateLimitPeriod param.Field[float64]` Body param ### Returns - `type ProviderConfigNewResponse struct{…}` - `ID string` - `Alias string` - `DefaultConfig bool` - `GatewayID string` gateway id - `ModifiedAt Time` - `ProviderSlug string` - `SecretID string` - `SecretPreview string` - `RateLimit float64` - `RateLimitPeriod float64` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/ai_gateway" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) providerConfig, err := client.AIGateway.ProviderConfigs.New( context.TODO(), "my-gateway", ai_gateway.ProviderConfigNewParams{ AccountID: cloudflare.F("3ebbcb006d4d46d7bb6a8c7f14676cb0"), Alias: cloudflare.F("alias"), DefaultConfig: cloudflare.F(true), ProviderSlug: cloudflare.F("provider_slug"), Secret: cloudflare.F("secret"), SecretID: cloudflare.F("secret_id"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", providerConfig.ID) } ``` #### Response ```json { "result": { "id": "id", "alias": "alias", "default_config": true, "gateway_id": "my-gateway", "modified_at": "2019-12-27T18:11:19.117Z", "provider_slug": "provider_slug", "secret_id": "secret_id", "secret_preview": "secret_preview", "rate_limit": 0, "rate_limit_period": 0 }, "success": true } ```