Pay-i Proxy icon

Pay-i Proxy

Send LLM requests through Pay-i proxy for cost tracking and budget enforcement

Pay-i Proxy

AI-generated

Summary

Send LLM messages through the Pay-i proxy to OpenAI, Anthropic, Azure OpenAI, AWS Bedrock, or Databricks, attaching cost attribution and optional budget-limit tracking. Make one request per incoming item and return the provider response.

Inputs

  • provider — Select the provider; defaults to OpenAI.
  • providerApiKey (required) — Provider API key or token; for Bedrock, supply the AWS access key ID. Databricks uses its separate credential instead.
  • model (required) — Model ID for OpenAI, Anthropic, or Bedrock; defaults to gpt-4o. Azure uses the deployment name for routing, and Databricks uses the serving endpoint.
  • azureDeploymentName (required) — Azure OpenAI deployment to call; required when Azure OpenAI is selected.
  • azureApiVersion — Azure API version; defaults to 2024-02-01.
  • bedrockSecretKey (required) — AWS secret access key; required for Bedrock.
  • bedrockSessionToken — Optional AWS session token for temporary Bedrock credentials.
  • bedrockRegion — Bedrock region; defaults to us-east-1.
  • databricksEndpointName (required) — Databricks serving endpoint name. Workspace URL and access token come from the Databricks credential.
  • databricksCloudProvider (required) — Databricks hosting cloud used for pricing: AWS, Azure, or Google Cloud; defaults to AWS.
  • messages (required) — JSON message array added to the provider request body unless a raw body is supplied. Use the selected provider's message format; Anthropic requests also default to max_tokens: 1024.
  • rawBody — Optional JSON replacement for the entire request body, including messages and model fields. Provider routing, authentication, pricing, and tracking headers still use the configured parameters.
  • userId — Optional user identifier sent to Pay-i for cost attribution.
  • useCaseName — Tracking name; defaults to the workflow name with spaces replaced by hyphens.
  • useCaseId — Use case instance identifier; defaults to the n8n execution ID.
  • useCaseStep — Tracking label for this step; defaults to Pay-i Proxy.
  • advancedTracking — Optional use case version, JSON properties, and comma-separated limit IDs sent as tracking headers. The nested Flatten Gemini Content and Debug Logging options are declared but unused by this operation.
  • includeCostData — Defaults to true. Rename a top-level xproxy_result response field to payiCost; when false, remove that field.
  • returnFullResponse — Include HTTP status and response headers alongside the response body; defaults to false.
  • debugLogging — Log request URL, partially masked authentication headers, a body summary, and a response preview to the n8n logger. Defaults to false; string body values and response content may appear in logs.

Output shape

One JSON response item per incoming item, containing the provider response or the full HTTP response when requested.

Provider response structure varies and is not normalized to generated text. Cost handling only checks top-level xproxy_result, so cost data nested inside a full response body is not renamed or removed. With Continue On Fail enabled, failed items return {"error":"..."}. Requires Pay-i credentials with an HTTPS base URL.

Links

Discussion