@audicle/sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +244 -0
- package/dist/index.cjs +538 -0
- package/dist/index.d.cts +966 -0
- package/dist/index.d.ts +966 -0
- package/dist/index.js +492 -0
- package/package.json +44 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,966 @@
|
|
|
1
|
+
import createClient from 'openapi-fetch';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This file was auto-generated by openapi-typescript.
|
|
5
|
+
* Do not make direct changes to the file.
|
|
6
|
+
*/
|
|
7
|
+
export interface paths {
|
|
8
|
+
"/v1/health": {
|
|
9
|
+
parameters: {
|
|
10
|
+
query?: never;
|
|
11
|
+
header?: never;
|
|
12
|
+
path?: never;
|
|
13
|
+
cookie?: never;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Service health check
|
|
17
|
+
* @description Returns the health status of the service and its dependencies.
|
|
18
|
+
*/
|
|
19
|
+
get: operations["health-check"];
|
|
20
|
+
put?: never;
|
|
21
|
+
post?: never;
|
|
22
|
+
delete?: never;
|
|
23
|
+
options?: never;
|
|
24
|
+
head?: never;
|
|
25
|
+
patch?: never;
|
|
26
|
+
trace?: never;
|
|
27
|
+
};
|
|
28
|
+
"/v1/transcribe": {
|
|
29
|
+
parameters: {
|
|
30
|
+
query?: never;
|
|
31
|
+
header?: never;
|
|
32
|
+
path?: never;
|
|
33
|
+
cookie?: never;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Stream audio for live transcription
|
|
37
|
+
* @description Initiates a WebSocket connection for live audio transcription.
|
|
38
|
+
*
|
|
39
|
+
* The `model` query parameter determines the transcription backend:
|
|
40
|
+
* - `default`, `turbo` — Whisper-based streaming (TranscriptionSession DO)
|
|
41
|
+
* - `gpt-realtime-mini`, `deepgram-nova-3` — LLM provider relay (RealtimeSession DO)
|
|
42
|
+
*
|
|
43
|
+
* **Protocol:** Send binary audio frames (PCM s16le) over the WebSocket. The server responds with JSON messages:
|
|
44
|
+
* - `{"type": "session.begin", "id": "...", "model": "..."}` — connection established
|
|
45
|
+
* - `{"type": "transcript", "is_final": true/false, "transcript": {"text": "...", "start": 0.0, "end": 1.5}}` — transcription results
|
|
46
|
+
* - `{"type": "vad", "event": "speech_start|speech_end", "timestamp_ms": N}` — voice activity detection (realtime models only)
|
|
47
|
+
* - `{"type": "error", "code": "...", "message": "..."}` — error occurred
|
|
48
|
+
* - `{"type": "session.end", "reason": "...", "usage": {...}}` — session ended
|
|
49
|
+
*
|
|
50
|
+
* **Client → Server JSON messages:**
|
|
51
|
+
* - `{"type": "finalize"}` — flush current audio buffer and get final transcript
|
|
52
|
+
* - `{"type": "stop"}` — end the session
|
|
53
|
+
* - `{"type": "configure", ...}` — update session config mid-stream
|
|
54
|
+
*
|
|
55
|
+
* **WebSocket close codes:** 4400 (bad request), 4401 (unauthorized), 4402 (payment required), 4404 (not found), 4429 (rate limited).
|
|
56
|
+
*/
|
|
57
|
+
get: operations["stream-audio"];
|
|
58
|
+
put?: never;
|
|
59
|
+
/**
|
|
60
|
+
* Transcribe audio
|
|
61
|
+
* @description Transcribe audio. Supports two input modes:
|
|
62
|
+
*
|
|
63
|
+
* 1. **Raw binary** — Send audio bytes directly with `Content-Type: audio/*`. Options via query params.
|
|
64
|
+
* 2. **Multipart** — Upload a file via `multipart/form-data` with a `file` field, or provide an `audio_url` to transcribe from a URL. Exactly one of `file` or `audio_url` is required.
|
|
65
|
+
*
|
|
66
|
+
* **Sync by default.** Files under 25 MB return the completed transcript in the response (200). Larger files or `Prefer: respond-async` queue for async processing (202 with `Location` header).
|
|
67
|
+
*
|
|
68
|
+
* Use `Prefer: wait=N` to set your timeout: "wait up to N seconds, otherwise give me a 202."
|
|
69
|
+
*
|
|
70
|
+
* Use `Idempotency-Key` header for safe retries — same key within 24h returns the cached result.
|
|
71
|
+
*/
|
|
72
|
+
post: operations["transcribe-file"];
|
|
73
|
+
delete?: never;
|
|
74
|
+
options?: never;
|
|
75
|
+
head?: never;
|
|
76
|
+
patch?: never;
|
|
77
|
+
trace?: never;
|
|
78
|
+
};
|
|
79
|
+
"/v1/transcribe/{id}/observe": {
|
|
80
|
+
parameters: {
|
|
81
|
+
query?: never;
|
|
82
|
+
header?: never;
|
|
83
|
+
path?: never;
|
|
84
|
+
cookie?: never;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Observe a live transcription session
|
|
88
|
+
* @description Opens a read-only WebSocket that receives the same transcript messages as the primary session. Useful for dashboard live views.
|
|
89
|
+
*/
|
|
90
|
+
get: operations["observe-session"];
|
|
91
|
+
put?: never;
|
|
92
|
+
post?: never;
|
|
93
|
+
delete?: never;
|
|
94
|
+
options?: never;
|
|
95
|
+
head?: never;
|
|
96
|
+
patch?: never;
|
|
97
|
+
trace?: never;
|
|
98
|
+
};
|
|
99
|
+
"/v1/usage": {
|
|
100
|
+
parameters: {
|
|
101
|
+
query?: never;
|
|
102
|
+
header?: never;
|
|
103
|
+
path?: never;
|
|
104
|
+
cookie?: never;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Get usage summary
|
|
108
|
+
* @description Returns usage statistics for the authenticated user within a date range.
|
|
109
|
+
*/
|
|
110
|
+
get: operations["get-usage"];
|
|
111
|
+
put?: never;
|
|
112
|
+
post?: never;
|
|
113
|
+
delete?: never;
|
|
114
|
+
options?: never;
|
|
115
|
+
head?: never;
|
|
116
|
+
patch?: never;
|
|
117
|
+
trace?: never;
|
|
118
|
+
};
|
|
119
|
+
"/v1/transcripts": {
|
|
120
|
+
parameters: {
|
|
121
|
+
query?: never;
|
|
122
|
+
header?: never;
|
|
123
|
+
path?: never;
|
|
124
|
+
cookie?: never;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* List transcription jobs
|
|
128
|
+
* @description Returns a paginated list of transcription jobs with cursor-based pagination.
|
|
129
|
+
*/
|
|
130
|
+
get: operations["list-transcripts"];
|
|
131
|
+
put?: never;
|
|
132
|
+
post?: never;
|
|
133
|
+
delete?: never;
|
|
134
|
+
options?: never;
|
|
135
|
+
head?: never;
|
|
136
|
+
patch?: never;
|
|
137
|
+
trace?: never;
|
|
138
|
+
};
|
|
139
|
+
"/v1/transcripts/{id}": {
|
|
140
|
+
parameters: {
|
|
141
|
+
query?: never;
|
|
142
|
+
header?: never;
|
|
143
|
+
path?: never;
|
|
144
|
+
cookie?: never;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Get a transcription job
|
|
148
|
+
* @description Returns the transcription job details. Use `?format=` to get alternative output formats: `json` (default), `text` (plain transcript), `srt` (SubRip subtitles), `vtt` (WebVTT subtitles).
|
|
149
|
+
*/
|
|
150
|
+
get: operations["get-transcript"];
|
|
151
|
+
put?: never;
|
|
152
|
+
post?: never;
|
|
153
|
+
/**
|
|
154
|
+
* Delete a transcription job
|
|
155
|
+
* @description Deletes the transcription job and associated result data from storage.
|
|
156
|
+
*/
|
|
157
|
+
delete: operations["delete-transcript"];
|
|
158
|
+
options?: never;
|
|
159
|
+
head?: never;
|
|
160
|
+
patch?: never;
|
|
161
|
+
trace?: never;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export interface components {
|
|
165
|
+
schemas: {
|
|
166
|
+
HealthResponse: {
|
|
167
|
+
/** @enum {string} */
|
|
168
|
+
status: "healthy" | "degraded" | "unhealthy";
|
|
169
|
+
version: string;
|
|
170
|
+
checks: {
|
|
171
|
+
database?: {
|
|
172
|
+
/** @enum {string} */
|
|
173
|
+
status: "pass" | "fail";
|
|
174
|
+
latency_ms: number;
|
|
175
|
+
};
|
|
176
|
+
storage?: {
|
|
177
|
+
/** @enum {string} */
|
|
178
|
+
status: "pass" | "fail";
|
|
179
|
+
latency_ms: number;
|
|
180
|
+
};
|
|
181
|
+
ai?: {
|
|
182
|
+
/** @enum {string} */
|
|
183
|
+
status: "pass" | "fail";
|
|
184
|
+
latency_ms: number;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
ErrorResponse: {
|
|
189
|
+
error: {
|
|
190
|
+
code: string;
|
|
191
|
+
message: string;
|
|
192
|
+
request_id: string;
|
|
193
|
+
details?: {
|
|
194
|
+
[key: string]: unknown;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
Transcription: {
|
|
199
|
+
id: string;
|
|
200
|
+
/** @enum {string} */
|
|
201
|
+
status: "queued" | "processing" | "streaming" | "completed" | "error";
|
|
202
|
+
language: string | null;
|
|
203
|
+
detected_language: string | null;
|
|
204
|
+
model: string;
|
|
205
|
+
speaker_labels: boolean;
|
|
206
|
+
word_timestamps: boolean;
|
|
207
|
+
duration_seconds: number | null;
|
|
208
|
+
audio_url: string | null;
|
|
209
|
+
webhook_url: string | null;
|
|
210
|
+
/** @enum {string|null} */
|
|
211
|
+
webhook_status: "pending" | "delivered" | "failed" | null;
|
|
212
|
+
metadata: {
|
|
213
|
+
[key: string]: string;
|
|
214
|
+
} | null;
|
|
215
|
+
error: {
|
|
216
|
+
code: string;
|
|
217
|
+
message: string;
|
|
218
|
+
} | null;
|
|
219
|
+
result: components["schemas"]["TranscriptionResult"];
|
|
220
|
+
usage: components["schemas"]["TranscriptionUsage"];
|
|
221
|
+
created_at: string;
|
|
222
|
+
updated_at: string;
|
|
223
|
+
};
|
|
224
|
+
/** @description Transcription result, populated when status is 'completed' */
|
|
225
|
+
TranscriptionResult: {
|
|
226
|
+
/** @description Full transcript text */
|
|
227
|
+
text: string;
|
|
228
|
+
/** @description Detected language code */
|
|
229
|
+
language?: string;
|
|
230
|
+
/** @description Audio duration in seconds */
|
|
231
|
+
duration_seconds?: number;
|
|
232
|
+
/** @description Transcript segments with timestamps */
|
|
233
|
+
segments: components["schemas"]["TranscriptionSegment"][];
|
|
234
|
+
/** @description Word-level timestamps */
|
|
235
|
+
words: components["schemas"]["TranscriptionWord"][];
|
|
236
|
+
} | null;
|
|
237
|
+
TranscriptionSegment: {
|
|
238
|
+
id: number;
|
|
239
|
+
start: number;
|
|
240
|
+
end: number;
|
|
241
|
+
text: string;
|
|
242
|
+
confidence?: number;
|
|
243
|
+
words?: components["schemas"]["TranscriptionWord"][];
|
|
244
|
+
};
|
|
245
|
+
TranscriptionWord: {
|
|
246
|
+
text: string;
|
|
247
|
+
start: number;
|
|
248
|
+
end: number;
|
|
249
|
+
confidence?: number;
|
|
250
|
+
};
|
|
251
|
+
/** @description Usage and cost info, populated when status is 'completed' */
|
|
252
|
+
TranscriptionUsage: {
|
|
253
|
+
duration_seconds: number;
|
|
254
|
+
cost_cents: number;
|
|
255
|
+
model: string;
|
|
256
|
+
} | null;
|
|
257
|
+
UsageResponse: {
|
|
258
|
+
total_requests: number;
|
|
259
|
+
total_duration_seconds: number;
|
|
260
|
+
total_cost_cents: number;
|
|
261
|
+
breakdown: {
|
|
262
|
+
period: string;
|
|
263
|
+
requests: number;
|
|
264
|
+
duration_seconds: number;
|
|
265
|
+
cost_cents: number;
|
|
266
|
+
}[];
|
|
267
|
+
};
|
|
268
|
+
TranscriptionListResponse: {
|
|
269
|
+
data: components["schemas"]["Transcription"][];
|
|
270
|
+
has_more: boolean;
|
|
271
|
+
next_cursor: string | null;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
responses: never;
|
|
275
|
+
parameters: never;
|
|
276
|
+
requestBodies: never;
|
|
277
|
+
headers: never;
|
|
278
|
+
pathItems: never;
|
|
279
|
+
}
|
|
280
|
+
export interface operations {
|
|
281
|
+
"health-check": {
|
|
282
|
+
parameters: {
|
|
283
|
+
query?: never;
|
|
284
|
+
header?: never;
|
|
285
|
+
path?: never;
|
|
286
|
+
cookie?: never;
|
|
287
|
+
};
|
|
288
|
+
requestBody?: never;
|
|
289
|
+
responses: {
|
|
290
|
+
/** @description Service is healthy */
|
|
291
|
+
200: {
|
|
292
|
+
headers: {
|
|
293
|
+
[name: string]: unknown;
|
|
294
|
+
};
|
|
295
|
+
content: {
|
|
296
|
+
"application/json": components["schemas"]["HealthResponse"];
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
/** @description Service is degraded or unhealthy */
|
|
300
|
+
503: {
|
|
301
|
+
headers: {
|
|
302
|
+
[name: string]: unknown;
|
|
303
|
+
};
|
|
304
|
+
content: {
|
|
305
|
+
"application/json": components["schemas"]["HealthResponse"];
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
"stream-audio": {
|
|
311
|
+
parameters: {
|
|
312
|
+
query: {
|
|
313
|
+
/** @description API key for authentication */
|
|
314
|
+
token: string;
|
|
315
|
+
/** @description Transcription model */
|
|
316
|
+
model?: "default" | "turbo" | "gpt-realtime-mini" | "deepgram-nova-3";
|
|
317
|
+
/** @description ISO 639-1 language code */
|
|
318
|
+
language?: "af" | "am" | "ar" | "as" | "az" | "ba" | "be" | "bg" | "bn" | "bo" | "br" | "bs" | "ca" | "cs" | "cy" | "da" | "de" | "el" | "en" | "es" | "et" | "eu" | "fa" | "fi" | "fo" | "fr" | "gl" | "gu" | "ha" | "haw" | "he" | "hi" | "hr" | "ht" | "hu" | "hy" | "id" | "is" | "it" | "ja" | "jw" | "ka" | "kk" | "km" | "kn" | "ko" | "la" | "lb" | "ln" | "lo" | "lt" | "lv" | "mg" | "mi" | "mk" | "ml" | "mn" | "mr" | "ms" | "mt" | "my" | "ne" | "nl" | "nn" | "no" | "oc" | "pa" | "pl" | "ps" | "pt" | "ro" | "ru" | "sa" | "sd" | "si" | "sk" | "sl" | "sn" | "so" | "sq" | "sr" | "su" | "sv" | "sw" | "ta" | "te" | "tg" | "th" | "tk" | "tl" | "tr" | "tt" | "uk" | "ur" | "uz" | "vi" | "yi" | "yo" | "zh" | "yue";
|
|
319
|
+
/** @description Audio sample rate in Hz (8000-48000) */
|
|
320
|
+
sample_rate?: number;
|
|
321
|
+
/** @description Audio encoding */
|
|
322
|
+
encoding?: "pcm_s16le";
|
|
323
|
+
/** @description Include interim (partial) transcripts (realtime models only) */
|
|
324
|
+
interim_results?: boolean | null;
|
|
325
|
+
};
|
|
326
|
+
header?: never;
|
|
327
|
+
path?: never;
|
|
328
|
+
cookie?: never;
|
|
329
|
+
};
|
|
330
|
+
requestBody?: never;
|
|
331
|
+
responses: {
|
|
332
|
+
/** @description WebSocket connection established */
|
|
333
|
+
101: {
|
|
334
|
+
headers: {
|
|
335
|
+
[name: string]: unknown;
|
|
336
|
+
};
|
|
337
|
+
content?: never;
|
|
338
|
+
};
|
|
339
|
+
/** @description Invalid request parameters */
|
|
340
|
+
400: {
|
|
341
|
+
headers: {
|
|
342
|
+
[name: string]: unknown;
|
|
343
|
+
};
|
|
344
|
+
content: {
|
|
345
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
/** @description Invalid or missing API key */
|
|
349
|
+
401: {
|
|
350
|
+
headers: {
|
|
351
|
+
[name: string]: unknown;
|
|
352
|
+
};
|
|
353
|
+
content: {
|
|
354
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
/** @description Payment required */
|
|
358
|
+
402: {
|
|
359
|
+
headers: {
|
|
360
|
+
[name: string]: unknown;
|
|
361
|
+
};
|
|
362
|
+
content: {
|
|
363
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
"transcribe-file": {
|
|
369
|
+
parameters: {
|
|
370
|
+
query?: never;
|
|
371
|
+
header?: never;
|
|
372
|
+
path?: never;
|
|
373
|
+
cookie?: never;
|
|
374
|
+
};
|
|
375
|
+
requestBody: {
|
|
376
|
+
content: {
|
|
377
|
+
"audio/*": string;
|
|
378
|
+
"multipart/form-data": {
|
|
379
|
+
/**
|
|
380
|
+
* Format: binary
|
|
381
|
+
* @description Audio file to transcribe (mutually exclusive with audio_url)
|
|
382
|
+
*/
|
|
383
|
+
file?: string;
|
|
384
|
+
/**
|
|
385
|
+
* Format: uri
|
|
386
|
+
* @description URL of audio file to transcribe (must be HTTPS, mutually exclusive with file)
|
|
387
|
+
*/
|
|
388
|
+
audio_url?: string;
|
|
389
|
+
/**
|
|
390
|
+
* @default default
|
|
391
|
+
* @enum {string}
|
|
392
|
+
*/
|
|
393
|
+
model?: "default" | "turbo";
|
|
394
|
+
language?: string;
|
|
395
|
+
/**
|
|
396
|
+
* @description Enable speaker diarization
|
|
397
|
+
* @default true
|
|
398
|
+
* @enum {string}
|
|
399
|
+
*/
|
|
400
|
+
speaker_labels?: "true" | "false";
|
|
401
|
+
/**
|
|
402
|
+
* @default true
|
|
403
|
+
* @enum {string}
|
|
404
|
+
*/
|
|
405
|
+
word_timestamps?: "true" | "false";
|
|
406
|
+
webhook_url?: string;
|
|
407
|
+
/** @description JSON-encoded key-value pairs */
|
|
408
|
+
metadata?: string;
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
responses: {
|
|
413
|
+
/** @description Transcription completed synchronously */
|
|
414
|
+
200: {
|
|
415
|
+
headers: {
|
|
416
|
+
[name: string]: unknown;
|
|
417
|
+
};
|
|
418
|
+
content: {
|
|
419
|
+
"application/json": components["schemas"]["Transcription"];
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
/** @description Transcription queued for async processing */
|
|
423
|
+
202: {
|
|
424
|
+
headers: {
|
|
425
|
+
[name: string]: unknown;
|
|
426
|
+
};
|
|
427
|
+
content: {
|
|
428
|
+
"application/json": components["schemas"]["Transcription"];
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
/** @description Invalid request */
|
|
432
|
+
400: {
|
|
433
|
+
headers: {
|
|
434
|
+
[name: string]: unknown;
|
|
435
|
+
};
|
|
436
|
+
content: {
|
|
437
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
/** @description Invalid or missing API key */
|
|
441
|
+
401: {
|
|
442
|
+
headers: {
|
|
443
|
+
[name: string]: unknown;
|
|
444
|
+
};
|
|
445
|
+
content: {
|
|
446
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
/** @description Payment required */
|
|
450
|
+
402: {
|
|
451
|
+
headers: {
|
|
452
|
+
[name: string]: unknown;
|
|
453
|
+
};
|
|
454
|
+
content: {
|
|
455
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
456
|
+
};
|
|
457
|
+
};
|
|
458
|
+
/** @description File too large */
|
|
459
|
+
413: {
|
|
460
|
+
headers: {
|
|
461
|
+
[name: string]: unknown;
|
|
462
|
+
};
|
|
463
|
+
content: {
|
|
464
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
465
|
+
};
|
|
466
|
+
};
|
|
467
|
+
/** @description Rate limit exceeded */
|
|
468
|
+
429: {
|
|
469
|
+
headers: {
|
|
470
|
+
[name: string]: unknown;
|
|
471
|
+
};
|
|
472
|
+
content: {
|
|
473
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
474
|
+
};
|
|
475
|
+
};
|
|
476
|
+
};
|
|
477
|
+
};
|
|
478
|
+
"observe-session": {
|
|
479
|
+
parameters: {
|
|
480
|
+
query: {
|
|
481
|
+
/** @description API key for authentication */
|
|
482
|
+
token: string;
|
|
483
|
+
};
|
|
484
|
+
header?: never;
|
|
485
|
+
path: {
|
|
486
|
+
/** @description Resource ID */
|
|
487
|
+
id: string;
|
|
488
|
+
};
|
|
489
|
+
cookie?: never;
|
|
490
|
+
};
|
|
491
|
+
requestBody?: never;
|
|
492
|
+
responses: {
|
|
493
|
+
/** @description WebSocket connection established */
|
|
494
|
+
101: {
|
|
495
|
+
headers: {
|
|
496
|
+
[name: string]: unknown;
|
|
497
|
+
};
|
|
498
|
+
content?: never;
|
|
499
|
+
};
|
|
500
|
+
/** @description Invalid request */
|
|
501
|
+
400: {
|
|
502
|
+
headers: {
|
|
503
|
+
[name: string]: unknown;
|
|
504
|
+
};
|
|
505
|
+
content: {
|
|
506
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
/** @description Invalid or missing API key */
|
|
510
|
+
401: {
|
|
511
|
+
headers: {
|
|
512
|
+
[name: string]: unknown;
|
|
513
|
+
};
|
|
514
|
+
content: {
|
|
515
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
516
|
+
};
|
|
517
|
+
};
|
|
518
|
+
/** @description Transcription not found */
|
|
519
|
+
404: {
|
|
520
|
+
headers: {
|
|
521
|
+
[name: string]: unknown;
|
|
522
|
+
};
|
|
523
|
+
content: {
|
|
524
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
525
|
+
};
|
|
526
|
+
};
|
|
527
|
+
};
|
|
528
|
+
};
|
|
529
|
+
"get-usage": {
|
|
530
|
+
parameters: {
|
|
531
|
+
query: {
|
|
532
|
+
/** @description Start date (YYYY-MM-DD) */
|
|
533
|
+
start_date: string;
|
|
534
|
+
/** @description End date (YYYY-MM-DD) */
|
|
535
|
+
end_date: string;
|
|
536
|
+
/** @description Time granularity for breakdown */
|
|
537
|
+
granularity?: "hour" | "day";
|
|
538
|
+
};
|
|
539
|
+
header?: never;
|
|
540
|
+
path?: never;
|
|
541
|
+
cookie?: never;
|
|
542
|
+
};
|
|
543
|
+
requestBody?: never;
|
|
544
|
+
responses: {
|
|
545
|
+
/** @description Usage summary */
|
|
546
|
+
200: {
|
|
547
|
+
headers: {
|
|
548
|
+
[name: string]: unknown;
|
|
549
|
+
};
|
|
550
|
+
content: {
|
|
551
|
+
"application/json": components["schemas"]["UsageResponse"];
|
|
552
|
+
};
|
|
553
|
+
};
|
|
554
|
+
/** @description Invalid request */
|
|
555
|
+
400: {
|
|
556
|
+
headers: {
|
|
557
|
+
[name: string]: unknown;
|
|
558
|
+
};
|
|
559
|
+
content: {
|
|
560
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
561
|
+
};
|
|
562
|
+
};
|
|
563
|
+
/** @description Missing or invalid API key */
|
|
564
|
+
401: {
|
|
565
|
+
headers: {
|
|
566
|
+
[name: string]: unknown;
|
|
567
|
+
};
|
|
568
|
+
content: {
|
|
569
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
570
|
+
};
|
|
571
|
+
};
|
|
572
|
+
/** @description Rate limit exceeded */
|
|
573
|
+
429: {
|
|
574
|
+
headers: {
|
|
575
|
+
[name: string]: unknown;
|
|
576
|
+
};
|
|
577
|
+
content: {
|
|
578
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
579
|
+
};
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
"list-transcripts": {
|
|
584
|
+
parameters: {
|
|
585
|
+
query?: {
|
|
586
|
+
cursor?: string;
|
|
587
|
+
/** @description Number of results (1-100, default 20) */
|
|
588
|
+
limit?: number;
|
|
589
|
+
status?: "queued" | "processing" | "streaming" | "completed" | "error";
|
|
590
|
+
/** @description ISO 8601 datetime */
|
|
591
|
+
created_after?: string;
|
|
592
|
+
/** @description ISO 8601 datetime */
|
|
593
|
+
created_before?: string;
|
|
594
|
+
};
|
|
595
|
+
header?: never;
|
|
596
|
+
path?: never;
|
|
597
|
+
cookie?: never;
|
|
598
|
+
};
|
|
599
|
+
requestBody?: never;
|
|
600
|
+
responses: {
|
|
601
|
+
/** @description List of transcriptions */
|
|
602
|
+
200: {
|
|
603
|
+
headers: {
|
|
604
|
+
[name: string]: unknown;
|
|
605
|
+
};
|
|
606
|
+
content: {
|
|
607
|
+
"application/json": components["schemas"]["TranscriptionListResponse"];
|
|
608
|
+
};
|
|
609
|
+
};
|
|
610
|
+
/** @description Missing or invalid API key */
|
|
611
|
+
401: {
|
|
612
|
+
headers: {
|
|
613
|
+
[name: string]: unknown;
|
|
614
|
+
};
|
|
615
|
+
content: {
|
|
616
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
/** @description Rate limit exceeded */
|
|
620
|
+
429: {
|
|
621
|
+
headers: {
|
|
622
|
+
[name: string]: unknown;
|
|
623
|
+
};
|
|
624
|
+
content: {
|
|
625
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
626
|
+
};
|
|
627
|
+
};
|
|
628
|
+
};
|
|
629
|
+
};
|
|
630
|
+
"get-transcript": {
|
|
631
|
+
parameters: {
|
|
632
|
+
query?: {
|
|
633
|
+
/** @description Output format: json (default), text, srt, or vtt */
|
|
634
|
+
format?: "json" | "text" | "srt" | "vtt";
|
|
635
|
+
};
|
|
636
|
+
header?: never;
|
|
637
|
+
path: {
|
|
638
|
+
/** @description Resource ID */
|
|
639
|
+
id: string;
|
|
640
|
+
};
|
|
641
|
+
cookie?: never;
|
|
642
|
+
};
|
|
643
|
+
requestBody?: never;
|
|
644
|
+
responses: {
|
|
645
|
+
/** @description Transcription details (json format). For text/srt/vtt formats, returns text/plain or text/vtt. */
|
|
646
|
+
200: {
|
|
647
|
+
headers: {
|
|
648
|
+
[name: string]: unknown;
|
|
649
|
+
};
|
|
650
|
+
content: {
|
|
651
|
+
"application/json": components["schemas"]["Transcription"];
|
|
652
|
+
};
|
|
653
|
+
};
|
|
654
|
+
/** @description Missing or invalid API key */
|
|
655
|
+
401: {
|
|
656
|
+
headers: {
|
|
657
|
+
[name: string]: unknown;
|
|
658
|
+
};
|
|
659
|
+
content: {
|
|
660
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
661
|
+
};
|
|
662
|
+
};
|
|
663
|
+
/** @description Transcription not found */
|
|
664
|
+
404: {
|
|
665
|
+
headers: {
|
|
666
|
+
[name: string]: unknown;
|
|
667
|
+
};
|
|
668
|
+
content: {
|
|
669
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
670
|
+
};
|
|
671
|
+
};
|
|
672
|
+
/** @description Rate limit exceeded */
|
|
673
|
+
429: {
|
|
674
|
+
headers: {
|
|
675
|
+
[name: string]: unknown;
|
|
676
|
+
};
|
|
677
|
+
content: {
|
|
678
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
679
|
+
};
|
|
680
|
+
};
|
|
681
|
+
};
|
|
682
|
+
};
|
|
683
|
+
"delete-transcript": {
|
|
684
|
+
parameters: {
|
|
685
|
+
query?: never;
|
|
686
|
+
header?: never;
|
|
687
|
+
path: {
|
|
688
|
+
/** @description Resource ID */
|
|
689
|
+
id: string;
|
|
690
|
+
};
|
|
691
|
+
cookie?: never;
|
|
692
|
+
};
|
|
693
|
+
requestBody?: never;
|
|
694
|
+
responses: {
|
|
695
|
+
/** @description Transcription deleted */
|
|
696
|
+
204: {
|
|
697
|
+
headers: {
|
|
698
|
+
[name: string]: unknown;
|
|
699
|
+
};
|
|
700
|
+
content?: never;
|
|
701
|
+
};
|
|
702
|
+
/** @description Missing or invalid API key */
|
|
703
|
+
401: {
|
|
704
|
+
headers: {
|
|
705
|
+
[name: string]: unknown;
|
|
706
|
+
};
|
|
707
|
+
content: {
|
|
708
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
709
|
+
};
|
|
710
|
+
};
|
|
711
|
+
/** @description Transcription not found */
|
|
712
|
+
404: {
|
|
713
|
+
headers: {
|
|
714
|
+
[name: string]: unknown;
|
|
715
|
+
};
|
|
716
|
+
content: {
|
|
717
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
718
|
+
};
|
|
719
|
+
};
|
|
720
|
+
/** @description Rate limit exceeded */
|
|
721
|
+
429: {
|
|
722
|
+
headers: {
|
|
723
|
+
[name: string]: unknown;
|
|
724
|
+
};
|
|
725
|
+
content: {
|
|
726
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
727
|
+
};
|
|
728
|
+
};
|
|
729
|
+
};
|
|
730
|
+
};
|
|
731
|
+
}
|
|
732
|
+
/** Opaque type alias for the configured openapi-fetch client */
|
|
733
|
+
export type ApiClient = ReturnType<typeof createClient<paths>>;
|
|
734
|
+
export type Transcription = components["schemas"]["Transcription"];
|
|
735
|
+
export type TranscriptionResult = components["schemas"]["TranscriptionResult"];
|
|
736
|
+
export type TranscriptionSegment = components["schemas"]["TranscriptionSegment"];
|
|
737
|
+
export type TranscriptionWord = components["schemas"]["TranscriptionWord"];
|
|
738
|
+
export type TranscriptionUsage = components["schemas"]["TranscriptionUsage"];
|
|
739
|
+
export type TranscriptionListResponse = components["schemas"]["TranscriptionListResponse"];
|
|
740
|
+
export type UsageResponse = components["schemas"]["UsageResponse"];
|
|
741
|
+
export type HealthResponse = components["schemas"]["HealthResponse"];
|
|
742
|
+
export type ErrorResponse = components["schemas"]["ErrorResponse"];
|
|
743
|
+
export type TranscriptionStatus = Transcription["status"];
|
|
744
|
+
export type TranscriptionModel = "default" | "turbo" | "gpt-realtime-mini" | "deepgram-nova-3";
|
|
745
|
+
export interface ListTranscriptsParams {
|
|
746
|
+
cursor?: string;
|
|
747
|
+
limit?: number;
|
|
748
|
+
status?: "queued" | "processing" | "streaming" | "completed" | "error";
|
|
749
|
+
createdAfter?: string;
|
|
750
|
+
createdBefore?: string;
|
|
751
|
+
}
|
|
752
|
+
export interface WaitOptions {
|
|
753
|
+
/** Polling interval in milliseconds (default: 3000) */
|
|
754
|
+
interval?: number;
|
|
755
|
+
/** Maximum time to wait in milliseconds (default: 300000 = 5 minutes) */
|
|
756
|
+
timeout?: number;
|
|
757
|
+
}
|
|
758
|
+
declare class TranscriptsResource {
|
|
759
|
+
#private;
|
|
760
|
+
constructor(api: ApiClient, baseUrl: string, apiKey: string);
|
|
761
|
+
get(id: string): Promise<Transcription>;
|
|
762
|
+
getText(id: string): Promise<string>;
|
|
763
|
+
getSrt(id: string): Promise<string>;
|
|
764
|
+
getVtt(id: string): Promise<string>;
|
|
765
|
+
list(params?: ListTranscriptsParams): Promise<TranscriptionListResponse>;
|
|
766
|
+
listAll(params?: Omit<ListTranscriptsParams, "cursor">): AsyncGenerator<Transcription>;
|
|
767
|
+
delete(id: string): Promise<void>;
|
|
768
|
+
wait(id: string, options?: WaitOptions): Promise<Transcription>;
|
|
769
|
+
private getFormatted;
|
|
770
|
+
}
|
|
771
|
+
export interface GetUsageParams {
|
|
772
|
+
startDate: string;
|
|
773
|
+
endDate: string;
|
|
774
|
+
granularity?: "hour" | "day";
|
|
775
|
+
}
|
|
776
|
+
declare class UsageResource {
|
|
777
|
+
#private;
|
|
778
|
+
constructor(api: ApiClient);
|
|
779
|
+
get(params: GetUsageParams): Promise<UsageResponse>;
|
|
780
|
+
}
|
|
781
|
+
export interface TranscribeFileInput {
|
|
782
|
+
file?: Blob | File | ArrayBuffer | Uint8Array;
|
|
783
|
+
audioUrl?: string;
|
|
784
|
+
}
|
|
785
|
+
export interface TranscribeOptions {
|
|
786
|
+
model?: "default" | "turbo";
|
|
787
|
+
language?: string;
|
|
788
|
+
speakerLabels?: boolean;
|
|
789
|
+
wordTimestamps?: boolean;
|
|
790
|
+
webhookUrl?: string;
|
|
791
|
+
metadata?: Record<string, string>;
|
|
792
|
+
idempotencyKey?: string;
|
|
793
|
+
/** Force async processing (returns 202 immediately) */
|
|
794
|
+
async?: boolean;
|
|
795
|
+
/** Max seconds to wait for sync result before falling back to 202 */
|
|
796
|
+
wait?: number;
|
|
797
|
+
}
|
|
798
|
+
export type Listener<T> = (data: T) => void;
|
|
799
|
+
export declare class TypedEmitter<Events extends Record<string, unknown> = Record<string, unknown>> {
|
|
800
|
+
private listeners;
|
|
801
|
+
on<K extends keyof Events>(event: K, fn: Listener<Events[K]>): this;
|
|
802
|
+
off<K extends keyof Events>(event: K, fn: Listener<Events[K]>): this;
|
|
803
|
+
once<K extends keyof Events>(event: K, fn: Listener<Events[K]>): this;
|
|
804
|
+
protected emit<K extends keyof Events>(event: K, data: Events[K]): void;
|
|
805
|
+
removeAllListeners(): void;
|
|
806
|
+
}
|
|
807
|
+
export interface StreamWord {
|
|
808
|
+
text: string;
|
|
809
|
+
start: number;
|
|
810
|
+
end: number;
|
|
811
|
+
confidence?: number;
|
|
812
|
+
speaker?: string | null;
|
|
813
|
+
punctuated_word?: string;
|
|
814
|
+
}
|
|
815
|
+
export interface SessionBeginMessage {
|
|
816
|
+
type: "session.begin";
|
|
817
|
+
id: string;
|
|
818
|
+
model: string;
|
|
819
|
+
}
|
|
820
|
+
export interface TranscriptMessage {
|
|
821
|
+
type: "transcript";
|
|
822
|
+
is_final: boolean;
|
|
823
|
+
transcript: {
|
|
824
|
+
text: string;
|
|
825
|
+
start: number;
|
|
826
|
+
end: number;
|
|
827
|
+
words?: StreamWord[];
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
export interface VadMessage {
|
|
831
|
+
type: "vad";
|
|
832
|
+
event: "speech_start" | "speech_end";
|
|
833
|
+
timestamp_ms: number;
|
|
834
|
+
}
|
|
835
|
+
export interface SessionErrorMessage {
|
|
836
|
+
type: "error";
|
|
837
|
+
code: string;
|
|
838
|
+
message: string;
|
|
839
|
+
}
|
|
840
|
+
export interface SessionEndMessage {
|
|
841
|
+
type: "session.end";
|
|
842
|
+
reason: string;
|
|
843
|
+
usage: {
|
|
844
|
+
duration_seconds: number;
|
|
845
|
+
cost_cents: number;
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
export type ServerMessage = SessionBeginMessage | TranscriptMessage | VadMessage | SessionErrorMessage | SessionEndMessage;
|
|
849
|
+
export type StreamEvents = {
|
|
850
|
+
"session.begin": SessionBeginMessage;
|
|
851
|
+
transcript: TranscriptMessage;
|
|
852
|
+
vad: VadMessage;
|
|
853
|
+
error: SessionErrorMessage;
|
|
854
|
+
"session.end": SessionEndMessage;
|
|
855
|
+
open: void;
|
|
856
|
+
close: {
|
|
857
|
+
code: number;
|
|
858
|
+
reason: string;
|
|
859
|
+
};
|
|
860
|
+
};
|
|
861
|
+
export interface TranscribeStreamOptions {
|
|
862
|
+
model?: "default" | "turbo" | "gpt-realtime-mini" | "deepgram-nova-3";
|
|
863
|
+
language?: string;
|
|
864
|
+
sample_rate?: number;
|
|
865
|
+
encoding?: "pcm_s16le";
|
|
866
|
+
interim_results?: boolean;
|
|
867
|
+
}
|
|
868
|
+
export declare class TranscriptionStream extends TypedEmitter<StreamEvents> {
|
|
869
|
+
#private;
|
|
870
|
+
constructor(baseUrl: string, apiKey: string, options?: TranscribeStreamOptions);
|
|
871
|
+
sendAudio(data: ArrayBuffer | ArrayBufferView): void;
|
|
872
|
+
finalize(): void;
|
|
873
|
+
stop(): void;
|
|
874
|
+
configure(config: Record<string, unknown>): void;
|
|
875
|
+
close(): void;
|
|
876
|
+
get readyState(): number;
|
|
877
|
+
}
|
|
878
|
+
export declare class ObserverStream extends TypedEmitter<StreamEvents> {
|
|
879
|
+
#private;
|
|
880
|
+
constructor(baseUrl: string, apiKey: string, sessionId: string);
|
|
881
|
+
close(): void;
|
|
882
|
+
get readyState(): number;
|
|
883
|
+
}
|
|
884
|
+
export interface AudicleOptions {
|
|
885
|
+
apiKey: string;
|
|
886
|
+
baseUrl?: string;
|
|
887
|
+
}
|
|
888
|
+
export declare class Audicle {
|
|
889
|
+
#private;
|
|
890
|
+
readonly transcripts: TranscriptsResource;
|
|
891
|
+
readonly usage: UsageResource;
|
|
892
|
+
readonly streaming: StreamingNamespace;
|
|
893
|
+
constructor(options: AudicleOptions);
|
|
894
|
+
health(): Promise<{
|
|
895
|
+
status: "healthy" | "degraded" | "unhealthy";
|
|
896
|
+
version: string;
|
|
897
|
+
checks: {
|
|
898
|
+
database?: {
|
|
899
|
+
status: "pass" | "fail";
|
|
900
|
+
latency_ms: number;
|
|
901
|
+
};
|
|
902
|
+
storage?: {
|
|
903
|
+
status: "pass" | "fail";
|
|
904
|
+
latency_ms: number;
|
|
905
|
+
};
|
|
906
|
+
ai?: {
|
|
907
|
+
status: "pass" | "fail";
|
|
908
|
+
latency_ms: number;
|
|
909
|
+
};
|
|
910
|
+
};
|
|
911
|
+
}>;
|
|
912
|
+
transcribe(input: TranscribeFileInput, options?: TranscribeOptions): Promise<{
|
|
913
|
+
id: string;
|
|
914
|
+
status: "queued" | "processing" | "streaming" | "completed" | "error";
|
|
915
|
+
language: string | null;
|
|
916
|
+
detected_language: string | null;
|
|
917
|
+
model: string;
|
|
918
|
+
speaker_labels: boolean;
|
|
919
|
+
word_timestamps: boolean;
|
|
920
|
+
duration_seconds: number | null;
|
|
921
|
+
audio_url: string | null;
|
|
922
|
+
webhook_url: string | null;
|
|
923
|
+
webhook_status: "pending" | "delivered" | "failed" | null;
|
|
924
|
+
metadata: {
|
|
925
|
+
[key: string]: string;
|
|
926
|
+
} | null;
|
|
927
|
+
error: {
|
|
928
|
+
code: string;
|
|
929
|
+
message: string;
|
|
930
|
+
} | null;
|
|
931
|
+
result: components["schemas"]["TranscriptionResult"];
|
|
932
|
+
usage: components["schemas"]["TranscriptionUsage"];
|
|
933
|
+
created_at: string;
|
|
934
|
+
updated_at: string;
|
|
935
|
+
}>;
|
|
936
|
+
}
|
|
937
|
+
declare class StreamingNamespace {
|
|
938
|
+
#private;
|
|
939
|
+
constructor(baseUrl: string, apiKey: string);
|
|
940
|
+
transcribe(options?: TranscribeStreamOptions): TranscriptionStream;
|
|
941
|
+
observe(sessionId: string): ObserverStream;
|
|
942
|
+
}
|
|
943
|
+
export declare class AudicleError extends Error {
|
|
944
|
+
constructor(message: string);
|
|
945
|
+
}
|
|
946
|
+
export declare class AudicleApiError extends AudicleError {
|
|
947
|
+
readonly status: number;
|
|
948
|
+
readonly code: string;
|
|
949
|
+
readonly requestId: string;
|
|
950
|
+
readonly details?: Record<string, unknown>;
|
|
951
|
+
constructor(status: number, code: string, message: string, requestId: string, details?: Record<string, unknown>);
|
|
952
|
+
}
|
|
953
|
+
export declare class AudicleAuthError extends AudicleApiError {
|
|
954
|
+
constructor(code: string, message: string, requestId: string, details?: Record<string, unknown>);
|
|
955
|
+
}
|
|
956
|
+
export declare class AudicleNotFoundError extends AudicleApiError {
|
|
957
|
+
constructor(code: string, message: string, requestId: string, details?: Record<string, unknown>);
|
|
958
|
+
}
|
|
959
|
+
export declare class AudicleRateLimitError extends AudicleApiError {
|
|
960
|
+
constructor(code: string, message: string, requestId: string, details?: Record<string, unknown>);
|
|
961
|
+
}
|
|
962
|
+
export declare class AudicleTimeoutError extends AudicleError {
|
|
963
|
+
constructor(message: string);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
export {};
|