Skip to content
Gab AI

Gab AI for developers

One AI API.
Models, tools and clear usage.

Build chat, research and creative tools with one Gab AI key. Use OpenAI-compatible Chat Completions and Responses or Anthropic-style Messages, choose your model, and connect the clients you already use.

Code example
Python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["GAB_API_KEY"],
    base_url="https://gab.ai/v1",
)

response = client.chat.completions.create(
    model="arya",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello, how are you?"}
    ],
)

print(response.choices[0].message.content)
Models to build with
203
Leading providers
31
Key for everything
1

Connect with the API format your app uses.

Start with Chat Completions, Responses or Messages. Each uses the same Gab AI key with its own request format.

Choose the protocol and base URL for your client

Choose the protocol and base URL for your client
Request format
Client base URL
Request endpoint
Setup reference
OpenAI-style Chat Completionshttps://gab.ai/v1POST /v1/chat/completions
OpenAI SDK and compatible chat clientsFirst request
OpenAI-style Responseshttps://gab.ai/v1POST /v1/responses
Codex uses a named Responses providerCodex setup
Anthropic-style Messageshttps://gab.ai for clients that append /v1/messagesPOST /v1/messages
Claude Code CLI gateway variablesClaude Code setup

Choose your client’s request format, then follow its setup guide for the base URL and model settings.

Use Gab as a multi-model LLM API for your app: one key connects to the offered models without managing a separate key for each provider. Point a compatible OpenAI client at Gab’s base URL, or use the Messages format for a client that expects it. Follow the protocol reference for supported fields and features.

Choose a model for your budget.

Match the model to the work before paying for more capacity than the task needs.

For a lower-cost API workflow, compare the current rates for models that support your inputs and tools. Start with a small representative request, then increase context or output only when the result needs it. Longer histories, reasoning and extra tool calls can increase usage.

Compare the cost of completing the task, including useful revisions, rather than a token rate alone. Read the completed request’s usage and keep your app’s output budget explicit.

Model costs and API billing

Meet Auto Router

Choose your model. Or leave it to Auto.

Choose a model by name for your task, or let Auto route your request. For coding, it considers the complexity of the work ahead.

Coding complexity

  • quick

    Syntax, one-liners, short explanations

  • standard

    One contained unit of work

  • hard

    Repo-scale, multi-file, security-sensitive

For supported coding agents, the selected model stays consistent through a tool loop. A new task can be routed again.

Find the selected model in the response and the X-Gab-Routed-Model header.

model="auto"
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_GAB_API_KEY",
    base_url="https://gab.ai/v1",
)

# Auto Router classifies the kickoff (quick / standard / hard for coding)
# and sticks that model for a Cursor / Claude Code / Codex tool loop.
response = client.chat.completions.create(
    model="auto",
    messages=[
        {"role": "user", "content": "Write a debounce helper and tests"}
    ],
)

print(response.model)  # slug that actually ran
# Also inspect X-Gab-Routed-Model, X-Gab-Router-Intent, X-Gab-Router-Coding-Tier
print(response.choices[0].message.content)

Fits your workflow

Your tools. More possibilities.

Connect your editor, coding agent or scripts using the matching API format. Each guide shows the base URL, credentials and model settings.

More integration guides

Follow the guide for your installed client version.

Build on an answer in conversation.

Draft a proposal from your notes

Use Chat Completions to turn source notes into a proposal, then refine the answer with a follow-up.

The workshop proposal includes 24 proposed participants at USD 20 each, generating USD 480 in income. After subtracting the USD 370 base cost, the remaining funds are USD 110 before unspecified tax and delivery. Currently, no date, venue, or approval exists for the event.

Read the source request
Source request
Text
Write three short sentences for a workshop proposal using only these facts: 24 proposed participants at USD 20 gives USD 480 income. Base cost is USD 370, so remaining funds are USD 110 before unspecified tax and delivery. No date, venue or approval exists. State the figures and unknowns clearly; do not invent details. Maximum 60 words.

Add the next action in a follow-up

Ask for the next step while keeping the figures and unknowns. The follow-up adds a request to confirm tax and delivery before approval.

The workshop proposes 24 participants at USD 20, yielding USD 480 income. The base cost is USD 370, leaving USD 110 before unspecified tax and delivery. No date, venue, or approval exists. Please confirm tax and delivery before approving the proposal.

Read the follow-up instruction
Follow-up instruction
Text
Keep those figures and unknowns. Add a direct next action asking the group to confirm tax and delivery before approving the proposal. Use no more than 60 words.

The API reference

Build with text, media and tools.

Create chat experiences, generate images, videos and speech, work with files, and manage API keys and usage.

Chat and agents

Generation

Files and account

Explore the full reference

Before your first request.

Can I use Gab AI with an OpenAI SDK?

Yes. Use https://gab.ai/v1 with your Gab API key for supported Chat Completions and Responses requests. The quickstart shows the request format; the endpoint reference explains fields and model capabilities.

Which base URL should I use for my client?

Use https://gab.ai/v1 for OpenAI-style clients. Clients such as Claude Code that append /v1/messages use https://gab.ai. Follow the setup guide for your client version.

Do I need Plus to use the Gab AI API?

Yes. Authenticated API requests require active Plus or Plus Premium and applicable credits.

Is Arya API usage included in Plus Chat?

No. API requests use credits separately from Arya’s included use in Plus Chat.

Start building

Bring Gab AI into your next project.

Authenticated API access requires Plus or Plus Premium and applicable credits. Create a key, follow the quickstart, and build from there.