Skip to main content
Glama

venice_get_rate_limits

Retrieve current rate limits, usage statistics, and account details to monitor API consumption and manage access effectively.

Instructions

Get current rate limits, usage, and account information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the venice_get_rate_limits tool. It makes an API call to /api_keys/rate_limits using the veniceAPI helper, parses the response typed as RateLimitsResponse, and returns the data as a formatted JSON string in a text content block or an error message if the request fails.
    async () => { const response = await veniceAPI("/api_keys/rate_limits"); const data = await response.json() as RateLimitsResponse; 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) }] }; }
  • The registration of the venice_get_rate_limits tool using server.tool(). It specifies the tool name, description, empty input schema ({}), and references the inline handler function.
    server.tool( "venice_get_rate_limits", "Get current rate limits, usage, and account information", {}, async () => { const response = await veniceAPI("/api_keys/rate_limits"); const data = await response.json() as RateLimitsResponse; 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) }] }; } );
  • Type definition for the RateLimitsResponse used in the tool handler to type the API response data.
    export interface RateLimitsResponse extends VeniceAPIError { data?: Record<string, unknown>; }
  • The veniceAPI helper function used by the tool handler to make authenticated HTTP requests to the Venice API endpoints.
    export async function veniceAPI(endpoint: string, options: RequestInit = {}): Promise<Response> { const url = `${BASE_URL}${endpoint}`; const headers: Record<string, string> = { "Authorization": `Bearer ${API_KEY}`, "Content-Type": "application/json", ...(options.headers as Record<string, string> || {}), }; return fetch(url, { ...options, headers }); }

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