Getting Started with OpenRouter on macOS

OpenRouter puts one API key and one base URL in front of models from dozens of vendors. On the day this was written its catalogue held 417 models, 17 of them free to call. Because the wire format is OpenAI’s, the openai Python package talks to it unchanged: point base_url at OpenRouter and switching from a Google model to a Chinese one is a change to a string. A plain proxy would give you one endpoint and nothing else. Four things here are worth building around, and the last two are the ones that bite: ...

52 min