Create realtime session
curl --request POST \
--url https://gengen.farm/api/gengen/v1/audio/realtime/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"controls": {
"voiceId": "<string>",
"languageCode": "<string>"
}
}
'import requests
url = "https://gengen.farm/api/gengen/v1/audio/realtime/sessions"
payload = { "controls": {
"voiceId": "<string>",
"languageCode": "<string>"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({controls: {voiceId: '<string>', languageCode: '<string>'}})
};
fetch('https://gengen.farm/api/gengen/v1/audio/realtime/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"sessionId": "<string>",
"url": "<string>",
"token": "<string>",
"tokenExpiresAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"inputMode": "completeTurn"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}WebSocket
Create realtime session
Create realtime session. See the Audio API guide for limits, lifecycle and examples.
POST
/
audio
/
realtime
/
sessions
Create realtime session
curl --request POST \
--url https://gengen.farm/api/gengen/v1/audio/realtime/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"controls": {
"voiceId": "<string>",
"languageCode": "<string>"
}
}
'import requests
url = "https://gengen.farm/api/gengen/v1/audio/realtime/sessions"
payload = { "controls": {
"voiceId": "<string>",
"languageCode": "<string>"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({controls: {voiceId: '<string>', languageCode: '<string>'}})
};
fetch('https://gengen.farm/api/gengen/v1/audio/realtime/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"sessionId": "<string>",
"url": "<string>",
"token": "<string>",
"tokenExpiresAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z",
"inputMode": "completeTurn"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}See the Audio API guide for request examples, limits, billing and delivery behavior.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json