How to Add ATXP to n8n AI Agents
n8n AI agents can now browse the web, call external APIs, summarize documents, and trigger actions across dozens of services. The moment your agent does any of that with a paid API, you have a n8n ai agent payments problem. This guide shows you how to wire ATXP into any n8n workflow using nothing but HTTP Request nodes — no SDK, no Python, no custom code node required.
Why do n8n AI agents need a payment layer?
n8n’s AI Agent node is deceptively powerful. Connect an LLM, attach a few tools, and you have an agent that can autonomously decide to call SerpAPI, a web scraping service, an image generation endpoint, or any custom API you’ve built. Each of those calls may cost money.
Without a payment layer, here’s what you’re actually doing:
- Embedding your personal API keys directly into n8n credentials
- Giving every workflow access to the same key with no per-workflow spending cap
- Having zero visibility into which workflow spent what
- Running no circuit breaker when a misconfigured agent loops and calls an API 400 times
That last one isn’t hypothetical. n8n’s “loop until condition” pattern combined with an LLM that misreads its exit condition is exactly the kind of scenario that generates a $300 Serper bill at 2am. The real cost of managing multiple API credentials yourself compounds fast at workflow scale.
ATXP solves this at the infrastructure level. Each n8n workflow gets its own ATXP agent identity with a hard spend cap. When the budget is exhausted, calls stop — not because you wrote a try/catch, but because ATXP enforces it before the request ever leaves your workflow.
How does ATXP’s HTTP integration work with n8n?
ATXP exposes a REST API. n8n speaks REST natively via its HTTP Request node. That’s the entire integration surface — no SDK, no npm install, no Code node required.
The pattern has three parts:
- Register an agent — one-time call to create an agent identity with a name and initial budget
- Fund the agent — add credits via the ATXP dashboard or API
- Route tool calls through ATXP — instead of calling SerpAPI directly, you call ATXP’s search endpoint using your agent key. ATXP deducts from the budget and proxies the request.
For n8n builders, step 3 is the key shift. You’re replacing https://serpapi.com/search with https://api.atxp.ai/v1/search and swapping your SerpAPI key for your ATXP agent key. The response format is compatible. The tool call itself doesn’t change from the LLM’s perspective.
Here’s how the request mapping looks:
| What you had | What you use with ATXP |
|---|---|
POST serpapi.com/search with SerpAPI key | POST api.atxp.ai/v1/search with ATXP agent key |
POST api.stability.ai/generate with Stability key | POST api.atxp.ai/v1/image with ATXP agent key |
POST api.sendgrid.com/mail/send with SendGrid key | POST api.atxp.ai/v1/email/send with ATXP agent key |
| Direct Perplexity, Browserless, etc. | ATXP-proxied equivalents |
Your SerpAPI key, Stability key, and SendGrid key never enter n8n at all. They live in ATXP. n8n holds one credential: your ATXP agent API key.
Setting up ATXP credentials in n8n
Before building the workflow, store your ATXP agent key as an n8n credential.
Step 1: Create an ATXP account and register an agent
Go to atxp.ai and create an account. From the dashboard, create a new agent:
POST https://api.atxp.ai/v1/agents
Authorization: Bearer YOUR_ATXP_ACCOUNT_KEY
{
"name": "n8n-research-agent",
"budget": 10.00,
"currency": "USD"
}
The response includes your agent_id and agent_key. The agent_key is what goes into n8n.
Step 2: Add an n8n credential
In n8n, go to Credentials → New → Header Auth:
- Name:
ATXP Agent Key - Name field:
Authorization - Value field:
Bearer YOUR_AGENT_KEY
Save it. This credential is now available to any HTTP Request node in any workflow.
Step 3: Wire your first tool call
In your AI Agent node, add a tool. For most n8n builders, this means adding an HTTP Request tool:
Method: GET
URL: https://api.atxp.ai/v1/search
Authentication: Predefined Credential Type → Header Auth → ATXP Agent Key
Query Parameters:
q: {{ $fromAI('query', 'The search query') }}
That’s the complete tool definition. The AI Agent node will call this HTTP Request whenever it decides it needs to search the web. Each call debits your agent’s budget.
How do you set a budget limit at the workflow level?
This is where ATXP’s model differs from just using an API key directly. Budget limits are defined on the agent, not on the API key.
When you created the agent above, you set "budget": 10.00. That’s a hard cap. When the balance hits zero, ATXP returns a 402 Payment Required and your n8n workflow either stops or hits your fallback branch — whichever you’ve configured.
For production workflows, you’ll want to handle this explicitly. Add an IF node after each ATXP tool call that checks for a 402 status:
Condition: {{ $json.statusCode }} equals 402
True branch: Send Slack alert → Stop workflow
False branch: Continue processing
This gives you a clean failure path rather than a generic HTTP error bubbling up through the agent.
Per-workflow agent isolation
The key control mechanism: give each workflow its own agent identity.
| Workflow | Agent Name | Budget | Reset |
|---|---|---|---|
| Daily SEO Research | n8n-seo-agent | $5/day | Daily via cron |
| Client Report Generator | n8n-report-agent | $20/run | Per-run |
| Product Monitor | n8n-monitor-agent | $2/day | Daily |
| Support Ticket Triage | n8n-support-agent | $1/day | Daily |
Budget resets happen via the ATXP API — add an HTTP Request node at the start of any workflow that should refresh its budget each run:
POST https://api.atxp.ai/v1/agents/YOUR_AGENT_ID/topup
Authorization: Bearer YOUR_ATXP_ACCOUNT_KEY
{
"amount": 5.00
}
Chain this before the AI Agent node and your workflow self-funds on each execution.
Ready to add payment infrastructure to your n8n agents? Create a free ATXP account at atxp.ai and have your first agent running with a budget in under 10 minutes.
What tools can ATXP proxy for n8n agents?
ATXP covers 14+ tool categories accessible via the same unified API:
| Tool Category | ATXP Endpoint | Replaces |
|---|---|---|
| Web search | /v1/search | SerpAPI, Serper, Brave Search |
| Web scraping / browse | /v1/browse | Browserless, Firecrawl |
| Image generation | /v1/image | Stability AI, DALL-E direct |
| Email send | /v1/email/send | SendGrid, Mailgun |
| Email receive | /v1/email/inbox | Inbound parsing services |
| SMS | /v1/sms/send | Twilio |
| LLM calls | /v1/llm | OpenAI, Anthropic, Gemini |
| X/Twitter search | /v1/twitter/search | Twitter API v2 |
For n8n, this matters because you can replace 8 different credential configurations with one. Your AI Agent node’s tools all authenticate identically — ATXP agent key in the header, endpoint changes, same HTTP Request node template.
How do you track what your n8n agent actually spent?
After a workflow run, query the agent’s transaction log:
GET https://api.atxp.ai/v1/agents/YOUR_AGENT_ID/transactions
Authorization: Bearer YOUR_ATXP_ACCOUNT_KEY
Response:
{
"transactions": [
{
"timestamp": "2026-04-23T14:22:01Z",
"tool": "search",
"query": "competitor pricing 2026",
"cost_usd": 0.003,
"balance_after": 4.997
},
{
"timestamp": "2026-04-23T14:22:18Z",
"tool": "browse",
"url": "https://example.com/pricing",
"cost_usd": 0.010,
"balance_after": 4.987
}
]
}
Add an HTTP Request node at the end of any workflow to pull this and send it to a Slack channel or Google Sheet. You get a per-run cost receipt with full tool-call attribution — something you can’t get from raw API key usage.
This is meaningfully different from LLM token billing. ATXP tracks every tool call, not just the model inference. When your agent searches three times, scrapes two pages, and generates one image, you see all five charges with timestamps. For more on how agents should track and cap external API costs, see how ATXP’s IOU model caps agent spending and the broader framing in how agents pay for API calls.
Does ATXP work with n8n’s native tool nodes?
n8n ships with built-in integrations for SerpAPI, Wikipedia, Calculator, and a few others as native tool types in the AI Agent node. ATXP doesn’t replace these at the node level — you’ll continue using n8n’s native SerpAPI node if you have a direct SerpAPI key.
The ATXP pattern is for the HTTP Request tool type: any API call you’re routing through an HTTP Request node as a tool can be routed through ATXP instead.
For API categories where ATXP has a native proxy (search, browse, image, email), replacing the direct API call with ATXP gives you budget enforcement. For everything else — n8n’s native database nodes, CRM nodes, calendar nodes — those continue to operate on their own credentials and billing. ATXP doesn’t intercept non-API tool calls.
How do you give an n8n agent a real budget without writing code?
For n8n builders who want zero-code budget setup:
- Create an ATXP agent via the dashboard (no API call needed)
- Fund it via the dashboard payment flow (Stripe or crypto)
- Copy the agent key into n8n’s Header Auth credential
- Set all HTTP tool calls to use that credential
- Set a budget alert threshold in the ATXP dashboard (email when balance drops below $X)
That’s the complete no-code path. The dashboard handles agent creation, funding, and alerts. n8n handles workflow execution. ATXP enforces the budget at the API gateway level.
For teams or client-facing workflows, the pattern scales: one ATXP account, one agent per client or workflow, separate budgets, separate transaction logs. The client-isolation model maps cleanly to n8n’s folder-based workflow organization.
For more on the underlying mechanics of agent budget design, how to give an AI agent a budget covers the decision framework in depth. And if you’re evaluating whether to build a direct API integration or use ATXP as the gateway, how to build an AI agent without API keys walks through the tradeoffs.
FAQ
Does ATXP require a code node in n8n?
No. Every ATXP interaction is a plain HTTP request. n8n’s built-in HTTP Request node handles all of it — authentication via Header Auth credential, JSON body for POST requests, query params for GET requests. No Code node, no Function node, no npm packages.
What happens when an n8n agent exhausts its ATXP budget mid-workflow?
ATXP returns HTTP 402. n8n treats this as a failed HTTP request. If your AI Agent node is configured to continue on error, it may attempt to recover — add an explicit IF node checking for 402 on each tool call if you want deterministic budget-exhaustion behavior. The agent stops spending the moment the balance hits zero; no charges accumulate after that.
Can I share one ATXP agent key across multiple n8n workflows?
Yes, but it’s not recommended. Sharing a key means sharing a budget and a transaction log — you lose per-workflow attribution. The correct pattern is one ATXP agent per workflow (or per client, if you’re building client-facing automations). Agent creation is free; you only pay for actual tool usage. The overhead of separate agents is administrative, not financial.
Does ATXP work with self-hosted n8n?
Yes. ATXP is a hosted API — your n8n instance makes outbound HTTPS calls to api.atxp.ai. Whether your n8n is on n8n.cloud, a VPS, or running locally, the integration is identical as long as your n8n instance has outbound internet access.
Can ATXP handle multiple tool calls within a single agent run?
Yes. Each tool call is a separate HTTP request with a separate transaction. The agent’s balance decrements after each call. If the agent makes 10 tool calls in a single workflow execution, you get 10 transaction records and 10 balance decrements. The budget cap applies cumulatively across the run.