1. Registry
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. apig
  6. getAiModelProviders
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
alicloud logo alicloud logo
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi

    This data source provides Apig Ai Model Provider available to the user.What is Ai Model Provider

    NOTE: Available since v1.286.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    // The ID of an existing AI-type APIG gateway
    const gatewayId = config.require("gatewayId");
    const _default = alicloud.apig.getAiModelProviders({
        gatewayId: gatewayId,
    });
    export const firstProviderId = _default.then(_default => _default.providers?.[0]?.modelProviderId);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    # The ID of an existing AI-type APIG gateway
    gateway_id = config.require("gatewayId")
    default = alicloud.apig.get_ai_model_providers(gateway_id=gateway_id)
    pulumi.export("firstProviderId", default.providers[0].model_provider_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/apig"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		// The ID of an existing AI-type APIG gateway
    		gatewayId := cfg.Require("gatewayId")
    		_default, err := apig.GetAiModelProviders(ctx, &apig.GetAiModelProvidersArgs{
    			GatewayId: gatewayId,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstProviderId", _default.Providers[0].ModelProviderId)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        // The ID of an existing AI-type APIG gateway
        var gatewayId = config.Require("gatewayId");
        var @default = AliCloud.Apig.GetAiModelProviders.Invoke(new()
        {
            GatewayId = gatewayId,
        });
    
        return new Dictionary<string, object?>
        {
            ["firstProviderId"] = @default.Apply(@default => @default.Apply(getAiModelProvidersResult => getAiModelProvidersResult.Providers[0]?.ModelProviderId)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.apig.ApigFunctions;
    import com.pulumi.alicloud.apig.inputs.GetAiModelProvidersArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var gatewayId = config.require("gatewayId");
            final var default = ApigFunctions.getAiModelProviders(GetAiModelProvidersArgs.builder()
                .gatewayId(gatewayId)
                .build());
    
            ctx.export("firstProviderId", default_.providers()[0].modelProviderId());
        }
    }
    
    configuration:
      gatewayId:
        type: string
    variables:
      default:
        fn::invoke:
          function: alicloud:apig:getAiModelProviders
          arguments:
            gatewayId: ${gatewayId}
    outputs:
      firstProviderId: ${default.providers[0].modelProviderId}
    
    pulumi {
      required_providers {
        alicloud = {
          source = "pulumi/alicloud"
        }
      }
    }
    
    data "alicloud_apig_getaimodelproviders" "default" {
      gateway_id = var.gatewayId
    }
    
    variable "gatewayId" {
      type        = string
      description = "The ID of an existing AI-type APIG gateway"
    }
    output "firstProviderId" {
      value = data.alicloud_apig_getaimodelproviders.default.providers[0].model_provider_id
    }
    

    Using getAiModelProviders

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getAiModelProviders(args: GetAiModelProvidersArgs, opts?: InvokeOptions): Promise<GetAiModelProvidersResult>
    function getAiModelProvidersOutput(args: GetAiModelProvidersOutputArgs, opts?: InvokeOutputOptions): Output<GetAiModelProvidersResult>
    def get_ai_model_providers(gateway_id: Optional[str] = None,
                               ids: Optional[Sequence[str]] = None,
                               output_file: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetAiModelProvidersResult
    def get_ai_model_providers_output(gateway_id: pulumi.Input[Optional[str]] = None,
                               ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
                               output_file: pulumi.Input[Optional[str]] = None,
                               opts: Optional[InvokeOutputOptions] = None) -> Output[GetAiModelProvidersResult]
    func GetAiModelProviders(ctx *Context, args *GetAiModelProvidersArgs, opts ...InvokeOption) (*GetAiModelProvidersResult, error)
    func GetAiModelProvidersOutput(ctx *Context, args *GetAiModelProvidersOutputArgs, opts ...InvokeOption) GetAiModelProvidersResultOutput

    > Note: This function is named GetAiModelProviders in the Go SDK.

    public static class GetAiModelProviders 
    {
        public static Task<GetAiModelProvidersResult> InvokeAsync(GetAiModelProvidersArgs args, InvokeOptions? opts = null)
        public static Output<GetAiModelProvidersResult> Invoke(GetAiModelProvidersInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetAiModelProvidersResult> Invoke(GetAiModelProvidersInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetAiModelProvidersResult> getAiModelProviders(GetAiModelProvidersArgs args, InvokeOptions options)
    public static Output<GetAiModelProvidersResult> getAiModelProviders(GetAiModelProvidersArgs args, InvokeOptions options)
    public static Output<GetAiModelProvidersResult> getAiModelProviders(GetAiModelProvidersArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: alicloud:apig/getAiModelProviders:getAiModelProviders
      arguments:
        # arguments dictionary
    data "alicloud_apig_get_ai_model_providers" "name" {
        # arguments
    }

    The following arguments are supported:

    GatewayId string
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    Ids List<string>
    A list of Ai Model Provider IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    GatewayId string
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    Ids []string
    A list of Ai Model Provider IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    gateway_id string
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    ids list(string)
    A list of Ai Model Provider IDs.
    output_file string
    File name where to save data source results (after running pulumi preview).
    gatewayId String
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    ids List<String>
    A list of Ai Model Provider IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    gatewayId string
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    ids string[]
    A list of Ai Model Provider IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    gateway_id str
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    ids Sequence[str]
    A list of Ai Model Provider IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    gatewayId String
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    ids List<String>
    A list of Ai Model Provider IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getAiModelProviders Result

    The following output properties are available:

    GatewayId string
    The gateway ID of the model card.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of Ai Model Provider IDs.
    Providers List<Pulumi.AliCloud.Apig.Outputs.GetAiModelProvidersProvider>
    A list of Ai Model Provider Entries. Each element contains the following attributes:
    OutputFile string
    GatewayId string
    The gateway ID of the model card.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of Ai Model Provider IDs.
    Providers []GetAiModelProvidersProvider
    A list of Ai Model Provider Entries. Each element contains the following attributes:
    OutputFile string
    gateway_id string
    The gateway ID of the model card.
    id string
    The provider-assigned unique ID for this managed resource.
    ids list(string)
    A list of Ai Model Provider IDs.
    providers list(object)
    A list of Ai Model Provider Entries. Each element contains the following attributes:
    output_file string
    gatewayId String
    The gateway ID of the model card.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Ai Model Provider IDs.
    providers List<GetAiModelProvidersProvider>
    A list of Ai Model Provider Entries. Each element contains the following attributes:
    outputFile String
    gatewayId string
    The gateway ID of the model card.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of Ai Model Provider IDs.
    providers GetAiModelProvidersProvider[]
    A list of Ai Model Provider Entries. Each element contains the following attributes:
    outputFile string
    gateway_id str
    The gateway ID of the model card.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of Ai Model Provider IDs.
    providers Sequence[GetAiModelProvidersProvider]
    A list of Ai Model Provider Entries. Each element contains the following attributes:
    output_file str
    gatewayId String
    The gateway ID of the model card.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Ai Model Provider IDs.
    providers List<Property Map>
    A list of Ai Model Provider Entries. Each element contains the following attributes:
    outputFile String

    Supporting Types

    GetAiModelProvidersProvider

    BoundServices List<Pulumi.AliCloud.Apig.Inputs.GetAiModelProvidersProviderBoundService>
    A list of AI service summaries currently bound to this model vendor. Each element contains the following attributes:
    DisplayName string
    Model supplier presentation name.
    GatewayId string
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    Id string
    The ID of the resource supplied above.
    ModelCards List<Pulumi.AliCloud.Apig.Inputs.GetAiModelProvidersProviderModelCard>
    A list of model cards currently associated with the model supplier. Each element contains the following attributes:
    ModelCount int
    The number of model cards currently associated with the model supplier.
    ModelProvider string
    The model provider identifier.
    ModelProviderId string
    The first ID of the resource.
    Source string
    The model source.
    UpdateTime string
    The last update time of the model card.
    BoundServices []GetAiModelProvidersProviderBoundService
    A list of AI service summaries currently bound to this model vendor. Each element contains the following attributes:
    DisplayName string
    Model supplier presentation name.
    GatewayId string
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    Id string
    The ID of the resource supplied above.
    ModelCards []GetAiModelProvidersProviderModelCard
    A list of model cards currently associated with the model supplier. Each element contains the following attributes:
    ModelCount int
    The number of model cards currently associated with the model supplier.
    ModelProvider string
    The model provider identifier.
    ModelProviderId string
    The first ID of the resource.
    Source string
    The model source.
    UpdateTime string
    The last update time of the model card.
    bound_services list(object)
    A list of AI service summaries currently bound to this model vendor. Each element contains the following attributes:
    display_name string
    Model supplier presentation name.
    gateway_id string
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    id string
    The ID of the resource supplied above.
    model_cards list(object)
    A list of model cards currently associated with the model supplier. Each element contains the following attributes:
    model_count number
    The number of model cards currently associated with the model supplier.
    model_provider string
    The model provider identifier.
    model_provider_id string
    The first ID of the resource.
    source string
    The model source.
    update_time string
    The last update time of the model card.
    boundServices List<GetAiModelProvidersProviderBoundService>
    A list of AI service summaries currently bound to this model vendor. Each element contains the following attributes:
    displayName String
    Model supplier presentation name.
    gatewayId String
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    id String
    The ID of the resource supplied above.
    modelCards List<GetAiModelProvidersProviderModelCard>
    A list of model cards currently associated with the model supplier. Each element contains the following attributes:
    modelCount Integer
    The number of model cards currently associated with the model supplier.
    modelProvider String
    The model provider identifier.
    modelProviderId String
    The first ID of the resource.
    source String
    The model source.
    updateTime String
    The last update time of the model card.
    boundServices GetAiModelProvidersProviderBoundService[]
    A list of AI service summaries currently bound to this model vendor. Each element contains the following attributes:
    displayName string
    Model supplier presentation name.
    gatewayId string
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    id string
    The ID of the resource supplied above.
    modelCards GetAiModelProvidersProviderModelCard[]
    A list of model cards currently associated with the model supplier. Each element contains the following attributes:
    modelCount number
    The number of model cards currently associated with the model supplier.
    modelProvider string
    The model provider identifier.
    modelProviderId string
    The first ID of the resource.
    source string
    The model source.
    updateTime string
    The last update time of the model card.
    bound_services Sequence[GetAiModelProvidersProviderBoundService]
    A list of AI service summaries currently bound to this model vendor. Each element contains the following attributes:
    display_name str
    Model supplier presentation name.
    gateway_id str
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    id str
    The ID of the resource supplied above.
    model_cards Sequence[GetAiModelProvidersProviderModelCard]
    A list of model cards currently associated with the model supplier. Each element contains the following attributes:
    model_count int
    The number of model cards currently associated with the model supplier.
    model_provider str
    The model provider identifier.
    model_provider_id str
    The first ID of the resource.
    source str
    The model source.
    update_time str
    The last update time of the model card.
    boundServices List<Property Map>
    A list of AI service summaries currently bound to this model vendor. Each element contains the following attributes:
    displayName String
    Model supplier presentation name.
    gatewayId String
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    id String
    The ID of the resource supplied above.
    modelCards List<Property Map>
    A list of model cards currently associated with the model supplier. Each element contains the following attributes:
    modelCount Number
    The number of model cards currently associated with the model supplier.
    modelProvider String
    The model provider identifier.
    modelProviderId String
    The first ID of the resource.
    source String
    The model source.
    updateTime String
    The last update time of the model card.

    GetAiModelProvidersProviderBoundService

    ExpressType string
    The express type of the AI service.
    GroupName string
    The group name of the AI service.
    Name string
    The name of the AI service.
    Namespace string
    The namespace of the AI service.
    PaiWorkspaceId string
    The PAI workspace ID.
    PaiWorkspaceName string
    The PAI workspace name.
    Qualifier string
    The qualifier of the AI service.
    ServiceId string
    The ID of the AI service.
    SourceType string
    The source type of the AI service.
    Status string
    The status of the AI service.
    ExpressType string
    The express type of the AI service.
    GroupName string
    The group name of the AI service.
    Name string
    The name of the AI service.
    Namespace string
    The namespace of the AI service.
    PaiWorkspaceId string
    The PAI workspace ID.
    PaiWorkspaceName string
    The PAI workspace name.
    Qualifier string
    The qualifier of the AI service.
    ServiceId string
    The ID of the AI service.
    SourceType string
    The source type of the AI service.
    Status string
    The status of the AI service.
    express_type string
    The express type of the AI service.
    group_name string
    The group name of the AI service.
    name string
    The name of the AI service.
    namespace string
    The namespace of the AI service.
    pai_workspace_id string
    The PAI workspace ID.
    pai_workspace_name string
    The PAI workspace name.
    qualifier string
    The qualifier of the AI service.
    service_id string
    The ID of the AI service.
    source_type string
    The source type of the AI service.
    status string
    The status of the AI service.
    expressType String
    The express type of the AI service.
    groupName String
    The group name of the AI service.
    name String
    The name of the AI service.
    namespace String
    The namespace of the AI service.
    paiWorkspaceId String
    The PAI workspace ID.
    paiWorkspaceName String
    The PAI workspace name.
    qualifier String
    The qualifier of the AI service.
    serviceId String
    The ID of the AI service.
    sourceType String
    The source type of the AI service.
    status String
    The status of the AI service.
    expressType string
    The express type of the AI service.
    groupName string
    The group name of the AI service.
    name string
    The name of the AI service.
    namespace string
    The namespace of the AI service.
    paiWorkspaceId string
    The PAI workspace ID.
    paiWorkspaceName string
    The PAI workspace name.
    qualifier string
    The qualifier of the AI service.
    serviceId string
    The ID of the AI service.
    sourceType string
    The source type of the AI service.
    status string
    The status of the AI service.
    express_type str
    The express type of the AI service.
    group_name str
    The group name of the AI service.
    name str
    The name of the AI service.
    namespace str
    The namespace of the AI service.
    pai_workspace_id str
    The PAI workspace ID.
    pai_workspace_name str
    The PAI workspace name.
    qualifier str
    The qualifier of the AI service.
    service_id str
    The ID of the AI service.
    source_type str
    The source type of the AI service.
    status str
    The status of the AI service.
    expressType String
    The express type of the AI service.
    groupName String
    The group name of the AI service.
    name String
    The name of the AI service.
    namespace String
    The namespace of the AI service.
    paiWorkspaceId String
    The PAI workspace ID.
    paiWorkspaceName String
    The PAI workspace name.
    qualifier String
    The qualifier of the AI service.
    serviceId String
    The ID of the AI service.
    sourceType String
    The source type of the AI service.
    status String
    The status of the AI service.

    GetAiModelProvidersProviderModelCard

    GatewayId string
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    ModelCardId string
    The ID of the model card.
    ModelName string
    The model name.
    ModelProvider string
    The model provider identifier.
    Source string
    The model source.
    UpdateTime string
    The last update time of the model card.
    GatewayId string
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    ModelCardId string
    The ID of the model card.
    ModelName string
    The model name.
    ModelProvider string
    The model provider identifier.
    Source string
    The model source.
    UpdateTime string
    The last update time of the model card.
    gateway_id string
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    model_card_id string
    The ID of the model card.
    model_name string
    The model name.
    model_provider string
    The model provider identifier.
    source string
    The model source.
    update_time string
    The last update time of the model card.
    gatewayId String
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    modelCardId String
    The ID of the model card.
    modelName String
    The model name.
    modelProvider String
    The model provider identifier.
    source String
    The model source.
    updateTime String
    The last update time of the model card.
    gatewayId string
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    modelCardId string
    The ID of the model card.
    modelName string
    The model name.
    modelProvider string
    The model provider identifier.
    source string
    The model source.
    updateTime string
    The last update time of the model card.
    gateway_id str
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    model_card_id str
    The ID of the model card.
    model_name str
    The model name.
    model_provider str
    The model provider identifier.
    source str
    The model source.
    update_time str
    The last update time of the model card.
    gatewayId String
    The ID of the AI gateway instance. The target instance must exist, belong to the current account, and be of the AI gateway type.
    modelCardId String
    The ID of the model card.
    modelName String
    The model name.
    modelProvider String
    The model provider identifier.
    source String
    The model source.
    updateTime String
    The last update time of the model card.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo alicloud logo
    Viewing docs for Alibaba Cloud v3.108.0
    published on Thursday, Sep 17, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial