1. Packages
  2. Packages
  3. Akeyless Provider
  4. API Docs
  5. TargetOpenai
Viewing docs for akeyless 2.0.1
published on Monday, Apr 27, 2026 by akeyless-community
Viewing docs for akeyless 2.0.1
published on Monday, Apr 27, 2026 by akeyless-community

    OpenAI Target resource

    Create TargetOpenai Resource

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

    Constructor syntax

    new TargetOpenai(name: string, args?: TargetOpenaiArgs, opts?: CustomResourceOptions);
    @overload
    def TargetOpenai(resource_name: str,
                     args: Optional[TargetOpenaiArgs] = None,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def TargetOpenai(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     api_key: Optional[str] = None,
                     api_key_id: Optional[str] = None,
                     description: Optional[str] = None,
                     keep_prev_version: Optional[str] = None,
                     key: Optional[str] = None,
                     max_versions: Optional[str] = None,
                     model: Optional[str] = None,
                     name: Optional[str] = None,
                     openai_url: Optional[str] = None,
                     organization_id: Optional[str] = None,
                     target_openai_id: Optional[str] = None)
    func NewTargetOpenai(ctx *Context, name string, args *TargetOpenaiArgs, opts ...ResourceOption) (*TargetOpenai, error)
    public TargetOpenai(string name, TargetOpenaiArgs? args = null, CustomResourceOptions? opts = null)
    public TargetOpenai(String name, TargetOpenaiArgs args)
    public TargetOpenai(String name, TargetOpenaiArgs args, CustomResourceOptions options)
    
    type: akeyless:TargetOpenai
    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 TargetOpenaiArgs
    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 TargetOpenaiArgs
    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 TargetOpenaiArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TargetOpenaiArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TargetOpenaiArgs
    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 targetOpenaiResource = new Akeyless.TargetOpenai("targetOpenaiResource", new()
    {
        ApiKey = "string",
        ApiKeyId = "string",
        Description = "string",
        KeepPrevVersion = "string",
        Key = "string",
        MaxVersions = "string",
        Model = "string",
        Name = "string",
        OpenaiUrl = "string",
        OrganizationId = "string",
        TargetOpenaiId = "string",
    });
    
    example, err := akeyless.NewTargetOpenai(ctx, "targetOpenaiResource", &akeyless.TargetOpenaiArgs{
    	ApiKey:          pulumi.String("string"),
    	ApiKeyId:        pulumi.String("string"),
    	Description:     pulumi.String("string"),
    	KeepPrevVersion: pulumi.String("string"),
    	Key:             pulumi.String("string"),
    	MaxVersions:     pulumi.String("string"),
    	Model:           pulumi.String("string"),
    	Name:            pulumi.String("string"),
    	OpenaiUrl:       pulumi.String("string"),
    	OrganizationId:  pulumi.String("string"),
    	TargetOpenaiId:  pulumi.String("string"),
    })
    
    var targetOpenaiResource = new TargetOpenai("targetOpenaiResource", TargetOpenaiArgs.builder()
        .apiKey("string")
        .apiKeyId("string")
        .description("string")
        .keepPrevVersion("string")
        .key("string")
        .maxVersions("string")
        .model("string")
        .name("string")
        .openaiUrl("string")
        .organizationId("string")
        .targetOpenaiId("string")
        .build());
    
    target_openai_resource = akeyless.TargetOpenai("targetOpenaiResource",
        api_key="string",
        api_key_id="string",
        description="string",
        keep_prev_version="string",
        key="string",
        max_versions="string",
        model="string",
        name="string",
        openai_url="string",
        organization_id="string",
        target_openai_id="string")
    
    const targetOpenaiResource = new akeyless.TargetOpenai("targetOpenaiResource", {
        apiKey: "string",
        apiKeyId: "string",
        description: "string",
        keepPrevVersion: "string",
        key: "string",
        maxVersions: "string",
        model: "string",
        name: "string",
        openaiUrl: "string",
        organizationId: "string",
        targetOpenaiId: "string",
    });
    
    type: akeyless:TargetOpenai
    properties:
        apiKey: string
        apiKeyId: string
        description: string
        keepPrevVersion: string
        key: string
        maxVersions: string
        model: string
        name: string
        openaiUrl: string
        organizationId: string
        targetOpenaiId: string
    

    TargetOpenai 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 TargetOpenai resource accepts the following input properties:

    ApiKey string
    API key for OpenAI
    ApiKeyId string
    API key ID
    Description string
    Description of the object
    KeepPrevVersion string
    Whether to keep previous version [true/false]. If not set, use default according to account settings
    Key string
    The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
    MaxVersions string
    Set the maximum number of versions, limited by the account settings defaults.
    Model string
    Default model to use with OpenAI
    Name string
    Target name
    OpenaiUrl string
    Base URL of the OpenAI API
    OrganizationId string
    Organization ID
    TargetOpenaiId string
    The ID of this resource.
    ApiKey string
    API key for OpenAI
    ApiKeyId string
    API key ID
    Description string
    Description of the object
    KeepPrevVersion string
    Whether to keep previous version [true/false]. If not set, use default according to account settings
    Key string
    The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
    MaxVersions string
    Set the maximum number of versions, limited by the account settings defaults.
    Model string
    Default model to use with OpenAI
    Name string
    Target name
    OpenaiUrl string
    Base URL of the OpenAI API
    OrganizationId string
    Organization ID
    TargetOpenaiId string
    The ID of this resource.
    apiKey String
    API key for OpenAI
    apiKeyId String
    API key ID
    description String
    Description of the object
    keepPrevVersion String
    Whether to keep previous version [true/false]. If not set, use default according to account settings
    key String
    The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
    maxVersions String
    Set the maximum number of versions, limited by the account settings defaults.
    model String
    Default model to use with OpenAI
    name String
    Target name
    openaiUrl String
    Base URL of the OpenAI API
    organizationId String
    Organization ID
    targetOpenaiId String
    The ID of this resource.
    apiKey string
    API key for OpenAI
    apiKeyId string
    API key ID
    description string
    Description of the object
    keepPrevVersion string
    Whether to keep previous version [true/false]. If not set, use default according to account settings
    key string
    The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
    maxVersions string
    Set the maximum number of versions, limited by the account settings defaults.
    model string
    Default model to use with OpenAI
    name string
    Target name
    openaiUrl string
    Base URL of the OpenAI API
    organizationId string
    Organization ID
    targetOpenaiId string
    The ID of this resource.
    api_key str
    API key for OpenAI
    api_key_id str
    API key ID
    description str
    Description of the object
    keep_prev_version str
    Whether to keep previous version [true/false]. If not set, use default according to account settings
    key str
    The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
    max_versions str
    Set the maximum number of versions, limited by the account settings defaults.
    model str
    Default model to use with OpenAI
    name str
    Target name
    openai_url str
    Base URL of the OpenAI API
    organization_id str
    Organization ID
    target_openai_id str
    The ID of this resource.
    apiKey String
    API key for OpenAI
    apiKeyId String
    API key ID
    description String
    Description of the object
    keepPrevVersion String
    Whether to keep previous version [true/false]. If not set, use default according to account settings
    key String
    The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
    maxVersions String
    Set the maximum number of versions, limited by the account settings defaults.
    model String
    Default model to use with OpenAI
    name String
    Target name
    openaiUrl String
    Base URL of the OpenAI API
    organizationId String
    Organization ID
    targetOpenaiId String
    The ID of this resource.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    ProjectId string
    Project ID
    Id string
    The provider-assigned unique ID for this managed resource.
    ProjectId string
    Project ID
    id String
    The provider-assigned unique ID for this managed resource.
    projectId String
    Project ID
    id string
    The provider-assigned unique ID for this managed resource.
    projectId string
    Project ID
    id str
    The provider-assigned unique ID for this managed resource.
    project_id str
    Project ID
    id String
    The provider-assigned unique ID for this managed resource.
    projectId String
    Project ID

    Look up Existing TargetOpenai Resource

    Get an existing TargetOpenai 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?: TargetOpenaiState, opts?: CustomResourceOptions): TargetOpenai
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_key: Optional[str] = None,
            api_key_id: Optional[str] = None,
            description: Optional[str] = None,
            keep_prev_version: Optional[str] = None,
            key: Optional[str] = None,
            max_versions: Optional[str] = None,
            model: Optional[str] = None,
            name: Optional[str] = None,
            openai_url: Optional[str] = None,
            organization_id: Optional[str] = None,
            project_id: Optional[str] = None,
            target_openai_id: Optional[str] = None) -> TargetOpenai
    func GetTargetOpenai(ctx *Context, name string, id IDInput, state *TargetOpenaiState, opts ...ResourceOption) (*TargetOpenai, error)
    public static TargetOpenai Get(string name, Input<string> id, TargetOpenaiState? state, CustomResourceOptions? opts = null)
    public static TargetOpenai get(String name, Output<String> id, TargetOpenaiState state, CustomResourceOptions options)
    resources:  _:    type: akeyless:TargetOpenai    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
    API key for OpenAI
    ApiKeyId string
    API key ID
    Description string
    Description of the object
    KeepPrevVersion string
    Whether to keep previous version [true/false]. If not set, use default according to account settings
    Key string
    The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
    MaxVersions string
    Set the maximum number of versions, limited by the account settings defaults.
    Model string
    Default model to use with OpenAI
    Name string
    Target name
    OpenaiUrl string
    Base URL of the OpenAI API
    OrganizationId string
    Organization ID
    ProjectId string
    Project ID
    TargetOpenaiId string
    The ID of this resource.
    ApiKey string
    API key for OpenAI
    ApiKeyId string
    API key ID
    Description string
    Description of the object
    KeepPrevVersion string
    Whether to keep previous version [true/false]. If not set, use default according to account settings
    Key string
    The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
    MaxVersions string
    Set the maximum number of versions, limited by the account settings defaults.
    Model string
    Default model to use with OpenAI
    Name string
    Target name
    OpenaiUrl string
    Base URL of the OpenAI API
    OrganizationId string
    Organization ID
    ProjectId string
    Project ID
    TargetOpenaiId string
    The ID of this resource.
    apiKey String
    API key for OpenAI
    apiKeyId String
    API key ID
    description String
    Description of the object
    keepPrevVersion String
    Whether to keep previous version [true/false]. If not set, use default according to account settings
    key String
    The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
    maxVersions String
    Set the maximum number of versions, limited by the account settings defaults.
    model String
    Default model to use with OpenAI
    name String
    Target name
    openaiUrl String
    Base URL of the OpenAI API
    organizationId String
    Organization ID
    projectId String
    Project ID
    targetOpenaiId String
    The ID of this resource.
    apiKey string
    API key for OpenAI
    apiKeyId string
    API key ID
    description string
    Description of the object
    keepPrevVersion string
    Whether to keep previous version [true/false]. If not set, use default according to account settings
    key string
    The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
    maxVersions string
    Set the maximum number of versions, limited by the account settings defaults.
    model string
    Default model to use with OpenAI
    name string
    Target name
    openaiUrl string
    Base URL of the OpenAI API
    organizationId string
    Organization ID
    projectId string
    Project ID
    targetOpenaiId string
    The ID of this resource.
    api_key str
    API key for OpenAI
    api_key_id str
    API key ID
    description str
    Description of the object
    keep_prev_version str
    Whether to keep previous version [true/false]. If not set, use default according to account settings
    key str
    The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
    max_versions str
    Set the maximum number of versions, limited by the account settings defaults.
    model str
    Default model to use with OpenAI
    name str
    Target name
    openai_url str
    Base URL of the OpenAI API
    organization_id str
    Organization ID
    project_id str
    Project ID
    target_openai_id str
    The ID of this resource.
    apiKey String
    API key for OpenAI
    apiKeyId String
    API key ID
    description String
    Description of the object
    keepPrevVersion String
    Whether to keep previous version [true/false]. If not set, use default according to account settings
    key String
    The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
    maxVersions String
    Set the maximum number of versions, limited by the account settings defaults.
    model String
    Default model to use with OpenAI
    name String
    Target name
    openaiUrl String
    Base URL of the OpenAI API
    organizationId String
    Organization ID
    projectId String
    Project ID
    targetOpenaiId String
    The ID of this resource.

    Package Details

    Repository
    akeyless akeyless-community/terraform-provider-akeyless
    License
    Notes
    This Pulumi package is based on the akeyless Terraform Provider.
    Viewing docs for akeyless 2.0.1
    published on Monday, Apr 27, 2026 by akeyless-community
      Try Pulumi Cloud free. Your team will thank you.