Skip to main content

Admin API

Standalone self-hosted gateways expose separate local interfaces for management and application traffic.

Use the admin API to create and update the resources AISIX reads when it handles application traffic:

In a basic request path, these resources are a provider key, a model alias, and a caller API key. Admin changes are dynamic, so you can update them without restarting the gateway.

Access the Admin API

The admin API runs on the admin listener configured at startup. In the examples below, the listener is available at http://127.0.0.1:3001.

Admin authentication is static startup configuration. Admin keys come from admin.admin_keys in config.yaml and are separate from caller API keys.

Configure at least one admin key in config.yaml:

config.yaml
admin:
addr: "0.0.0.0:3001"
admin_keys:
- "admin-local-only-change-me"

For local testing, the example key is enough. For shared or production environments, replace it with a strong secret, restrict the admin listener to a private network or loopback interface when possible, and do not reuse proxy caller API keys as admin keys. Because admin keys are startup configuration, rotate them through deployment or configuration management.

Set AISIX_ADMIN_KEY to one of the configured admin keys, then send a minimal admin request:

export AISIX_ADMIN_KEY="admin-local-only-change-me"

curl -sS "http://127.0.0.1:3001/admin/v1/models" \
-H "Authorization: Bearer ${AISIX_ADMIN_KEY}"

What Admin API Manages

After you can access the admin API, use it to create the resources that make up the request path.

Provider keys store upstream credentials and endpoint settings. Models define the caller-facing aliases and map them to upstream models or routing targets. Caller API keys authenticate callers and control which model aliases they can use.

Other resources add policy and telemetry behavior around the same path, such as guardrails, cache policies, and observability exporters.

Start with the resource you want to configure, such as provider keys, models, or API keys. Use the Admin API Reference when you need exact endpoints, request schemas, response schemas, status codes, or error fields.

Next Steps

You have now seen how the admin API fits into a self-hosted request path. Continue with Provider Credentials, Model Aliases, and Caller API Keys to build the first traffic path.

API7.ai Logo

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.

Sign up for API7 newsletter

Product

API7 Gateway

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the Apache Software Foundation