1. Packages
  2. DigitalOcean Provider
  3. API Docs
  4. GenaiOpenaiApiKey
DigitalOcean v4.51.0 published on Thursday, Aug 14, 2025 by Pulumi

digitalocean.GenaiOpenaiApiKey

Explore with Pulumi AI

digitalocean logo
DigitalOcean v4.51.0 published on Thursday, Aug 14, 2025 by Pulumi

    Create GenaiOpenaiApiKey Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new GenaiOpenaiApiKey(name: string, args: GenaiOpenaiApiKeyArgs, opts?: CustomResourceOptions);
    @overload
    def GenaiOpenaiApiKey(resource_name: str,
                          args: GenaiOpenaiApiKeyArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def GenaiOpenaiApiKey(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          api_key: Optional[str] = None,
                          models: Optional[Sequence[GenaiOpenaiApiKeyModelArgs]] = None,
                          name: Optional[str] = None)
    func NewGenaiOpenaiApiKey(ctx *Context, name string, args GenaiOpenaiApiKeyArgs, opts ...ResourceOption) (*GenaiOpenaiApiKey, error)
    public GenaiOpenaiApiKey(string name, GenaiOpenaiApiKeyArgs args, CustomResourceOptions? opts = null)
    public GenaiOpenaiApiKey(String name, GenaiOpenaiApiKeyArgs args)
    public GenaiOpenaiApiKey(String name, GenaiOpenaiApiKeyArgs args, CustomResourceOptions options)
    
    type: digitalocean:GenaiOpenaiApiKey
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args GenaiOpenaiApiKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args GenaiOpenaiApiKeyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args GenaiOpenaiApiKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GenaiOpenaiApiKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GenaiOpenaiApiKeyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var genaiOpenaiApiKeyResource = new DigitalOcean.GenaiOpenaiApiKey("genaiOpenaiApiKeyResource", new()
    {
        ApiKey = "string",
        Models = new[]
        {
            new DigitalOcean.Inputs.GenaiOpenaiApiKeyModelArgs
            {
                Agreements = new[]
                {
                    new DigitalOcean.Inputs.GenaiOpenaiApiKeyModelAgreementArgs
                    {
                        Description = "string",
                        Name = "string",
                        Url = "string",
                        Uuid = "string",
                    },
                },
                CreatedAt = "string",
                InferenceName = "string",
                InferenceVersion = "string",
                IsFoundational = false,
                Name = "string",
                ParentUuid = "string",
                Provider = "string",
                UpdatedAt = "string",
                UploadComplete = false,
                Url = "string",
                Usecases = new[]
                {
                    "string",
                },
                Versions = new[]
                {
                    new DigitalOcean.Inputs.GenaiOpenaiApiKeyModelVersionArgs
                    {
                        Major = 0,
                        Minor = 0,
                        Patch = 0,
                    },
                },
            },
        },
        Name = "string",
    });
    
    example, err := digitalocean.NewGenaiOpenaiApiKey(ctx, "genaiOpenaiApiKeyResource", &digitalocean.GenaiOpenaiApiKeyArgs{
    	ApiKey: pulumi.String("string"),
    	Models: digitalocean.GenaiOpenaiApiKeyModelArray{
    		&digitalocean.GenaiOpenaiApiKeyModelArgs{
    			Agreements: digitalocean.GenaiOpenaiApiKeyModelAgreementArray{
    				&digitalocean.GenaiOpenaiApiKeyModelAgreementArgs{
    					Description: pulumi.String("string"),
    					Name:        pulumi.String("string"),
    					Url:         pulumi.String("string"),
    					Uuid:        pulumi.String("string"),
    				},
    			},
    			CreatedAt:        pulumi.String("string"),
    			InferenceName:    pulumi.String("string"),
    			InferenceVersion: pulumi.String("string"),
    			IsFoundational:   pulumi.Bool(false),
    			Name:             pulumi.String("string"),
    			ParentUuid:       pulumi.String("string"),
    			Provider:         pulumi.String("string"),
    			UpdatedAt:        pulumi.String("string"),
    			UploadComplete:   pulumi.Bool(false),
    			Url:              pulumi.String("string"),
    			Usecases: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			Versions: digitalocean.GenaiOpenaiApiKeyModelVersionArray{
    				&digitalocean.GenaiOpenaiApiKeyModelVersionArgs{
    					Major: pulumi.Int(0),
    					Minor: pulumi.Int(0),
    					Patch: pulumi.Int(0),
    				},
    			},
    		},
    	},
    	Name: pulumi.String("string"),
    })
    
    var genaiOpenaiApiKeyResource = new GenaiOpenaiApiKey("genaiOpenaiApiKeyResource", GenaiOpenaiApiKeyArgs.builder()
        .apiKey("string")
        .models(GenaiOpenaiApiKeyModelArgs.builder()
            .agreements(GenaiOpenaiApiKeyModelAgreementArgs.builder()
                .description("string")
                .name("string")
                .url("string")
                .uuid("string")
                .build())
            .createdAt("string")
            .inferenceName("string")
            .inferenceVersion("string")
            .isFoundational(false)
            .name("string")
            .parentUuid("string")
            .provider("string")
            .updatedAt("string")
            .uploadComplete(false)
            .url("string")
            .usecases("string")
            .versions(GenaiOpenaiApiKeyModelVersionArgs.builder()
                .major(0)
                .minor(0)
                .patch(0)
                .build())
            .build())
        .name("string")
        .build());
    
    genai_openai_api_key_resource = digitalocean.GenaiOpenaiApiKey("genaiOpenaiApiKeyResource",
        api_key="string",
        models=[{
            "agreements": [{
                "description": "string",
                "name": "string",
                "url": "string",
                "uuid": "string",
            }],
            "created_at": "string",
            "inference_name": "string",
            "inference_version": "string",
            "is_foundational": False,
            "name": "string",
            "parent_uuid": "string",
            "provider": "string",
            "updated_at": "string",
            "upload_complete": False,
            "url": "string",
            "usecases": ["string"],
            "versions": [{
                "major": 0,
                "minor": 0,
                "patch": 0,
            }],
        }],
        name="string")
    
    const genaiOpenaiApiKeyResource = new digitalocean.GenaiOpenaiApiKey("genaiOpenaiApiKeyResource", {
        apiKey: "string",
        models: [{
            agreements: [{
                description: "string",
                name: "string",
                url: "string",
                uuid: "string",
            }],
            createdAt: "string",
            inferenceName: "string",
            inferenceVersion: "string",
            isFoundational: false,
            name: "string",
            parentUuid: "string",
            provider: "string",
            updatedAt: "string",
            uploadComplete: false,
            url: "string",
            usecases: ["string"],
            versions: [{
                major: 0,
                minor: 0,
                patch: 0,
            }],
        }],
        name: "string",
    });
    
    type: digitalocean:GenaiOpenaiApiKey
    properties:
        apiKey: string
        models:
            - agreements:
                - description: string
                  name: string
                  url: string
                  uuid: string
              createdAt: string
              inferenceName: string
              inferenceVersion: string
              isFoundational: false
              name: string
              parentUuid: string
              provider: string
              updatedAt: string
              uploadComplete: false
              url: string
              usecases:
                - string
              versions:
                - major: 0
                  minor: 0
                  patch: 0
        name: string
    

    GenaiOpenaiApiKey Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The GenaiOpenaiApiKey resource accepts the following input properties:

    ApiKey string
    The OpenAI API key.
    Models List<Pulumi.DigitalOcean.Inputs.GenaiOpenaiApiKeyModel>
    Models associated with the OpenAI API key
    Name string
    A name for the API key.
    ApiKey string
    The OpenAI API key.
    Models []GenaiOpenaiApiKeyModelArgs
    Models associated with the OpenAI API key
    Name string
    A name for the API key.
    apiKey String
    The OpenAI API key.
    models List<GenaiOpenaiApiKeyModel>
    Models associated with the OpenAI API key
    name String
    A name for the API key.
    apiKey string
    The OpenAI API key.
    models GenaiOpenaiApiKeyModel[]
    Models associated with the OpenAI API key
    name string
    A name for the API key.
    api_key str
    The OpenAI API key.
    models Sequence[GenaiOpenaiApiKeyModelArgs]
    Models associated with the OpenAI API key
    name str
    A name for the API key.
    apiKey String
    The OpenAI API key.
    models List<Property Map>
    Models associated with the OpenAI API key
    name String
    A name for the API key.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the GenaiOpenaiApiKey resource produces the following output properties:

    CreatedAt string
    When the API key was created.
    CreatedBy string
    Who created the API key.
    DeletedAt string
    When the API key was deleted.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdatedAt string
    When the API key was last updated.
    Uuid string
    The UUID of the API key.
    CreatedAt string
    When the API key was created.
    CreatedBy string
    Who created the API key.
    DeletedAt string
    When the API key was deleted.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdatedAt string
    When the API key was last updated.
    Uuid string
    The UUID of the API key.
    createdAt String
    When the API key was created.
    createdBy String
    Who created the API key.
    deletedAt String
    When the API key was deleted.
    id String
    The provider-assigned unique ID for this managed resource.
    updatedAt String
    When the API key was last updated.
    uuid String
    The UUID of the API key.
    createdAt string
    When the API key was created.
    createdBy string
    Who created the API key.
    deletedAt string
    When the API key was deleted.
    id string
    The provider-assigned unique ID for this managed resource.
    updatedAt string
    When the API key was last updated.
    uuid string
    The UUID of the API key.
    created_at str
    When the API key was created.
    created_by str
    Who created the API key.
    deleted_at str
    When the API key was deleted.
    id str
    The provider-assigned unique ID for this managed resource.
    updated_at str
    When the API key was last updated.
    uuid str
    The UUID of the API key.
    createdAt String
    When the API key was created.
    createdBy String
    Who created the API key.
    deletedAt String
    When the API key was deleted.
    id String
    The provider-assigned unique ID for this managed resource.
    updatedAt String
    When the API key was last updated.
    uuid String
    The UUID of the API key.

    Look up Existing GenaiOpenaiApiKey Resource

    Get an existing GenaiOpenaiApiKey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: GenaiOpenaiApiKeyState, opts?: CustomResourceOptions): GenaiOpenaiApiKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_key: Optional[str] = None,
            created_at: Optional[str] = None,
            created_by: Optional[str] = None,
            deleted_at: Optional[str] = None,
            models: Optional[Sequence[GenaiOpenaiApiKeyModelArgs]] = None,
            name: Optional[str] = None,
            updated_at: Optional[str] = None,
            uuid: Optional[str] = None) -> GenaiOpenaiApiKey
    func GetGenaiOpenaiApiKey(ctx *Context, name string, id IDInput, state *GenaiOpenaiApiKeyState, opts ...ResourceOption) (*GenaiOpenaiApiKey, error)
    public static GenaiOpenaiApiKey Get(string name, Input<string> id, GenaiOpenaiApiKeyState? state, CustomResourceOptions? opts = null)
    public static GenaiOpenaiApiKey get(String name, Output<String> id, GenaiOpenaiApiKeyState state, CustomResourceOptions options)
    resources:  _:    type: digitalocean:GenaiOpenaiApiKey    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ApiKey string
    The OpenAI API key.
    CreatedAt string
    When the API key was created.
    CreatedBy string
    Who created the API key.
    DeletedAt string
    When the API key was deleted.
    Models List<Pulumi.DigitalOcean.Inputs.GenaiOpenaiApiKeyModel>
    Models associated with the OpenAI API key
    Name string
    A name for the API key.
    UpdatedAt string
    When the API key was last updated.
    Uuid string
    The UUID of the API key.
    ApiKey string
    The OpenAI API key.
    CreatedAt string
    When the API key was created.
    CreatedBy string
    Who created the API key.
    DeletedAt string
    When the API key was deleted.
    Models []GenaiOpenaiApiKeyModelArgs
    Models associated with the OpenAI API key
    Name string
    A name for the API key.
    UpdatedAt string
    When the API key was last updated.
    Uuid string
    The UUID of the API key.
    apiKey String
    The OpenAI API key.
    createdAt String
    When the API key was created.
    createdBy String
    Who created the API key.
    deletedAt String
    When the API key was deleted.
    models List<GenaiOpenaiApiKeyModel>
    Models associated with the OpenAI API key
    name String
    A name for the API key.
    updatedAt String
    When the API key was last updated.
    uuid String
    The UUID of the API key.
    apiKey string
    The OpenAI API key.
    createdAt string
    When the API key was created.
    createdBy string
    Who created the API key.
    deletedAt string
    When the API key was deleted.
    models GenaiOpenaiApiKeyModel[]
    Models associated with the OpenAI API key
    name string
    A name for the API key.
    updatedAt string
    When the API key was last updated.
    uuid string
    The UUID of the API key.
    api_key str
    The OpenAI API key.
    created_at str
    When the API key was created.
    created_by str
    Who created the API key.
    deleted_at str
    When the API key was deleted.
    models Sequence[GenaiOpenaiApiKeyModelArgs]
    Models associated with the OpenAI API key
    name str
    A name for the API key.
    updated_at str
    When the API key was last updated.
    uuid str
    The UUID of the API key.
    apiKey String
    The OpenAI API key.
    createdAt String
    When the API key was created.
    createdBy String
    Who created the API key.
    deletedAt String
    When the API key was deleted.
    models List<Property Map>
    Models associated with the OpenAI API key
    name String
    A name for the API key.
    updatedAt String
    When the API key was last updated.
    uuid String
    The UUID of the API key.

    Supporting Types

    GenaiOpenaiApiKeyModel, GenaiOpenaiApiKeyModelArgs

    Agreements List<Pulumi.DigitalOcean.Inputs.GenaiOpenaiApiKeyModelAgreement>
    Agreement information for the model
    CreatedAt string
    Created At timestamp for the Knowledge Base
    InferenceName string
    Inference name of the model
    InferenceVersion string
    Infernce version of the model
    IsFoundational bool
    Indicates if the Model Base is foundational
    Name string
    Name of the Knowledge Base
    ParentUuid string
    Parent UUID of the Model
    Provider string
    Provider of the Model
    UpdatedAt string
    Timestamp when the Knowledge Base was updated
    UploadComplete bool
    Indicates if the Model upload is complete
    Url string
    URL of the Model
    Usecases List<string>
    List of Usecases for the Model
    Versions List<Pulumi.DigitalOcean.Inputs.GenaiOpenaiApiKeyModelVersion>
    URL of the Model
    Agreements []GenaiOpenaiApiKeyModelAgreement
    Agreement information for the model
    CreatedAt string
    Created At timestamp for the Knowledge Base
    InferenceName string
    Inference name of the model
    InferenceVersion string
    Infernce version of the model
    IsFoundational bool
    Indicates if the Model Base is foundational
    Name string
    Name of the Knowledge Base
    ParentUuid string
    Parent UUID of the Model
    Provider string
    Provider of the Model
    UpdatedAt string
    Timestamp when the Knowledge Base was updated
    UploadComplete bool
    Indicates if the Model upload is complete
    Url string
    URL of the Model
    Usecases []string
    List of Usecases for the Model
    Versions []GenaiOpenaiApiKeyModelVersion
    URL of the Model
    agreements List<GenaiOpenaiApiKeyModelAgreement>
    Agreement information for the model
    createdAt String
    Created At timestamp for the Knowledge Base
    inferenceName String
    Inference name of the model
    inferenceVersion String
    Infernce version of the model
    isFoundational Boolean
    Indicates if the Model Base is foundational
    name String
    Name of the Knowledge Base
    parentUuid String
    Parent UUID of the Model
    provider String
    Provider of the Model
    updatedAt String
    Timestamp when the Knowledge Base was updated
    uploadComplete Boolean
    Indicates if the Model upload is complete
    url String
    URL of the Model
    usecases List<String>
    List of Usecases for the Model
    versions List<GenaiOpenaiApiKeyModelVersion>
    URL of the Model
    agreements GenaiOpenaiApiKeyModelAgreement[]
    Agreement information for the model
    createdAt string
    Created At timestamp for the Knowledge Base
    inferenceName string
    Inference name of the model
    inferenceVersion string
    Infernce version of the model
    isFoundational boolean
    Indicates if the Model Base is foundational
    name string
    Name of the Knowledge Base
    parentUuid string
    Parent UUID of the Model
    provider string
    Provider of the Model
    updatedAt string
    Timestamp when the Knowledge Base was updated
    uploadComplete boolean
    Indicates if the Model upload is complete
    url string
    URL of the Model
    usecases string[]
    List of Usecases for the Model
    versions GenaiOpenaiApiKeyModelVersion[]
    URL of the Model
    agreements Sequence[GenaiOpenaiApiKeyModelAgreement]
    Agreement information for the model
    created_at str
    Created At timestamp for the Knowledge Base
    inference_name str
    Inference name of the model
    inference_version str
    Infernce version of the model
    is_foundational bool
    Indicates if the Model Base is foundational
    name str
    Name of the Knowledge Base
    parent_uuid str
    Parent UUID of the Model
    provider str
    Provider of the Model
    updated_at str
    Timestamp when the Knowledge Base was updated
    upload_complete bool
    Indicates if the Model upload is complete
    url str
    URL of the Model
    usecases Sequence[str]
    List of Usecases for the Model
    versions Sequence[GenaiOpenaiApiKeyModelVersion]
    URL of the Model
    agreements List<Property Map>
    Agreement information for the model
    createdAt String
    Created At timestamp for the Knowledge Base
    inferenceName String
    Inference name of the model
    inferenceVersion String
    Infernce version of the model
    isFoundational Boolean
    Indicates if the Model Base is foundational
    name String
    Name of the Knowledge Base
    parentUuid String
    Parent UUID of the Model
    provider String
    Provider of the Model
    updatedAt String
    Timestamp when the Knowledge Base was updated
    uploadComplete Boolean
    Indicates if the Model upload is complete
    url String
    URL of the Model
    usecases List<String>
    List of Usecases for the Model
    versions List<Property Map>
    URL of the Model

    GenaiOpenaiApiKeyModelAgreement, GenaiOpenaiApiKeyModelAgreementArgs

    Description string
    Description of the agreement
    Name string
    Name of the agreement
    Url string
    URL of the agreement
    Uuid string
    UUID of the agreement
    Description string
    Description of the agreement
    Name string
    Name of the agreement
    Url string
    URL of the agreement
    Uuid string
    UUID of the agreement
    description String
    Description of the agreement
    name String
    Name of the agreement
    url String
    URL of the agreement
    uuid String
    UUID of the agreement
    description string
    Description of the agreement
    name string
    Name of the agreement
    url string
    URL of the agreement
    uuid string
    UUID of the agreement
    description str
    Description of the agreement
    name str
    Name of the agreement
    url str
    URL of the agreement
    uuid str
    UUID of the agreement
    description String
    Description of the agreement
    name String
    Name of the agreement
    url String
    URL of the agreement
    uuid String
    UUID of the agreement

    GenaiOpenaiApiKeyModelVersion, GenaiOpenaiApiKeyModelVersionArgs

    Major int
    Major version of the model
    Minor int
    Minor version of the model
    Patch int
    Patch version of the model
    Major int
    Major version of the model
    Minor int
    Minor version of the model
    Patch int
    Patch version of the model
    major Integer
    Major version of the model
    minor Integer
    Minor version of the model
    patch Integer
    Patch version of the model
    major number
    Major version of the model
    minor number
    Minor version of the model
    patch number
    Patch version of the model
    major int
    Major version of the model
    minor int
    Minor version of the model
    patch int
    Patch version of the model
    major Number
    Major version of the model
    minor Number
    Minor version of the model
    patch Number
    Patch version of the model

    Package Details

    Repository
    DigitalOcean pulumi/pulumi-digitalocean
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the digitalocean Terraform Provider.
    digitalocean logo
    DigitalOcean v4.51.0 published on Thursday, Aug 14, 2025 by Pulumi