# OpenAIModelResource

- Kind: `class`
- Package: [Aspire.Hosting.OpenAI](/reference/api/csharp/aspire.hosting.openai.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.OpenAI`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.OpenAI/OpenAIModelResource.cs)
- Inherits: `Resource`
- Implements: `IExpressionValue`, `IManifestExpressionProvider`, `IResource`, `IResourceWithConnectionString`, `IResourceWithParent`, `IResourceWithParent<OpenAIResource>`, `IValueProvider`, `IValueWithReferences`

Represents an OpenAI Model resource.

## Definition

```csharp
namespace Aspire.Hosting.OpenAI;

public class OpenAIModelResource
    : Aspire.Hosting.ApplicationModel.Resource,
      Aspire.Hosting.ApplicationModel.IExpressionValue,
      Aspire.Hosting.ApplicationModel.IManifestExpressionProvider,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithConnectionString,
      Aspire.Hosting.ApplicationModel.IResourceWithParent,
      Aspire.Hosting.ApplicationModel.IResourceWithParent<Aspire.Hosting.OpenAI.OpenAIResource>,
      Aspire.Hosting.ApplicationModel.IValueProvider,
      Aspire.Hosting.ApplicationModel.IValueWithReferences
{
    // ...
}
```

## Constructors

- [OpenAIModelResource(string, string, OpenAIResource)](/reference/api/csharp/aspire.hosting.openai/openaimodelresource/constructors.md#constructor-string-string-openairesource) -- Initializes a new instance of the [OpenAIModelResource](/reference/api/csharp/aspire.hosting.openai/openaimodelresource.md) class.

## Properties

- [ConnectionStringExpression](/reference/api/csharp/aspire.hosting.openai/openaimodelresource/properties.md#connectionstringexpression) : `ReferenceExpression` `get` -- Gets the connection string expression for the OpenAI Model resource.
- [Model](/reference/api/csharp/aspire.hosting.openai/openaimodelresource/properties.md#model) : `string` `get; set` -- Gets or sets the model name, e.g., "gpt-4o-mini".
- [Parent](/reference/api/csharp/aspire.hosting.openai/openaimodelresource/properties.md#parent) : [OpenAIResource](/reference/api/csharp/aspire.hosting.openai/openairesource.md) `get` -- Parent OpenAI account resource from which settings (like API key) can be shared.
