Authentication
Every request carries your API key in the Authorization header.
curl https://api.tikiapi.com/v1/account \
-H "Authorization: Bearer $TIKIAPI_KEY"Live and test keys
| Prefix | What it does |
|---|---|
tk_live_ | Makes real videos and spends your balance. |
tk_test_ | Free. Returns sample results, so you can build and test without spending. A test order with the word fail in the prompt fails on purpose, to test your error handling. |
Create and revoke keys
Create keys in the dashboard. A key is shown once, when you create it: we store only a hash. If a key leaks, revoke it there and create a new one. A revoked key stops working at once.
Spending limits
Each key can have its own spending limit. When a key reaches it, new orders get 429 key_limit_reached while the rest of your account keeps working. Give each app or server its own key with its own limit.
Permissions
A key can do only what it was created for:
| Scope | Allows |
|---|---|
models:read | GET /v1/models |
generations:write | POST /v1/generations, POST /v1/generations/{id}/cancel |
generations:read | GET /v1/generations, GET /v1/generations/{id} |
account:read | GET /v1/account |
A request outside the key's permissions gets 403 missing_scope.
Keep keys safe
- Call the API from your server. Requests from web pages are refused, so a key in a browser can't be used anyway.
- Keep keys in environment variables or a secret manager, not in code.
- Use a separate key per app, with a spending limit.
Check your balance
{
"object": "account",
"name": "My company",
"key_mode": "live",
"balance": { "currency": "USD", "total": "25.00", "held": "0.84", "available": "24.16" }
}held is the price of videos still being made. It is charged when a video is ready and released if it fails.
