Skip to main content

Obtain a session token

Call the server endpoint POST /v1/console/session-tokens.

Request parameters

  • Body
    • expireAt: int, expiration timestamp in seconds. Range: now < expireAt < now + 1 hour
    • modelVersion: string, reserved field; omit
  • Header
    • X-Api-Key: your API key

Request example

curl --location --request POST 'https://<console-api-host>/v1/console/session-tokens' \  # replace with your console API domain
--header 'X-Api-Key: <your-api-key>' \                                                  # replace with your API key
--header 'Content-Type: application/json' \
--data-raw '{
    "expireAt": 1754824283,
    "modelVersion": ""
}'                                                                                      # set expireAt to the desired expiration time

Response example

{
  "sessionToken": "..."
}