Providers#
We support LLMs from several providers, including OpenAI, Anthropic, OpenRouter, Requesty, Deepseek, Azure, and any OpenAI-compatible server (e.g. ollama, llama-cpp-python).
You can also bring your own subscription instead of an API key: a ChatGPT Plus/Pro plan via OpenAI Subscription or a SuperGrok plan via Grok Subscription.
Important
A provider or subscription backend is not an agent harness. This page
configures model access inside the gptme runtime. For example,
openai-subscription uses ChatGPT subscription access from gptme; it does
not run the Codex CLI harness. Likewise, grok-subscription does not run
the Grok Build harness. See 🔁 Runtime Portability for the
workspace / harness / model / access distinction.
Note
We are in the process of adding support for configurable custom providers.
You can find our model recommendations on the Evals page.
Selecting a provider and model#
To select a provider and model, run gptme with the -m/--model flag set to <provider>/<model>, for example:
gptme "hello" -m openai/gpt-5.5
gptme "hello" -m anthropic # will use provider default
gptme "hello" -m openrouter/x-ai/grok-4
gptme "hello" -m openrouter/deepseek/deepseek-v4-pro
gptme "hello" -m deepseek/deepseek-reasoner
gptme "hello" -m gemini/gemini-2.5-flash
gptme "hello" -m groq/llama-3.3-70b-versatile
gptme "hello" -m xai/grok-4
gptme "hello" -m openai-subscription/gpt-5.5-pro
gptme "hello" -m grok-subscription/grok-4.6
gptme "hello" -m local/llama3.2:1b
gptme "hello" -m gptme/claude-sonnet-4-6
You can list the models known to gptme using gptme '/models' - '/exit'.
Which tool format a model performs best with also varies by provider and model — see Tool Formats for how to choose one.
Configuring credentials#
To configure provider credentials interactively, run /account inside gptme:
/account
/account setup
/account setup openrouter
/account setup openrouter starts browser-based OpenRouter sign-in using OAuth / PKCE, stores the resulting key in ~/.config/gptme/credentials.toml, and switches the default model to OpenRouter’s recommended default.
For providers without OAuth onboarding yet, /account setup <provider> prompts for the key without putting it in shell history and stores it in ~/.config/gptme/credentials.toml (or $XDG_CONFIG_HOME/gptme/credentials.toml if set). Supported manual providers currently include anthropic, openai, deepseek, gemini, groq, and xai.
Subscription sign-in (ChatGPT Plus/Pro and SuperGrok) is also offered in the first-run setup when gptme starts without any configured credentials.
You can still use the [env] section in the Global config file to store API keys using the same format as the environment variables:
OPENAI_API_KEY="your-api-key"ANTHROPIC_API_KEY="your-api-key"OPENROUTER_API_KEY="your-api-key"GEMINI_API_KEY="your-api-key"XAI_API_KEY="your-api-key"GROQ_API_KEY="your-api-key"DEEPSEEK_API_KEY="your-api-key"
OpenAI Platform#
Use the direct OpenAI Platform provider with openai/<model>:
gptme "hello" -m openai/gpt-4o
gptme "hello" -m openai/gpt-5
gptme "fix this bug" -m openai/gpt-5.5
GPT-5-class openai/* models (gpt-5, gpt-5.5, gpt-5-mini, and
gpt-5-nano) and o-series models automatically use the OpenAI Responses API.
gptme routes these models through /v1/responses by default:
export OPENAI_API_KEY="your-api-key"
gptme "solve this problem" -m openai/gpt-5
Non-GPT-5 models, proxy providers such as OpenRouter, and other OpenAI-compatible backends continue using the chat-completions path.
To force the legacy chat-completions path for debugging or comparison, set
GPTME_OPENAI_RESPONSES_API=0:
export GPTME_OPENAI_RESPONSES_API=0
gptme "solve this problem" -m openai/gpt-5
In addition to 0, the flag also accepts false, no, and off as
falsy values.
Note
This flag only affects the direct openai provider. The
openai-subscription provider uses its own Responses API path by
default.
OpenRouter#
OpenRouter provides access to 100+ models through a single API key. gptme applies sensible defaults for OpenRouter requests:
Provider routing:
require_parametersis enabled, ensuring the routed provider supports all request parameters (tools, response format, etc.). This prevents silent failures when OpenRouter falls back to a provider that doesn’t support function calling.Privacy:
data_collectiondefaults to"deny", preventing providers from training on your data. This aligns with gptme’s privacy-first philosophy.Provider override: Use
model@providersyntax to pin a specific backend (e.g.anthropic/claude-sonnet-4-20250514@anthropic).Quantization: Optionally restrict to specific precision levels (e.g.
fp16for quality,int4for cost savings). SetOPENROUTER_QUANTIZATIONto a comma-separated list of accepted levels.
Configuration:
# In gptme.toml or ~/.config/gptme/config.toml
[env]
OPENROUTER_API_KEY = "your-api-key"
# Override data collection preference (default: "deny")
# Set to "allow" if you need providers that require data collection consent
OPENROUTER_DATA_COLLECTION = "allow"
# Restrict to specific quantization levels (optional)
# Common values: fp16, bf16, fp8, int8, int4, unknown
OPENROUTER_QUANTIZATION = "fp16,bf16"
Requesty#
Requesty is an OpenAI-compatible LLM gateway that routes to many models through a single API key, using the same provider/model naming as OpenRouter (e.g. requesty/openai/gpt-4o-mini, requesty/anthropic/claude-sonnet-4-5). It is reached through the standard OpenAI-compatible client path.
Configuration:
# In gptme.toml or ~/.config/gptme/config.toml
[env]
REQUESTY_API_KEY = "your-api-key"
Get an API key at https://app.requesty.ai/api-keys. See https://docs.requesty.ai for details.
Groq#
Groq provides fast inference for open-source models via its own API key — not through the OPENAI_BASE_URL / OPENAI_API_KEY pattern.
Configuration:
export GROQ_API_KEY="gsk_..."
gptme "hello" -m groq/llama-3.3-70b-versatile
Or store the key via the interactive setup:
gptme '/account setup groq'
Or in ~/.config/gptme/config.toml:
[env]
GROQ_API_KEY = "gsk_..."
Note
Using OPENAI_BASE_URL=https://api.groq.com/openai/v1 with OPENAI_API_KEY
will return a 401 — Groq requires its own GROQ_API_KEY.
The groq/<model> provider prefix handles this automatically.
Popular Groq models:
groq/llama-3.3-70b-versatile— fast 70B Llama 3.3groq/llama-3.1-8b-instant— fastest, smallest
OpenAI Subscription#
You can use your existing ChatGPT Plus/Pro subscription with gptme. This uses the ChatGPT backend API (Codex endpoint) instead of the OpenAI Platform API, allowing you to leverage your subscription for development.
Setup:
Authenticate using the OAuth command (opens browser for login):
gptme-auth openai-subscription
This stores credentials locally at ~/.config/gptme/oauth/openai_subscription.json.
Access tokens are automatically refreshed before expiry, so you only need to authenticate once.
Usage:
gptme "hello" -m openai-subscription/gpt-5.5-pro
gptme "hello" -m openai-subscription/gpt-5.4
You can also append reasoning levels: :low, :medium, :high, or :xhigh:
gptme "solve this problem" -m openai-subscription/gpt-5.5-pro:high
Available Models:
gpt-5.5-pro- Latest flagship with maximum reasoning compute (Responses API only)gpt-5.4- Previous flagship with reasoning capabilitiesgpt-5.3-codex- Previous code-optimized variantgpt-5.3-codex-spark- Faster variant of gpt-5.3-codexgpt-5.2- Previous generation GPT modelgpt-5.2-codex- Previous code-optimized variantgpt-5.1-codex-max- Maximum capability variantgpt-5.1-codex- Code-optimizedgpt-5.1-codex-mini- Smaller code-optimized variantgpt-5.1- Previous generation
Note
This is for personal development use with your own ChatGPT Plus/Pro subscription. For production or multi-user applications, use the OpenAI Platform API. OAuth credentials are stored locally and access tokens are refreshed automatically.
Grok Subscription#
You can use your existing SuperGrok subscription (grok.com) with gptme, instead of an xAI API key. This uses the same subscription endpoint as the grok CLI.
Setup:
If you have the grok CLI installed and have run grok login, gptme automatically reuses those tokens (from ~/.grok/auth.json) with no extra steps.
Otherwise, authenticate directly using the OAuth command (opens browser for login):
gptme-auth grok-subscription
This stores credentials locally at ~/.config/gptme/oauth/grok_subscription.json.
Access tokens are automatically refreshed before expiry, and refreshed tokens are synced back to the grok CLI’s auth file when present.
Usage:
gptme "hello" -m grok-subscription/grok-4.6
gptme "hello" -m grok-subscription/grok-4.5
Available Models:
grok-4.6- Current frontier model (500K context, vision, reasoning)grok-4.5- Previous frontier model (500K context, vision, reasoning)
The subscription endpoint is OpenAI-compatible and supports native function calling (--tool-format tool).
Note
This is for personal development use with your own SuperGrok subscription.
For production or multi-user applications, use the xAI Platform API (xai provider) with an API key from console.x.ai.
gptme Managed Service#
The gptme provider connects to the gptme.ai managed service, which acts as an OpenAI-compatible LLM proxy/gateway. This gives you access to multiple model providers (Anthropic, OpenAI, etc.) through a single account.
Setup:
Authenticate using the Device Flow command:
gptme-auth login
This opens your browser to approve access, then stores a token locally at ~/.config/gptme/auth/gptme-cloud-<hash>.json. Tokens are refreshed automatically.
Usage:
gptme "hello" -m gptme/claude-sonnet-4-6
gptme "hello" -m gptme # uses default model
Models are pass-through: gptme/<model> proxies to the corresponding backend provider.
Environment variables (alternative to Device Flow login):
GPTME_CLOUD_API_KEY: API key for the managed serviceGPTME_CLOUD_BASE_URL: Custom service URL (default:https://fleet.gptme.ai/v1)
Auth commands:
gptme-auth login # Login via Device Flow (opens browser)
gptme-auth login --no-browser # Print URL instead of opening browser
gptme-auth status # Show current login status
gptme-auth logout # Remove stored credentials
Provider Plugins (Entry Points)#
Third-party packages can register LLM providers via Python entry points, making them available immediately after pip install without any configuration changes.
How it works: A plugin package declares an entry point in the gptme.providers group:
[project.entry-points."gptme.providers"]
minimax = "gptme_provider_minimax:provider"
Where provider is a ProviderPlugin instance.
Usage: Once installed, use the provider name as the model prefix:
pip install gptme-provider-minimax
gptme "hello" -m minimax/MiniMax-M3
Creating a provider plugin:
from gptme.llm.models import ModelMeta, ProviderPlugin
provider = ProviderPlugin(
name="minimax", # Unique provider name
api_key_env="MINIMAX_API_KEY", # Env var for API key
base_url="https://api.minimax.chat/v1", # OpenAI-compatible endpoint
models=[
ModelMeta(
provider="unknown",
model="minimax/MiniMax-M3",
context=1_000_000,
price_input=0.6,
price_output=2.4,
supports_vision=True,
supports_reasoning=True,
),
ModelMeta(
provider="unknown",
model="minimax/MiniMax-M2.7",
context=204_800,
price_input=0.3,
price_output=1.2,
supports_reasoning=True,
),
],
)
ProviderPlugin fields:
Field |
Required |
Description |
|---|---|---|
|
Yes |
Unique provider name (e.g. |
|
Yes |
Environment variable holding the API key |
|
Yes |
OpenAI-compatible API base URL |
|
No |
List of |
|
No |
Custom |
If init is provided, it must register an OpenAI-compatible client before returning, or gptme will raise a RuntimeError.
Plugin providers are auto-initialised on first use and routed through the OpenAI client path.
Note
For new plugins, consider using the unified plugin system (gptme.plugins entry-point group) instead. It lets a single package provide tools, hooks, commands, and a provider together. The gptme.providers group still works and is supported for backward compatibility.
Local#
You can use local LLM models using any OpenAI API-compatible server.
To achieve that with ollama, install it then run:
ollama pull llama3.2:1b
ollama serve
OPENAI_BASE_URL="http://127.0.0.1:11434/v1" gptme 'hello' -m local/llama3.2:1b
Note
Small models won’t work well with tools, severely limiting the usefulness of gptme. You can find an overview of how different models perform on the Evals page.
More about providers