メインコンテンツへスキップ
POST
/
access-token
Generate a New Access Token
curl --request POST \
  --url https://api.cartesia.ai/access-token \
  --header 'Cartesia-Version: <cartesia-version>' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "grants": {
    "tts": true,
    "stt": true
  },
  "expires_in": 123
}
'
{
  "token": "<string>"
}

承認

X-API-Key
string
header
必須

ヘッダー

Cartesia-Version
enum<string>
必須

API version header.

利用可能なオプション:
2024-11-13
:

"2024-11-13"

ボディ

application/json
grants
TokenGrant · object

The permissions to be granted via the token. Both TTS and STT grants are optional - specify only the capabilities you need.

expires_in
integer | null

The number of seconds the token will be valid for since the time of generation. The maximum is 1 hour (3600 seconds).

レスポンス

200 - application/json
token
string
必須

The generated Access Token.