Update README.md

Fixes the open ai code to ensure it points to /v1
This commit is contained in:
Fireblade2534 2025-01-08 10:30:35 -05:00 committed by GitHub
parent 02292665c8
commit 418307d4a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,7 +34,7 @@ The service can be accessed through either the API endpoints or the Gradio web i
```python
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8880",
base_url="http://localhost:8880/v1",
api_key="not-needed"
)
@ -59,7 +59,7 @@ The service can be accessed through either the API endpoints or the Gradio web i
```python
# Using OpenAI's Python library
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8880", api_key="not-needed")
client = OpenAI(base_url="http://localhost:8880/v1", api_key="not-needed")
response = client.audio.speech.create(
model="kokoro", # Not used but required for compatibility, also accepts library defaults
voice="af_bella+af_sky",
@ -96,8 +96,8 @@ with open("output.mp3", "wb") as f:
Quick tests (run from another terminal):
```bash
python examples/test_openai_tts.py # Test OpenAI Compatibility
python examples/test_all_voices.py # Test all available voices
python examples/assorted_checks/test_openai/test_openai_tts.py # Test OpenAI Compatibility
python examples/assorted_checks/test_voices/test_all_voices.py # Test all available voices
```
</details>