Pinter
ENID
API Keys
View as Markdown

Generate New API Key for Current User

POST/api/identity/api-keys/me

Overview

Creates a new personal API token or BYOK credential. The raw plaintext key secret is returned only once in this response.

Authentication & Headers

  • Auth: Bearer Token
  • Required Header: API-Version: 1

Parameters & Request Body

  • name (string, required): Descriptive label for the key.
  • is_byok (boolean, optional, default: false): Set to true if configuring personal third-party LLM key.
  • expires_days (integer, optional, default: 90): Key expiration validity period in days.

Request body

application/json

namestringrequired
descriptionstring | null
expires_atstring (date-time) | null
{
  "name": "string",
  "description": "string",
  "expires_at": "2026-01-01T00:00:00Z"
}

Responses

201 API key generated successfully

400 Bad Request - The request parameters or headers are invalid (e.g. unsupported API-Version).

401 Unauthorized - Missing, invalid, or expired JWT Bearer token.

403 Forbidden - Insufficient role permissions or resource access denied by RBAC policy.

404 Not Found - The requested resource ID was not found.

422 Validation Error

detailobject[]
detail[].locstring | integer[]required
detail[].msgstringrequired
detail[].typestringrequired
detail[].inputobject
detail[].ctxobject
{
  "detail": [
    {
      "loc": [
        null
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Example

curl -X POST "$PINTER_URL/api/identity/api-keys/me" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","description":"string","expires_at":"2026-01-01T00:00:00Z"}'