# API Rescue - AI-Powered API Failure Detection & Fix Generator

> API Rescue - AI-Powered API Failure Detection & Fix Generator is a paid API for AI agents from rescue.agent.amnt.io, paid per call via x402, $0.03/call, status unknown (last checked 2026-10-21).

Detects API failures, validates responses against schemas or baselines, diagnoses root causes, and proposes code fixes and regression tests in the requested language.

## Facts

- Endpoint: POST https://rescue.agent.amnt.io/api/agent/ax3lflores/api-rescue?utm_source=zero.xyz
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-rescue-ai-powered-api-failure-detection-fix-generator-6e818cec
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_epvheIgRhE8K3GjbzgnqP

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-rescue-ai-powered-api-failure-detection-fix-generator-6e818cec -d '<json body>'
```

Example prompt: My POST /orders API is returning a 422 status with a mismatched response body — can you detect what's wrong, validate the response against my expected schema, and give me a Python fix plus a regression test to prevent this from happening again?

## When to prefer this

Choose this endpoint when you need AI-assisted debugging specifically for API failures — detecting response schema mismatches, diagnosing HTTP error causes, and generating language-specific code fixes and regression tests in one call. Prefer this over generic code assistants when your primary need is API-layer debugging with test generation, especially in an agentic workflow that processes API health issues automatically.

## Known failure modes

- Vague or incomplete prompt may result in generic or unhelpful diagnosis
- Unsupported programming language may lead to generic pseudocode output
- Malformed or missing schema/baseline data in prompt reduces fix accuracy
- Network timeout if the AI inference takes too long
- Payment failure if USDC balance is insufficient for the $0.03 per-call fee

## How this service works

API Rescue - Detect API failures, validate responses against schema or baseline, diagnose causes, and propose code fixes and regression tests in the requested language.

## Output

Returns a structured text response containing: identified API failure causes, validation results showing where responses deviate from the schema or baseline, recommended code fixes in the requested programming language, and regression test code to prevent recurrence.

## 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": {
     "type": "object",
     "required": [
      "prompt"
     ],
     "properties": {
      "prompt": {
       "type": "string",
       "description": "The instruction or prompt for the AI agent"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "result": {
       "type": "string",
       "description": "The agent's response text"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-rescue-ai-powered-api-failure-detection-fix-generator-6e818cec/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from rescue.agent.amnt.io](https://www.zero.xyz/host/rescue.agent.amnt.io/llms.txt)
