import requests
# Set the API endpoint URL
endpoint = "https://api.runpod.ai/v1/whisper/run"
# Set the headers for the request
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <YOUR_API_KEY>"
}
# Define your inputs
input_data = {
"input": {
"audio": "https:/link/to/audio_file",
}
}
# Make the request
response = requests.post(endpoint, json=input_data, headers=headers)
# Print the response
print(response.text)
API KEYとaudioのリンクを適宜変更してください。上記スクリプトを実行すると、実行結果として、以下のようなレスポンスが返ってきます。
{"delayTime":90,"executionTime":4122,"id":"8090d715-7fe2-41f0-8307-cc99e8a53d20","input":{"audio":"https://dss-kiel.de/images/media_center/signals/lombard/male_0_kmh.mp3"},"output":{"detected_language":"german","segments":[{"avg_logprob":-0.25298240780830383,"compression_ratio":1.6414342629482073,"end":9,"id":0,"no_speech_prob":0.002470968523994088,"seek":0,"start":0,"temperature":0,"text":" Einst stritten sich Nordwint und Sonne, wer von ihnen beiden wohl der stärkere Wäre, als ein Wanderer, der in einen warmen Mantel gehüllt war, des Wegester herkam.","tokens":[6391,372,1056,2987,3041,16229,86,686,674,5185,716,11,2612,2957,24623,23446,24531,1163,33527,74,323,343,12277,11,3907,1343,343,4483,260,11,1163,294,4891,1516,2558,32829,338,13218,49976,1516,11,730,492,432,3120,720,39917,13]},
# ... 省略
"status":"COMPLETED"}