API Documentatie
音子AI开放平台 API 文档,提供完整的接口说明和使用示例
文档说明
本文档描述了音子AI开放平台 API 的使用方法。开发者可以通过 API 进行订单创建、查询等操作。 所有接口均需要通过 apiKey 进行鉴权。
Open Platform API Documentatie (v1)
Dit document beschrijft hoe de YinziAI Open Platform API te gebruiken. Ontwikkelaars kunnen de API gebruiken om bestellingen aan te maken, de status op te vragen, en meer.
Authenticatie (Authentication)
Alle interfaces vereisen authenticatie via apiKey. Het systeem identificeert de gebruiker op basis van de apiKey, zonder afhankelijk te zijn van Sessie of Token.
Je kunt je sleutel vinden in "Gebruikerscentrum" -> "API Key".
Er worden twee authenticatiemethoden ondersteund:
-
Header Authenticatie (Aanbevolen)
Authorization: Bearer <your_api_key> -
Query Parameter Authenticatie
?apiKey=<your_api_key>
Basis URL
https://api.yinziai.com
Interface Lijst
1. Bestelling Aanmaken (Create Order)
Maakt een asynchrone verwerkingsbestelling aan. Het systeem genereert automatisch een bestelnummer en retourneert dit.
- URL:
/api/open/v1/order/create - Method:
POST - Content-Type:
application/json
Verzoek Parameters
| Parameternaam | Type | Verplicht | Beschrijving |
|---|---|---|---|
| orderType | string | Ja | Besteltype, zie opsomming hieronder |
| stuff | object | Ja | Materiaalinformatie |
| stuff.pathKey | string | Ja | Bronadres (ondersteunt HTTP link) |
Verzoek Voorbeelden
Track Scheiding (track-separation)
Scheidt audio in zang- en begeleidingssporen.
{
"orderType": "track-separation",
"stuff": {
"pathKey": "https://example.com/audio.mp3"
}
}
Stem Extractie (extract-voice)
Extraheert het zanggedeelte uit de audio.
{
"orderType": "extract-voice",
"stuff": {
"pathKey": "https://example.com/audio.mp3"
}
}
Muziek Extractie (extract-music)
Extraheert het begeleidings-/achtergrondmuziekgedeelte uit de audio.
{
"orderType": "extract-music",
"stuff": {
"pathKey": "https://example.com/audio.mp3"
}
}
Tekst Extractie (extract-text)
Extraheert tekstinhoud uit video of audio.
{
"orderType": "extract-text",
"stuff": {
"pathKey": "https://example.com/video.mp4"
}
}
Reactie Voorbeeld
{
"code": 0,
"data": {
"orderNo": "abc123XYZ789defGHI",
"orderType": "track-separation",
"orderStatus": "processing",
"payStatus": "waiting",
"messageId": "task-id-123"
},
"msg": "success"
}
Reactie Veld Beschrijving
| Veld | Type | Beschrijving |
|---|---|---|
| orderNo | string | Bestelnummer, gebruikt voor latere vragen |
| orderType | string | Besteltype |
| orderStatus | string | Bestelstatus |
| payStatus | string | Betaalstatus |
| messageId | string | Taak Bericht ID |
2. Bestelling Opvragen (Query Order)
Vraagt de verwerkingsstatus en het resultaat van de bestelling op. Na voltooiing van de verwerking wordt de downloadlink voor het resultaat geretourneerd.
Let op: De eerste vraag na voltooiing van de bestelling zal automatisch credits afschrijven.
- URL:
/api/open/v1/order/query - Method:
GET
Verzoek Parameters
| Parameternaam | Type | Verplicht | Beschrijving |
|---|---|---|---|
| orderNo | string | Ja | Bestelnummer |
Verzoek Voorbeeld
GET /api/open/v1/order/query?orderNo=abc123XYZ789defGHI
Authorization: Bearer <your_api_key>
Reactie Voorbeeld (Verwerken)
{
"code": 0,
"data": {
"orderNo": "abc123XYZ789defGHI",
"orderType": "track-separation",
"status": "processing",
"cost": 0,
"reason": null,
"stuffs": [],
"balance": 1000
},
"msg": "success"
}
Reactie Voorbeeld (Voltooid)
{
"code": 0,
"data": {
"orderNo": "abc123XYZ789defGHI",
"orderType": "track-separation",
"status": "finish",
"cost": 10,
"reason": null,
"stuffs": [
{
"name": "vocals.mp3",
"business": "vocals",
"url": "https://cdn.example.com/result/vocals.mp3"
},
{
"name": "accompaniment.mp3",
"business": "accompaniment",
"url": "https://cdn.example.com/result/accompaniment.mp3"
}
],
"balance": 990
},
"msg": "success"
}
Reactie Veld Beschrijving
| Veld | Type | Beschrijving |
|---|---|---|
| orderNo | string | Bestelnummer |
| orderType | string | Besteltype |
| status | string | Bestelstatus |
| cost | number | Verbruikte credits |
| reason | string | Mislukkingsreden (alleen bij mislukking) |
| stuffs | array | Resultatenlijst |
| stuffs[].name | string | Bestandsnaam |
| stuffs[].business | string | Bedrijfstype (vocals/accompaniment/caption, etc.) |
| stuffs[].url | string | Downloadlink (1 uur geldig) |
| balance | number | Huidige beschikbare creditsaldo van de gebruiker |
3. Korte Video Analyse (Short Video Analyze)
Real-time analyse van korte video deel-links om video-informatie en watermerk-vrije downloadadressen te verkrijgen.
Let op: Deze interface is een real-time interface, die onmiddellijk credits zal afschrijven en het resultaat zal retourneren.
- URL:
/api/open/v1/short-video/analyze - Method:
POST - Content-Type:
application/json
Verzoek Parameters
| Parameternaam | Type | Verplicht | Beschrijving |
|---|---|---|---|
| link | string | Ja | Korte video deel-link |
Verzoek Voorbeeld
{
"link": "https://v.douyin.com/ixxxxxx/"
}
Reactie Voorbeeld
{
"code": 0,
"data": {
"title": "Videotitel",
"author": "Auteur Bijnaam",
"cover": "https://cdn.example.com/cover.jpg",
"videoUrl": "https://cdn.example.com/video.mp4",
"musicUrl": "https://cdn.example.com/music.mp3",
"balance": 990
},
"msg": "success"
}
Reactie Veld Beschrijving
| Veld | Type | Beschrijving |
|---|---|---|
| title | string | Videotitel |
| author | string | Auteur Bijnaam |
| cover | string | Omslagafbeelding adres |
| videoUrl | string | Watermerk-vrij video downloadadres |
| musicUrl | string | Achtergrondmuziek downloadadres (indien beschikbaar) |
| balance | number | Huidige beschikbare creditsaldo van de gebruiker |
Foutcode Beschrijving
| Foutcode | Beschrijving |
|---|---|
| 0 | Succes |
| 400 | Verzoek parameter fout |
| 401 | Authenticatie mislukt (API Key ongeldig of ontbreekt) |
| 500 | Interne serverfout |
Veelvoorkomende Foutmeldingen
| Foutmelding | Beschrijving |
|---|---|
| API Key is required | API Key is vereist |
| Invalid API Key | API Key is ongeldig |
| pathKey is required | Bronadres is vereist |
| Order not found | Bestelling bestaat niet of behoort niet toe aan huidige gebruiker |
| ErrorCode.USER_BLANCE_NOT_ENOUGH | Onvoldoende creditsaldo |
Bijlage
OrderType (Besteltype)
| Waarde | Beschrijving |
|---|---|
| track-separation | Track scheiding (scheid zang en begeleiding) |
| extract-voice | Stem extractie |
| extract-music | Begeleiding extractie |
| extract-text | Tekst extractie |
OrderStatus (Bestelstatus)
| Waarde | Beschrijving |
|---|---|
| pending | In wachtrij |
| processing | Verwerken |
| finish | Voltooid |
| failed | Mislukt |
| timeout | Time-out |
Ondersteunde Korte Video Platforms
- Douyin
- Kuaishou
- Xiaohongshu
- En andere mainstream korte video platforms