Pay-i Anthropic (Proxy) icon

Pay-i Anthropic (Proxy)

Anthropic chat model routed through Pay-i proxy for cost tracking and budget enforcement

Pay-i Anthropic (Proxy)

AI-generated

Summary

Supplies an Anthropic Claude chat model (LangChain ChatAnthropic) to an n8n AI chain or agent, routing requests through the Pay-i proxy so usage is tracked for cost attribution and limits can be enforced.

Inputs

  • model (required) — Anthropic model ID (default claude-sonnet-4-6). Also sent to Pay-i as the xProxy-PriceAs-Resource header for pricing.
  • options — Collection with Maximum Number of Tokens (default 4096), Sampling Temperature, Top K, Top P, Enable Thinking, and Thinking Budget (min 1024, default 10000). When thinking is enabled, temperature, top K and top P are hidden and not sent. max_tokens is still sent.
  • userId — User identifier for cost attribution (xProxy-User-ID header).
  • useCaseName — Use case name for tracking. Defaults to the workflow name with spaces replaced by hyphens.
  • useCaseId — Use case instance ID. Defaults to the n8n execution ID, so each run is its own use case.
  • useCaseStep — Step label within the use case. If left empty or at the default 'Pay-i Anthropic (Proxy)', the node's canvas name is used instead.
  • advancedTracking — Collection to use with Pay-i Support guidance: Use Case Version, Use Case Properties (JSON), Limit IDs (comma-separated limits to enforce), Flatten Gemini Content (declared but not used by this node), and Debug Logging (logs URL and headers to the server console, with the Pay-i API key masked).

Output shape

A single LangChain ChatAnthropic model object on the AI Language Model connector, not item data. Connect it to an AI Agent, chain or other node that accepts a language model.

Requires two credentials: payiApi (base URL and API key) and anthropicApi (API key). Requests go to {payiBaseUrl}/api/v1/proxy/anthropic with xProxy-* headers. Header values are sanitized to ASCII, with typographic characters folded and other non-ASCII dropped. Token usage is reported to n8n via N8nLlmTracing. No call is made until the downstream node invokes the model.

Examples

Example 1: Track Claude costs per workflow run in an AI Agent

Model claude-sonnet-4-6, leave tracking fields at defaults, and connect to the Agent's Chat Model input. Each execution appears in Pay-i as its own use case.

Example 2: Enable extended thinking

Options: Enable Thinking on, Thinking Budget 8000, Maximum Number of Tokens 16000.

Example 3: Attribute spend to a user and enforce a budget limit

Set User ID to the customer's ID, Use Case Step to 'Step 1 - Outline', and Advanced Tracking > Limit IDs to your Pay-i limit ID.

Links

Discussion