# gpt2api-openai-gateway

This skill walks your agent through deploying a self-hosted Anthropic-compatible gateway over chatgpt.com and wiring up an account pool.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 378 installs · ★ 88
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/trending-skills/tree/HEAD/skills/gpt2api-openai-gateway/SKILL.md
- Updated: 2026-10-09
- HTML: https://affpapa.org/en/nevibecode/skills/gpt2api-openai-gateway

## What it does

The skill covers `gpt2api`, a self-hosted gateway that exposes `/v1/images/generations`, `/v1/images/edits` and `/v1/chat/completions` in Anthropic format. It ships the Docker Compose steps, the `configs/config.yaml` layout, account import and API key creation through the admin dashboard.

Three secrets go into `.env` before anything starts: `JWT_SECRET`, `CRYPTO_AES_KEY` and the MySQL passwords. The AES key has to be exactly 64 hex characters or the service will not boot. Claude accounts are imported in bulk, either as JSON sessions with `access_token` and `refresh_token` or as plain AT/RT/ST lines, and proxies are registered separately.

Once running, the gateway drops into the official SDKs — swap `base_url` for your instance and the rest of the code stays put. A scheduler enforces a minimum interval between hits on the same account and backs off on a 429. Skip the proxy setup and the pool degrades fast.

## Requirements
- Works with: Docker

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill gpt2api-openai-gateway -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/gpt2api-openai-gateway/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/gpt2api-openai-gateway/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill gpt2api-openai-gateway -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/gpt2api-openai-gateway/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill gpt2api-openai-gateway -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/gpt2api-openai-gateway/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/trending-skills gpt2api-openai-gateway
```

2. **Manually: put the files in place**
- File: `.github/skills/gpt2api-openai-gateway/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill gpt2api-openai-gateway -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/trending-skills --path skills/gpt2api-openai-gateway
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/gpt2api-openai-gateway/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill gpt2api-openai-gateway -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/trending-skills/tree/HEAD/skills/gpt2api-openai-gateway/SKILL.md

## When to use it
- stand up an Anthropic-compatible gateway to chatgpt.com on your own server
- build a Claude account pool with rotation and rate limits
- generate images in batches through `/v1/images/generations`
- point the Python or Node.js SDK at your gateway without rewriting code
- issue API keys with quotas and a model whitelist

## Example prompts
- deploy gpt2api with Docker Compose and generate the .env secrets
- add a new Claude account to the pool with its access_token and refresh_token
- show me how to call Claude-image-2 from the Python SDK through my gateway

## Similar
- [llm-gateway](https://affpapa.org/en/nevibecode/skills/llm-gateway.md) — skill · 333 installs
- [gateway-workers](https://affpapa.org/en/nevibecode/skills/gateway-workers.md) — skill · 8600 installs
- [cuopt-install](https://affpapa.org/en/nevibecode/skills/cuopt-install.md) — skill · 2500 installs
- [cuopt-server-api-python](https://affpapa.org/en/nevibecode/skills/cuopt-server-api-python.md) — skill · 2200 installs
- [model-deployment](https://affpapa.org/en/nevibecode/skills/model-deployment.md) — skill · 379 installs
- [vllm-server](https://affpapa.org/en/nevibecode/skills/vllm-server.md) — skill · 314 installs

From the same set: [reason-machines/trending-skills](https://affpapa.org/en/nevibecode/by/reason-machines/trending-skills.md) — 139 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
