Skip to content

Commit 42068fe

Browse files
authored
Merge pull request #161 from togethercomputer/blaine/eng-48102-add-missing-voices-module-with-list-api-to-openapi-spec-and
Add spec for listing voices
2 parents 588513d + 6fd233f commit 42068fe

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

openapi.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,45 @@ servers:
1515
security:
1616
- bearerAuth: []
1717
paths:
18+
/voices:
19+
get:
20+
tags: ['Voices']
21+
summary: Fetch available voices for each model
22+
description: Fetch available voices for each model
23+
operationId: fetchVoices
24+
responses:
25+
'200':
26+
description: Success
27+
content:
28+
application/json:
29+
schema:
30+
$ref: '#/components/schemas/ListVoicesResponse'
31+
x-codeSamples:
32+
- lang: Python
33+
label: Together AI SDK (Python)
34+
source: |
35+
from together import Together
36+
import os
37+
38+
client = Together(
39+
api_key=os.environ.get("TOGETHER_API_KEY"),
40+
)
41+
42+
response = client.audio.voices.list()
43+
44+
print(response.data)
45+
- lang: TypeScript
46+
label: Together AI SDK (TypeScript)
47+
source: |
48+
import Together from "together-ai";
49+
50+
const client = new Together({
51+
apiKey: process.env.TOGETHER_API_KEY,
52+
});
53+
54+
const response = await client.audio.voices.list()
55+
56+
console.log(response.data);
1857
/videos/{id}:
1958
get:
2059
tags: ['Video']
@@ -4421,6 +4460,35 @@ components:
44214460
x-default: default
44224461

44234462
schemas:
4463+
ListVoicesResponse:
4464+
description: Response containing a list of models and their available voices.
4465+
type: object
4466+
required: ['data']
4467+
properties:
4468+
data:
4469+
type: array
4470+
items:
4471+
$ref: '#/components/schemas/ModelVoices'
4472+
4473+
ModelVoices:
4474+
description: Represents a model with its available voices.
4475+
type: object
4476+
required: ['model', 'voices']
4477+
properties:
4478+
model:
4479+
type: string
4480+
4481+
voices:
4482+
type: array
4483+
items:
4484+
type: object
4485+
required: ['id', 'name']
4486+
properties:
4487+
id:
4488+
type: string
4489+
name:
4490+
type: string
4491+
44244492
ListAvailibilityZonesResponse:
44254493
description: List of unique availability zones
44264494
type: object

0 commit comments

Comments
 (0)