Call Your First Model
Send your first request through AISIX AI Gateway using a gateway base URL, caller API key, and model alias your platform team already gave you.
This page is for someone who already has AISIX gateway access and wants to make a call, not provision infrastructure. If you have a gateway base URL, a caller API key, and a model alias, you can send a request in the next few minutes.
If AISIX is already deployed for your organization, obtain the gateway URL, model alias, and caller API key from the team that manages it. If you are setting up that infrastructure yourself instead, see AISIX Deployment Options, the Open-Source AISIX Gateway Quickstart, or the AISIX Enterprise Quickstart.
What You Need
- Gateway base URL — the proxy origin your application sends requests to.
- Caller API key — the credential that authorizes the request and restricts which model aliases it can use.
- A model alias you're allowed to use — the caller-facing name you send in
model, not the upstream provider's model ID.
For how these fit together — caller key → model alias → provider key — see Resource Model.
Send a Request with curl
# AISIX_PROXY is the gateway origin; omit a trailing slash and endpoint path.
export AISIX_PROXY="YOUR_AISIX_GATEWAY_URL"
export AISIX_API_KEY="YOUR_CALLER_API_KEY"
export AISIX_MODEL="YOUR_MODEL_ALIAS"
curl -sS -X POST "$AISIX_PROXY/v1/chat/completions" \
-H "Authorization: Bearer ${AISIX_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"model": "'"$AISIX_MODEL"'",
"messages": [
{"role": "user", "content": "Hello from AISIX."}
]
}'This is the OpenAI-compatible chat-completions route. AISIX also exposes /v1/messages for Anthropic-style requests; see Anthropic SDK for that request and response shape.
A successful request reaches the upstream model and returns an OpenAI-compatible chat-completions object with an assistant message.
Use an SDK Instead
If your application already uses an OpenAI- or Anthropic-compatible client, point that client at AISIX instead of calling curl directly: OpenAI SDK, Anthropic SDK.
Find Which Model Aliases Your Key Can Use
curl -sS "$AISIX_PROXY/v1/models" \
-H "Authorization: Bearer ${AISIX_API_KEY}"This returns the model aliases the caller API key can access. Wildcard aliases, such as openai/*, never appear in this list because they are patterns rather than concrete model names.
If the Request Fails
401or403— check that you are sending the plaintext caller API key and an allowed model alias.404— the requested model alias is not configured.
For the full error envelope, see Headers and Error Codes.
Next Steps
You have now called AISIX directly with curl. Continue with Resource Model to see how caller keys, model aliases, and provider keys fit together, Supported Endpoints for the full set of proxy routes, Streaming for streamed responses, or Tool Calling for tool definitions.