saar-win opened a new issue, #12735:
URL: https://github.com/apache/apisix/issues/12735
### Description
Apisix helm chart: 2.12.2
Plugins:
- prometheus
- ai-rag
- ai-rate-limiting
- ai-proxy-multi
- ai-proxy
- limit-count
Hey, using Ai-Proxy / Ai-Proxy-Multi in a YAML option.
I'm looking for an approach to inject a secret via k8s yaml in the header
example:
```
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
name: azure-openai-gpt-4.1-nano-route-hybrid
namespace: apisix
spec:
ingressClassName: apisix
http:
- name: gpt-4.1-nano-all-regions
match:
hosts:
- apisix.my.url.com
paths:
- /v1/chat/completions
plugins:
# Layer 1: Per-instance request-based rate limiting with Redis
# Rate limiting must run before the proxy plugin
- name: ai-proxy-multi
enable: true
config:
# Load balancing strategy: roundrobin distributes requests
evenly across all instances
# Ensures all three instances receive traffic in rotation
timeout: 10000 # in milliseconds
load_balancer:
type: ewma
logging:
# summaries: true
payload: true
instances:
####################################################################################################################
# GPT-4.1 - Nano - Multiple Azure regions
####################################################################################################################
- name: germany-west-central-dev
provider: azure-openai
weight: 33
auth:
header:
Authorization: "Bearer $ENV://$AZURE_OPENAI_API_KEY_NAME"
override:
endpoint:
https://XXXX-openai-germany-west-central-dev.openai.azure.com/openai/deployments/gpt-4.1-nano-2025-04-14/chat/completions?api-version=2025-04-01-preview
options:
model: gpt-4.1-nano-2025-04-14
- name: poland-central
provider: azure-openai
weight: 33
auth:
header:
Authorization: "Bearer $ENV://$AZURE_OPENAI_API_KEY_NAME"
override:
endpoint:
https://XXXX-openai-poland-central.openai.azure.com/openai/deployments/gpt-4.1-nano-2025-04-14/chat/completions?api-version=2025-04-01-preview
options:
model: gpt-4.1-nano-2025-04-14
- name: india-south-central
provider: azure-openai
weight: 33
auth:
header:
Authorization: "Bearer $ENV://$AZURE_OPENAI_API_KEY_NAME"
override:
endpoint:
https://XXXX-openai-italy-north.openai.azure.com/openai/deployments/gpt-4.1-nano-2025-04-14/chat/completions?api-version=2025-04-01-preview
options:
model: gpt-4.1-nano-2025-04-14
```
I've injected secrets as environment variables at the chart level,
`$ENV://$AZURE_OPENAI_API_KEY_NAME`
`$ENV://${{AZURE_OPENAI_API_KEY_NAME}}`
I've tried many versions of the secret variable, but I haven't found
anything that works.
Do you support this?
**Another question:**
Is there an option to pass the model name to the ai-proxy-multi in the
request, or do I need to create a separate URI for each model?
Thanks!
### Environment
- APISIX version (run `apisix version`):
- Operating system (run `uname -a`):
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
- etcd version, if relevant (run `curl
http://127.0.0.1:9090/v1/server_info`):
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run `luarocks --version`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]