- GitHub Copilot CLI and other OpenAI-compatible clients can also connect via the OpenAI endpoint.

Code Gateway settings main screen
Concept
Activation and Setup
Enabling Code Gateway
Open admin settings
Activate the gateway
Add Provider
Security settings

Code Gateway activation and full settings
Global Settings
Provider Settings
A Provider is the upstream LLM service Code Gateway forwards requests to.- Multiple Providers can be registered simultaneously, each identified by a unique
provider_id.
Supported Providers
Provider Presets
Picking a preset when adding a Provider auto-sets the type and base URL.- Azure AI Foundry - OpenAI: For OpenAI-compatible models (
openaitype). Use with Cursor, Codex CLI, GitHub Copilot. - Azure AI Foundry - Claude: For Claude models (
azure_ai_foundrytype). Use with Claude Code, Cursor.
Adding a Provider

Add Code Gateway Provider
- OpenAI / Anthropic / Gemini
- Azure OpenAI
- Vertex AI
Developer Usage
Developers set the BASE_URL of their AI coding tools to Cloosphere Code Gateway and use a Cloosphere API key.
Developer setup guide — per-tool BASE_URL and API key
Endpoint Structure
- OpenAI Provider:
https://cloosphere.company.com/api/v1/code-gateway/openai/v1/chat/completions - Anthropic Provider:
https://cloosphere.company.com/api/v1/code-gateway/anthropic/v1/messages
Authentication
Code Gateway accepts API keys in four ways (in priority order).Per-Tool Setup Examples
- Claude Code
- Cursor
- Codex CLI
- Gemini CLI
- GitHub Copilot
Claude Code Setup Script
An auto-setup script is provided for Claude Code users.- It auto-installs the helper script and configures
~/.claude/settings.json.
- Linux / macOS
- Windows (PowerShell)
- Install helper script (
~/cloosphere-helper.shor~/cloosphere-helper.ps1): Auto-attach repository metadata (Git remote URL, working directory) to API keys - Configure
~/.claude/settings.json: Auto-setANTHROPIC_AUTH_TOKEN,ANTHROPIC_BASE_URL,apiKeyHelper
Security Features
The Security master toggle enables or disables the security checks below (guardrails, allowed models, file patterns, repository blocking) in bulk.- Turning on Follow global guardrail settings applies the global guardrail settings directly to Code Gateway without separate configuration.
Guardrails
Apply guardrails to Code Gateway for PII detection, content filtering, etc., on coding tool inputs.- Specify guardrail IDs created in Guardrail Management.
Allowed Models
Restrict to specific models.- Configurable at both global and Provider levels.
allowed_models (global) and model_ids (per Provider) are set, only models allowed by both are usable. allowed_models is the Code Gateway-wide policy; model_ids adds per-Provider restriction.Rate Limit
Limit max requests per minute per user.- Operates on a 60-second sliding window.
File Pattern Block
Block files matching specific patterns in coding tool requests.- Specify patterns in glob format.
Blocked Repositories
Block AI coding tool usage in specific Git repositories.- Matching is based on repository metadata (repo URL, working directory) passed via the helper script.
git@github.com:org/repo.git) are auto-normalized for matching.
Require Repository Metadata
Enablingrequire_repo_metadata blocks requests without repository metadata via the helper script.
- This forces all Code Gateway users to set up the helper script.
Usage Tracking
All requests through Code Gateway are auto-logged for usage.- Admins can review usage logs to see per-team, per-user, per-model usage.
Usage Statistics
View per-period usage statistics to analyze cost and trends.Filters
Proxy Processing Flow
The full flow Code Gateway uses to process requests:Troubleshooting
403 Forbidden: Code Gateway is disabled
403 Forbidden: Code Gateway is disabled
403 Forbidden: Code Gateway access not permitted
403 Forbidden: Code Gateway access not permitted
features.code_gateway in group permission settings.404 Not Found: Provider not found
404 Not Found: Provider not found
provider_id in the request URL doesn’t match a registered Provider. Verify Provider ID.403 Forbidden: Model not allowed
403 Forbidden: Model not allowed
429 Too Many Requests: Rate limit exceeded
429 Too Many Requests: Rate limit exceeded
403 Forbidden: Repository metadata is required
403 Forbidden: Repository metadata is required
require_repo_metadata is enabled but the helper script isn’t configured. Run the Claude Code setup script to install the helper script.403 Forbidden: AI coding tool usage is blocked for repository
403 Forbidden: AI coding tool usage is blocked for repository
blocked_repos pattern. Ask an admin for unblock.