Codex CLI

Use Codex-style OpenAI clients with Gab AI through /v1/chat/completions and /v1/responses.

Prerequisites

Configuration

Codex-style clients generally expect OpenAI-compatible environment variables. Use the Gab AI OpenAI-compatible base URL:

Environment variables

Responses API support

Newer OpenAI agent clients may use /v1/responses instead of /v1/chat/completions. Gab AI supports both paths for text, streaming, and function/tool workflows.

Supported Features

Smoke Test

Test the Responses API directly before launching your CLI: To test function calling:

Responses API

Function tool request

Troubleshooting

export OPENAI_BASE_URL="https://gab.ai/v1"
export OPENAI_API_KEY="YOUR_GAB_API_KEY"

codex

Responses API support

Newer OpenAI agent clients may use /v1/responses instead of /v1/chat/completions. Gab AI supports both paths for text, streaming, and function/tool workflows.

curl https://gab.ai/v1/responses \\
  -H "Authorization: Bearer YOUR_GAB_API_KEY" \\
  -H "Content-Type: application/json" \\
  -d '{
    "model": "arya",
    "input": "Say hello from the Responses API.",
    "max_output_tokens": 128
  }'
curl https://gab.ai/v1/responses \\
  -H "Authorization: Bearer YOUR_GAB_API_KEY" \\
  -H "Content-Type: application/json" \\
  -d '{
    "model": "arya",
    "input": "What is the weather in Paris? Use the weather tool.",
    "tools": [
      {
        "type": "function",
        "name": "get_weather",
        "description": "Get weather for a location.",
        "parameters": {
          "type": "object",
          "properties": { "location": { "type": "string" } },
          "required": ["location"]
        }
      }
    ],
    "tool_choice": { "type": "function", "name": "get_weather" }
  }'