Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@
- changed-files:
- any-glob-to-any-file:
- "extensions/google-gemini-cli-auth/**"
"extensions: gatewayz":
- changed-files:
- any-glob-to-any-file:
- "extensions/gatewayz/**"
- "docs/providers/gatewayz.md"
"extensions: llm-task":
- changed-files:
- any-glob-to-any-file:
Expand Down
9 changes: 9 additions & 0 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@
"source": "/zai/",
"destination": "/providers/zai"
},
{
"source": "/gatewayz",
"destination": "/providers/gatewayz"
},
{
"source": "/gatewayz/",
"destination": "/providers/gatewayz"
},
{
"source": "/message",
"destination": "/cli/message"
Expand Down Expand Up @@ -1027,6 +1035,7 @@
"providers/minimax",
"providers/vercel-ai-gateway",
"providers/openrouter",
"providers/gatewayz",
"providers/synthetic",
"providers/opencode",
"providers/glm",
Expand Down
74 changes: 74 additions & 0 deletions docs/providers/gatewayz.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
summary: "Use Gatewayz's universal AI inference API to access 10,000+ models in OpenClaw"
read_when:
- You want a single API key for many LLMs
- You want to run models via Gatewayz in OpenClaw
title: "Gatewayz"
---

# Gatewayz

Gatewayz provides a **universal AI inference API** with unified access to over 10,000 AI models
through a single endpoint. It is OpenAI-compatible, so most OpenAI SDKs work by switching the base URL.

Supported models include GPT, Claude, Gemini, LLaMA, DeepSeek, Qwen, Mistral, and many more.

## Quick start

```bash
openclaw login gatewayz
```

This will prompt you for your API key and configure the provider.

## CLI setup (non-interactive)

```bash
openclaw onboard --auth-choice apiKey --token-provider gatewayz --token "$GATEWAYZ_API_KEY"
```

## Environment variable

You can also set the API key via environment variable:

```bash
export GATEWAYZ_API_KEY="your-api-key"
```

## Config snippet

```json5
{
env: { GATEWAYZ_API_KEY: "your-api-key" },
agents: {
defaults: {
model: { primary: "gatewayz/gpt-4o" },
},
},
}
```

## Available models

Gatewayz provides access to 10,000+ models. Some popular ones:

- `gatewayz/gpt-4o` - OpenAI GPT-4o
- `gatewayz/gpt-4o-mini` - OpenAI GPT-4o Mini
- `gatewayz/claude-3-5-sonnet-20241022` - Anthropic Claude 3.5 Sonnet
- `gatewayz/claude-3-5-haiku-20241022` - Anthropic Claude 3.5 Haiku
- `gatewayz/gemini-1.5-pro` - Google Gemini 1.5 Pro
- `gatewayz/gemini-1.5-flash` - Google Gemini 1.5 Flash
- `gatewayz/deepseek-chat` - DeepSeek Chat
- `gatewayz/deepseek-reasoner` - DeepSeek Reasoner
- `gatewayz/llama-3.1-70b-instruct` - Meta LLaMA 3.1 70B
- `gatewayz/qwen-2.5-72b-instruct` - Qwen 2.5 72B
- `gatewayz/mistral-large-latest` - Mistral Large

For the full model catalog, see [docs.gatewayz.ai](https://docs.gatewayz.ai).

## Notes

- Model refs are `gatewayz/<model-id>`.
- Get your API key from [gatewayz.ai](https://gatewayz.ai).
- Gatewayz uses a Bearer token with your API key under the hood.
- For more model/provider options, see [/concepts/model-providers](/concepts/model-providers).
80 changes: 80 additions & 0 deletions extensions/gatewayz/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import { describe, expect, it } from "vitest";

import gatewayzPlugin from "./index.js";

describe("gatewayz plugin", () => {
it("has correct plugin metadata", () => {
expect(gatewayzPlugin.id).toBe("gatewayz");
expect(gatewayzPlugin.name).toBe("Gatewayz");
expect(gatewayzPlugin.description).toContain("Universal AI inference");
});

it("registers provider with correct id and label", () => {
let registeredProvider: unknown = null;

const mockApi = {
registerProvider: (provider: unknown) => {
registeredProvider = provider;
},
};

gatewayzPlugin.register(mockApi as never);

expect(registeredProvider).not.toBeNull();
const provider = registeredProvider as {
id: string;
label: string;
aliases: string[];
envVars: string[];
models: { baseUrl: string; api: string; models: unknown[] };
auth: { id: string; kind: string }[];
};
expect(provider.id).toBe("gatewayz");
expect(provider.label).toBe("Gatewayz");
expect(provider.aliases).toContain("gateway");
expect(provider.envVars).toContain("GATEWAYZ_API_KEY");
});

it("registers provider with api_key auth method", () => {
let registeredProvider: unknown = null;

const mockApi = {
registerProvider: (provider: unknown) => {
registeredProvider = provider;
},
};

gatewayzPlugin.register(mockApi as never);

const provider = registeredProvider as {
auth: { id: string; kind: string; label: string }[];
};
expect(provider.auth).toHaveLength(1);
expect(provider.auth[0].id).toBe("api_key");
expect(provider.auth[0].kind).toBe("api_key");
});

it("registers provider with OpenAI-compatible models config", () => {
let registeredProvider: unknown = null;

const mockApi = {
registerProvider: (provider: unknown) => {
registeredProvider = provider;
},
};

gatewayzPlugin.register(mockApi as never);

const provider = registeredProvider as {
models: {
baseUrl: string;
api: string;
models: { id: string; name: string }[];
};
};
expect(provider.models.baseUrl).toBe("https://api.gatewayz.ai/v1");
expect(provider.models.api).toBe("openai-completions");
expect(provider.models.models.length).toBeGreaterThan(0);
expect(provider.models.models.some((m) => m.id === "gpt-4o")).toBe(true);
});
});
Loading