Skip to main content
Glama

venice_create_api_key

Generate new API keys for Venice AI to access chat, image generation, text-to-speech, and embedding capabilities with configurable permissions and limits.

Instructions

Create a new API key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYesDescription for the new API key
apiKeyTypeNoAPI key type (ADMIN or INFERENCE)INFERENCE
consumptionLimitNoOptional consumption limits
expiresAtNoOptional expiration date (ISO 8601 format)

Implementation Reference

  • Handler function that constructs the request body and calls veniceAPI to POST /api_keys, then formats the response.
    async ({ description, apiKeyType, consumptionLimit, expiresAt }) => { const body: Record<string, unknown> = { description, apiKeyType }; if (consumptionLimit) body.consumptionLimit = consumptionLimit; if (expiresAt) body.expiresAt = expiresAt; const response = await veniceAPI("/api_keys", { method: "POST", body: JSON.stringify(body) }); const data = await response.json() as CreateAPIKeyResponse; if (!response.ok) return { content: [{ type: "text" as const, text: `Error: ${data.error?.message || response.statusText}` }] }; const keyData = data.data; const secret = keyData?.apiKey || keyData?.key || "N/A"; return { content: [{ type: "text" as const, text: `Created API key "${keyData?.description}"\nID: ${keyData?.id}\nSecret: ${secret}\n\n⚠️ Save this secret - it won't be shown again!` }] }; }
  • Zod schema for input parameters: description (required), apiKeyType, consumptionLimit, expiresAt.
    { description: z.string().describe("Description for the new API key"), apiKeyType: z.enum(["ADMIN", "INFERENCE"]).optional().default("INFERENCE").describe("API key type (ADMIN or INFERENCE)"), consumptionLimit: z.object({ usd: z.number().optional(), diem: z.number().optional(), vcu: z.number().optional() }).optional().describe("Optional consumption limits"), expiresAt: z.string().optional().describe("Optional expiration date (ISO 8601 format)") },
  • Registers the venice_create_api_key tool with McpServer, including schema and inline handler.
    server.tool( "venice_create_api_key", "Create a new API key", { description: z.string().describe("Description for the new API key"), apiKeyType: z.enum(["ADMIN", "INFERENCE"]).optional().default("INFERENCE").describe("API key type (ADMIN or INFERENCE)"), consumptionLimit: z.object({ usd: z.number().optional(), diem: z.number().optional(), vcu: z.number().optional() }).optional().describe("Optional consumption limits"), expiresAt: z.string().optional().describe("Optional expiration date (ISO 8601 format)") }, async ({ description, apiKeyType, consumptionLimit, expiresAt }) => { const body: Record<string, unknown> = { description, apiKeyType }; if (consumptionLimit) body.consumptionLimit = consumptionLimit; if (expiresAt) body.expiresAt = expiresAt; const response = await veniceAPI("/api_keys", { method: "POST", body: JSON.stringify(body) }); const data = await response.json() as CreateAPIKeyResponse; if (!response.ok) return { content: [{ type: "text" as const, text: `Error: ${data.error?.message || response.statusText}` }] }; const keyData = data.data; const secret = keyData?.apiKey || keyData?.key || "N/A"; return { content: [{ type: "text" as const, text: `Created API key "${keyData?.description}"\nID: ${keyData?.id}\nSecret: ${secret}\n\n⚠️ Save this secret - it won't be shown again!` }] }; } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/georgeglarson/venice-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server