# gogoapi Integration Guide for AI Coding Agents gogoapi is a unified AI model gateway compatible with both OpenAI and Anthropic protocols. ## Endpoints - OpenAI-compatible Base URL (MUST include `/v1`): `https://api.gogoapi.dev/v1` - Chat Completions: `POST https://api.gogoapi.dev/v1/chat/completions` - Responses API: `POST https://api.gogoapi.dev/v1/responses` - Anthropic-compatible Base URL (MUST NOT include `/v1`): `https://api.gogoapi.dev` - Messages API: `POST https://api.gogoapi.dev/v1/messages` ## Recommended Model IDs - Coding / Agent: `kimi-k2.7-code`, `claude-sonnet-5-5`, `gpt-6.2-sol` - Fast / Low-cost: `deepseek-v4.1-flash-1017`, `minimax-m3` - Reasoning / General: `deepseek-v4-pro-0813`, `kimi-k3`, `kimi-k3.1-pro`, `glm-5.3` ## Tool Configuration Templates ### 1. Claude Code (`~/.claude/settings.json`) ```json { "env": { "ANTHROPIC_BASE_URL": "https://api.gogoapi.dev", "ANTHROPIC_AUTH_TOKEN": "", "ANTHROPIC_MODEL": "kimi-k2.7-code" } } ``` Note: Never add `/v1` to `ANTHROPIC_BASE_URL`. ### 2. Codex CLI (`~/.codex/config.toml`) First export `GOGO_API_KEY=""` in shell profile, then write: ```toml model_provider = "gogoapi" model = "deepseek-v4.1-flash-1017" [model_providers.gogoapi] name = "gogoapi" base_url = "https://api.gogoapi.dev/v1" wire_api = "responses" env_key = "GOGO_API_KEY" ``` Note: `model_provider` and `model` MUST stay at the top level of the TOML file, above `[model_providers.gogoapi]`. ### 3. OpenCode (`~/.config/opencode/opencode.json`) ```json { "$schema": "https://opencode.ai/config.json", "provider": { "gogoapi": { "npm": "@ai-sdk/openai-compatible", "name": "gogoapi", "options": { "baseURL": "https://api.gogoapi.dev/v1", "apiKey": "" }, "models": { "kimi-k2.7-code": { "name": "kimi-k2.7-code" }, "deepseek-v4.1-flash-1017": { "name": "deepseek-v4.1-flash-1017" } } } }, "model": "gogoapi/kimi-k2.7-code" } ``` ### 4. Python / Node OpenAI SDK Replace `base_url` / `baseURL` with `https://api.gogoapi.dev/v1` and `api_key` / `apiKey` with ``. ## Verification Command ```bash curl https://api.gogoapi.dev/v1/chat/completions \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"model":"deepseek-v4.1-flash-1017","messages":[{"role":"user","content":"Reply OK"}]}' ```