Skip to main content

AI Gateway Quick Start Guide

You're reading AI Gateway 2026.10.0. The newest release is 1.2.0. Go to the newest release

This guide takes you from a downloaded distribution to a large language model (LLM) request routed through the API Platform AI Gateway. It then shows you how to govern that gateway from AI Workspace, the control plane for AI traffic.

Prerequisites​

Use one of these Docker-compatible container runtimes:

These examples use docker compose. If you use another Compose-compatible runtime, use the equivalent commands.

Verify the commands for your runtime are available. For Docker:

docker --version
docker compose version

To call an LLM through the gateway, you also need an API key from the specific LLM service.

You also need WSO2 subscription credentials to pull the gateway images from the WSO2 private registry (registry.wso2.com).

The Windows (PowerShell) examples on this page require PowerShell 7.3 or later.

Start the gateway​

Download the API Platform AI Gateway 2026.10.0 distribution from the WSO2 downloads page, or download wso2apip-ai-gateway-stsrelease-2026.10.0.zip directly. Then run the following commands from the folder where you saved it.

# Unzip the downloaded distribution.
unzip wso2apip-ai-gateway-stsrelease-2026.10.0.zip

cd wso2apip-ai-gateway-stsrelease-2026.10.0/

# Run the one-time setup. This provisions the Advanced Encryption Standard (AES)-256 at-rest
# encryption key, the router HTTPS listener certificate, api-platform.env, and the
# gateway-controller admin credentials. It prints the admin password once — copy it.
# When asked, press Enter to use the default username "admin" and a generated password.
./scripts/setup.sh

# Export the admin credentials so the management-API calls below can authenticate.
# The username defaults to "admin"; use the password setup.sh just printed.
export ADMIN_USERNAME=admin
export ADMIN_PASSWORD='<the password scripts/setup.sh printed>'

# Log in to the WSO2 private registry with your WSO2 subscription credentials.
docker login registry.wso2.com

# Start the complete stack in the background
docker compose up -d

# Verify gateway controller admin endpoint is running
curl http://localhost:9094/api/admin/v1/health
Port 8080, 8443, 9090, or 9094 already taken?

If the start command fails with a port binding error, identify what is already listening on the default ports:

On macOS or Linux, run:

lsof -nP -iTCP:8080 -sTCP:LISTEN
lsof -nP -iTCP:8443 -sTCP:LISTEN
lsof -nP -iTCP:9090 -sTCP:LISTEN
lsof -nP -iTCP:9094 -sTCP:LISTEN

On Windows PowerShell, run:

Get-NetTCPConnection -State Listen -LocalPort 8080,8443,9090,9094 | Select-Object LocalAddress, LocalPort, OwningProcess

Stop the conflicting service if you don't need it. If you need to keep it running, change the host-side value of the relevant ports: mapping in docker-compose.yaml. Then use the remapped host port in the verification and test commands on this page.

Customizing configuration

The setup script (setup.sh, or setup.ps1 on Windows) writes api-platform.env, which is loaded into the containers via Docker Compose env_file. To change the storage backend, connect to a control plane, or tune other settings, edit that file (or the config.toml interpolation tokens directly). See Gateway Configuration and Environment Interpolation.

Deploy an LLM provider configuration​

As a platform administrator, deploy an LLM provider for the vendor whose API key you hold. Select a provider below; each tab carries the complete definition for that provider.

Replace <openai-api-key> with your OpenAI API key, keeping the Bearer prefix.

curl -X POST http://localhost:9090/api/management/v1/llm-providers \
-H "Content-Type: application/yaml" \
-u "$ADMIN_USERNAME:$ADMIN_PASSWORD" \
--data-binary @- <<'EOF'
apiVersion: gateway.api-platform.wso2.com/v1
kind: LlmProvider
metadata:
name: openai-provider
spec:
displayName: OpenAI Provider
version: v1.0
template: openai
context: /openai/latest
upstream:
url: https://api.openai.com/v1
auth:
type: api-key
header: Authorization
value: Bearer <openai-api-key>
accessControl:
mode: deny_all
exceptions:
- path: /chat/completions
methods: [POST]
- path: /models
methods: [GET]
- path: /models/{modelId}
methods: [GET]
EOF

To test LLM provider traffic routing through the gateway, invoke the following request against the OpenAI provider.

curl -X POST https://localhost:8443/openai/latest/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{
"role": "user",
"content": "Hi"
}
]
}' -k
Why these commands pass -k

The -k flag tells curl to skip Transport Layer Security (TLS) certificate verification. The router presents the self-signed listener certificate that setup.sh or setup.ps1 generates, and no certificate authority trusts it. Outside local testing, give the router a certificate from a trusted certificate authority and remove -k.

Give each application its own endpoint

A provider exposes an LLM vendor to the gateway. An LLM proxy exposes that provider to a single application. The proxy has its own URL context and policies, and inherits the access control and budgets the provider enforces. See LLM proxy.

Govern this gateway from AI Workspace​

The gateway you just started serves traffic on its own. AI Workspace is the control plane for AI traffic across your organization. One console manages LLM providers, App LLM proxies, MCP proxies, policies such as guardrails and token-based rate limits, and the credentials behind them. Register this gateway with AI Workspace to govern every AI gateway you run from one place, across every environment.

Both directions work, and you can use them together:

  • Top-down. Configure an artifact in AI Workspace, apply policies to it, then deploy it to one or more gateways.
  • Bottom-up. Keep deploying through the management API, as this guide does. The gateway syncs every artifact you create to AI Workspace automatically, where each one appears as a copy the gateway owns. The OpenAI provider from this guide appears there without being re-declared. To see what a synced artifact looks like, and what stays editable, see Manage Gateway-deployed AI artifacts in AI Workspace.

The gateway keeps serving traffic either way. If AI Workspace is unreachable, the gateway carries on and the sync catches up once the connection is restored.

To weigh up the two products before you connect them, see Extend your gateway with AI Workspace. For the connection path that suits your runtime, see Connect the gateway to AI Workspace.

Stopping the gateway​

When stopping the gateway, you have two options:

Option 1: Stop runtime, keep data (persisted proxies and configuration)

docker compose down

This stops the containers but preserves the controller-data volume. When you restart with docker compose up, all your configurations are restored.

Option 2: Complete shutdown with data cleanup (fresh start)

docker compose down -v

This stops the containers and removes the controller-data volume. The next startup is a clean slate with no persisted templates or provider configuration.

Next steps​

Was this page helpful?