venice_retrieve_api_key
Retrieve details for a specific API key by providing its ID, enabling management of access credentials within the Venice AI platform.
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:60-65 (handler)Handler function for the 'venice_retrieve_api_key' tool. It takes a key_id parameter, makes an API call to `/api_keys/${key_id}` using veniceAPI, and returns the API key details as formatted JSON or an error message.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 'venice_retrieve_api_key' tool defining the required 'key_id' parameter as a string.{ key_id: z.string().describe("The API key ID to retrieve") },
- src/tools/admin/index.ts:56-66 (registration)Registration of the 'venice_retrieve_api_key' tool in the registerAdminTools function using McpServer.tool method.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) }] }; } );