Skip to main content
POST
/
v1
/
client
/
tokens
Create Client Token
const options = {
  method: 'POST',
  headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    expiresIn: 123,
    allowedModels: ['<string>'],
    allowedOrigins: ['<string>'],
    constraints: {realtime: {maxSessionDuration: 123}},
    metadata: {}
  })
};

fetch('https://api.decart.ai/v1/client/tokens', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "apiKey": "<string>",
  "expiresAt": "<string>",
  "permissions": {},
  "constraints": {}
}

Documentation Index

Fetch the complete documentation index at: https://docs.platform.decart.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Headers

x-api-key
string
required

API key for authentication

Body

application/json
expiresIn
integer | null

Seconds until the token expires (default 60)

allowedModels
string[] | null

Restrict which models this token can access (max 20)

allowedOrigins
string[] | null

Restrict which web origins this token can be used from (max 20)

constraints
TokenConstraints · object

Operational limits for the token

metadata
Metadata · object

Response

Successful Response

apiKey
string
required
expiresAt
string
required
permissions
Permissions · object
constraints
Constraints · object