Spaces:
Sleeping
Sleeping
| import requests | |
| def test_generate_real(): | |
| url = "http://127.0.0.1:8000/generate" | |
| # Key provided by user | |
| api_key = "ap2_b71da4b1-5155-47a2-b522-431fe5cb728d" | |
| payload = { | |
| "text": "Hello, verification successful.", | |
| "murf_api_key": api_key, | |
| "voice_id": "en-US-marcus" | |
| } | |
| print("Testing /generate with PROVIDED key...") | |
| try: | |
| response = requests.post(url, json=payload) | |
| if response.status_code == 200: | |
| data = response.json() | |
| print("PASS: Audio Generated Successfully!") | |
| print(f"Audio URL: {data.get('audio_url')}") | |
| else: | |
| print(f"FAIL: Status {response.status_code}") | |
| print(response.text) | |
| except Exception as e: | |
| print(f"FAIL: {e}") | |
| if __name__ == "__main__": | |
| test_generate_real() | |