Skip to main content

OpenAI Key

Kvery's generative-AI features — the AI SQL assistant and generated query descriptions — run on OpenAI using your own API key. You add the key once on your profile, and the AI features work everywhere in the app.

Why your own key?​

Using your key means AI usage is billed directly to your OpenAI account, you stay in control of spend, and Kvery never has to broker a shared key. Without a key configured, AI chat and Generate AI in the editor open your profile on the OpenAI tab with the message "To use AI features, please add your OpenAI API key.".

Adding your key​

  1. Create an API key in your OpenAI account.
  2. Open your Kvery profile settings and go to the OpenAI tab.
  3. Paste the key into the OpenAI key field, choose a model in OpenAI model, and click Save. While no model is saved, the list starts at its first entry, GPT-6 Astra (most capable), the most expensive one: pick the model you want before saving.

A key must be 8 to 500 printable characters without spaces; anything else is refused with "This does not look like a valid OpenAI API key.". Kvery stores the key encrypted.

When you save, Kvery checks the key and the model with OpenAI:

  • An invalid or revoked key is refused, and so is a model that is not available for your key.
  • If OpenAI can't be reached or doesn't allow the check (for example, a key with restricted permissions), the settings are saved without the check.

The AI features work in the editor right after saving, without reloading the page; AI chat is shown while Kvery can read the database structure of the query's connection (see Generative AI).

Managing a saved key​

  • Your saved key is never shown again — the profile only displays a masked form of it (for example sk-…a1B2).
  • To change the model, pick another one and save; leave the key field empty to keep the saved key.
  • To replace the key, paste the new key and save.
  • To remove the key, use Remove key and confirm "Remove your saved OpenAI API key? AI features stop working until you add a key again.". The saved model is removed as well.

Models and cost​

You choose the model on the same tab. Costs are OpenAI's per-token rates billed to your account; see Generative AI for the available models, their pricing and guidance on which one to pick.

warning

Your OpenAI key is a secret. Don't share it, and rotate it in OpenAI if you suspect it has been exposed — then update it in your Kvery profile.

Tips​

  • Start with the recommended model for everyday help; switch to the most capable one only for the hardest queries.
  • Set a usage limit in your OpenAI account dashboard to cap spend.
  • If AI requests fail with a quota or billing message, check your OpenAI billing settings — the limit is on your OpenAI account, not in Kvery.