Enterprise service bus, rebuilt for agentic AI
The asynchronous execution layer between LLM agents and production APIs. Fire a tool-use intent, get an execution ID in milliseconds — klanex owns the retries, backoff, approvals, credentials, and audit trail, so a hallucinated JSON key or a rate limit never crashes your workflow.
$ curl -s https://api.klanexai.com/v1/executions -H "X-API-Key: klx_…" -d '{
"target": { "url": "https://api.stripe.com/v1/refunds", "headers": { "Authorization": "Bearer …" } },
"payload": { "charge_id": "ch_9f2k", "amount": 500 },
"payload_schema": { … }, "idempotency_key": "refund-ch_9f2k", "requires_approval": true }'
{"execution_id": "exe_4d0c85a6", "status": "PENDING_APPROVAL"} # 14 ms — agent is free
─ human clicks Approve in Slack ───────────────────────────────────────────
─ attempt 1 → stripe returns 429 · klanex backs off, agent never knows ───
─ attempt 2 → 200 OK ──────────────────────────────────────────────────────
webhook → execution.completed (attempts: 2, HMAC-signed, credentials never left the vault)
Grab a free sandbox key with one command — no account, no card — and wire klanex into your agent as MCP tools. Works in Claude Code, Cursor, VS Code, and Windsurf.
# 1. grab a free sandbox key (no signup, no card, 100 executions)
curl -sX POST https://api.sandbox.klanexai.com/playground/key
{"api_key": "klx_test_9f2k…", "mcp_url": "https://api.sandbox.klanexai.com/mcp", …}
# 2. add klanex to your agent as tools (Claude Code shown)
claude mcp add --transport http klanex https://api.sandbox.klanexai.com/mcp \
--header "X-API-Key: klx_test_9f2k…"
# your agent now has execute · get_execution · list_executions · replay · get_usage
# stdio-only client? use: KLANEX_API_KEY=klx_test_… npx -y klanex-mcp
Sandbox keys are disposable (Stripe test mode, auto-expire after 7 days). Want the full walkthrough, including how to make the retries fire? Open the sandbox guide →
Ready for production? Create a durable account →
One invented JSON key and your five-step workflow dies at step three — with the API's cryptic 400 lost far from the model that caused it.
An agent thinks for 30–60 seconds. Held-open HTTP connections time out, and every timeout takes the agent's operational context with it.
Nobody wants raw production API keys floating through a generative environment — or an agent autonomously refunding customers unsupervised.
klanex closes the synchronous loop in milliseconds, then executes on its own terms: queued, retried, supervised, recorded.
Every intent is checked against your JSON Schema. Hallucinations bounce back instantly with an llm_hint the agent uses to fix itself.
Valid intents are persisted to the audit trail and queued. Your agent gets 202 + execution_id and moves on with its life.
Isolated workers make the real call with per-host circuit breakers, timeouts, and exponential backoff on 429s, 5xxs, and outages.
Terminal states fire an HMAC-signed webhook to your backend — or poll the API. Either way, the full history is queryable forever.
Invalid payloads are rejected in milliseconds with an llm_hint written to be pasted straight back into the model's context.
429 / 5xx / timeouts are absorbed with exponential backoff and per-host breakers. Permanent 4xxs fail fast with a correction hint.
Flag destructive calls with requires_approval. They pause until a human approves or rejects — right from a Slack button. Approvals never carry over to replays.
Pass an idempotency_key and network retries can never double-refund, double-email, or double-anything.
Your API keys are encrypted with Cloud KMS the moment they arrive, decrypted only in worker memory for the duration of the call, and redacted everywhere else.
How it works →Payloads are stored byte-exact. After an outage, one bulk-replay call re-runs every failure — no expensive second trip through the LLM, and permanently rejected payloads are skipped automatically.
Every intent, attempt, decision, and result is recorded and queryable — the compliance story your enterprise buyers will ask about first.
Results arrive HMAC-signed with replay protection. SDK verification is one function call, byte-compatible across Go, TypeScript, and Python.
Token buckets per API key keep a runaway agent loop from taking the platform — or your budget — down with it.
Configure once with a single API call — credentials are sealed in the KMS vault like everything else.
Executions awaiting approval post to Slack with Approve / Reject buttons. Clicks are verified against Slack's request signature, the decision lands in the audit trail as via Slack by @you, and the message updates with the outcome. Optional failure alerts included.
When an execution fails terminally, klanex files an issue in your project: execution ID, target, attempts, error code, and one-line replay instructions. No payload contents ever leave the vault. Nothing to triage by hand at 2am.
Every lifecycle event fires an HMAC-signed webhook, and the full audit trail is queryable through the OpenAPI-specified REST API — wire up Teams, PagerDuty, or your own dashboard.
Model Context Protocol
klanex is a Model Context Protocol server. Point any MCP-capable client — Claude Code, Claude Desktop, Cursor, VS Code, Windsurf — at the hosted endpoint and your agent gets the whole reliability engine as native tools. No SDK, no glue code.
$ claude mcp add --transport http klanex https://api.klanexai.com/mcp \
--header "X-API-Key: klx_…"
# your agent can now call, as native tools:
execute get_execution list_executions replay_execution get_usage list_connections
$ npx -y klanex-mcp # stdio, for Claude Desktop and other stdio-only clients
Six tools cover submit, poll, list, replay, usage, and stored credentials — every guarantee from the REST API, callable by the model itself.
A schema-rejected payload returns as a tool error carrying the llm_hint, so the model self-corrects without ever leaving the conversation.
Use the hosted Streamable HTTP endpoint directly, or npx -y klanex-mcp for stdio-only clients. Free sandbox keys to try it end to end.
Listed on the official MCP Registry · npm · GitHub
Official SDKs for TypeScript and Python, or plain HTTP from anything else. The 422 self-correction loop comes free.
import { Klanex, KlanexSchemaError } from "@klanex/sdk";
const klanex = new Klanex({ apiKey, baseUrl });
try {
const { executionId } = await klanex.execute({
target: { url: "https://api.stripe.com/v1/refunds", headers: { Authorization: key } },
payload: agentGeneratedJson,
payloadSchema: refundSchema,
idempotencyKey: `refund-${chargeId}`,
});
} catch (err) {
if (err instanceof KlanexSchemaError) {
// feed the hint back — the agent fixes its own payload
messages.push({ role: "user", content: err.llmHint });
return retryWithLLM(messages);
}
}
from klanex import Klanex, KlanexSchemaError
klanex = Klanex(api_key=API_KEY, base_url=BASE_URL)
try:
accepted = klanex.execute(
target={"url": "https://api.stripe.com/v1/refunds",
"headers": {"Authorization": key}},
payload=agent_generated_json,
payload_schema=refund_schema,
idempotency_key=f"refund-{charge_id}",
)
except KlanexSchemaError as err:
# feed the hint back — the agent fixes its own payload
messages.append({"role": "user", "content": err.llm_hint})
return retry_with_llm(messages)
$ curl -s https://api.klanexai.com/v1/executions \
-H "X-API-Key: klx_…" \
-d '{
"target": { "url": "https://api.stripe.com/v1/refunds",
"headers": { "Authorization": "Bearer …" } },
"payload": { "charge_id": "ch_9f2k", "amount": 500 },
"payload_schema": { "type": "object", "required": ["charge_id", "amount"] },
"idempotency_key": "refund-ch_9f2k"
}'
{"execution_id": "exe_4d0c85a6", "status": "QUEUED"}
Flat monthly plans with generous execution volume — no inference markup, no seat licenses. You pay per execution; retries and schema-rejected payloads are always free.
For trying klanex.
Your first agent in production.
Agents doing real volume.
Volume execution pricing, SSO & custom SLA, custom data retention, and priority support — for teams putting agents near money.
Start free — 1,000 executions a month, the full reliability engine, no credit card to explore.