1. Registry
  2. Packages
  3. Mongodbatlas Provider
  4. API Docs
  5. getAiModelOrgApiKeys
Viewing docs for MongoDB Atlas v4.15.0
published on Friday, Aug 28, 2026 by Pulumi
mongodbatlas logo mongodbatlas logo
Viewing docs for MongoDB Atlas v4.15.0
published on Friday, Aug 28, 2026 by Pulumi

    mongodbatlas.getAiModelOrgApiKeys returns all AI Model API Keys across all projects in the specified organization.

    NOTE: AI Model API Keys are always associated with a specific project. This organization-level data source provides a consolidated view of all API keys across all projects within the organization.

    Example Usage

    S

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    const _this = mongodbatlas.getAiModelOrgApiKeys({
        orgId: orgId,
    });
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    this = mongodbatlas.get_ai_model_org_api_keys(org_id=org_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-mongodbatlas/sdk/v4/go/mongodbatlas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := mongodbatlas.GetAiModelOrgApiKeys(ctx, &mongodbatlas.LookupAiModelOrgApiKeysArgs{
    			OrgId: orgId,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = Mongodbatlas.GetAiModelOrgApiKeys.Invoke(new()
        {
            OrgId = orgId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.MongodbatlasFunctions;
    import com.pulumi.mongodbatlas.inputs.GetAiModelOrgApiKeysArgs;
    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 this = MongodbatlasFunctions.getAiModelOrgApiKeys(GetAiModelOrgApiKeysArgs.builder()
                .orgId(orgId)
                .build());
    
        }
    }
    
    variables:
      this:
        fn::invoke:
          function: mongodbatlas:getAiModelOrgApiKeys
          arguments:
            orgId: ${orgId}
    
    pulumi {
      required_providers {
        mongodbatlas = {
          source = "pulumi/mongodbatlas"
        }
      }
    }
    
    data "mongodbatlas_getaimodelorgapikeys" "this" {
      org_id = orgId
    }
    

    Using getAiModelOrgApiKeys

    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 getAiModelOrgApiKeys(args: GetAiModelOrgApiKeysArgs, opts?: InvokeOptions): Promise<GetAiModelOrgApiKeysResult>
    function getAiModelOrgApiKeysOutput(args: GetAiModelOrgApiKeysOutputArgs, opts?: InvokeOutputOptions): Output<GetAiModelOrgApiKeysResult>
    def get_ai_model_org_api_keys(org_id: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetAiModelOrgApiKeysResult
    def get_ai_model_org_api_keys_output(org_id: pulumi.Input[Optional[str]] = None,
                                  opts: Optional[InvokeOutputOptions] = None) -> Output[GetAiModelOrgApiKeysResult]
    func LookupAiModelOrgApiKeys(ctx *Context, args *LookupAiModelOrgApiKeysArgs, opts ...InvokeOption) (*LookupAiModelOrgApiKeysResult, error)
    func LookupAiModelOrgApiKeysOutput(ctx *Context, args *LookupAiModelOrgApiKeysOutputArgs, opts ...InvokeOption) LookupAiModelOrgApiKeysResultOutput

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

    public static class GetAiModelOrgApiKeys 
    {
        public static Task<GetAiModelOrgApiKeysResult> InvokeAsync(GetAiModelOrgApiKeysArgs args, InvokeOptions? opts = null)
        public static Output<GetAiModelOrgApiKeysResult> Invoke(GetAiModelOrgApiKeysInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetAiModelOrgApiKeysResult> Invoke(GetAiModelOrgApiKeysInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetAiModelOrgApiKeysResult> getAiModelOrgApiKeys(GetAiModelOrgApiKeysArgs args, InvokeOptions options)
    public static Output<GetAiModelOrgApiKeysResult> getAiModelOrgApiKeys(GetAiModelOrgApiKeysArgs args, InvokeOptions options)
    public static Output<GetAiModelOrgApiKeysResult> getAiModelOrgApiKeys(GetAiModelOrgApiKeysArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: mongodbatlas:index/getAiModelOrgApiKeys:getAiModelOrgApiKeys
      arguments:
        # arguments dictionary
    data "mongodbatlas_get_ai_model_org_api_keys" "name" {
        # arguments
    }

    The following arguments are supported:

    OrgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    OrgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    org_id string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    orgId String
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    orgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    org_id str
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    orgId String
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.

    getAiModelOrgApiKeys Result

    The following output properties are available:

    OrgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    Results List<GetAiModelOrgApiKeysResult>
    List of returned documents that MongoDB Cloud provides when completing this request.
    OrgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    Results []GetAiModelOrgApiKeysResult
    List of returned documents that MongoDB Cloud provides when completing this request.
    org_id string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    results list(object)
    List of returned documents that MongoDB Cloud provides when completing this request.
    orgId String
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    results List<GetAiModelOrgApiKeysResult>
    List of returned documents that MongoDB Cloud provides when completing this request.
    orgId string
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    results GetAiModelOrgApiKeysResult[]
    List of returned documents that MongoDB Cloud provides when completing this request.
    org_id str
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    results Sequence[GetAiModelOrgApiKeysResult]
    List of returned documents that MongoDB Cloud provides when completing this request.
    orgId String
    Unique 24-hexadecimal digit string that identifies the organization that contains your projects.
    results List<Property Map>
    List of returned documents that MongoDB Cloud provides when completing this request.

    Supporting Types

    GetAiModelOrgApiKeysResult

    ApiKeyId string
    Identifier used to reference this API key in admin API calls.
    Cloud string
    Cloud provider scope for this API key. Use "ANY" for cloud-agnostic scope.
    CreatedAt string
    UTC date when the API key was created. This parameter is formatted as an ISO 8601 timestamp.
    CreatedBy string
    Name of the user that created this API key. If no user name is available, the user ID is returned.
    Endpoint string
    Server-computed endpoint hostname derived from cloud and geography. This field is read-only and must not be supplied in request bodies.
    Geography string
    Geography scope for this API key. Use "ANY" for geography-agnostic scope.
    LastUsedAt string
    UTC date when the API key was last used. This parameter is formatted as an ISO 8601 timestamp.
    MaskedSecret string
    A partially obfuscated version of the API key secret returned when the API key was created.
    Name string
    Arbitrary string identifier assigned to this API key for convenient identification.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    Status string
    A string describing the current status of the API key.
    ApiKeyId string
    Identifier used to reference this API key in admin API calls.
    Cloud string
    Cloud provider scope for this API key. Use "ANY" for cloud-agnostic scope.
    CreatedAt string
    UTC date when the API key was created. This parameter is formatted as an ISO 8601 timestamp.
    CreatedBy string
    Name of the user that created this API key. If no user name is available, the user ID is returned.
    Endpoint string
    Server-computed endpoint hostname derived from cloud and geography. This field is read-only and must not be supplied in request bodies.
    Geography string
    Geography scope for this API key. Use "ANY" for geography-agnostic scope.
    LastUsedAt string
    UTC date when the API key was last used. This parameter is formatted as an ISO 8601 timestamp.
    MaskedSecret string
    A partially obfuscated version of the API key secret returned when the API key was created.
    Name string
    Arbitrary string identifier assigned to this API key for convenient identification.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    Status string
    A string describing the current status of the API key.
    api_key_id string
    Identifier used to reference this API key in admin API calls.
    cloud string
    Cloud provider scope for this API key. Use "ANY" for cloud-agnostic scope.
    created_at string
    UTC date when the API key was created. This parameter is formatted as an ISO 8601 timestamp.
    created_by string
    Name of the user that created this API key. If no user name is available, the user ID is returned.
    endpoint string
    Server-computed endpoint hostname derived from cloud and geography. This field is read-only and must not be supplied in request bodies.
    geography string
    Geography scope for this API key. Use "ANY" for geography-agnostic scope.
    last_used_at string
    UTC date when the API key was last used. This parameter is formatted as an ISO 8601 timestamp.
    masked_secret string
    A partially obfuscated version of the API key secret returned when the API key was created.
    name string
    Arbitrary string identifier assigned to this API key for convenient identification.
    project_id string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    status string
    A string describing the current status of the API key.
    apiKeyId String
    Identifier used to reference this API key in admin API calls.
    cloud String
    Cloud provider scope for this API key. Use "ANY" for cloud-agnostic scope.
    createdAt String
    UTC date when the API key was created. This parameter is formatted as an ISO 8601 timestamp.
    createdBy String
    Name of the user that created this API key. If no user name is available, the user ID is returned.
    endpoint String
    Server-computed endpoint hostname derived from cloud and geography. This field is read-only and must not be supplied in request bodies.
    geography String
    Geography scope for this API key. Use "ANY" for geography-agnostic scope.
    lastUsedAt String
    UTC date when the API key was last used. This parameter is formatted as an ISO 8601 timestamp.
    maskedSecret String
    A partially obfuscated version of the API key secret returned when the API key was created.
    name String
    Arbitrary string identifier assigned to this API key for convenient identification.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    status String
    A string describing the current status of the API key.
    apiKeyId string
    Identifier used to reference this API key in admin API calls.
    cloud string
    Cloud provider scope for this API key. Use "ANY" for cloud-agnostic scope.
    createdAt string
    UTC date when the API key was created. This parameter is formatted as an ISO 8601 timestamp.
    createdBy string
    Name of the user that created this API key. If no user name is available, the user ID is returned.
    endpoint string
    Server-computed endpoint hostname derived from cloud and geography. This field is read-only and must not be supplied in request bodies.
    geography string
    Geography scope for this API key. Use "ANY" for geography-agnostic scope.
    lastUsedAt string
    UTC date when the API key was last used. This parameter is formatted as an ISO 8601 timestamp.
    maskedSecret string
    A partially obfuscated version of the API key secret returned when the API key was created.
    name string
    Arbitrary string identifier assigned to this API key for convenient identification.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    status string
    A string describing the current status of the API key.
    api_key_id str
    Identifier used to reference this API key in admin API calls.
    cloud str
    Cloud provider scope for this API key. Use "ANY" for cloud-agnostic scope.
    created_at str
    UTC date when the API key was created. This parameter is formatted as an ISO 8601 timestamp.
    created_by str
    Name of the user that created this API key. If no user name is available, the user ID is returned.
    endpoint str
    Server-computed endpoint hostname derived from cloud and geography. This field is read-only and must not be supplied in request bodies.
    geography str
    Geography scope for this API key. Use "ANY" for geography-agnostic scope.
    last_used_at str
    UTC date when the API key was last used. This parameter is formatted as an ISO 8601 timestamp.
    masked_secret str
    A partially obfuscated version of the API key secret returned when the API key was created.
    name str
    Arbitrary string identifier assigned to this API key for convenient identification.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    status str
    A string describing the current status of the API key.
    apiKeyId String
    Identifier used to reference this API key in admin API calls.
    cloud String
    Cloud provider scope for this API key. Use "ANY" for cloud-agnostic scope.
    createdAt String
    UTC date when the API key was created. This parameter is formatted as an ISO 8601 timestamp.
    createdBy String
    Name of the user that created this API key. If no user name is available, the user ID is returned.
    endpoint String
    Server-computed endpoint hostname derived from cloud and geography. This field is read-only and must not be supplied in request bodies.
    geography String
    Geography scope for this API key. Use "ANY" for geography-agnostic scope.
    lastUsedAt String
    UTC date when the API key was last used. This parameter is formatted as an ISO 8601 timestamp.
    maskedSecret String
    A partially obfuscated version of the API key secret returned when the API key was created.
    name String
    Arbitrary string identifier assigned to this API key for convenient identification.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    status String
    A string describing the current status of the API key.

    Package Details

    Repository
    MongoDB Atlas pulumi/pulumi-mongodbatlas
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the mongodbatlas Terraform Provider.
    mongodbatlas logo mongodbatlas logo
    Viewing docs for MongoDB Atlas v4.15.0
    published on Friday, Aug 28, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial