🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
feat(ai-gateway): open usage instructions from the gateway keys page (#19569)
Tobias Wochinger6282a733abe6
diff --git a/web/src/components/SettingsTable/SettingsTable.tsx b/web/src/components/SettingsTable/SettingsTable.tsxindex 9bd1c3e721..b7cb9c5831 100644--- a/web/src/components/SettingsTable/SettingsTable.tsx+++ b/web/src/components/SettingsTable/SettingsTable.tsx@@ -164,7 +164,7 @@ export function SettingsTable<TData extends object>({))}</div>- <div className="ml-auto flex items-center gap-2">+ <div className="ml-auto flex flex-wrap items-center justify-end gap-2">{columnVisibilityKey && (<DataTableColumnVisibilityFiltercolumns={columns}diff --git a/web/src/components/design-system/ExpandableContentPeek/ExpandableContentPeek.stories.tsx b/web/src/components/design-system/ExpandableContentPeek/ExpandableContentPeek.stories.tsxindex 75fca465dc..87e92bed99 100644--- a/web/src/components/design-system/ExpandableContentPeek/ExpandableContentPeek.stories.tsx+++ b/web/src/components/design-system/ExpandableContentPeek/ExpandableContentPeek.stories.tsx@@ -23,3 +23,10 @@ export const FitsWithoutPeek = meta.story({children: <p className="max-w-md text-sm">Short content renders as is.</p>,},});++export const DefaultExpanded = meta.story({+ args: {+ ...Overflowing.input.args,+ defaultExpanded: true,+ },+});diff --git a/web/src/components/design-system/ExpandableContentPeek/ExpandableContentPeek.tsx b/web/src/components/design-system/ExpandableContentPeek/ExpandableContentPeek.tsxindex e832e67a56..88288e6a58 100644--- a/web/src/components/design-system/ExpandableContentPeek/ExpandableContentPeek.tsx+++ b/web/src/components/design-system/ExpandableContentPeek/ExpandableContentPeek.tsx@@ -27,6 +27,8 @@ type ExpandableContentPeekProps = PropsWithChildren<{/** Label of the button that reveals the rest, e.g. "Show all steps". */expandLabel: string;collapsedHeight?: "sm" | "md" | "lg";+ /** Starts with the full content shown, without fade or expand button. */+ defaultExpanded?: boolean;/** Called once when the clamped content is revealed. */onAfterExpand?: () => void;}>;@@ -67,9 +69,10 @@ export function ExpandableContentPeek({children,expandLabel,collapsedHeight = "md",+ defaultExpanded = false,onAfterExpand,}: ExpandableContentPeekProps) {- const [isExpanded, setIsExpanded] = useState(false);+ const [isExpanded, setIsExpanded] = useState(defaultExpanded);const containerRef = useRef<HTMLDivElement>(null);const contentRef = useRef<HTMLDivElement>(null);const isOverflowing = useIsOverflowing(containerRef, contentRef, !isExpanded);diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/GatewayApiKeysPage.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/GatewayApiKeysPage.tsxindex 69e8a265d7..438f9f0ad3 100644--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/GatewayApiKeysPage.tsx+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/GatewayApiKeysPage.tsx@@ -27,7 +27,7 @@ export function GatewayApiKeysPage({return <GatewayNotSetUpNotice title="Gateway keys" />;}return (- <div className="flex flex-col gap-4">+ <div className="flex h-full min-h-0 flex-col gap-4"><div><Header title="Gateway keys" /><p className="text-muted-foreground text-sm">@@ -41,11 +41,13 @@ export function GatewayApiKeysPage({/></p></div>- <ConnectedGatewayApiKeysTable- key={organizationId}- organizationId={organizationId}- canInvite={canManageGateway && canInviteMembers}- />+ <div className="flex min-h-0 flex-1 flex-col overflow-hidden">+ <ConnectedGatewayApiKeysTable+ key={organizationId}+ organizationId={organizationId}+ canInvite={canManageGateway && canInviteMembers}+ />+ </div></div>);}diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/ConnectedGatewayApiKeysTable.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/ConnectedGatewayApiKeysTable.tsxindex 1d1163ffc9..87b8de99ad 100644--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/ConnectedGatewayApiKeysTable.tsx+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/ConnectedGatewayApiKeysTable.tsx@@ -3,6 +3,7 @@ import { useState } from "react";import { Alert } from "@/src/components/design-system/Alert/Alert";import { Button } from "@/src/components/ui/button";import { CreateGatewayApiKeyDialogController } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/CreateGatewayApiKeyDialogController/CreateGatewayApiKeyDialogController";+import { UsageInstructionsDialogController } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/UsageInstructionsDialogController/UsageInstructionsDialogController";import { TeamInviteDialogController } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/TeamInviteDialogController/TeamInviteDialogController";import { ConfirmationDialogController } from "@/src/components/design-system/ConfirmationDialogController/ConfirmationDialogController";import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";@@ -85,35 +86,40 @@ export function ConnectedGatewayApiKeysTable({{({ openDialog: openRevokeDialog }) => (<TeamInviteDialogController organizationId={organizationId}>{({ openDialog: openInviteDialog }) => (- <CreateGatewayApiKeyDialogController- organizationId={organizationId}- >- {({ openDialog }) => {- return (- <GatewayApiKeysTable- data={- rows === undefined- ? { status: "loading" }- : { status: "success", data: rows }- }- lastUsed={lastUsed}- pagination={{- mode: "offset",- totalCount: apiKeysQuery.data?.totalCount ?? null,- state: paginationState,- onChange: setPaginationState,- }}- search={{- value: searchQuery,- onChange: handleSearchChange,- }}- createAction={openDialog}- inviteAction={canInvite ? openInviteDialog : undefined}- onRevoke={openRevokeDialog}- />- );- }}- </CreateGatewayApiKeyDialogController>+ <UsageInstructionsDialogController organizationId={organizationId}>+ {({ openDialog: openUsageInstructionsDialog }) => (+ <CreateGatewayApiKeyDialogController+ organizationId={organizationId}+ >+ {({ openDialog }) => {+ return (+ <GatewayApiKeysTable+ data={+ rows === undefined+ ? { status: "loading" }+ : { status: "success", data: rows }+ }+ lastUsed={lastUsed}+ pagination={{+ mode: "offset",+ totalCount: apiKeysQuery.data?.totalCount ?? null,+ state: paginationState,+ onChange: setPaginationState,+ }}+ search={{+ value: searchQuery,+ onChange: handleSearchChange,+ }}+ createAction={openDialog}+ inviteAction={canInvite ? openInviteDialog : undefined}+ usageInstructionsAction={openUsageInstructionsDialog}+ onRevoke={openRevokeDialog}+ />+ );+ }}+ </CreateGatewayApiKeyDialogController>+ )}+ </UsageInstructionsDialogController>)}</TeamInviteDialogController>)}diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.stories.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.stories.tsxindex cf15fdb902..0451d54d58 100644--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.stories.tsx+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.stories.tsx@@ -54,6 +54,7 @@ const manyApiKeys = Array.from({ length: 30 }, (_, index) => ({const actions = {lastUsed: { status: "success", isTracked: true },createAction: onCreate,+ usageInstructionsAction: fn(),onRevoke,pagination: {mode: "offset",@@ -64,7 +65,12 @@ const actions = {search: { value: "", onChange: fn() },} satisfies Pick<ComponentProps<typeof GatewayApiKeysTable>,- "lastUsed" | "createAction" | "onRevoke" | "pagination" | "search"+ | "lastUsed"+ | "createAction"+ | "usageInstructionsAction"+ | "onRevoke"+ | "pagination"+ | "search">;const lastUsedCell = (canvas: {diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.tsxindex 8bb41fb154..74090acbe7 100644--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.tsx+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GatewayApiKeysTable/GatewayApiKeysTable.tsx@@ -1,4 +1,4 @@-import { Plus, Trash, UserPlus } from "@langfuse/icons";+import { BookOpen, Plus, Trash, UserPlus } from "@langfuse/icons";import { formatDistanceToNowStrict } from "date-fns";import { SettingsTable } from "@/src/components/SettingsTable/SettingsTable";@@ -48,6 +48,7 @@ export function GatewayApiKeysTable({lastUsed,createAction,inviteAction,+ usageInstructionsAction,onRevoke,pagination,search,@@ -57,6 +58,7 @@ export function GatewayApiKeysTable({createAction: () => void;/** Omit for callers who cannot invite people to the organization. */inviteAction?: () => void;+ usageInstructionsAction: () => void;onRevoke: (apiKeyId: string) => void;pagination: PaginationBarProps;search: { value: string; onChange: (value: string) => void };@@ -170,6 +172,13 @@ export function GatewayApiKeysTable({},]: []),+ {+ id: "usage-instructions",+ label: "Usage instructions",+ variant: "outline",+ icon: <BookOpen size="base" aria-hidden="true" />,+ onClick: usageInstructionsAction,+ },{id: "create-key",label: "Create key",diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/GeneratedKeyContent.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/GeneratedKeyContent.tsxindex f62fa2a9f3..f674879d4f 100644--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/GeneratedKeyContent.tsx+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/GeneratedKeyContent.tsx@@ -1,40 +1,7 @@-import { Alert } from "@/src/components/design-system/Alert/Alert";import { Dialog } from "@/src/components/design-system/Dialog/Dialog";-import { Skeleton } from "@/src/components/ui/skeleton";-import { SetupInstructionsTabs } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/SetupInstructionsTabs/SetupInstructionsTabs";+import { SetupInstructions } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/SetupInstructions";import { usePostHogClientCapture } from "@/src/features/posthog-analytics/usePostHogClientCapture";import { MaskedGatewayKey } from "./components/MaskedGatewayKey";-import { useAgentSetupInstructions } from "./hooks/useAgentSetupInstructions";--type SetupInstructionsProps = {- organizationId: string;-};--function SetupInstructions({ organizationId }: SetupInstructionsProps) {- const { instructions, isPending, isError } =- useAgentSetupInstructions(organizationId);-- if (isPending) {- return <Skeleton className="h-48 w-full" />;- }- if (isError || !instructions) {- return (- <Alert variant="destructive">- <Alert.Title>Setup instructions could not be loaded</Alert.Title>- <Alert.Description>- Your key works. Follow the docs to connect your tools.- </Alert.Description>- </Alert>- );- }-- return (- <SetupInstructionsTabs- organizationId={organizationId}- instructions={instructions}- />- );-}type GeneratedKeyContentProps = {organizationId: string;diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/SetupInstructions.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/SetupInstructions.tsxnew file mode 100644index 0000000000..b767982582--- /dev/null+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/SetupInstructions.tsx@@ -0,0 +1,39 @@+import { Alert } from "@/src/components/design-system/Alert/Alert";+import { Skeleton } from "@/src/components/ui/skeleton";+import { SetupInstructionsTabs } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/SetupInstructionsTabs/SetupInstructionsTabs";+import { useAgentSetupInstructions } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/hooks/useAgentSetupInstructions";++type SetupInstructionsProps = {+ organizationId: string;+ defaultExpanded?: boolean;+};++export function SetupInstructions({+ organizationId,+ defaultExpanded,+}: SetupInstructionsProps) {+ const { instructions, isPending, isError } =+ useAgentSetupInstructions(organizationId);++ if (isPending) {+ return <Skeleton className="h-48 w-full" />;+ }+ if (isError || !instructions) {+ return (+ <Alert variant="destructive">+ <Alert.Title>Setup instructions could not be loaded</Alert.Title>+ <Alert.Description>+ Your key works. Follow the docs to connect your tools.+ </Alert.Description>+ </Alert>+ );+ }++ return (+ <SetupInstructionsTabs+ organizationId={organizationId}+ instructions={instructions}+ defaultExpanded={defaultExpanded}+ />+ );+}diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/AgentInstructionsPanel.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/AgentInstructionsPanel.tsxsimilarity index 95%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/AgentInstructionsPanel.tsxrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/AgentInstructionsPanel.tsxindex b1093e81ee..269040bc45 100644--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/AgentInstructionsPanel.tsx+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/AgentInstructionsPanel.tsx@@ -7,11 +7,13 @@ import { CopyForAgentButton } from "./CopyForAgentButton";type AgentInstructionsPanelProps = {organizationId: string;instructions: AgentSetupInstructions;+ defaultExpanded?: boolean;};export function AgentInstructionsPanel({organizationId,instructions,+ defaultExpanded,}: AgentInstructionsPanelProps) {const capture = usePostHogClientCapture();const agent = { orgId: organizationId, agentId: instructions.id };@@ -31,6 +33,7 @@ export function AgentInstructionsPanel({<div className="w-full"><ExpandableContentPeekexpandLabel="Show all steps"+ defaultExpanded={defaultExpanded}onAfterExpand={() =>capture("ai_gateway:agent_setup_instructions_viewed", {...agent,diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/AgentSetupSteps.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/AgentSetupSteps.tsxsimilarity index 100%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/AgentSetupSteps.tsxrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/AgentSetupSteps.tsxdiff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/AgentVariantTabs.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/AgentVariantTabs.tsxsimilarity index 94%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/AgentVariantTabs.tsxrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/AgentVariantTabs.tsxindex 56920883e3..fb7d498bc6 100644--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/AgentVariantTabs.tsx+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/AgentVariantTabs.tsx@@ -13,6 +13,7 @@ type AgentVariantTabsProps = {ariaLabel: string;value: AgentId;onValueChange: (value: AgentId) => void;+ defaultExpanded?: boolean;};/** Variants of one tool, e.g. Claude Code and Claude Desktop, share one tab with a switch between them. */@@ -23,6 +24,7 @@ export function AgentVariantTabs({ariaLabel,value,onValueChange,+ defaultExpanded,}: AgentVariantTabsProps) {const handleValueChange = (next: string) => {const variant = variants.find((v) => v.id === next);@@ -48,6 +50,7 @@ export function AgentVariantTabs({<AgentInstructionsPanelorganizationId={organizationId}instructions={entry}+ defaultExpanded={defaultExpanded}/></div></Tabs.Content>diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/CopyForAgentButton.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/CopyForAgentButton.tsxsimilarity index 89%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/CopyForAgentButton.tsxrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/CopyForAgentButton.tsxindex 8fd2654c00..288858fb5a 100644--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/CopyForAgentButton.tsx+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/CopyForAgentButton.tsx@@ -1,7 +1,7 @@import { Check, Copy } from "@langfuse/icons";import { Button } from "@/src/components/design-system/Button/Button";-import { formatAgentSetupMarkdown } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/formatAgentSetupMarkdown";+import { formatAgentSetupMarkdown } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/formatAgentSetupMarkdown";import type { AgentSetupInstructions } from "@/src/features/ai-gateway/types/agentSetupInstructions";import { useCopyToClipboard } from "@/src/hooks/useCopyToClipboard";diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/SetupInstructionsTabs/SetupInstructionsTabs.stories.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/SetupInstructionsTabs/SetupInstructionsTabs.stories.tsxsimilarity index 92%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/SetupInstructionsTabs/SetupInstructionsTabs.stories.tsxrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/SetupInstructionsTabs/SetupInstructionsTabs.stories.tsxindex 68be447b7b..5bded892ac 100644--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/SetupInstructionsTabs/SetupInstructionsTabs.stories.tsx+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/SetupInstructionsTabs/SetupInstructionsTabs.stories.tsx@@ -1,7 +1,7 @@import { expect, userEvent, within } from "storybook/test";import preview from "@/.storybook/preview";-import { buildAgentSetupInstructions } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildAgentSetupInstructions";+import { buildAgentSetupInstructions } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildAgentSetupInstructions";import { SetupInstructionsTabs } from "./SetupInstructionsTabs";const context = {diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/SetupInstructionsTabs/SetupInstructionsTabs.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/SetupInstructionsTabs/SetupInstructionsTabs.tsxsimilarity index 92%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/SetupInstructionsTabs/SetupInstructionsTabs.tsxrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/SetupInstructionsTabs/SetupInstructionsTabs.tsxindex ed4d2177d6..1329550466 100644--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/SetupInstructionsTabs/SetupInstructionsTabs.tsx+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/SetupInstructionsTabs/SetupInstructionsTabs.tsx@@ -5,11 +5,11 @@ import { SiClaude, SiGithubcopilot, SiOpenai } from "@langfuse/icons/si";import { Button } from "@/src/components/design-system/Button/Button";import { Tabs } from "@/src/components/design-system/Tabs/Tabs";import type { AgentSetupInstructions } from "@/src/features/ai-gateway/types/agentSetupInstructions";-import { AgentInstructionsPanel } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/AgentInstructionsPanel";+import { AgentInstructionsPanel } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/AgentInstructionsPanel";import {AgentVariantTabs,type AgentVariant,-} from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/components/AgentVariantTabs";+} from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/components/AgentVariantTabs";type AgentId = AgentSetupInstructions["id"];type VariantTabId = "claude" | "copilot";@@ -57,11 +57,14 @@ function isVariantTabId(value: string): value is VariantTabId {type SetupInstructionsTabsProps = {organizationId: string;instructions: AgentSetupInstructions[];+ /** Shows every step without the "Show all steps" peek. */+ defaultExpanded?: boolean;};export function SetupInstructionsTabs({organizationId,instructions,+ defaultExpanded,}: SetupInstructionsTabsProps) {const [activeTab, setActiveTab] = useState<string>(DEFAULT_TAB);const [activeVariants, setActiveVariants] = useState<@@ -122,6 +125,7 @@ export function SetupInstructionsTabs({organizationId={organizationId}instructions={instructions}{...VARIANT_TABS[variantTabId]}+ defaultExpanded={defaultExpanded}value={activeVariants[variantTabId]}onValueChange={(next) =>setActiveVariants((current) => ({@@ -141,6 +145,7 @@ export function SetupInstructionsTabs({<AgentInstructionsPanelorganizationId={organizationId}instructions={entry}+ defaultExpanded={defaultExpanded}/></div></Tabs.Content>diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/AGENTS.md b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/AGENTS.mdsimilarity index 100%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/AGENTS.mdrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/AGENTS.mddiff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/__tests__/agentSetupInstructions.clienttest.ts b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/__tests__/agentSetupInstructions.clienttest.tssimilarity index 100%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/__tests__/agentSetupInstructions.clienttest.tsrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/__tests__/agentSetupInstructions.clienttest.tsdiff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildAgentSetupInstructions.ts b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildAgentSetupInstructions.tssimilarity index 100%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildAgentSetupInstructions.tsrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildAgentSetupInstructions.tsdiff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildApiInstructions.ts b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildApiInstructions.tssimilarity index 100%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildApiInstructions.tsrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildApiInstructions.tsdiff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildClaudeCodeInstructions.ts b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildClaudeCodeInstructions.tssimilarity index 100%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildClaudeCodeInstructions.tsrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildClaudeCodeInstructions.tsdiff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildClaudeDesktopInstructions.ts b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildClaudeDesktopInstructions.tssimilarity index 100%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildClaudeDesktopInstructions.tsrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildClaudeDesktopInstructions.tsdiff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildCodexInstructions.ts b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildCodexInstructions.tssimilarity index 100%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildCodexInstructions.tsrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildCodexInstructions.tsdiff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildCopilotCliInstructions.ts b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildCopilotCliInstructions.tssimilarity index 100%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildCopilotCliInstructions.tsrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildCopilotCliInstructions.tsdiff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildCopilotDesktopInstructions.ts b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildCopilotDesktopInstructions.tssimilarity index 100%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildCopilotDesktopInstructions.tsrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildCopilotDesktopInstructions.tsdiff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildOpenCodeInstructions.ts b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildOpenCodeInstructions.tssimilarity index 100%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildOpenCodeInstructions.tsrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildOpenCodeInstructions.tsdiff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/formatAgentSetupMarkdown.ts b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/formatAgentSetupMarkdown.tssimilarity index 100%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/formatAgentSetupMarkdown.tsrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/formatAgentSetupMarkdown.tsdiff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/hooks/useAgentSetupInstructions.ts b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/hooks/useAgentSetupInstructions.tssimilarity index 82%rename from web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/hooks/useAgentSetupInstructions.tsrename to web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/hooks/useAgentSetupInstructions.tsindex d99198f3b1..5c74fb1140 100644--- a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/hooks/useAgentSetupInstructions.ts+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/hooks/useAgentSetupInstructions.ts@@ -1,4 +1,4 @@-import { buildAgentSetupInstructions } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/GeneratedKeyContent/fns/agentSetupInstructions/buildAgentSetupInstructions";+import { buildAgentSetupInstructions } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/fns/agentSetupInstructions/buildAgentSetupInstructions";import { api } from "@/src/utils/api";export function useAgentSetupInstructions(organizationId: string) {diff --git a/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/UsageInstructionsDialogController/UsageInstructionsDialogController.tsx b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/UsageInstructionsDialogController/UsageInstructionsDialogController.tsxnew file mode 100644index 0000000000..65bd6a3316--- /dev/null+++ b/web/src/features/ai-gateway/components/GatewayApiKeysPage/components/UsageInstructionsDialogController/UsageInstructionsDialogController.tsx@@ -0,0 +1,32 @@+import type { ReactNode } from "react";++import { Dialog } from "@/src/components/design-system/Dialog/Dialog";+import { DialogController } from "@/src/components/design-system/DialogController/DialogController";+import { SetupInstructions } from "@/src/features/ai-gateway/components/GatewayApiKeysPage/components/SetupInstructions/SetupInstructions";++type UsageInstructionsDialogControllerProps = {+ organizationId: string;+ children: (control: { openDialog: () => void }) => ReactNode;+};++export function UsageInstructionsDialogController({+ organizationId,+ children,+}: UsageInstructionsDialogControllerProps) {+ return (+ <DialogController+ renderDialog={() => (+ <Dialog title="Connect to the AI Gateway" size="md" closeLabel="Close">+ <Dialog.Body>+ <SetupInstructions+ organizationId={organizationId}+ defaultExpanded+ />+ </Dialog.Body>+ </Dialog>+ )}+ >+ {children}+ </DialogController>+ );+}diff --git a/web/src/features/settings/SettingsPage.tsx b/web/src/features/settings/SettingsPage.tsxindex 30e228e015..0a4587a701 100644--- a/web/src/features/settings/SettingsPage.tsx+++ b/web/src/features/settings/SettingsPage.tsx@@ -43,7 +43,9 @@ export function SettingsPage({ scope }: SettingsPageProps) {typeof router.query.page === "string" ? router.query.page : undefined;const fullHeight =scope === "organization" &&- (activeSlug === "ai-gateway-models" || activeSlug === "ai-gateway");+ (activeSlug === "ai-gateway-models" ||+ activeSlug === "ai-gateway" ||+ activeSlug === "ai-gateway-api-keys");if (scope === "organization" && !organization) {return (