Skip to content

AI assistant (BYO key)

Pro Plus. Settings → Pro Plus → AI assistant. Off by default; when you turn it on, you bring your own API key. See the no-AI-dependency concept for the underlying rule.

  1. AI features enabled — flip the toggle on
  2. Provider — Anthropic (Claude) or OpenAI
  3. API key — your own. Stored locally at ~/.config/quay/ai-settings.json, never synced, never sent to Quay’s servers.
  4. Model — defaults to a small fast one (claude-haiku-4-5 / gpt-4o-mini). Override with any model id the provider exposes.
  5. Schema-aware prompts — separate toggle, off by default. When off, your table/column names never leave Quay. When on, the schema goes to the provider with each prompt.

Save. The button surfaces a “Saved.” status; the AI surfaces in the editor + EXPLAIN panel + schema browser become available.

Cursor in the editor, ⌘K, type a natural-language description: “give me an UPDATE that bumps every order older than 30 days to ‘expired’”. The result is inserted as text into the editor — not executed. You still hit ⌘↵ to run it, with the standard confirmation rules applying.

Run EXPLAIN on a query → the tips panel adds an “AI commentary” section below the deterministic tips. Free- form natural language (“you’ve got a hash join on a 4M-row table that’s reshuffling 80MB through work_mem; either tune work_mem higher or look for a more selective predicate”).

The deterministic tips above are unchanged. AI augments, doesn’t replace.

Right-click any table or column → Explain. The AI reads:

  • The table’s DDL
  • Comments (COMMENT ON TABLE / COMMENT ON COLUMN)
  • Recent query patterns (last N queries that touched this object — only if you’ve enabled query-history capture in Settings → Behavior)
  • The column’s name conventions

…and writes a paragraph: “this looks like the user_subscription junction table; based on the queries it’s likely you join through it for billing reports.”

If you’ve turned schema-aware prompts off, the AI gets only the DDL — no actual data + no recent queries.

Per the no-AI-dependency rule:

  • Every AI feature has a deterministic non-AI fallback that’s complete on its own
  • AI is opt-in, off by default
  • Quay never proxies AI calls through its own servers
  • API key is local to your machine, never synced
AI featureNon-AI fallback (what you get with AI off)
⌘K generateSnippet expansion + autocomplete in the editor
AI EXPLAINRule-based EXPLAIN interpreter (explain tips)
AI explain table / columnSchema browser + comments column inline
  • Quay never sees the prompt. The HTTP call goes Quay → provider, with your API key in the header. No Quay proxy, no Quay logging server, no telemetry.
  • Schema-aware off by default. Even with AI on, the table / column names don’t leave Quay until you explicitly enable schema-aware prompts.
  • Query history is local. Recent queries are pulled from Quay’s local history, not from a server.

The implication: if you’re handling a database under a security policy that forbids exposing schema names to third parties, leave AI off (or use it without the schema-aware toggle). Compliance isn’t compromised by Quay’s defaults.

Cost depends on the model + your usage pattern. Rough order of magnitude with the default models:

  • ⌘K generate: ~$0.0001 / query (claude-haiku) / ~$0.0002 (gpt-4o-mini)
  • AI EXPLAIN commentary: ~$0.001 / EXPLAIN
  • AI schema explain: ~$0.001 / object

Even heavy usage rarely tops $5/mo for a single user. Watch your provider’s billing dashboard if you’re uncertain.

  • Auto-fix the schema (“AI noticed the missing index and added it for you”)
  • Auto-correct the query (“the AI rewrote your UPDATE before running”)
  • Run-on-its-own AI with no human in the loop

All of those are paths where confidence drops below the North Star. The AI assistant always pauses + shows you what it produced

  • requires a human keystroke to execute.