OtherAPI ReferenceAuth

Create temporary API key

Creates a short-lived API key for specific temporary use cases. The key will automatically expire after the specified duration. Use `single_use` and `max_session_duration_seconds` to limit how the key can be used by a client. See the [Temporary API keys guide](https://docs.soniox.com/guides/temporary-api-keys) for details.

POST
https://api.soniox.com/v1/auth/temporary-api-key

Creates a short-lived API key for specific temporary use cases. The key will automatically expire after the specified duration.

Use single_use and max_session_duration_seconds to limit how the key can be used by a client. See the Temporary API keys guide for details.

Headers

AuthorizationRequiredBearer <SONIOX_API_KEY>

Request

application/jsonRequired
usage_typeRequiredstring

Intended usage of the temporary API key.

Value in: "transcribe_websocket" | "tts_rt"
expires_in_secondsRequiredinteger

Duration in seconds until the temporary API key expires.

Minimum: 1Maximum: 3600
client_reference_idstring

Optional tracking identifier string. Does not need to be unique.

Maximum length: 256
single_useboolean

If true, the temporary API key can be used only once.

max_session_duration_secondsinteger

Maximum connection duration in seconds for WebSocket and TTS HTTP streaming endpoints. If exceeded, the connection will be dropped. If not set, no limit is applied.

Minimum: 1Maximum: 18000

Response

201

Created temporary API key.

api_keyRequiredstring

Created temporary API key.

expires_atRequiredstring

UTC timestamp indicating when generated temporary API key will expire.

Format: "date-time"

Errors

Created temporary API key.

{
  "api_key": "snx_temp_AcsDGHvigal7tHRzzzqJI7EdJ5CFwk9C0PtXN_s_cUKJ.Oo1TyosFa7b3rgAcXA2bayqBFO7667gXROEu0mH0U4vgvlNzCqVGgTzitabbXlK7FKH-sSy0F1NKI1OOJzQaAw.YPj4oA",
  "expires_at": "2025-02-22T22:47:37.150Z"
}