Azure OpenAI uses an API key and endpoint to list deployments via the Azure OpenAI REST API. No browser cookies.
Data sources + fallback order
- Azure OpenAI REST API (
/openai/deployments)- No fallback — single-source API strategy.
Credentials (if applicable)
API key resolution (in order):
- Preferences setting
azure.apiToken(stored in Keychain) - Environment variable
AZURE_OPENAI_API_KEY
API endpoints / Probe mechanism
- Strategy:
azure.api(kind:.apiToken) - Endpoint construction:
<endpoint>/openai/deployments?api-version=<version>- Enforces HTTPS — rejects bare
http://to prevent cleartext token leakage. - If endpoint omits the path,
/openai/deploymentsis appended. - If endpoint includes a path, the path is preserved and
/openai/deploymentsis appended after it.
- Enforces HTTPS — rejects bare
- Headers:
api-key: <token>Content-Type: application/json
- Default API version:
2024-10-21
Configuration resolution (in order)
Endpoint:
- Preferences setting
azure.endpoint AZURE_OPENAI_ENDPOINTenv varAZURE_OPENAI_BASE_URLenv var
API version (defaults to 2024-10-21):
- Preferences setting
azure.apiVersion AZURE_OPENAI_API_VERSIONenv var
Deployment filter (optional, for UI highlighting):
- Preferences setting
azure.deployment AZURE_OPENAI_DEPLOYMENTenv var
Parsing + mapping
- Response structure is flexible — accepts
data[]orvalue[]as the top-level container. - Each deployment has
id(orname) andmodel(ormodelName). - Snapshot shows deployment count, up to 3 unique model names, and the target deployment if specified.
- No quota/rate-limit windows —
usedPercentis always 0,hasKnownLimitis false. - Primary
RateWindowlabel: “Deployments”. - Supports model breakdown via
supportsModelBreakdown: true.
Key files
Sources/RunicCore/Providers/Azure/AzureProviderDescriptor.swiftSources/RunicCore/Providers/Azure/AzureUsageFetcher.swift
Read the source ↗ Checked against Runic 2.13.5 · 9730f91