Credits and limits
One credit means one successfully delivered transcript that was not already cached.
| Event | Credits |
|---|---|
| Cache hit | 0 |
| Successful cold transcript, including a labelled fallback | 1 |
| No captions, unavailable video, strict refusal, 429, 5xx, or budget pause | 0 |
| Listing, facts, account, usage, status, files, manifests, archives, or webhooks | 0 |
Free accounts receive 100 credits each UTC month. The allowance resets and does not accumulate. Purchased credits are a separate bucket, never expire, and are spent only after free credits.
Per-key limits
| Limit | Free key | Paid key |
|---|---|---|
| Requests/minute, approximate | 60 | 300 |
| Concurrent synchronous cold fetches | 2 | 10 |
| Cold fetches/day | 100 | 20,000 |
| Cache reads/day | 2,000 | 100,000 |
| Cold enumerations/day | 25 | 25 |
| Live keys | 2 | 5 |
| Active jobs | 1 × 100 videos | 5 × 500 videos |
New accounts are limited to 25 cold fetches per UTC day for their first two days. Global guards begin at 50,000 API cold fetches/day, a separate 5,000/day free-tier pool, and 6,000 API Data API units/day.
Every API response includes X-RateLimit-Limit where a key rate applies and X-Request-Id. Authenticated responses include X-Credits-Charged and X-Credits-Balance. A 429 includes Retry-After; exact rate remaining/reset headers are not fabricated.
curl -i --get https://api.scripthaul.com/v1/transcript \
-H "Authorization: Bearer $SCRIPTHAUL_API_KEY" \
--data-urlencode "video_id=jNQXAC9IVRw"
Automatic outage credit
After each UTC day, ScriptHaul checks its own ten-minute serving-strategy observations. A day qualifies only after at least four recorded hours with no healthy strategy; missed observations do not manufacture outage time. Each account then receives floor(that day's successful delivery debits × 10%) as purchased, non-expiring credits. Failures already cost zero and are not part of the debit total. The ledger reference is unique per account and UTC day, so retries cannot credit twice. Frozen accounts receive the credit but remain frozen; closed accounts are recorded as skipped.
Inspect usage and balance in four languages
GET /v1/usage is the zero-credit way to inspect daily counters over a UTC date range. Its JSON body contains scope, range, and rows; X-Credits-Balance carries the current total. Use GET /v1/account when you need the separate free, purchased, and reserved buckets. Maintained runnable variants are in the examples directory.
curl https://api.scripthaul.com/v1/usage \
-H "Authorization: Bearer $SCRIPTHAUL_API_KEY"
import os, urllib.request
request = urllib.request.Request("https://api.scripthaul.com/v1/usage")
request.add_header("Authorization", f"Bearer {os.environ['SCRIPTHAUL_API_KEY']}")
print(urllib.request.urlopen(request).read().decode())
const response = await fetch("https://api.scripthaul.com/v1/usage", {
headers: { Authorization: `Bearer ${process.env.SCRIPTHAUL_API_KEY}` },
});
console.log(await response.json());
req, _ := http.NewRequest("GET", "https://api.scripthaul.com/v1/usage", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SCRIPTHAUL_API_KEY"))
response, err := http.DefaultClient.Do(req)
if err != nil { log.Fatal(err) }
defer response.Body.Close()
io.Copy(os.Stdout, response.Body)