Pay-i Azure AI Foundry (Proxy) icon

Pay-i Azure AI Foundry (Proxy)

Azure AI Foundry chat model routed through Pay-i proxy for cost tracking and budget enforcement

Pay-i Azure AI Foundry (Proxy)

AI-generated

Summary

Supplies a LangChain ChatOpenAI language model to an n8n AI chain or agent. It sends requests to an Azure OpenAI deployment through the Pay-i proxy, so usage is tracked for cost attribution and limits.

Inputs

  • deploymentName (required) — Azure OpenAI deployment name (not the model name). It goes into the proxy URL path and is also sent as the xProxy-PriceAs-Resource header.
  • apiVersion (required) — Azure API version, sent as the api-version query parameter. Default is 2024-08-01-preview. If blank, the node uses the Azure credential's apiVersion, then falls back to 2024-08-01-preview.
  • options — Model settings: temperature, maxTokens (-1 means no limit), topP, frequencyPenalty and presencePenalty. They are passed straight to ChatOpenAI. The source also reads timeout and maxRetries (default 2) from this collection, but the UI doesn't expose them.
  • userId — User identifier for cost attribution, sent as xProxy-User-ID.
  • useCaseName — Use case name, sent as xProxy-UseCase-Name. Defaults to the workflow name with spaces replaced by hyphens.
  • useCaseId — Use case instance ID, sent as xProxy-UseCase-ID. Defaults to the n8n execution ID.
  • useCaseStep — Step label, sent as xProxy-UseCase-Step. If left blank or at the default 'Pay-i Azure AI Foundry (Proxy)', the node's canvas name is used instead.
  • advancedTracking — Collection to use only with Pay-i Support guidance: useCaseVersion, useCaseProperties (JSON), limitIds (comma-separated limits to enforce) and debugLogging, which logs request details to the n8n server console with API keys masked. The UI also lists flattenContent (Gemini), but this node's source doesn't use it.
  • credentials: payiApi (required) — Pay-i base URL and API key.
  • credentials: azureOpenAiApi (required) — Azure API key, plus an endpoint or resource name (the endpoint is used if set) and an optional API version.

Output shape

A single AI Language Model connection (output 'Model') carrying a configured ChatOpenAI instance. It has no data items and is meant to be wired into the language model input of an AI Agent or chain node.

Requests go to {payiBaseUrl}/api/v1/proxy/azure.openai/openai/deployments/{deploymentName}. Headers carry the Pay-i API key, the upstream Azure endpoint, the Azure api-key and the tracking values. Header values are sanitized to ASCII, so smart quotes and dashes are folded and other non-ASCII characters are dropped. Tracking headers are only sent when their values are non-empty. Calls are traced through n8n's LLM tracing, and failed attempts go through n8n's retry handler.

Examples

Example 1: Route an AI Agent's Azure GPT-4o calls through Pay-i for per-user cost tracking

Set Deployment Name to your Azure deployment, keep the default API Version, set User ID to {{ $json.userId }}, and select both the Pay-i and Azure OpenAI credentials. Connect the Model output to the AI Agent.

Links

Discussion