OpenAI Chat Completions transport adapter. Covers OpenAI, OpenRouter, DeepSeek, and other OpenAI-compatible providers.
OpenAI Chat Completions transport adapter. Covers OpenAI, OpenRouter, DeepSeek, and other OpenAI-compatible providers.
(azure-url-builder profile _request path)URL builder for Azure OpenAI deployments. Composes {base-url}/openai/deployments/{deployment}{path}?api-version=... Reads :azure/deployment and :azure/api-version off the profile.
URL builder for Azure OpenAI deployments. Composes
{base-url}/openai/deployments/{deployment}{path}?api-version=...
Reads :azure/deployment and :azure/api-version off the profile.(build-alias-profile spec)Construct an OpenAI-compat provider profile from a spec map.
Spec keys: :id required, e.g. :mistral :base-url required, e.g. "https://api.mistral.ai/v1" :env-var-names vector of env-var name strings :auth-strategy defaults :bearer :auth-header-name only with :api-key-header :default-headers optional map :capabilities defaults #{:chat :streaming :tools} :quirks optional map: :drops #{:k1 :k2} strip body keys :thinking-explicit send :thinking dict :supports-model-listing? defaults true :supported-params optional set (carried as :profile/supported-params enforces drop+warn)
Construct an OpenAI-compat provider profile from a spec map.
Spec keys:
:id required, e.g. :mistral
:base-url required, e.g. "https://api.mistral.ai/v1"
:env-var-names vector of env-var name strings
:auth-strategy defaults :bearer
:auth-header-name only with :api-key-header
:default-headers optional map
:capabilities defaults #{:chat :streaming :tools}
:quirks optional map:
:drops #{:k1 :k2} strip body keys
:thinking-explicit send :thinking dict
:supports-model-listing? defaults true
:supported-params optional set (carried as
:profile/supported-params
enforces drop+warn)(register-alias! spec)Register an OpenAI-compat alias profile in one call.
Register an OpenAI-compat alias profile in one call.
(register-azure-deployment!
{:keys [id endpoint deployment api-version env-var-names auth-strategy
auth-header-name capabilities quirks default-headers]
:or {auth-strategy :api-key-header
auth-header-name "api-key"
capabilities #{:tools :reasoning :chat :json-schema :streaming}
quirks {}
default-headers {}}})Register an Azure OpenAI deployment as a provider profile.
Required: :id keyword id for the profile (e.g. :azure-gpt4o-prod) :endpoint base URL, e.g. "https://my-rg.openai.azure.com" (no trailing slash, no /openai/deployments/...) :deployment the deployment name configured in the Azure portal :api-version e.g. "2024-08-01-preview"
Optional: :env-var-names vector of env-var names to read the API key from (defaults to ["AZURE_OPENAI_API_KEY"]) :auth-strategy :api-key-header (default) or :bearer (AAD) :auth-header-name defaults to "api-key" (only used with :api-key-header). Set to "Authorization" or pass :auth-strategy :bearer for AAD bearer. :capabilities defaults #{:chat :streaming :tools :json-schema :reasoning} :quirks optional quirks map passed through verbatim :default-headers optional map merged into outgoing headers
Register an Azure OpenAI deployment as a provider profile.
Required:
:id keyword id for the profile (e.g. :azure-gpt4o-prod)
:endpoint base URL, e.g. "https://my-rg.openai.azure.com"
(no trailing slash, no /openai/deployments/...)
:deployment the deployment name configured in the Azure portal
:api-version e.g. "2024-08-01-preview"
Optional:
:env-var-names vector of env-var names to read the API key from
(defaults to ["AZURE_OPENAI_API_KEY"])
:auth-strategy :api-key-header (default) or :bearer (AAD)
:auth-header-name defaults to "api-key" (only used with
:api-key-header). Set to "Authorization" or
pass :auth-strategy :bearer for AAD bearer.
:capabilities defaults #{:chat :streaming :tools
:json-schema :reasoning}
:quirks optional quirks map passed through verbatim
:default-headers optional map merged into outgoing headerscljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |