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.klanex.dev/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)
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.
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.
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.klanex.dev/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"}
No inference markup, no seat licenses. You're charged when klanex successfully executes on your behalf.
while in early access
fractions of a cent per successful call
for teams putting agents near money
klanex is in early access — we're onboarding design partners now.