Getting 500 with gpt-4o and tools

Try: temperature and top_p at 0.1

Try: max_tokens at 2000

The server error is usually when the AI has written something as a tool output that is not a valid tool call or JSON. With the poor quality of this model, an additional 10k may be enough that it cannot still understand how to use the function. You can provide a much longer function description, elaborating on how to use it, what it will return, the types of queries to write, how characters should be escaped or written in URL encoding, etc. to re-focus attention on using the tool properly.