Models & protocols
OpenAI Chat / Responses, Anthropic Messages, and Gemini / Vertex. Public model names with supported conversion or native forwarding.
Model accessENTERPRISE AI GATEWAY · SELF-HOSTED
One gateway for models, access, cost, and security. Give platform teams a shared view and business teams the tools to put AI to work.
Go gateway / Bilingual console / Docker Compose
BUILT FOR YOUR ORGANIZATION
Connect model resources, people, policies, and request outcomes for the everyday work of managing enterprise AI.
OpenAI Chat / Responses, Anthropic Messages, and Gemini / Vertex. Public model names with supported conversion or native forwarding.
Model accessOrganizations, teams, projects, and scoped roles. Personal and service virtual keys with model permissions, expiration, and access revocation.
PermissionsUsage by user, key, team, and project. Budgets, RPM / TPM, cache rates, time windows, and historical price snapshots.
Pricing & usageWeight, load, latency, cost, and usage policies. Inherited templates, model groups, categorized fallbacks, retries, and cooldowns.
Routing policiesText rules, secret detection, and moderation adapters. Combine HTTP, JSON, and LLM checks in XGo to block, redact, or flag.
Programmable guardrailsMulti-turn messages and tool-call structures, Responses history continuation, and session tracing. Validate streams and compare models in Playground.
Sessions & runtimeDeployment-specific images, audio, embeddings, reranking, and video tasks. Track asynchronous status, results, usage, and settlement.
Media tasksModel catalogs, configuration diagnostics, request and error logs, cost details, audit records, and health checks.
OperationsTHE XHUB DIFFERENCE
Compose enterprise checks in XGo pre-call guardrails. Draft testing and real calls share the same executor.
Explore scripts & examples →Select templates through key, team, and organization scopes. Clear a binding to inherit; routing never expands model permissions.
Understand inheritance →Keep applied price snapshots, distinguish response and prompt caches, and deduplicate asynchronous task settlement.
Understand pricing →ONE WORKSPACE
Administrators configure resources. Members discover available models. Use one console to connect, validate, and trace requests.

Actual interface from a configured instance. Fresh installations need provider credentials and deployments.
FROM SETUP TO SCALE
Add credentials and deployments. Publish model names.
Configure teams, members, access, and budgets.
Issue virtual keys. Validate in Playground.
Review costs, adjust policies, and trace failures.
Share a model catalog with departmental budgets and clear resource ownership.
Manage service keys, tool-call structures, and multi-turn usage.
Bring retrieval, dialogue, and media tasks into a shared endpoint and usage system.
START ON YOUR INFRASTRUCTURE
Clone the repository, build images on your host, then start the gateway, console, and stores with Docker Compose.
Requires Git, Go 1.25, Node.js ≥24.14.1, npm ≥11.10.0, Docker Compose, Bash, and a readable system CA bundle (override with XHUB_CA_CERT_FILE). Use WSL2 on Windows.
Complete setup & first request →:3000Gateway API :4000git clone https://github.com/qiniu/xhub.git
cd xhub
bash deploy/build.sh
docker compose up -d --no-buildfrom openai import OpenAI
client = OpenAI(
api_key="YOUR_XHUB_VIRTUAL_KEY",
base_url="http://localhost:4000",
)
response = client.chat.completions.create(
model="YOUR_PUBLIC_MODEL_NAME",
messages=[{"role": "user", "content": "Hello, XHub!"}],
)
print(response.choices[0].message.content)DOCUMENTATION
Setup, administration, protocols, permissions, security, and operations. Built directly from repository documentation.
Prerequisites, Docker, source installation, and your first call.
Models, organizations, teams, keys, routing, and costs.
Registered endpoints, protocol capabilities, and request paths.
Protocol registration, request lifecycle, source locations, and tests.