Providers
Local Ollama or LM Studio ($0) or bring your own cloud key: OpenAI, Anthropic, Gemini, Groq, xAI, Mistral, DeepSeek, OpenRouter, Together, Fireworks, Hetzner Inference (experimental), or any OpenAI-compatible gateway. kprompt does not sell API keys.
kprompt does not sell API keys. For NL plans use local Ollama ($0, no key) via kprompt init --ollama, or BYOK with kprompt init --provider … plus your own cloud key. Requests go from your machine to that provider; there is no kprompt-hosted inference proxy. With no provider configured, the CLI stays unconfigured (no silent OpenAI default). Provider keys are environment variables only and are never written to the config file. Optional Team kp_… tokens are for org policy/audit, not LLM inference.
Supported providers
| Provider | --provider | Env key(s) | Default model |
|---|---|---|---|
| Ollama (local) | ollama | none required — $0 first path | llama3.2 |
| LM Studio (local) | lmstudio | none required — $0; server must be running with a model loaded | local-model (must match a loaded model name) |
| OpenAI | openai | KPROMPT_OPENAI_API_KEY / OPENAI_API_KEY | gpt-4o-mini |
| Anthropic | anthropic | KPROMPT_ANTHROPIC_API_KEY / ANTHROPIC_API_KEY | claude-sonnet-4-6 |
| Google Gemini | gemini | KPROMPT_GEMINI_API_KEY / GEMINI_API_KEY / GOOGLE_API_KEY | gemini-3.6-flash |
| Groq | groq | KPROMPT_GROQ_API_KEY / GROQ_API_KEY | llama-3.3-70b-versatile |
| xAI (Grok) | xai | KPROMPT_XAI_API_KEY / XAI_API_KEY | grok-4.5 |
| Cerebras | cerebras | KPROMPT_CEREBRAS_API_KEY / CEREBRAS_API_KEY | gpt-oss-120b |
| Mistral | mistral | KPROMPT_MISTRAL_API_KEY / MISTRAL_API_KEY | mistral-small-latest |
| DeepSeek | deepseek | KPROMPT_DEEPSEEK_API_KEY / DEEPSEEK_API_KEY | deepseek-chat |
| Moonshot (Kimi K3) | moonshot | KPROMPT_MOONSHOT_API_KEY / MOONSHOT_API_KEY | kimi-k3 |
| Qwen (DashScope) | qwen | KPROMPT_QWEN_API_KEY / DASHSCOPE_API_KEY / QWEN_API_KEY | qwen-plus |
| OpenRouter | openrouter | KPROMPT_OPENROUTER_API_KEY / OPENROUTER_API_KEY | openai/gpt-4o-mini |
| Together | together | KPROMPT_TOGETHER_API_KEY / TOGETHER_API_KEY | meta-llama/Llama-3.3-70B-Instruct-Turbo |
| Fireworks | fireworks | KPROMPT_FIREWORKS_API_KEY / FIREWORKS_API_KEY | accounts/fireworks/models/llama-v3p3-70b-instruct |
| Hetzner Inference | hetzner | KPROMPT_HETZNER_API_KEY / HETZNER_API_KEY | Qwen/Qwen3.6-35B-A3B-FP8 (experimental / free while in beta) |
| Azure OpenAI | azure | KPROMPT_AZURE_API_KEY / AZURE_OPENAI_API_KEY / KPROMPT_OPENAI_API_KEY | deployment name (requires base_url) |
| OpenAI-compatible | openai-compatible | KPROMPT_OPENAI_API_KEY | requires base_url |
Ollama runs locally at http://127.0.0.1:11434/v1 and needs no key — the $0 path for trying kprompt or running it in CI. LM Studio is the same local OpenAI-compatible shape at http://127.0.0.1:1234/v1; start the app, load a model, and pass --model with that model's name. Groq, xAI (Grok), Cerebras, Mistral, DeepSeek, Moonshot (Kimi K3), Qwen (DashScope), OpenRouter, Together, Fireworks, and Hetzner Inference all speak the OpenAI-compatible API. Fireworks model ids are account-scoped (accounts/fireworks/models/…). Hetzner Inference is experimental (free while in beta, no SLA). The qwen preset defaults to the international DashScope endpoint; mainland China keys need KPROMPT_OPENAI_BASE_URL pointed at the CN compatible-mode URL. Azure OpenAI uses the named azure preset with a resource base_url; --model is your deployment name.
Gemini free tier (honest)
AI Studio keys often start on a free tier with daily / per-minute quotas. Exceeding them returns HTTP 429 — Google’s limit, not a kprompt bug. Get a key at aistudio.google.com/apikey. Monitor quotas at ai.dev/rate-limit.
export KPROMPT_GEMINI_API_KEY=...
kprompt config set provider gemini
kprompt config set model gemini-3.6-flash # current GA Flash| Symptom | What to do |
|---|---|
| 429 / generate_content_free_tier_* | Wait for reset, enable billing on that Google project (calls become paid), or switch to Ollama |
| 404 model no longer available to new users | Use a current model id (e.g. gemini-3.1-flash-lite / gemini-3.5-flash) — older gemini-2.5-flash-lite may be closed to new keys |
| Works in CLI, Team /run fails | Bridge uses the same machine env/secrets — export the key (or secrets pull) where kprompt run listen runs |
Prefer Ollama when you want $0 with no cloud quota. Team bridge failures: App runs & CLI bridge.
How keys are resolved
- Ollama and LM Studio need no provider key
- The KPROMPT_-prefixed variable is checked first, then the vendor default such as OPENAI_API_KEY
- Environment variables always win over keys pulled from a Team org with kprompt secrets pull
- ~/.kprompt/config.yaml stores provider, model, namespace, and base_url — never a key
- kprompt doctor reports whether a usable key was found without printing its value
- Team kp_… tokens from kprompt login are unrelated to LLM provider keys
Examples
# Local Ollama ($0)
kprompt --provider ollama --model llama3.2 "list pods"
# LM Studio (local $0 — start the server and load a model first)
kprompt --provider lmstudio --model <loaded-model-name> "list pods"
export KPROMPT_OPENAI_API_KEY=sk-...
kprompt "list deployments"
export KPROMPT_ANTHROPIC_API_KEY=sk-ant-...
kprompt --provider anthropic "explain why api is crashing"
export KPROMPT_GEMINI_API_KEY=...
kprompt --provider gemini --model gemini-3.6-flash "deploy redis"
export KPROMPT_XAI_API_KEY=...
kprompt --provider xai "explain why api is crashlooping"
export KPROMPT_MOONSHOT_API_KEY=...
kprompt --provider moonshot "explain why api is crashlooping"
export KPROMPT_QWEN_API_KEY=...
kprompt --provider qwen "explain why api is crashlooping"
# Hetzner Inference (experimental — free while in beta)
export KPROMPT_HETZNER_API_KEY=...
kprompt --provider hetzner "list pods"Azure OpenAI and custom gateways
Azure OpenAI has a named azure preset (still OpenAI-compatible under the hood). Set the resource URL as base_url; --model is the deployment name you created in the portal — not an OpenAI model id. Generic gateways keep using openai-compatible.
export KPROMPT_AZURE_API_KEY=...
export KPROMPT_OPENAI_BASE_URL=https://YOUR_RESOURCE.openai.azure.com/openai/v1
kprompt --provider azure --model my-gpt4o-deploy "list services"
# or any OpenAI-compatible gateway
export KPROMPT_OPENAI_API_KEY=...
export KPROMPT_OPENAI_BASE_URL=https://gateway.example/v1
kprompt --provider openai-compatible --model gpt-4o-mini "list services"Config file
~/.kprompt/config.yaml
provider: ollama
model: llama3.2
# provider: gemini
# model: gemini-3.6-flash
# base_url: https://api.groq.com/openai/v1 # optional override
namespace: defaultOr set the same values from the CLI
kprompt config set provider ollama
kprompt config set model llama3.2
kprompt configChoosing a model
- Start with local Ollama ($0) for first NL plans — no cloud key to buy
- Fast and cheap cloud models handle routine intents like list, scale, and logs well
- Reserve a stronger model for explain, investigate, and why prompts that reason across events and logs
- Local Ollama models avoid all spend but produce weaker plans on ambiguous prompts
- Switch per command with --provider and --model without changing your saved defaults
Model choice affects plan quality, never the approval boundary: a weaker model may produce a worse plan, but it still cannot bypass the safety engine or apply without approval.