Skip to content
Gab AI

Use Gab AI with Prime Agent: setup, access and checks

Configure a Gab model for your Prime Agent projects with the custom-provider setup below.

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

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

Install and open Prime Agent

Install Prime Agent, then open it in the project directory you intend to use.

Install and launch
Bash/Zsh
curl -fsSL https://app.primeintellect.ai/prime-agent/install.sh | sh

cd /path/to/project
prime-agent

Add the Gab custom provider

For Prime Agent versions that support ~/.prime/agent/models.json, merge the provider below without removing existing entries. It uses Chat Completions at https://gab.ai/v1 and reads GAB_AI_API_KEY for authentication. Match the installed version’s custom-model schema before editing.

~/.prime/agent/models.json
JSON
{
  "providers": {
    "gab-ai": {
      "baseUrl": "https://gab.ai/v1",
      "api": "openai-completions",
      "apiKey": "GAB_AI_API_KEY",
      "compat": {
        "supportsDeveloperRole": false,
        "supportsReasoningEffort": false
      },
      "models": [
        {
          "id": "arya",
          "name": "Arya",
          "reasoning": false,
          "input": ["text"],
          "contextWindow": 128000
        },
        {
          "id": "claude-sonnet-4-5",
          "name": "Claude Sonnet 4.5",
          "reasoning": true,
          "input": ["text", "image"],
          "contextWindow": 200000
        }
      ]
    }
  }
}

Set your key and choose the model

Export GAB_AI_API_KEY in the shell that launches Prime Agent. Select the gab-ai provider and a model ID from your configuration, using the launch command or the /model picker.

Launch with Gab AI
Bash/Zsh
export GAB_AI_API_KEY="YOUR_GAB_API_KEY"

cd /path/to/project
prime-agent --provider gab-ai --model arya

Find models with function calling

Use a function-calling text model for agent tasks. Copy the exact model ID into models.json and match any configured input/context limits to the catalog.

List function-calling models
cURL
curl https://gab.ai/v1/models \
  -H "Authorization: Bearer YOUR_GAB_API_KEY" \
  | jq -r '.data[] | select(.capabilities.function_calling and .capabilities.text) | .id'

Use a current model ID or catalog alias

Copy the exact ID or an alias returned by /v1/models. Display names and guessed dotted/hyphenated spellings are not reliable. Check text/function-calling capability and map the ID in the client.

Choose capabilities for your workflow

Match the Gab model’s capabilities to the inputs and tools your client sends.

  • Chat Completions requests through the configured Gab provider.
  • Streaming and function calling with models that advertise those capabilities.
  • Image inputs when both the selected model and client support the requested format.

Continue your Prime Agent work

Use these client commands to inspect or resume sessions after connecting your provider. They operate Prime Agent itself.

CLI reference (common)
Bash/Zsh
prime-agent agents                   # Browse running, idle, and saved sessions
prime-agent attach <agent>           # Reattach to a running session
prime-agent --resume <path|id>       # Resume a saved session
prime-agent -p "Summarize this repo" # One-shot non-interactive prompt
prime-agent doctor                   # Inspect background services

Troubleshooting

  • 401 authentication_error: confirm GAB_AI_API_KEY is set (or the literal key in models.json) with no extra whitespace.
  • 403 plus_required: the developer API requires an active Gab AI Plus subscription.
  • 400 invalid_model: the model id in models.json or --model does not match GET /v1/models.
  • Provider missing in /model: edit ~/.prime/agent/models.json, then reopen /model (it reloads without a full restart).
  • Empty or broken replies: baseUrl must be https://gab.ai/v1 (include the /v1 suffix). Verify with a curl chat completion first.
  • 402 credits_exhausted: check GET /v1/credits and top up if needed.

Try a first prompt and follow-up

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

First prompt for Prime Agent
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 Prime Agent
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 Prime Agent 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?