ApiVersion Property  
 

Sets or returns the API version used when a provider requires an explicit version string.

Syntax

object.ApiVersion [= value ]

Remarks

The ApiVersion property is a String value that specifies the API version used when communicating with providers that require an explicit version identifier as part of the request. Applications should only set this property if the provider documentation specifically requires an API version. Preview or experimental API versions may introduce compatibility changes and should be used with caution in production applications.

Some providers, particularly Microsoft Foundry and Azure OpenAI deployments, require applications to specify an API version string with each request. The version identifies the format and capabilities of the service endpoint being used. The version string is typically assigned by the provider and may correspond to a specific release date or preview version. For example, a Foundry deployment may require an API version such as "2024-05-01-preview" or "2024-10-21". If an incorrect or unsupported version is specified, the provider may reject the request or return an error indicating that the requested API version is invalid.

Providers may also use API versions internally through request headers rather than query parameters. For example, Anthropic requests include a version header that identifies the expected API behavior. In most cases, the control will automatically provide the appropriate default value and the application does not need to explicitly set this property.

Data Type

String

See Also

BaseUrl Property, Provider Property, ProviderName Property, Connect Method