# MatrixFold X API Failure Explainer

> MatrixFold X API Failure Explainer is a paid API for AI agents from api-production-853c.up.railway.app, paid per call via x402, $0.004000/call, status unknown (last checked 2026-09-15).

Classifies failed X (Twitter) create-post API responses into error categories and returns retry guidance and repair hints for AI agents

## Facts

- Endpoint: POST https://api-production-853c.up.railway.app/v1/explain-failure
- Price: $0.004000/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-production-853c-up-railway-app-0bc4a4b1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GAL7rE4jQM_o62UWxiWP1

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 api-production-853c-up-railway-app-0bc4a4b1 -d '<json body>'
```

Example prompt: My agent just got a 403 error back from X's POST /2/tweets endpoint with the message 'You are not permitted to perform this action' — can you classify what kind of failure this is and tell me how to fix it or whether to retry?

## When to prefer this

Use this endpoint when an AI agent has already attempted to post to X via POST /2/tweets and received a failure response and needs structured triage before deciding whether to retry, repair the payload, or escalate. Ideal for autonomous agents running social publishing workflows who need programmatic error handling rather than raw HTTP status codes.

## Known failure modes

- Missing or malformed failed X API response body — returns unknown classification
- Unrecognized error format not matching any X API error schema — classified as unknown
- Service unavailable on Railway hosting — 502/503 upstream error
- Malformed request body to this endpoint — 400 bad request

## Output

Returns a structured JSON object containing the error category (one of: auth, permission, rate-limit, payload, media, duplicate, transient, or unknown), a plain-language explanation of the failure, retry guidance (whether and when to retry), and specific repair hints to fix the root cause before attempting again.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "platform",
  "text"
 ],
 "properties": {
  "text": {
   "type": "string",
   "maxLength": 6000,
   "minLength": 1,
   "description": "AI agent social post body to validate for length, hashtags, links, emoji density, and publishing guardrails."
  },
  "title": {
   "type": "string",
   "maxLength": 160,
   "description": "Optional social post title to validate for platform rules."
  },
  "hashtags": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "maxItems": 30,
   "description": "Hashtags to check for platform limits."
  },
  "platform": {
   "enum": [
    "x",
    "linkedin",
    "xiaohongshu"
   ],
   "type": "string",
   "description": "Target social platform for post compliance validation: X/Twitter, LinkedIn, or Xiaohongshu."
  },
  "imageUrls": {
   "type": "array",
   "items": {
    "type": "string",
    "format": "uri"
   },
   "maxItems": 20,
   "description": "Image URLs to check for platform image-count limits."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-production-853c-up-railway-app-0bc4a4b1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api-production-853c.up.railway.app](https://www.zero.xyz/host/api-production-853c.up.railway.app/llms.txt)
