The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
import { useInfiniteQuery } from "@tanstack/react-query";
import { createQueryKeys } from "../common/queryKeysFactory";
import { keyAliasesCall, type PaginatedKeyAliasResponse } from "@/components/networking";
import useAuthorized from "../useAuthorized";
const infiniteKeyAliasKeys = createQueryKeys("infiniteKeyAliases");
export const useInfiniteKeyAliases = (size: number = 50, search?: string, team_id?: string) => {
const { accessToken } = useAuthorized();
return useInfiniteQuery<PaginatedKeyAliasResponse>({
queryKey: infiniteKeyAliasKeys.list({
filters: {
size,
...(search && { search }),
...(team_id && { team_id }),
},
}),
queryFn: async ({ pageParam }) => {
return await keyAliasesCall(accessToken!, pageParam as number, size, search, team_id);
},
initialPageParam: 1,
getNextPageParam: (lastPage) => {
if (lastPage.current_page < lastPage.total_pages) {
return lastPage.current_page + 1;
}
return undefined;
},
enabled: Boolean(accessToken),
});
};