CAP: Detecting Unauthorized Data Usage in Generative Models via Prompt Generation