# 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.

Licensing

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](https://api7.ai/contact) or email <support@api7.ai>.

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

* Install [Docker](https://docs.docker.com/get-docker/) with Docker Compose V2.
* Install [cURL](https://curl.se/), `tar`, and OpenSSL. If you use the Admin API to configure AISIX Enterprise, also install [jq](https://jqlang.github.io/jq/).
* Make sure the installation host can reach `run.api7.ai`, Docker Hub, and OpenAI.
* Make sure ports `5432`, `8080`, `7944`, and `3000` are 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[​](#start-the-control-plane "Direct link to 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`.

On a fresh installation, the installer prints the first administrator's effective email address and initial password once the control-plane API is ready. The sample shows the defaults. If you set either value through an environment variable at startup, the installer prints the effective value.

```
First administrator (shown this once):

  email:    admin@example.com

  password: <generated password>
```

Keep the displayed credentials for sign-in, even if a later service fails to start. If startup stops before the control-plane API is ready, retry with the original first-administrator settings. The installer prints the dashboard URL after the entire stack starts successfully.

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[​](#sign-in "Direct link to Sign In")

Open `http://localhost:8080` and sign in with the first administrator's email address and password from the installer.

![AISIX Enterprise sign-in page showing the default administrator email and an empty password field](https://static.api7.ai/uploads/2026/11/17/bctf6mTe_sign-in.webp)

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[​](#create-gateway-resources "Direct link to Create Gateway Resources")

AISIX Enterprise provides two ways to manage gateway resources.

* Use the [dashboard](#dashboard) to create and inspect resources in the browser.
* Use the [AISIX Cloud Admin API](#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[​](#dashboard "Direct link to 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[​](#create-the-environment "Direct link to Create the Environment")

1. Under **Organization**, open **Environments** and select **New environment**.

2. Enter `prod` in **Display name** and select **Create environment**.

   ![New environment form with prod in Display name and the Create environment button](https://static.api7.ai/uploads/2026/11/17/RY5XtoYx_environment.webp)

3. On the confirmation page, select **Back to environments**.

#### Add the OpenAI Provider Key[​](#add-the-openai-provider-key "Direct link to Add the OpenAI Provider Key")

1. Under **Organization**, open **Provider keys** and select **New provider key**.
2. Set **Display name** to `OpenAI` and choose **OpenAI** in **Provider**.
3. Paste your OpenAI API key into **Upstream API key**.
4. Under **Allowed environments**, select `prod` so models in that environment can use the credential.

![New provider key form with OpenAI as the name and provider, the credential masked, and prod selected](https://static.api7.ai/uploads/2026/11/17/HPo1xnIa_provider-key.webp)

Select **Create provider key** and confirm that `OpenAI` appears in the list.

#### Create the Direct Model[​](#create-the-direct-model "Direct link to Create the Direct Model")

1. In **Environments**, select **Enter** for `prod`.

2. Open **Models**, select **Create model**, and choose **Direct model**.

   ![Create model menu with Direct model outlined above the other model types](https://static.api7.ai/uploads/2026/11/17/46QfTZoM_model-picker.webp)

3. Enter `gpt-4o-mini` in **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.

4. In **Provider key**, select **OpenAI (openai)**.

![New model form showing gpt-4o-mini as the display name and upstream model ID with OpenAI selected as the provider key](https://static.api7.ai/uploads/2026/11/17/P69gIlHM_direct-model.webp)

Select **Create model** and confirm that `gpt-4o-mini` appears in the environment's model list.

#### Create the Caller API Key[​](#create-the-caller-api-key "Direct link to Create the Caller API Key")

1. In `prod`, open **API keys** and select **New API key**.

2. Set **Display name** to `quickstart-caller` and select `gpt-4o-mini` under **Allowed models**.

   ![New API key form with quickstart-caller as the display name and gpt-4o-mini selected under Allowed models](https://static.api7.ai/uploads/2026/11/17/BoSxqCKk_caller-key.webp)

3. Select **Create API key**. On the **One-time view** card, select **Copy** to store the plaintext securely.

4. Select **I've saved it** and confirm that `quickstart-caller` appears 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](#create-an-admin-token) and look up the IDs of existing resources with the [list operations in the Admin API](https://docs.api7.ai/ai-gateway/reference/cloud-admin-api.md).

Continue to [Attach an AISIX Gateway](#attach-an-aisix-gateway) once the caller key is exported.

### AISIX Cloud Admin API[​](#aisix-cloud-admin-api "Direct link to 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[​](#create-an-admin-token "Direct link to Create an Admin Token")

The AISIX Cloud Admin API authenticates with an organization-scoped admin token.

1. In the organization navigation, open **Admin tokens** and select **New token**.
2. Enter a unique name such as `quickstart-admin`, choose an expiration period, and enable the **write** scope.
3. 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](https://docs.api7.ai/ai-gateway/cloud/admin-tokens.md).

#### Create the Resources[​](#create-the-resources "Direct link to 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[​](#attach-an-aisix-gateway "Direct link to 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.

1. In **Environments**, select **Enter** for `prod`, then open **Data planes**. If the page already lists registered gateways, select **Add a data plane**.

2. For this local setup, leave **Validity** at its default and **Hostname (optional)** empty. Select **Issue certificate**.

   ![Issue gateway certificate panel with default validity, an empty hostname field, and the Docker install script still locked](https://static.api7.ai/uploads/2026/11/17/pDoBchCP_gateway-issue-certificate.webp)

3. On the **Docker** tab, copy the generated snippet. Treat the snippet as a secret because it contains the gateway certificate and private key.

4. On Linux with Docker Engine, add `--add-host host.docker.internal:host-gateway` before the image name in the generated `docker run` command. Docker Desktop resolves `host.docker.internal` automatically.

5. Run the snippet. It starts a container named `aisix-dp`, publishes the proxy on port `3000`, and waits for `/readyz` to return success. If it keeps waiting, inspect `docker logs aisix-dp`.

6. Return to **Data planes** and select **Refresh**. Under **Registered data planes**, check that the gateway is **Healthy** and has a recent **Last heartbeat**.

![Registered data planes showing a healthy gateway and its last heartbeat](https://static.api7.ai/uploads/2026/11/17/cmoWL274_gateway-connected.webp)

For certificate validity, other deployment options, and connection troubleshooting, see [Connect a Gateway](https://docs.api7.ai/ai-gateway/cloud/connect-a-gateway.md).

## Send and Verify a Request[​](#send-and-verify-a-request "Direct link to Send and Verify a Request")

Use the same terminal where you exported `AISIX_API_KEY`.

1. 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, run `docker logs aisix-dp` to check whether the gateway is still waiting for its first configuration. See [Startup and the First Configuration](https://docs.api7.ai/ai-gateway/deployment/health-checks.md#startup-and-the-first-configuration).

2. List the models available to the caller key.

   ```
   curl -fsS "$AISIX_PROXY/v1/models" \

     -H "Authorization: Bearer ${AISIX_API_KEY}"
   ```

   Check that `gpt-4o-mini` appears in the `data` array. If it is missing, wait a few seconds for the configuration to reach the gateway and repeat this check.

3. 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[​](#clean-up "Direct link to 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](https://docs.api7.ai/ai-gateway/cloud/organizations-and-environments.md#delete-an-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[​](#next-steps "Direct link to 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](https://docs.api7.ai/ai-gateway/on-premises/deployment.md) to choose a deployment method and prepare a persistent environment.
* Use the [AISIX Enterprise / Cloud Admin API](https://docs.api7.ai/ai-gateway/reference/cloud-admin-api.md) to automate control-plane operations with an admin token.
* Read [Resource Model](https://docs.api7.ai/ai-gateway/models/resource-model.md) to see how provider keys, models, and caller API keys fit together.
* Call the gateway from application code with the [OpenAI SDK](https://docs.api7.ai/ai-gateway/getting-started/openai-sdk.md) or [Anthropic SDK](https://docs.api7.ai/ai-gateway/getting-started/anthropic-sdk.md) guide.
