Get Started with AISIX Enterprise
In this quickstart, you evaluate AISIX Enterprise on one machine using Docker Compose, the bundled PostgreSQL database, and local endpoints. You start the control plane and dashboard, attach an AISIX gateway, configure an OpenAI model, and send a request through the gateway.
The local setup runs the control-plane services, dashboard, and PostgreSQL as one management stack. The AISIX gateway runs separately, giving configuration and live traffic distinct paths:
The control plane sends the configuration to the gateway. Client requests then travel through the gateway to OpenAI without crossing the control plane, while the dashboard provides gateway status, logs, and usage.
The AISIX Enterprise control plane and dashboard are commercial software. Certain features are free for development, testing, and evaluation, but production use requires a commercial license. To run AISIX Enterprise in production, contact API7 or email support@api7.ai.
Prerequisites
- Install Docker with Docker Compose V2.
- Install cURL,
tar, and OpenSSL. If you use the Admin API to configure AISIX Enterprise, also install jq. - Make sure the installation host can reach
run.api7.ai, Docker Hub, and OpenAI. - Make sure ports
5432,8080,7944, and3000are available on the installation host. - Use a browser on the installation host to open the dashboard at
http://localhost:8080. - Prepare an OpenAI API key with access to
gpt-4o-mini.
Start the Control Plane
On a host with Docker and internet access, run:
curl -fsSL "https://run.api7.ai/aisix-self-hosted/quickstart" | bash
The installer downloads the current AISIX Enterprise package into ./aisix-self-hosted, generates a .env file with fresh secrets, pulls the container images, and starts the stack. The default dashboard URL is http://localhost:8080.
The installer also prints the first administrator's credentials, once, when the stack first starts successfully. If the first start fails, the run that succeeds prints them:
First administrator (shown this once):
email: admin@example.com
password: <generated password>
Keep them for the next step. They are also stored in .env as AISIX_CLOUD_BOOTSTRAP_ADMIN_EMAIL and AISIX_CLOUD_BOOTSTRAP_ADMIN_PASSWORD.
For this single-host quickstart, open ./aisix-self-hosted/.env and set the data-plane manager URL to:
AISIX_CLOUD_DPMGR_BASE_URL=https://host.docker.internal:7944
Recreate the api and dpm Docker Compose services so the dashboard uses the updated endpoint and dp-manager issues its TLS certificate for it. Wait for both services to become healthy:
cd aisix-self-hosted
docker compose up -d --wait api dpm
Check the control-plane health endpoint:
curl -fsS "http://127.0.0.1:8080/healthz"
The command should return {"status":"ok"}. Keep this terminal in the aisix-self-hosted directory for the remaining shell commands.
Sign In
Open http://localhost:8080 and sign in with the first administrator's email address and password from the installer.

When prompted, enter the installer password in Current password. Enter your replacement in New password and select Change password. The dashboard signs you in to the Default organization as its owner. If you run the quickstart again with the same PostgreSQL volume, sign in with the password you set here.
Create Gateway Resources
AISIX Enterprise provides two ways to manage gateway resources.
- Use the dashboard to create and inspect resources in the browser.
- Use the AISIX Cloud Admin API to automate the same operations and export resource IDs for follow-on guides.
Choose one workflow to create the quickstart resources.
Dashboard
The environment holds the model and the caller API key. The model uses a provider key to authenticate to OpenAI, and the caller key gives your application access to the model.
Create the Environment
-
Under Organization, open Environments and select New environment.
-
Enter
prodin Display name and select Create environment.
-
On the confirmation page, select Back to environments.
Add the OpenAI Provider Key
- Under Organization, open Provider keys and select New provider key.
- Set Display name to
OpenAIand choose OpenAI in Provider. - Paste your OpenAI API key into Upstream API key.
- Under Allowed environments, select
prodso models in that environment can use the credential.

Select Create provider key and confirm that OpenAI appears in the list.
Create the Direct Model
-
In Environments, select Enter for
prod. -
Open Models, select Create model, and choose Direct model.

-
Enter
gpt-4o-miniin Display name and Upstream model id. The display name is the alias your application sends. The upstream model ID is the model AISIX requests from OpenAI. -
In Provider key, select OpenAI (openai).

Select Create model and confirm that gpt-4o-mini appears in the environment's model list.
Create the Caller API Key
-
In
prod, open API keys and select New API key. -
Set Display name to
quickstart-callerand selectgpt-4o-miniunder Allowed models.
-
Select Create API key. On the One-time view card, select Copy to store the plaintext securely.
-
Select I've saved it and confirm that
quickstart-callerappears in the list. The plaintext is no longer available after you dismiss the card.
Export the copied caller key to send the verification request:
export AISIX_API_KEY="YOUR_CALLER_API_KEY"
For guides that use the Admin API, create an admin token and look up the IDs of existing resources with the list operations in the Admin API.
Continue to Attach an AISIX Gateway once the caller key is exported.
AISIX Cloud Admin API
Use a write-scoped admin token to create the resources and save their IDs for later API calls.
Create an Admin Token
The AISIX Cloud Admin API authenticates with an organization-scoped admin token.
- In the organization navigation, open Admin tokens and select New token.
- Enter a unique name such as
quickstart-admin, choose an expiration period, and enable the write scope. - Create the token and copy its plaintext value before leaving the page. The value is shown only once.
Export the control-plane API URL and token in the terminal:
export AISIX_CP="http://localhost:8080/api"
export AISIX_TOKEN="YOUR_ADMIN_TOKEN"
For token scope, expiration, and rotation details, see Admin Tokens.
Create the Resources
Create the prod environment:
ENV_RESPONSE=$(curl -fsS -X POST "$AISIX_CP/environments" \
-H "Authorization: Bearer ${AISIX_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"display_name": "prod"}')
export ENV_ID=$(echo "$ENV_RESPONSE" | jq -er '.environment.id')
echo "$ENV_RESPONSE" | jq
Create a provider key that stores your OpenAI credential and allow it in the environment:
export OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
PROVIDER_KEY_RESPONSE=$(curl -fsS -X POST "$AISIX_CP/provider_keys" \
-H "Authorization: Bearer ${AISIX_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"provider": "openai",
"display_name": "OpenAI",
"api_key": "'"${OPENAI_API_KEY}"'",
"api_base": "https://api.openai.com/v1",
"allowed_environments": ["'"${ENV_ID}"'"]
}')
export PROVIDER_KEY_ID=$(echo "$PROVIDER_KEY_RESPONSE" | jq -er '.provider_key.id')
echo "$PROVIDER_KEY_RESPONSE" | jq
Create a gpt-4o-mini model backed by the provider key:
MODEL_RESPONSE=$(curl -fsS -X POST "$AISIX_CP/environments/$ENV_ID/models" \
-H "Authorization: Bearer ${AISIX_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"display_name": "gpt-4o-mini",
"model_name": "gpt-4o-mini",
"provider_key_id": "'"${PROVIDER_KEY_ID}"'"
}')
export MODEL_ID=$(echo "$MODEL_RESPONSE" | jq -er '.model.id')
echo "$MODEL_RESPONSE" | jq
Create a caller API key that can use the model. Save the plaintext value because it is returned only once:
API_KEY_RESPONSE=$(curl -fsS -X POST "$AISIX_CP/environments/$ENV_ID/api_keys" \
-H "Authorization: Bearer ${AISIX_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"display_name": "quickstart-caller",
"allowed_models": ["'"${MODEL_ID}"'"]
}')
export API_KEY_ID=$(echo "$API_KEY_RESPONSE" | jq -er '.api_key.id')
export AISIX_API_KEY=$(echo "$API_KEY_RESPONSE" | jq -er '.plaintext')
echo "$API_KEY_RESPONSE" | jq 'del(.plaintext)'
Each command saves the resource ID needed by the next step or by subsequent guides. If curl or jq reports an error, stop and correct it before continuing; a missing ID causes later commands to fail.
Attach an AISIX Gateway
The gateway runs separately from the control plane. Issue a certificate for prod so the gateway can connect and load that environment's configuration.
-
In Environments, select Enter for
prod, then open Data planes. If the page already lists registered gateways, select Add a data plane. -
For this local setup, leave Validity at its default and Hostname (optional) empty. Select Issue certificate.

-
On the Docker tab, copy the generated snippet. Treat the snippet as a secret because it contains the gateway certificate and private key.
-
On Linux with Docker Engine, add
--add-host host.docker.internal:host-gatewaybefore the image name in the generateddocker runcommand. Docker Desktop resolveshost.docker.internalautomatically. -
Run the snippet. It starts a container named
aisix-dp, publishes the proxy on port3000, and waits for/readyzto return success. If it keeps waiting, inspectdocker logs aisix-dp. -
Return to Data planes and select Refresh. Under Registered data planes, check that the gateway is Healthy and has a recent Last heartbeat.

For certificate validity, other deployment options, and connection troubleshooting, see Connect a Gateway.
Send and Verify a Request
Use the same terminal where you exported AISIX_API_KEY.
-
Set the local gateway URL and check that the proxy is reachable.
export AISIX_PROXY="http://127.0.0.1:3000"curl -fsS "$AISIX_PROXY/livez"Expect
ok. If the connection is refused, rundocker logs aisix-dpto check whether the gateway is still waiting for its first configuration. See Startup and the First Configuration. -
List the models available to the caller key.
curl -fsS "$AISIX_PROXY/v1/models" \-H "Authorization: Bearer ${AISIX_API_KEY}"Check that
gpt-4o-miniappears in thedataarray. If it is missing, wait a few seconds for the configuration to reach the gateway and repeat this check. -
Send a chat request after the model appears.
curl -sS -X POST "$AISIX_PROXY/v1/chat/completions" \-H "Authorization: Bearer ${AISIX_API_KEY}" \-H "Content-Type: application/json" \-d '{"model": "gpt-4o-mini","messages": [{"role": "user", "content": "Say hello from AISIX Enterprise."}]}'Expect an OpenAI-compatible response with an assistant message in
choices[0].message.
In the dashboard, open Logs in prod to inspect the request. Open Usage in the organization navigation to see its usage data.
Clean Up
If you plan to continue to another AISIX Enterprise guide, leave the stack and gateway running and skip cleanup. Otherwise, remove the caller key, model, and provider key with either workflow.
In the dashboard, open prod and revoke quickstart-caller in API keys. Then delete gpt-4o-mini from Models and OpenAI from Provider keys.
If you used the Admin API, delete the resources in the same order:
curl -fsS -X DELETE \
"$AISIX_CP/environments/$ENV_ID/api_keys/$API_KEY_ID" \
-H "Authorization: Bearer ${AISIX_TOKEN}" | jq
curl -fsS -X DELETE \
"$AISIX_CP/environments/$ENV_ID/models/$MODEL_ID" \
-H "Authorization: Bearer ${AISIX_TOKEN}" | jq
curl -fsS -X DELETE \
"$AISIX_CP/provider_keys/$PROVIDER_KEY_ID" \
-H "Authorization: Bearer ${AISIX_TOKEN}" | jq
If you created an admin token, revoke it in the dashboard when you finish the API cleanup. Then remove the gateway container:
docker rm -f aisix-dp
Before stopping the control plane, delete the prod environment you created so you can recreate it on a later run.
Stop and remove the control-plane containers:
./run.sh down
This preserves the PostgreSQL data volume.
Next Steps
You have now sent a request through a gateway connected to your local control plane. From here:
- Follow Deploy the AISIX Enterprise Control Plane to choose a deployment method and prepare a persistent environment.
- Use the AISIX Enterprise / Cloud Admin API to automate control-plane operations with an admin token.
- Read Resource Model to see how provider keys, models, and caller API keys fit together.
- Call the gateway from application code with the OpenAI SDK or Anthropic SDK guide.