{"openapi":"3.1.1","info":{"title":"Fallback","version":"0.1.0-beta.1","description":"Fallback gives autonomous agents small, deterministic utilities for the moments where automation gets stuck: finding the right source, diagnosing a failed request, repairing a request from available evidence, and deciding whether another search or paid retrieval is worth the cost.","license":{"name":"MIT"}},"servers":[{"url":"https://fallback.factrail.online"}],"paths":{"/v1/tools/source_route":{"post":{"operationId":"source_route","summary":"source_route","description":"Find likely authoritative or machine-readable sources when you know what information you need but not where to retrieve it. Provide a goal and optional publisher domain or start URL; it returns ranked candidate routes and bounded evidence. Use it before blind searching. Do not use it when you already have the correct source or only need reasoning over supplied context.","tags":["source-discovery"],"x-fallback-tool-id":"source_route","x-fallback-status":"available","x-fallback-price-usd":"0.02","x-fallback-x402-active":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"goal":{"type":"string","minLength":3,"maxLength":500},"domain":{"type":"string","maxLength":253,"format":"hostname","pattern":"^(?=.{1,253}\\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\\.?$"},"start_url":{"type":"string","maxLength":2048},"preferred_formats":{"maxItems":7,"type":"array","items":{"type":"string","enum":["json","csv","xml","rss","api","bulk_download","html"]}},"require_official":{"default":false,"type":"boolean"},"max_candidates":{"default":5,"type":"integer","minimum":1,"maximum":10}},"required":["goal"],"additionalProperties":false}}}},"responses":{"200":{"description":"Tool response envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}}},"402":{"description":"Payment required for this available paid tool."},"404":{"description":"Tool is unknown or unavailable."}}}},"/v1/tools/error_route":{"post":{"operationId":"error_route","summary":"error_route","description":"Diagnose a failed API, HTTP, MCP, or tool request and return a bounded safe next action. Use it after a request fails when the safe next step is unclear. Provide a status, response, or error text; it does not execute requests or verify undocumented fixes.","tags":["recovery"],"x-fallback-tool-id":"error_route","x-fallback-status":"available","x-fallback-price-usd":"0.002","x-fallback-x402-active":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"goal":{"type":"string","minLength":1,"maxLength":500},"request":{"type":"object","properties":{"method":{"type":"string","maxLength":16},"url":{"type":"string","maxLength":2048},"headers":{"type":"object","propertyNames":{"type":"string","maxLength":128},"additionalProperties":{"type":"string","maxLength":2048}},"body":{}},"additionalProperties":false},"response":{"type":"object","properties":{"status":{"type":"integer","minimum":100,"maximum":599},"headers":{"type":"object","propertyNames":{"type":"string","maxLength":128},"additionalProperties":{"type":"string","maxLength":2048}},"body":{"type":"string","maxLength":8192}},"additionalProperties":false},"error":{"type":"string","maxLength":2048},"attempt":{"type":"integer","minimum":1,"maximum":100}},"additionalProperties":false}}}},"responses":{"200":{"description":"Tool response envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}}},"402":{"description":"Payment required for this available paid tool."},"404":{"description":"Tool is unknown or unavailable."}}}},"/v1/tools/request_repair":{"post":{"operationId":"request_repair","summary":"request_repair","description":"Repair a failed API or HTTP request using only supplied schema and error evidence. Use after error_route identifies a request-shape or input problem. Returns the smallest justified request changes and abstains when evidence is insufficient.","tags":["recovery"],"x-fallback-tool-id":"request_repair","x-fallback-status":"available","x-fallback-price-usd":"0.005","x-fallback-x402-active":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"goal":{"type":"string","minLength":1,"maxLength":500},"request":{"type":"object","properties":{"method":{"type":"string","minLength":1,"maxLength":16},"url":{"type":"string","maxLength":2048},"headers":{"type":"object","propertyNames":{"type":"string","maxLength":128},"additionalProperties":{"type":"string","maxLength":4096}},"query":{"type":"object","propertyNames":{"type":"string","maxLength":128},"additionalProperties":{"$ref":"#/$defs/__schema0"}},"body":{"$ref":"#/$defs/__schema0"}},"additionalProperties":false},"response":{"type":"object","properties":{"status":{"type":"integer","minimum":100,"maximum":599},"headers":{"type":"object","propertyNames":{"type":"string","maxLength":128},"additionalProperties":{"type":"string","maxLength":4096}},"body":{"$ref":"#/$defs/__schema0"}},"additionalProperties":false},"error":{"type":"string","maxLength":4000},"error_route":{"type":"object","properties":{"classification":{"type":"string","enum":["authentication_required","authorization_denied","rate_limited","quota_exhausted","payment_required","payment_failed","schema_mismatch","invalid_input","not_found","method_not_allowed","unsupported_media_type","timeout","connection_failure","dns_failure","tls_failure","upstream_failure","service_unavailable","conflict","stale_state","malformed_response","blocked_or_challenged","unknown"]},"retry":{"type":"string","enum":["never","immediate","after_delay","after_change","after_auth","after_payment","unknown"]}},"required":["classification"],"additionalProperties":{}},"schema":{"$ref":"#/$defs/__schema0"},"constraints":{"default":{"allow_method_change":false,"allow_url_change":false},"type":"object","properties":{"allow_method_change":{"default":false,"type":"boolean"},"allow_url_change":{"default":false,"type":"boolean"}},"additionalProperties":false}},"required":["request"],"additionalProperties":false,"$defs":{"__schema0":{"anyOf":[{"type":"string","maxLength":8192},{"type":"number"},{"type":"boolean"},{"type":"null"},{"maxItems":256,"type":"array","items":{"$ref":"#/$defs/__schema0"}},{"type":"object","propertyNames":{"type":"string","maxLength":128},"additionalProperties":{"$ref":"#/$defs/__schema0"}}]}}}}}},"responses":{"200":{"description":"Tool response envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}}},"402":{"description":"Payment required for this available paid tool."},"404":{"description":"Tool is unknown or unavailable."}}}},"/v1/tools/stop_search":{"post":{"operationId":"stop_search","summary":"stop_search","description":"Decide whether another search or paid retrieval is worth the cost based on the scope already checked. Use after several search or source checks when you need to decide whether to continue or return a scoped not-found result. It does not prove universal absence and performs no searches itself.","tags":["search-quality"],"x-fallback-tool-id":"stop_search","x-fallback-status":"available","x-fallback-price-usd":"0.003","x-fallback-x402-active":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"goal":{"type":"string","minLength":1,"maxLength":500},"checks":{"default":[],"maxItems":40,"type":"array","items":{"type":"object","properties":{"target":{"type":"string","minLength":1,"maxLength":300},"method":{"type":"string","enum":["direct","search","documentation","api_catalog","registry","browser","other"]},"result":{"type":"string","enum":["found","not_found","inconclusive","error","blocked","contradictory"]},"authority":{"type":"string","enum":["primary","official","secondary","general","unknown"]},"coverage":{"type":"string","enum":["low","medium","high"]},"exhaustive":{"default":false,"type":"boolean"},"checked_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["target","method","result","authority","coverage"],"additionalProperties":false}},"remaining_routes":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"route":{"type":"string","minLength":1,"maxLength":300},"expected_value":{"anyOf":[{"type":"string","enum":["low","medium","high"]},{"type":"string","const":"unknown"}]},"estimated_cost_usd":{"type":"number","minimum":0,"maximum":10000}},"required":["route","expected_value"],"additionalProperties":false}},"search_budget":{"type":"object","properties":{"calls_used":{"type":"integer","minimum":0,"maximum":10000},"calls_remaining":{"type":"integer","minimum":0,"maximum":10000},"cost_used_usd":{"type":"number","minimum":0,"maximum":10000},"cost_remaining_usd":{"type":"number","minimum":0,"maximum":10000}},"additionalProperties":false},"risk":{"default":"medium","type":"string","enum":["low","medium","high"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Tool response envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResponse"}}}},"402":{"description":"Payment required for this available paid tool."},"404":{"description":"Tool is unknown or unavailable."}}}}},"components":{"schemas":{"ToolResponse":{"type":"object","required":["success","toolId","toolVersion","requestId","execution"],"properties":{"success":{"type":"boolean"},"toolId":{"type":"string"},"toolVersion":{"type":"string"},"requestId":{"type":"string"},"result":{},"error":{"type":"object"},"execution":{"type":"object"}}}}}}