🔒 Enterprise-grade API gateway that helps you monitor and impose cost or rate limits per API key. Get fine-grained access control and monitoring per user, application, or environment. Supports OpenAI, Azure OpenAI, Anthropic, vLLM, and open-source LLMs.
This is because when a p exists but policyInput is nil, json.Marshal fails and the request body does not get reset. Hence we're forwarding an empty request body to OpenAI, causing OpenAI to return an error.
Fix
Fix is to add a check to see if policyInput exists before running p.Filter.
Issue
When using a secret key with a policy to make a request to
POST /api/providers/openai/v1/assistants
, OpenAI returns this error:This is because when a
p
exists butpolicyInput
isnil
,json.Marshal
fails and the request body does not get reset. Hence we're forwarding an empty request body to OpenAI, causing OpenAI to return an error.Fix
Fix is to add a check to see if policyInput exists before running
p.Filter
.