# PatchPilot Code Repair Gateway API

Get PatchPilot Code Repair Gateway data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Codesphereug, pass parameters such as id, jsonrpc, method, and retrieve structured data including identifier, name, returned annotations field, description, and returned input schema field to search interfaces and source review, and integration reference.

Documentation: https://openany.si/market/apis/gateway/patchpilot-code-repair-gateway/
API ID: 6d5fc4a5-2f7a-48fe-bb9f-457c8c471179
Provider: codesphereug
Contract revision: 6
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/codesphereug/patchpilot/mcp
Page update time: 2026-12-03T02:49:50.513Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: application/json
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.001 / call
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract. Price update time: not supplied.
Contract update time: 2026-12-03T02:49:50.513Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "1000",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "PatchPilot Code Repair Gateway API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {}
    },
    "headers": {
      "type": "object",
      "properties": {}
    },
    "body": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers",
    "body"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "jsonrpc": {
      "type": "string"
    },
    "result": {
      "type": "object",
      "properties": {
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "annotations": {
                "type": "object",
                "properties": {
                  "destructiveHint": {
                    "type": "boolean"
                  },
                  "idempotentHint": {
                    "type": "boolean"
                  },
                  "openWorldHint": {
                    "type": "boolean"
                  },
                  "readOnlyHint": {
                    "type": "boolean"
                  }
                }
              },
              "description": {
                "type": "string"
              },
              "inputSchema": {
                "type": "object",
                "properties": {
                  "properties": {
                    "type": "object",
                    "properties": {
                      "export_aegis": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": "boolean"
                          },
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "original_files": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "unified_diff": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "include_tests": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": "boolean"
                          },
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "sources": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "token_budget": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": "integer"
                          },
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "top_k": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": "integer"
                          },
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "traceback_text": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "allow_test_modifications": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": "boolean"
                          },
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "max_files_touched": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": "integer"
                          },
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "max_lines_changed": {
                        "type": "object",
                        "properties": {
                          "default": {
                            "type": "integer"
                          },
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "patched_files": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "file_path": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "line_number": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      },
                      "query_name": {
                        "type": "object",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  },
                  "required": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "type": {
                    "type": "string"
                  }
                }
              },
              "name": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
```

## Request example
Scenario: Recorded upstream MCP tools/list (HTTP 200)
```bash
curl \
  'https://api.openany.si/v1/agent-apis/codesphereug/patchpilot/mcp' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "id": 2,
  "jsonrpc": "2.0",
  "method": "tools/list"
}'
```

## Response example
Published documentation example. Verify the actual response after an approved call.
Sample response · Documented HTTP 200
```json
{
  "id": 2,
  "jsonrpc": "2.0",
  "result": {
    "tools": [
      {
        "annotations": {
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": false,
          "readOnlyHint": true
        },
        "description": "Parse and audit a multi-file unified git diff against 8 deterministic AST anti-reward-hacking & safety rules (RH001–RH008) and export canonical Nexus Aegis G5 leaf attestation.",
        "inputSchema": {
          "properties": {
            "export_aegis": {
              "default": false,
              "description": "Whether to include canonical Nexus Aegis G5 attestation package in output.",
              "type": "boolean"
            },
            "original_files": {
              "description": "Optional mapping of {rel_path: original_source_code}.",
              "type": "object"
            },
            "unified_diff": {
              "description": "Multi-file unified diff string (e.g. git diff output).",
              "type": "string"
            }
          },
          "required": [
            "unified_diff"
          ],
          "type": "object"
        },
        "name": "audit_unified_diff"
      },
      {
        "annotations": {
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": false,
          "readOnlyHint": true
        },
        "description": "Rank suspect Python functions/methods from a traceback or pytest failure log using hybrid Stack-Trace + AST Call-Graph + BM25 token overlap, returning minimal line-numbered AST slices within a strict token budget.",
        "inputSchema": {
          "properties": {
            "include_tests": {
              "default": false,
              "description": "Whether to include test_* functions in ranked candidates.",
              "type": "boolean"
            },
            "sources": {
              "description": "Optional in-memory {rel_path: source_code} map instead of workspace_root.",
              "type": "object"
            },
            "token_budget": {
              "default": 1200,
              "description": "Maximum token budget across returned AST code slices.",
              "type": "integer"
            },
            "top_k": {
              "default": 5,
              "description": "Maximum number of suspect functions to return.",
              "type": "integer"
            },
            "traceback_text": {
              "description": "Raw Python traceback or pytest failure output.",
              "type": "string"
            }
          },
          "required": [
            "traceback_text"
          ],
          "type": "object"
        },
        "name": "localize_fault"
      },
      {
        "annotations": {
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": false,
          "readOnlyHint": true
        },
        "description": "Evaluate a proposed patch (original vs patched files or unified diff) against 8 deterministic AST anti-reward-hacking & safety rules (RH001–RH008).",
        "inputSchema": {
          "properties": {
            "allow_test_modifications": {
              "default": false,
              "description": "Whether edits to test files are allowed without triggering RH001-RH002.",
              "type": "boolean"
            },
            "max_files_touched": {
              "default": 5,
              "description": "Maximum number of files a candidate patch is permitted to modify.",
              "type": "integer"
            },
            "max_lines_changed": {
              "default": 250,
              "description": "Maximum added plus deleted lines allowed across the patch.",
              "type": "integer"
            },
            "original_files": {
              "description": "Mapping of {rel_path: original_source_code}.",
              "type": "object"
            },
            "patched_files": {
              "description": "Mapping of {rel_path: patched_source_code}.",
              "type": "object"
            },
            "unified_diff": {
              "description": "Optional unified diff string applied onto original_files.",
              "type": "string"
            }
          },
          "required": [
            "original_files"
          ],
          "type": "object"
        },
        "name": "verify_patch_integrity"
      },
      {
        "annotations": {
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": false,
          "readOnlyHint": true
        },
        "description": "Query the AST symbol table and bidirectional call graph of a workspace by symbol name or (file_path, line_number).",
        "inputSchema": {
          "properties": {
            "file_path": {
              "description": "Relative file path for line-based enclosing symbol lookup.",
              "type": "string"
            },
            "line_number": {
              "description": "1-based line number for enclosing symbol lookup.",
              "type": "integer"
            },
            "query_name": {
              "description": "Function, method, or class name to look up.",
              "type": "string"
            },
            "sources": {
              "description": "Optional in-memory {rel_path: source_code} map.",
              "type": "object"
            }
          },
          "required": [],
          "type": "object"
        },
        "name": "inspect_ast_symbols"
      }
    ]
  }
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
