Authentication

Every request must include an API key via the Authorization header. Keys come in two flavors: test mode for development and live mode for production.

API keys

Create and revoke keys at platform.tunelab.dev/keys.

PrefixModeCreditsRate limitUse for
tl_test_...testNever charged10 req/minLocal dev, CI, examples
tl_live_...liveCharged on missPer plan tierProduction traffic
Test keys return deterministic responses.
The same request always returns the same JSON, so you can snapshot-test your integration without burning credits.

Sending the header

cURL
curl https://api.tunelab.dev/v1/resolve/spotify:2WfaOiMkCvy7F5fcp2zZ8L \
  -H "Authorization: Bearer tl_live_xxx"

Security best practices

Error responses

StatusError codeCause
401unauthorizedMissing, malformed, or revoked key
402insufficient_creditsCredit balance too low for this operation
429rate_limit_exceededToo many requests in the current window

See Errors for the full error envelope and handling patterns.