Using Gab AI API with OpenClaw

Add Gab AI as a provider in your OpenClaw Gateway and access all generation endpoints through the OpenAI-compatible API.

Prerequisites

Configuration

In your OpenClaw Gateway configuration, add Gab AI as a provider using the OpenAI-compatible HTTP API format: Or if using the OpenClaw Go client (openclaw-go):

Gateway Configuration

Go Client

Making Requests

Requests follow the standard OpenAI chat completions format:

cURL Example

Supported Endpoints

Description

  1. POST /v1/chat/completions — Text generation (streaming and non-streaming)
  2. GET /v1/models — List available models
  3. POST /v1/images/generations — Image generation
  4. POST /v1/audio/speech — Text-to-speech
  5. POST /v1/videos/generations — Video generation (async)
  6. POST /v1/embeddings — Text embeddings for search and RAG
  7. GET /v1/credits — Check credit balance
  8. GET /v1/usage — Per-request usage history (tx_id, model, tokens, cost)

Authentication

All requests require a Bearer token: API keys can be created and managed at gab.ai/ai/settings or via the /v1/api-keys endpoints.

Authorization Header

Rate Limits

Credits

All generation endpoints consume credits. Check your balance with GET /v1/credits. If credits are exhausted, the API returns a 402 status code.

Monitor Your Usage

Use the X-RateLimit-Remaining header and the /v1/credits endpoint to monitor your usage and avoid interruptions.

providers:
  gab-ai:
    type: openai
    base_url: https://gab.ai/v1
    api_key: YOUR_GAB_API_KEY
client := openai.NewClient(
    openai.WithBaseURL("https://gab.ai/v1"),
    openai.WithAPIKey("YOUR_GAB_API_KEY"),
)
curl https://gab.ai/v1/chat/completions \\
  -H "Authorization: Bearer YOUR_GAB_API_KEY" \\
  -H "Content-Type: application/json" \\
  -d '{
    "model": "arya",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": true
  }'
Authorization: Bearer gab-xxxxxxxxxxxx

Monitor Your Usage

Use the X-RateLimit-Remaining header and the /v1/credits endpoint to monitor your usage and avoid interruptions.