For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
curl
Test agentgateway running in Kubernetes with curl
Test your agentgateway Kubernetes deployment using curl.
Before you begin
Get the gateway URL
export INGRESS_GW_ADDRESS=$(kubectl get svc -n agentgateway-system agentgateway-proxy \
-o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo "Gateway address: $INGRESS_GW_ADDRESS"Send a request
Replace <route-path> with the path configured in your HTTPRoute (for example, /openai).
curl "http://$INGRESS_GW_ADDRESS/<route-path>" \
-H "content-type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{"role": "user", "content": "Hello from Kubernetes!"}
]
}' | jqExample output:
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1677652288,
"model": "gpt-4o-mini",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 11,
"completion_tokens": 10,
"total_tokens": 21
}
}Authentication
If agentgateway requires authentication, include an Authorization header.
curl "http://$INGRESS_GW_ADDRESS/<route-path>" \
-H "content-type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "Hello"}]
}' | jq