Use Gab AI with Codex CLI: setup, access and checks
Add Gab as a model provider for your Codex projects using a named Responses configuration.
Connect your client to Gab AI
Have your client installed and a Gab API key ready. Follow the configuration for your client below, then select a model and try a first prompt.
Configure a Gab Responses provider
Replace YOUR_GAB_API_KEY with your complete Gab key and run the export command in the shell that launches Codex. Merge the named provider into your user-level ~/.codex/config.toml, keeping model and model_provider above the first TOML table. The sample selects Arya and routes Responses requests to https://gab.ai/v1. Keep unrelated settings.
export GAB_API_KEY="YOUR_GAB_API_KEY"model = "arya"
model_provider = "gab"
[model_providers.gab]
name = "Gab AI"
base_url = "https://gab.ai/v1"
env_key = "GAB_API_KEY"
wire_api = "responses"
requires_openai_auth = false
supports_websockets = falsecodex -m arya -c 'model_provider="gab"'Confirm the selected provider
Launch Codex with the configured Gab provider and model. Start with the prompt below in a disposable project, read the completed answer and inspect any proposed changes. Keep your normal command approvals.
Try a first prompt and follow-up
Select your configured Gab provider and model in Codex CLI. Send the first prompt, then continue the same conversation with the follow-up.
For a workshop, income is USD 480 and base cost is USD 370. Reply with the remaining amount only.Expected result: USD 110.
Change only the base cost to USD 395. Keep income at USD 480 and reply with the new remaining amount only.Expected result after the change: USD 85.
Check the API connection separately
This cURL example checks Chat Completions directly. Use the in-client prompts above to check your Codex CLI connection.
curl -sS https://gab.ai/v1/chat/completions \
-H "Authorization: Bearer $GAB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "arya",
"messages": [
{
"role": "user",
"content": "For a workshop, income is USD 480 and base cost is USD 370. Reply with the remaining amount only, as USD 110."
}
],
"max_tokens": 1024,
"stream": false
}'API access and usage
Authenticated API requests require active Plus or Plus Premium and applicable credits. API use is billed separately from included in-app Chat. Daily request limits and credit balance are separate; the authentication reference explains allowances and reset times.
Resolve failed or incomplete requests
Read the client’s error and confirm its active provider, base URL and model. For key, account or rate-limit errors, use the authentication guide. If an answer stops early, inspect the completion status and output budget before retrying. For tool failures, check the selected model’s capabilities and the client’s tool configuration.