{
  "openapi": "3.1.0",
  "info": {
    "title": "MYTOKEN Public API",
    "version": "1.0.0",
    "description": "Read-only MYTOKEN API backed by indexed snapshots and internal research surfaces. This API is not a live passthrough to provider APIs."
  },
  "servers": [
    {
      "url": "https://www.mytoken.fyi"
    }
  ],
  "tags": [
    {
      "name": "Health"
    },
    {
      "name": "Tokens"
    },
    {
      "name": "Wallets"
    },
    {
      "name": "Detector"
    },
    {
      "name": "Claimed"
    }
  ],
  "paths": {
    "/api/v1": {
      "get": {
        "tags": [
          "Health"
        ],
        "operationId": "getApiRoot",
        "summary": "Get API capability summary",
        "responses": {
          "200": {
            "description": "API summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccessEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/health": {
      "get": {
        "tags": [
          "Health"
        ],
        "operationId": "getHealth",
        "summary": "Health check",
        "responses": {
          "200": {
            "description": "Service health",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccessEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tokens/{slugOrMint}": {
      "get": {
        "tags": [
          "Tokens"
        ],
        "operationId": "getTokenBySlugOrMint",
        "summary": "Get token profile snapshot",
        "parameters": [
          {
            "name": "slugOrMint",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token slug or Solana mint address"
          }
        ],
        "responses": {
          "200": {
            "description": "Token profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccessEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Token not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/wallets/{wallet}": {
      "get": {
        "tags": [
          "Wallets"
        ],
        "operationId": "getWalletByAddress",
        "summary": "Get wallet intelligence snapshot",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana wallet address"
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccessEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Wallet not found in indexed data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/detector/{mintOrWallet}": {
      "get": {
        "tags": [
          "Detector"
        ],
        "operationId": "getDetectorReport",
        "summary": "Get probable linked-wallet family report",
        "parameters": [
          {
            "name": "mintOrWallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Solana mint or wallet address"
          }
        ],
        "responses": {
          "200": {
            "description": "Detector report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccessEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/claimed/{token}": {
      "get": {
        "tags": [
          "Claimed"
        ],
        "operationId": "getClaimedState",
        "summary": "Get claim/verification state snapshot",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token slug or Solana mint address"
          }
        ],
        "responses": {
          "200": {
            "description": "Claim state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccessEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Token not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorEnvelope"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Optional API key for higher quotas. Public tier is available without a key at lower rate limits."
      }
    },
    "schemas": {
      "ApiSuccessEnvelope": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "version": {
            "type": "string",
            "example": "v1"
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          },
          "meta": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "ok",
          "version",
          "data"
        ]
      },
      "ApiErrorEnvelope": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "version": {
            "type": "string",
            "example": "v1"
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "bad_request",
                  "not_found",
                  "rate_limited",
                  "unauthorized",
                  "forbidden",
                  "service_unavailable",
                  "internal_error"
                ]
              },
              "message": {
                "type": "string"
              },
              "hint": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "ok",
          "version",
          "error"
        ]
      }
    }
  },
  "security": [
    {},
    {
      "ApiKeyAuth": []
    }
  ],
  "externalDocs": {
    "description": "Developer documentation",
    "url": "https://www.mytoken.fyi/developers"
  }
}