What does 504 upstream_stalled or upstream_timeout mean?

The inference host stopped sending: upstream_timeout means it did not start answering within 180 seconds, upstream_stalled means it sent nothing for 60 seconds. Unlid cuts the request instead of letting it hang. A request that failed before any output is not charged; retry, or use another model if one keeps stalling.

What it looks like

HTTP 504
{"error":{"message":"Upstream sent nothing for 60 s. You were not charged.","code":"upstream_stalled", …}}

What to do

  • Retry. Send an Idempotency-Key header so a retry can never run twice.
  • If the same model stalls repeatedly, it is slow or overloaded right now: the status page shows each model's time to first token and success rate over the last 24 hours. Switch models for a while.
  • Very long prompts take longer before the first token; trimming old messages helps on slow models.

Was I charged?

Not when the timeout came before any output. If a streamed answer stalls halfway, you keep the part already received and are billed only for those tokens.

Related questions

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