# OpenAIModelResource Constructors

- Package: [Aspire.Hosting.OpenAI](/reference/api/csharp/aspire.hosting.openai.md)
- Type: [OpenAIModelResource](/reference/api/csharp/aspire.hosting.openai/openaimodelresource.md)
- Kind: `Constructors`
- Members: `1`

Represents an OpenAI Model resource.

## OpenAIModelResource(string, string, OpenAIResource)

- Name: `Constructor(string, string, OpenAIResource)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.OpenAI/OpenAIModelResource.cs#L27-L32)

Initializes a new instance of the [OpenAIModelResource](/reference/api/csharp/aspire.hosting.openai/openaimodelresource.md) class.

```csharp
public class OpenAIModelResource
{
    public OpenAIModelResource(
        string name,
        string model,
        OpenAIResource parent)
    {
        // ...
    }
}
```

## Parameters

- `name` (`string`)
  The name of the resource.
- `model` (`string`)
  The model name.
- `parent` ([OpenAIResource](/reference/api/csharp/aspire.hosting.openai/openairesource.md))
  The parent OpenAI resource.

## Remarks

The API key is owned by the parent [OpenAIResource](/reference/api/csharp/aspire.hosting.openai/openairesource.md).
