Create an API key
https://mp.speechmatics.com/v1/api-keysCreate an API key in your workspace.
This endpoint issues two kinds of key:
- Permanent key — a long-lived key for a project. Set
project_id(and optionallyname) and omitttl. Use this for a normal project API key. - Temporary key — a short-lived key that expires automatically. Set
ttlto the lifetime in seconds. Use temporary keys to authenticate end-user requests without exposing a long-lived key.
A long-lived API key can create only temporary keys. Creating a permanent key needs a management token.
The au region supports Batch only, so it cannot be combined with type=rt.
Authentication
Any one of:
- managementToken
Authorization: Bearer <token>A management token, scoped to the workspace.
- apiKey
Authorization: Bearer <token>A long-lived API key.
Query parameters
typeoptional"rt" | "batch" | "tts"The product this key can access:
batch(default),rt(Realtime), ortts(Text to Speech).
Request body
project_idoptionalinteger<int64> | nullThe project the API key belongs to. Set this to create a permanent key for a specific project.
nameoptionalstring | null≤ 120 charactersA display name for the API key (up to 120 characters).
client_refoptionalstring | nullAn end-user reference. For
batchkeys, it restricts the key to jobs created with the sameclient_ref; it is ignored forrtkeys.ttloptionalinteger<int64> | null≥ 60, ≤ 86400Time to live for a temporary key, in seconds, from 60 (1 minute) to 86400 (24 hours). Set
ttlto create a temporary key that expires automatically; omit it to create a permanent key.regionoptionaldeprecated"eu" | "usa" | "au" | nulldeprecatedDeprecated. Region (
eu(default),usa, orau) is now determined by the endpoint you call. Still accepted for backward compatibility, but it has no effect.
Responses
Created
key_valuestringapikey_idstring
Request
MANAGEMENT_TOKEN="YOUR_MANAGEMENT_TOKEN"
curl -L -X POST "https://mp.speechmatics.com/v1/api-keys?type=batch" \
-H "Authorization: Bearer ${MANAGEMENT_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"project_id": 12345, "name": "ci-pipeline"}'