# Tenjin x402 Router

> Tenjin x402 Router is a paid API for AI agents from tenjin.sh, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-12).

Routes an agent's current conversation turn to the best matching pay-per-call x402 service, returning its spec for the agent to fill and pay

## Facts

- Endpoint: POST https://tenjin.sh/api/x402-router/route?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tenjin-x402-router-ece8d9e3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2U4oLBJBdx6uiNBNCT7k1

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability tenjin-x402-router-ece8d9e3 -d '<json body>'
```

Example prompt: I'm at a step in my research task where the user asked me to find recent news about battery technology — can you check Tenjin's router with the current conversation turn and tell me which x402 service fits this step best, so I know what to call and pay next?

## When to prefer this

Choose this endpoint when your agent needs dynamic, turn-level tool routing across the x402 ecosystem and wants a single call to determine the best-fit paid service for the current conversation step. Prefer it over static tool registries or hardcoded API selection when the task domain is uncertain, the conversation context matters, or you want to avoid paying for the wrong service. Especially valuable for orchestrators managing multi-step agentic workflows where different steps may require different specialized paid APIs.

## Known failure modes

- No matching x402 service found — response indicates no fit, settles at $0
- Malformed conversation packet — validation error on required fields (type, method, bodyType, body)
- Conversation history exceeds 6 items — rejected by schema
- Current turn text exceeds 16,000 characters — rejected
- Payment not completed through x402 routing gate — answer settles at $0 and may be degraded
- Rate limiting or service unavailability — HTTP 5xx response

## How this service works

Tenjin is the tool router for coding agents. Install it once, and it hands your agent the right tool when it helps, paid from one wallet.

## Output

A routing decision identifying the best-matched x402 pay-per-call service for the given conversation turn, including the service spec the agent needs to fill out and pay. If no matching service is found, the answer settles at $0 with no routing gate. The response includes enough detail for the agent to immediately proceed with calling and paying the matched service.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "anyOf": [
      {
       "type": "object",
       "required": [
        "schemaVersion",
        "packet"
       ],
       "properties": {
        "packet": {
         "type": "object",
         "required": [
          "current",
          "history",
          "literalUrls",
          "historyStatus"
         ],
         "properties": {
          "current": {
           "type": "object",
           "required": [
            "role",
            "text"
           ],
           "properties": {
            "role": {
             "enum": [
              "user",
              "assistant"
             ],
             "type": "string"
            },
            "text": {
             "type": "string",
             "maxLength": 16000,
             "minLength": 1
            }
           },
           "additionalProperties": false
          },
          "history": {
           "type": "array",
           "items": {
            "type": "object",
            "required": [
             "role",
             "text"
            ],
            "properties": {
             "role": {
              "enum": [
               "user",
               "assistant"
              ],
              "type": "string"
             },
             "text": {
              "type": "string",
              "maxLength": 16000,
              "minLength": 1
             }
            },
            "additionalProperties": false
           },
           "maxItems": 6
          },
          "literalUrls": {
           "type": "array",
           "items": {
            "type": "string",
            "maxLength": 2000
           },
           "maxItems": 8
          },
          "pendingCall": {
           "anyOf": [
            {
             "type": "object",
             "required": [
              "tool",
              "query"
             ],
             "properties": {
              "tool": {
               "type": "string",
               "const": "WebSearch"
              },
              "query": {
               "type": "string",
               "maxLength": 4000,
               "minLength": 1
              }
             },
             "additionalProperties": false
            },
            {
             "type": "objec
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "jev": {
   "calls": 1,
   "latencyMs": 420
  },
  "decision": {
   "action": "native",
   "reason": "The host assistant and its own tools are enough for this step.",
   "diagnostics": {
    "stage": "capability",
    "missing": [],
    "nextAction": "Answer with the host assistant and its own tools; no paid capability fits this step.",
    "reasonCode": "native_sufficient"
   }
  },
  "routerVersion": "2026-10-02.3",
  "schemaVersion": 1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tenjin-x402-router-ece8d9e3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from tenjin.sh](https://www.zero.xyz/host/tenjin.sh/llms.txt)
