Key Point: You only need to change base_url and api_key; the rest of the code is identical to the official OpenAI one.
Supported Interfaces Overview#
| Interface | Method | Path | Description |
|---|
| Model list | GET | /v1/models | View available models |
| Chat completion | POST | /v1/chat/completions | Chat interface, supports streaming |
| Responses | POST | /v1/responses | OpenAI Responses API, supports streaming |
| Text vectorization | POST | /v1/embeddings | Embedding interface |
| Image generation | POST | /v1/images/generations | Text-to-image |
| Text-to-speech | POST | /v1/audio/speech | TTS, returns audio stream |
| Speech-to-text | POST | /v1/audio/transcriptions | STT, upload audio file |
| Speech translation | POST | /v1/audio/translations | Translate audio to English |
| Video generation | POST | /v1/video/generations | Text-to-video / image-to-video |
| Content moderation | POST | /v1/moderations | Text/image safety moderation |
| Rerank | POST | /v1/rerank | Document relevance ranking |
Modified at 2026-07-01 01:23:54