Spaces:
Configuration error
Configuration error
File size: 1,228 Bytes
b56d19a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
https://platform.openai.com/docs/api-reference/audio/createTranscription
https://platform.openai.com/docs/guides/speech-to-text
TODO: add a note about automatic downloads
TODO: add a note about api-key
TODO: mention streaming
TODO: add a demo
TODO: talk about audio format
## Curl
```bash
curl http://localhost:8000/v1/audio/transcriptions -F "[email protected]"
```
## Python
=== "httpx"
```python
import httpx
with open('audio.wav', 'rb') as f:
files = {'file': ('audio.wav', f)}
response = httpx.post('http://localhost:8000/v1/audio/transcriptions', files=files)
print(response.text)
```
## OpenAI SDKs
=== "Python"
```python
import httpx
with open('audio.wav', 'rb') as f:
files = {'file': ('audio.wav', f)}
response = httpx.post('http://localhost:8000/v1/audio/transcriptions', files=files)
print(response.text)
```
=== "CLI"
```bash
export OPENAI_BASE_URL=http://localhost:8000/v1/
export OPENAI_API_KEY="cant-be-empty"
openai api audio.transcriptions.create -m Systran/faster-whisper-small -f audio.wav --response-format text
```
=== "Other"
See [OpenAI libraries](https://platform.openai.com/docs/libraries).
|