{
  "openapi": "3.1.0",
  "info": {
    "title": "YourAITools Sell-your-API gateway: submit API",
    "version": "1.0.0",
    "description": "List your x402 or MCP API on YourAITools from an agent: one POST, no signup, no captcha. Free submission and 0% cut: buyers pay your own payTo wallet directly over x402, and YourAITools never holds funds. Each submission gets an automatic health check (your declared x402 resources must answer 402 with payment terms paying your payTo; MCP endpoints must answer initialize and tools/list), InjectScan prompt-injection screening of names and descriptions, and PayGuard OFAC screening of payTo. First listings for a payTo are reviewed by a human; later ones with clean checks are approved automatically. Approved listings are served at https://api.youraitools.co/g/{slug}/... and health-checked every 15 minutes; 3 failures in a row suspend a listing until it passes again. Limits: body 16384 bytes, manifest 12288 bytes, 5 submissions/hour and 20/day per IP, 5/day per payTo, 20 active listings per payTo. URLs must be public https hosts (no IPs, private or metadata addresses, no redirects off public hosts).",
    "contact": {
      "email": "hello@youraitools.co",
      "url": "https://api.youraitools.co/listing/"
    }
  },
  "servers": [
    {
      "url": "https://api.youraitools.co"
    }
  ],
  "paths": {
    "/listing/v1/submit": {
      "post": {
        "operationId": "submitListing",
        "summary": "Submit an x402 or MCP API (free)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Submission"
              },
              "examples": {
                "x402": {
                  "value": {
                    "name": "Weather Now",
                    "url": "https://api.example.com",
                    "payTo": "0x1111111111111111111111111111111111111111",
                    "category": "data",
                    "description": "Current weather for any city, paid per call over x402.",
                    "manifest": {
                      "type": "x402",
                      "resources": [
                        {
                          "path": "/v1/weather",
                          "method": "GET",
                          "description": "Current weather for ?city=",
                          "price": "$0.001"
                        }
                      ]
                    }
                  }
                },
                "mcp": {
                  "value": {
                    "name": "Doc Search MCP",
                    "endpoint": "https://mcp.example.com/mcp",
                    "payTo": [
                      "0x1111111111111111111111111111111111111111",
                      "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"
                    ],
                    "category": "search",
                    "manifest": {
                      "type": "mcp"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted; screening runs now. Poll status_url.",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status",
                    "status_url"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "const": "screening"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "poll_after_seconds": {
                      "type": "integer"
                    },
                    "gateway_url_when_approved": {
                      "type": "string",
                      "format": "uri"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid body, URL blocked, invalid payTo or bad checksum",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "message"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "example": {
                      "type": "object"
                    },
                    "existing": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Duplicate: this url is already listed or under review",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "message"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "example": {
                      "type": "object"
                    },
                    "existing": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Body or manifest too large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "message"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "example": {
                      "type": "object"
                    },
                    "existing": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Content-Type must be application/json",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "message"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "example": {
                      "type": "object"
                    },
                    "existing": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (per IP, per payTo, or global); see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "message"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "example": {
                      "type": "object"
                    },
                    "existing": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/listing/v1/submit/{id}": {
      "get": {
        "operationId": "getSubmissionStatus",
        "summary": "Submission status (poll)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^sub_[a-z2-9]{10}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Listing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "slug",
                    "status",
                    "status_url"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^sub_[a-z2-9]{10}$"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "category": {
                      "type": "string"
                    },
                    "kind": {
                      "enum": [
                        "x402",
                        "mcp"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "payTo": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "chain": {
                            "enum": [
                              "evm",
                              "solana"
                            ]
                          },
                          "address": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "status": {
                      "enum": [
                        "screening",
                        "pending_review",
                        "approved",
                        "suspended",
                        "rejected"
                      ]
                    },
                    "status_reason": {
                      "type": "string"
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "gateway_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "resources": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "checks": {
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "health": {
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown id",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error",
                    "message"
                  ],
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "example": {
                      "type": "object"
                    },
                    "existing": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/g/": {
      "get": {
        "operationId": "listGatewayListings",
        "summary": "Directory of approved listings",
        "responses": {
          "200": {
            "description": "Directory",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "listings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "slug",
                          "status",
                          "status_url"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "pattern": "^sub_[a-z2-9]{10}$"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          },
                          "kind": {
                            "enum": [
                              "x402",
                              "mcp"
                            ]
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "payTo": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "chain": {
                                  "enum": [
                                    "evm",
                                    "solana"
                                  ]
                                },
                                "address": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "status": {
                            "enum": [
                              "screening",
                              "pending_review",
                              "approved",
                              "suspended",
                              "rejected"
                            ]
                          },
                          "status_reason": {
                            "type": "string"
                          },
                          "flags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "status_url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "gateway_url": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uri"
                          },
                          "resources": {
                            "type": "array",
                            "items": {
                              "type": "object"
                            }
                          },
                          "checks": {
                            "type": [
                              "object",
                              "null"
                            ]
                          },
                          "health": {
                            "type": [
                              "object",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Submission": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "payTo",
          "category",
          "manifest"
        ],
        "oneOf": [
          {
            "required": [
              "url"
            ]
          },
          {
            "required": [
              "endpoint"
            ]
          }
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 3,
            "maxLength": 60
          },
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://",
            "maxLength": 500,
            "description": "x402: base URL of your API (resource paths are appended). MCP: the full Streamable HTTP endpoint. Public https host, port 443, no query."
          },
          "endpoint": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://",
            "maxLength": 500,
            "description": "Alias of url."
          },
          "payTo": {
            "oneOf": [
              {
                "type": "string",
                "description": "EVM address (0x + 40 hex; mixed case must pass EIP-55) or Solana address (base58, 32 bytes).",
                "examples": [
                  "0x1111111111111111111111111111111111111111"
                ]
              },
              {
                "type": "array",
                "minItems": 1,
                "maxItems": 2,
                "items": {
                  "type": "string",
                  "description": "EVM address (0x + 40 hex; mixed case must pass EIP-55) or Solana address (base58, 32 bytes).",
                  "examples": [
                    "0x1111111111111111111111111111111111111111"
                  ]
                },
                "description": "One EVM and/or one Solana address."
              }
            ],
            "description": "Your own wallet(s). Every x402 payment term must pay these; anything else blocks the call and suspends the listing."
          },
          "category": {
            "enum": [
              "ai",
              "data",
              "search",
              "crypto",
              "finance",
              "security",
              "dev-tools",
              "media",
              "commerce",
              "other"
            ]
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "manifest": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "type",
                  "resources"
                ],
                "properties": {
                  "type": {
                    "const": "x402"
                  },
                  "resources": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 20,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "path"
                      ],
                      "properties": {
                        "path": {
                          "type": "string",
                          "pattern": "^/[A-Za-z0-9/_\\-.~%:]*\\*?$",
                          "maxLength": 200,
                          "description": "Path under url; a trailing * allows any sub-path."
                        },
                        "method": {
                          "enum": [
                            "GET",
                            "POST"
                          ],
                          "default": "GET"
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "price": {
                          "type": "string",
                          "maxLength": 40
                        }
                      }
                    }
                  }
                }
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "const": "mcp"
                  },
                  "tools": {
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "type": "object",
                      "required": [
                        "name"
                      ],
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            ]
          }
        }
      },
      "Listing": {
        "type": "object",
        "required": [
          "id",
          "slug",
          "status",
          "status_url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^sub_[a-z2-9]{10}$"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "x402",
              "mcp"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "payTo": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "chain": {
                  "enum": [
                    "evm",
                    "solana"
                  ]
                },
                "address": {
                  "type": "string"
                }
              }
            }
          },
          "status": {
            "enum": [
              "screening",
              "pending_review",
              "approved",
              "suspended",
              "rejected"
            ]
          },
          "status_reason": {
            "type": "string"
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status_url": {
            "type": "string",
            "format": "uri"
          },
          "gateway_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "resources": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "checks": {
            "type": [
              "object",
              "null"
            ]
          },
          "health": {
            "type": [
              "object",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error",
          "message"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "example": {
            "type": "object"
          },
          "existing": {
            "type": "object"
          }
        }
      }
    }
  }
}