Skip to content
Help guide the future of agentgateway — Take the survey

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

Cursor

Verified : Code examples on this page have been automatically tested and verified.
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

Tip

Kind cluster? Kind does not support LoadBalancer services by default. To use this option with a Kind cluster, install and run cloud-provider-kind.

The following command reads the LoadBalancer IP address or hostname, whichever your cloud provider assigns.

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

echo "Gateway address: $INGRESS_GW_ADDRESS"

Configure Cursor

  1. Open the Cursor Settings.

    • macOS: Cmd + , or Cursor → Settings
    • Windows/Linux: Ctrl + , or File → Preferences → Settings
  2. Navigate to the Models tab.

  3. Enable Override OpenAI Base URL and enter your gateway address with the /v1 path. Cursor adds /chat/completions to it.

    http://<INGRESS_GW_ADDRESS>/v1

    For example, for a gateway on the ai-example.com secured host, use https://ai-example.com/v1. This base URL needs the route from the OpenAI v1/chat/completions tab of the OpenAI provider guide, which forwards every path to the backend. The Custom route tab rewrites every request to /v1/chat/completions, so it does not work with clients that add their own path, such as /chat/completions.

    Note

    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.
Was this page helpful?
Agentgateway assistant

Ask me anything about agentgateway configuration, features, or usage.

Note: AI-generated content might contain errors; please verify and test all returned information.

Tip: one topic per conversation gives the best results. Use the + button in the chat header to start a new conversation.

Switching topics? Starting a new conversation improves accuracy.
↑↓ navigate ↵ select esc dismiss

What could be improved?

Your feedback helps us improve assistant answers and identify docs gaps we should fix.

Need more help? Join us on Discord: https://discord.gg/y9efgEmppm

Want to use your own agent? Add the Solo MCP server to query our docs directly. Get started here: https://search.solo.io/.