|
| 1 | +--- |
| 2 | +layout: |
| 3 | + width: wide |
| 4 | + title: |
| 5 | + visible: true |
| 6 | + description: |
| 7 | + visible: true |
| 8 | + tableOfContents: |
| 9 | + visible: true |
| 10 | + outline: |
| 11 | + visible: true |
| 12 | + pagination: |
| 13 | + visible: true |
| 14 | + metadata: |
| 15 | + visible: true |
| 16 | + tags: |
| 17 | + visible: true |
| 18 | + actions: |
| 19 | + visible: true |
| 20 | +--- |
| 21 | + |
| 22 | +# Nova 3 Medical |
| 23 | + |
| 24 | +{% columns %} |
| 25 | +{% column width="66.66666666666666%" %} |
| 26 | +{% hint style="info" %} |
| 27 | +This documentation is valid for the following list of our models: |
| 28 | + |
| 29 | +* `nova-3-medical` |
| 30 | +{% endhint %} |
| 31 | +{% endcolumn %} |
| 32 | + |
| 33 | +{% column width="33.33333333333334%" %} |
| 34 | +<a href="https://aimlapi.com/app/deepgram/nova-3-medical" class="button primary">Try in Playground</a> |
| 35 | +{% endcolumn %} |
| 36 | +{% endcolumns %} |
| 37 | + |
| 38 | +Nova-3 Medical — speech-to-text model from Deepgram fine-tuned for clinical terminology, healthcare audio, and medical transcription workflows. Accurately recognizes drug names, diagnoses, procedures, and medical jargon in real-time and batch transcription. |
| 39 | + |
| 40 | +{% hint style="success" %} |
| 41 | +This model uses per-minute billing. The cost of audio transcription is based on the duration of the input audio file. |
| 42 | +{% endhint %} |
| 43 | + |
| 44 | +## Setup your API Key |
| 45 | + |
| 46 | +If you don't have an API key for the AI/ML API yet, feel free to use our [Quickstart guide](https://docs.aimlapi.com/quickstart/setting-up). |
| 47 | + |
| 48 | +## API Schemas |
| 49 | + |
| 50 | +{% openapi-operation spec="deepgram-nova-3-medical" path="/v1/stt/create" method="post" %} |
| 51 | +[OpenAPI deepgram-nova-3-medical](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/speech-models/Deepgram/nova-3-medical.json) |
| 52 | +{% endopenapi-operation %} |
| 53 | + |
| 54 | +## Quick Example: Processing a Speech Audio File via URL |
| 55 | + |
| 56 | +Let's transcribe the following audio fragment: |
| 57 | + |
| 58 | +{% embed url="https://drive.google.com/file/d/1ZN-28NUbK1TXHt6oEPj42zUJCv82e9L4/view?usp=sharing" %} |
| 59 | + |
| 60 | +{% code overflow="wrap" %} |
| 61 | +```python |
| 62 | +import time |
| 63 | +import requests |
| 64 | +import json |
| 65 | + |
| 66 | +base_url = "https://api.aimlapi.com/v1" |
| 67 | +# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>: |
| 68 | +api_key = "<YOUR_AIMLAPI_KEY>" |
| 69 | + |
| 70 | +# Creating and sending a speech-to-text conversion task to the server |
| 71 | +def create_stt(): |
| 72 | + url = f"{base_url}/stt/create" |
| 73 | + headers = { |
| 74 | + "Authorization": f"Bearer {api_key}", |
| 75 | + } |
| 76 | + |
| 77 | + data = { |
| 78 | + "model": "nova-3-medical", |
| 79 | + "url": "https://audio-samples.github.io/samples/mp3/blizzard_primed/sample-0.mp3" |
| 80 | + } |
| 81 | + |
| 82 | + response = requests.post(url, json=data, headers=headers) |
| 83 | + |
| 84 | + if response.status_code >= 400: |
| 85 | + print(f"Error: {response.status_code} - {response.text}") |
| 86 | + else: |
| 87 | + response_data = response.json() |
| 88 | + print(response_data) |
| 89 | + return response_data |
| 90 | + |
| 91 | +# Requesting the result of the task from the server using the generation_id |
| 92 | +def get_stt(gen_id): |
| 93 | + url = f"{base_url}/stt/{gen_id}" |
| 94 | + headers = { |
| 95 | + "Authorization": f"Bearer {api_key}", |
| 96 | + } |
| 97 | + response = requests.get(url, headers=headers) |
| 98 | + return response.json() |
| 99 | + |
| 100 | +# First, start the generation, then repeatedly request the result from the server every 10 seconds. |
| 101 | +def main(): |
| 102 | + stt_response = create_stt() |
| 103 | + gen_id = stt_response.get("generation_id") |
| 104 | + |
| 105 | + if gen_id: |
| 106 | + start_time = time.time() |
| 107 | + timeout = 600 |
| 108 | + while time.time() - start_time < timeout: |
| 109 | + response_data = get_stt(gen_id) |
| 110 | + |
| 111 | + if response_data is None: |
| 112 | + print("Error: No response from API") |
| 113 | + break |
| 114 | + |
| 115 | + status = response_data.get("status") |
| 116 | + |
| 117 | + if status == "waiting" or status == "active": |
| 118 | + print("Still waiting... Checking again in 10 seconds.") |
| 119 | + time.sleep(10) |
| 120 | + else: |
| 121 | + print("Processing complete:\n", response_data["result"]["results"]["channels"][0]["alternatives"][0]["transcript"]) |
| 122 | + |
| 123 | + # Uncomment the line below to print the entire result object with all service data |
| 124 | + # print("Processing complete:\n", json.dumps(response_data["result"], indent=2, ensure_ascii=False)) |
| 125 | + return response_data |
| 126 | + |
| 127 | + print("Timeout reached. Stopping.") |
| 128 | + return None |
| 129 | + |
| 130 | + |
| 131 | +if __name__ == "__main__": |
| 132 | + main() |
| 133 | +``` |
| 134 | +{% endcode %} |
| 135 | + |
| 136 | +<details> |
| 137 | + |
| 138 | +<summary>Response</summary> |
| 139 | + |
| 140 | +{% code overflow="wrap" %} |
| 141 | +```json5 |
| 142 | +{'generation_id': 'c3d4e5f6-a7b8-9012-cdef-123456789012'} |
| 143 | +Still waiting... Checking again in 10 seconds. |
| 144 | +Processing complete: |
| 145 | +{ |
| 146 | + "status": "completed", |
| 147 | + "result": { |
| 148 | + "metadata": { |
| 149 | + "request_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", |
| 150 | + "created": "2025-06-04T12:00:00.000Z", |
| 151 | + "duration": 11.4, |
| 152 | + "channels": 1, |
| 153 | + "models": ["nova-3-medical"], |
| 154 | + "model_info": { |
| 155 | + "nova-3-medical": { |
| 156 | + "name": "nova-3-medical", |
| 157 | + "version": "2024-12-18.0", |
| 158 | + "arch": "nova-3" |
| 159 | + } |
| 160 | + } |
| 161 | + }, |
| 162 | + "results": { |
| 163 | + "channels": [ |
| 164 | + { |
| 165 | + "alternatives": [ |
| 166 | + { |
| 167 | + "transcript": "He doesn't belong to you, and I don't see how you have anything to do with what is be his power, if he possess only that from this stage to you.", |
| 168 | + "confidence": 0.9882813, |
| 169 | + "words": [ |
| 170 | + { |
| 171 | + "word": "he", |
| 172 | + "start": 0.32, |
| 173 | + "end": 0.4, |
| 174 | + "confidence": 0.9882813, |
| 175 | + "speaker": 0, |
| 176 | + "punctuated_word": "He" |
| 177 | + } |
| 178 | + ] |
| 179 | + } |
| 180 | + ] |
| 181 | + } |
| 182 | + ] |
| 183 | + } |
| 184 | + } |
| 185 | +} |
| 186 | +``` |
| 187 | +{% endcode %} |
| 188 | + |
| 189 | +</details> |
0 commit comments