Skip to content
Version 2026.6.3 is the latest release with the newest features, but gets no long-term support. To stay supported, upgrade with every new release or use a quarterly stable release instead.

Cursor

Page as Markdown

Configure Cursor AI code editor to use agentgateway running in Kubernetes

Configure Cursor, the AI code editor, to route requests to your LLM through your agentgateway proxy.

Before you begin

  1. Set up an agentgateway proxy.
  2. Set up access to the OpenAI LLM provider.

Get the gateway URL

export INGRESS_GW_ADDRESS=$(kubectl get svc -n agentgateway-system agentgateway-proxy \
  -o jsonpath='{.status.loadBalancer.ingress[0].ip}')

echo "Gateway address: $INGRESS_GW_ADDRESS"
export INGRESS_GW_ADDRESS=$(kubectl get svc -n agentgateway-system agentgateway-proxy \
  -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')

echo "Gateway address: $INGRESS_GW_ADDRESS"

After port-forwarding, the gateway is accessible at http://localhost:8080. Use localhost:8080 wherever the instructions reference $INGRESS_GW_ADDRESS.

kubectl port-forward -n agentgateway-system svc/agentgateway-proxy 8080:80

Configure Cursor

  1. Open the Cursor Settings.

    • macOS: Cmd + , or CursorSettings
    • Windows/Linux: Ctrl + , or FilePreferencesSettings
  2. Navigate to the Models tab.

  3. Enable Override OpenAI Base URL and enter your gateway address and the route path from your HTTPRoute configuration.

    http://<INGRESS_GW_ADDRESS>/<route-path>

    For example, if your HTTPRoute uses path /openai on your ai-example.com secured host, use https://ai-example.com/openai.

    You do not need to provide LLM provider credentials (such as an API key) through Cursor. The credentials are configured in agentgateway. Toggle off any API key overrides in Cursor.

Verify the connection

  1. Open the Cursor chat panel (Cmd + L on macOS, Ctrl + L on Windows/Linux).
  2. Send a message such as “test”.
  3. Cursor responds through your agentgateway backend.