Why do I get 400 upstream_rejected_request ("blocked by safety filters")?

The inference host behind the model refused the request before generating anything, and Unlid passes its 400 through with the code upstream_rejected_request. Either the request has something the host does not accept (a parameter or content type the model does not support), or the host's own content filter blocked the prompt. Nothing is charged.

What it looks like

HTTP 400
{"error":{"message":"Upstream rejected the request: Your prompt was blocked by safety filters. Please revise and try again.","type":"invalid_request_error","code":"upstream_rejected_request"}}

What to do

  • Read the message. It carries the host's own reason. "Blocked by safety filters" is the host's filter, not the model refusing.
  • Try another uncensored model. Different models run on different hosts, and a filter on one host does not apply to another.
  • Check the request. Images sent to a text-only model, a parameter the model does not support, or a malformed tool definition are rejected the same way. Retrying the same request unchanged fails again.
  • If a model rejects ordinary requests, send the x-unlid-trace-id in the support chat so we can look at it.

A refusal written by the model itself arrives as a normal answer instead; see why an uncensored model refuses.

Related questions

Something not covered? Ask in the support chat at the bottom right, or see the FAQ and the API docs.