llmkit_list_keys
Read-onlyIdempotent
View all API keys, their current status, and creation dates to manage AI service access and track usage across multiple providers.
Instructions
List all API keys with status and creation date
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | Yes |
Implementation Reference
- The implementation of the 'handleListKeys' function, which fetches and formats the API keys list.
export async function handleListKeys() { const keyData = await getKeys(); const keys = keyData.keys.map(k => ({ name: k.name, prefix: k.key_prefix, status: k.revoked_at ? 'revoked' : 'active', created: k.created_at.slice(0, 10), })); if (!keys.length) return ok('No API keys found.', { keys }); return ok([ 'API Keys', '\u2500'.repeat(25), ...keys.map(k => `${k.name} (${k.prefix}...) - ${k.status.toUpperCase()} - created ${k.created}`), ].join('\n'), { keys }); } - The definition and registration of the 'llmkit_list_keys' tool, including its schema and registration in the handler map.
name: 'llmkit_list_keys', description: 'List all API keys with status and creation date', inputSchema: { type: 'object' as const, properties: {} }, outputSchema: { type: 'object' as const, properties: { keys: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, prefix: { type: 'string' }, status: { type: 'string' }, created: { type: 'string' } } } }, }, required: ['keys'], },