DevPrep

All topics › AI fundamentals for developers

Connecting third-party models: API keys, OpenAI-compatible APIs, rate limits

Middle PRO

Essence

Almost any AI tool can be pointed at a different model: another provider, an aggregator or a local server. You need three things: the API base URL, a key and a model name. The most common format is the OpenAI-compatible Chat Completions API: Xcode, Cursor, many agents and libraries understand it, and it's offered not only by OpenAI but also by Google, OpenRouter, Ollama, LM Studio and others.

The main engineering questions are where to keep the key, how to survive rate limits and errors, and how to be sure which model is actually answering.

The rest of this answer, with code and interview follow-ups, is in the DevPrep app.

Read the full answer in DevPrep

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store