venice_retrieve_api_key
Retrieve details for a specific API key in Venice AI's system to manage access to AI capabilities like chat, image generation, and text-to-speech.
Instructions
Get details for a specific API key
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key_id | Yes | The API key ID to retrieve |
Implementation Reference
- src/tools/admin/index.ts:56-65 (handler)Full tool handler implementation for 'venice_retrieve_api_key'. Registers the tool with schema for 'key_id' input, fetches details from Venice API endpoint `/api_keys/{key_id}`, and returns JSON data or error message.server.tool( "venice_retrieve_api_key", "Get details for a specific API key", { key_id: z.string().describe("The API key ID to retrieve") }, async ({ key_id }) => { const response = await veniceAPI(`/api_keys/${key_id}`); const data = await response.json() as { data?: Record<string, unknown>; error?: { message?: string } }; if (!response.ok) return { content: [{ type: "text" as const, text: `Error: ${data.error?.message || response.statusText}` }] }; return { content: [{ type: "text" as const, text: JSON.stringify(data.data, null, 2) }] }; }
- src/tools/admin/index.ts:59-59 (schema)Input schema for the tool: requires 'key_id' as string.{ key_id: z.string().describe("The API key ID to retrieve") },
- src/tools/admin/index.ts:56-65 (registration)Tool registration call within registerAdminTools function.server.tool( "venice_retrieve_api_key", "Get details for a specific API key", { key_id: z.string().describe("The API key ID to retrieve") }, async ({ key_id }) => { const response = await veniceAPI(`/api_keys/${key_id}`); const data = await response.json() as { data?: Record<string, unknown>; error?: { message?: string } }; if (!response.ok) return { content: [{ type: "text" as const, text: `Error: ${data.error?.message || response.statusText}` }] }; return { content: [{ type: "text" as const, text: JSON.stringify(data.data, null, 2) }] }; }