Skip to main content
GET
/
api
/
agents
/
{agent_id}
/
api-key
Get Agent Api Key
curl --request GET \
  --url https://api.example.com/api/agents/{agent_id}/api-key \
  --header 'Authorization: Bearer <token>'
{
  "key_prefix": "<string>",
  "masked_key": "<string>",
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agent_id
integer
required

Response

Successful Response

Response model for GET /api/agents/{agent_id}/api-key.

Returned only when an active (non-revoked) key exists for the agent; callers receive HTTP 404 with detail='no_active_key' otherwise. Crucially, full_key is not part of this shape -- the plaintext secret is unrecoverable post-generation by design.

key_prefix
string
required

Public-safe 6-char lookup handle of the active key.

masked_key
string
required

Display form xag_<prefix>_•••••••• with a fixed eight bullet characters. The bullet count does not reflect the secret's real length (32 chars) by design.

created_at
string<date-time>
required

UTC timestamp when the active key was created.