Skip to content
Gab AI

Use Gab AI with Pi CLI: setup, access and checks

Bring Gab chat models and API tools into Pi’s model picker with the Gab provider package.

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.

Prerequisites

  • Pi CLI installed on your computer.
  • A Gab API key and the model ID you want to use.

Install the Gab provider package

Add the Gab package to Pi, or use the one-run command to load it for a temporary session.

Install from npm
Bash/Zsh
pi install npm:@gabai/pi-gab-ai

One-time run
Bash/Zsh
pi --no-extensions -e npm:@gabai/pi-gab-ai --models "gab/*"

Connect your Gab API key

Start Pi and run /gab to enter your key. The package stores it through Pi’s authentication system. For a scripted session, set GAB_API_KEY before launching Pi. This guide uses the Gab package; Pi’s models.json custom-provider route is a separate setup.

Pi key setup command
Text
/gab

Environment variable
Bash/Zsh
export GAB_API_KEY="YOUR_GAB_API_KEY"
pi --models "gab/*"

Choose and switch Gab models

Find Gab models in Pi’s model picker under the gab provider. Use the commands below to list models, choose Arya or another model, refresh the catalog, inspect the connection or sign out.

List and launch models
Bash/Zsh
pi --list-models gab
pi --provider gab --model arya
pi --model gab/gpt-6-sol
pi --models "gab/*"

Pi model and connection commands
Text
/gab arya
/gab gpt-6-sol
/gab refresh
/gab status
/gab logout

Use the included Gab API tools

The package also exposes Gab tools for model discovery, account data, files and media tasks. Choose the tool for the work you need and review its inputs before running it.

  • Account tools: credits, usage, model discovery, API key management, and account export
  • Media tools: image generation, image editing, video generation with polling, and text-to-speech
  • Data tools: embeddings when embedding models are available
  • File tools: upload, list, inspect, and delete Gab AI files
  • Agent tools: OpenAI-compatible tool calls through Gab chat models
Example Pi prompt
Text
Use gab_generate_image to create one image of a red square centered on a white background.

Troubleshooting

  • 401 authentication_error: run /gab setup or /login, or confirm GAB_API_KEY is set.
  • hasAuth or authStorage error: update to @gabai/pi-gab-ai 0.3.0 or newer for Pi 0.84.1 compatibility.
  • No Gab models shown: run /gab refresh, or update the package with pi install npm:@gabai/pi-gab-ai and run pi --list-models gab.
  • Tool calling does not proceed: choose a Gab model with function_calling support from /v1/models.
  • Media tools fail: confirm your account has enough credits and the selected media model is enabled.

Try a first prompt and follow-up

Select your configured Gab provider and model in Pi CLI. Send the first prompt, then continue the same conversation with the follow-up.

First prompt for Pi CLI
Text
For a workshop, income is USD 480 and base cost is USD 370. Reply with the remaining amount only.

Expected result: USD 110.

Follow-up prompt for Pi CLI
Text
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 Pi CLI connection.

Try a small Chat Completions request
cURL
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.

Was this page helpful?