API Overview
Use the API Reference to look up Moss API endpoints, request parameters, return values, streaming events, and shared rules. Start with the scenario guides for integration workflows; use the corresponding Reference page as the authority for field-level implementation.
Authentication
Send a Bearer Token in the request headers for every call. Export the Key as an environment variable and never commit it to a source repository.
curl "https://api.mosi.cn/v1/models" \
-H "Authorization: Bearer $MOSS_API_KEY"Endpoint overview
| Endpoint | Capability | Synchronous | Asynchronous | Streaming |
|---|---|---|---|---|
| GET /v1/models | List available models | ✓ | - | - |
| POST /v1/files | Upload a file and obtain a file_id | ✓ | - | - |
| GET /v1/files | List files | ✓ | - | - |
| GET /v1/files/{file_id} | Get file details | ✓ | - | - |
| DELETE /v1/files/{file_id} | Delete a file | ✓ | - | - |
| POST /v1/audio/speech | Generate single-speaker speech, synchronously or as a stream | ✓ | ✓ | ✓ |
| POST /v1/audio/speech/speakers | Generate multi-speaker dialogue | ✓ | ✓ | - |
| POST /v1/audio/transcriptions | Transcribe audio | ✓ | ✓ | ✓ |
| GET /v1/audio/voices | List voices | ✓ | - | - |
| POST /v1/audio/voices | Create a voice | ✓ | - | - |
| POST /v1/audio/voice/generations | Generate a voice | ✓ | ✓ | - |
| POST /v1/responses | Understand images or video | ✓ | - | - |
| WSS /v1/realtime | Realtime video understanding, bidirectional WebSocket events (Beta) | - | - | ✓ |
| GET /v1/audio/tasks/{task_id} | Get a task | ✓ | - | - |
| POST /v1/images/generations | Generate an image | ✓ | - | - |
Shared rules
| Rule | Description |
|---|---|
| Base URL | https://api.mosi.cn |
| Authentication | Authenticate every request with Authorization: Bearer $MOSS_API_KEY. |
| JSON requests | Speech generation, transcription from a file_id or URL, multimodal understanding, and image generation use application/json. |
| File uploads | Local file uploads use multipart/form-data; follow the field names documented for each endpoint. |
| Synchronous | The request stays connected and returns the result when processing completes. |
| Asynchronous | Long-running audio operations can pass async=true, then poll GET /v1/audio/tasks/{task_id}. |
| Streaming | HTTP streaming endpoints document the stream field and response protocol; realtime video understanding uses bidirectional WebSocket events, not SSE. |
| Errors | Synchronous failures use the platform error object; field-level errors are documented on the endpoint page. |