⬆️ Upload & Process
Scriptix uses the TUS protocol to support resumable file uploads — ideal for large audio/video files and unstable networks.
✅ What You Need
- A TUS-compatible client (e.g. Uppy, tus-py-client)
- Your Scriptix API token (type: batch)
- The upload URL:
https://api.scriptix.io/api/v3/files/
🔐 Request Header
All requests must include one authentication header:
Header | Value | Notes |
---|---|---|
x-zoom-s2t-key | <your_api_key> | Required for all Batch API requests |
📤 What You Can Upload
File Type | Description |
---|---|
Media files | e.g. .mp4 , .mp3 , .wav , etc. |
Alignment files | Use only if aligning text to media |
Both | Used for creating captions/subtitles |
🧾 TUS Upload Flow
- Initialize the TUS client (e.g., Uppy or tus-py-client)
- Set metadata (e.g.,
language
,document_type
, etc.) - Upload to the Scriptix TUS endpoint
🧠 Metadata Parameters
Metadata is passed as TUS headers (via Upload-Metadata
) or in client config (e.g., uppy.setMeta()
):
Key | Required | Description |
---|---|---|
language | ☑️ | Target language (e.g. en-US , nl ) |
document_type | ☑️ | Either caption or document |
filetype | ☐ | Optional MIME type (e.g. audio/mp4 ) |
punctuation | ☐ | true or false (default: false ) |
keep_source | ☐ | Keep original file (true or false ) |
multichannel | ☐ | Multi-speaker detection (true or false ) |
document | ☐ | JSON string with extra config (e.g., webhook URL) |
💡 Use base64encode.org if setting headers manually.
🧪 Example – Python (tus-py-client)
from tusclient import client
my_client = client.TusClient(
"https://api.scriptix.io/api/v3/files/",
headers={"x-zoom-s2t-key": "YOUR_API_KEY"} # no Content-Type needed
)
uploader = my_client.uploader(
file_path="/path/to/video.mp4",
metadata={
# Required/important fields — all as strings because TUS metadata is text
"language": "en-US",
"document_type": "caption",
"filetype": "audio/mp4",
# “Media source” + webhook live in metadata too
"media_source": "upload", # or "url" if you support fetch-by-url flows
"webhook_url": "https://example.com/webhook",
# Feature flags as strings
"punctuation": "true",
"keep_source": "true",
"multichannel": "false"
}
)
uploader.upload()
🧪 Example – JavaScript (Uppy)
import Uppy from '@uppy/core'
import Tus from '@uppy/tus'
const uppy = new Uppy({
restrictions: {
allowedFileTypes: ['video/*', 'audio/*', 'text/*'],
maxTotalFileSize: 10737418240, // 10GB
minNumberOfFiles: 2, // For alignment
maxNumberOfFiles: 2
}
})
uppy.use(Tus, {
endpoint: 'https://api.scriptix.io/api/v3/files/',
retryDelays: [0, 1000, 3000, 5000],
headers: {
'Authorization': `${Token}`
},
withCredentials: true
})
uppy.setMeta({
language: 'nl',
document_type: 'caption',
punctuation: 'true',
keep_source: 'true',
document: JSON.stringify({
name: 'test.mp4',
type: 'video/mp4',
webhook_url: 'https://example.com/webhook'
})
})
🖼️ Use with Uppy UI
React Component
<Dashboard uppy={uppy} target="#upload-area" />
📄 Format Guidelines
When using your own TUS client, make sure to follow these formatting rules for metadata:
- Metadata must be a comma-separated list of
key base64(value)
pairs. - All values must be base64-encoded.
- Keys are case-sensitive and must match API field names exactly.
- Use base64encode.org to convert string values.
🔄 Using Other TUS Clients
You can also use other TUS-compatible libraries such as:
tus-js-client
tus-py-client
- Additional implementations listed on tus.io
These libraries are compatible with Scriptix as long as you follow the correct metadata format.
⚠️ Important: Upload-Metadata
Format
If you're using your own TUS client (or any library other than Uppy), make sure to:
- Format metadata as a comma-separated list of key-value pairs
- Base64-encode all values
Example:
language ZW4tVVM=, document_type Y2FwdGlvbg==, punctuation dHJ1ZQ==