Soniox
Docs
API referenceREST APIAuth

Create temporary API key

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

POST
/v1/auth/temporary-api-key

Headers

AuthorizationRequiredBearer <SONIOX_API_KEY>

Request

application/jsonRequired
usage_typeRequiredstring

Intended usage of the temporary API key.

Accepted values: "transcribe_websocket"
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

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": "temp:WYJ67RBEFUWQXXPKYPD2UGXKWB",
  "expires_at": "2025-02-22T22:47:37.150Z"
}

Invalid request.

Error types:

  • invalid_request: Invalid request.

{
  "status_code": 400,
  "error_type": "invalid_request",
  "message": "Invalid request.",
  "validation_errors": [
    {
      "error_type": "less_than_equal",
      "location": "body.payload.expires_in_seconds",
      "message": "Input should be less than or equal to 3600"
    }
  ],
  "request_id": "3d37a3bd-5078-47ee-a369-b204e3bbedda"
}

Authentication error.

{
  "status_code": 401,
  "error_type": "unauthenticated",
  "message": "Incorrect API key provided. You can get an API key at https://console.soniox.com",
  "validation_errors": [],
  "request_id": "3d37a3bd-5078-47ee-a369-b204e3bbedda"
}

Internal server error.

{
  "status_code": 500,
  "error_type": "internal_error",
  "message": "The server encountered an error. Please try again. If the issue persists contact support@soniox.com.",
  "validation_errors": [],
  "request_id": "3d37a3bd-5078-47ee-a369-b204e3bbedda"
}