Skip to main content
POST
https://api.trillet.ai
/
v1
/
api
/
keys
Create API Key
curl --request POST \
  --url https://api.trillet.ai/v1/api/keys \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "metadata": {}
}'
{
  "key": "tk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
  "_id": "665a1b2c3d4e5f6a7b8c9d0e",
  "userId": "664a1b2c3d4e5f6a7b8c9d0e",
  "metadata": {},
  "createdAt": "2024-06-01T09:00:00.000Z"
}

Headers

x-api-key
string
required
API key used for authenticating requests to the API.

Request Body

metadata
object
Optional metadata to associate with the API key.

Response Fields

key
string
The generated 32-character API key. Store this securely as it cannot be retrieved again.
_id
string
Unique identifier for the API key record.
userId
string
User ID associated with the API key.
metadata
object
Metadata associated with the API key.
createdAt
string
Timestamp when the API key was created.
{
  "key": "tk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
  "_id": "665a1b2c3d4e5f6a7b8c9d0e",
  "userId": "664a1b2c3d4e5f6a7b8c9d0e",
  "metadata": {},
  "createdAt": "2024-06-01T09:00:00.000Z"
}