Scope
Many gateways expose an OpenAI-compatible HTTP API so one client can call different upstream models by changing the model name and base URL. This page only covers how to wire and verify that pattern. It does not claim pricing, latency or quality rankings.
Watch: youtube.com/watch?v=PsYBPcMr93A.
What you need before calling
- A base URL from the provider (often ending with
/v1). - An API key you can revoke (never commit it to git or paste it into public chats).
- A model id string the gateway documents for the model you want.
Minimal smoke test
- Set the client base URL to the gateway, not to a hard-coded upstream host.
- Send a short chat/completions request with a fixed prompt such as “Reply with the word PONG only.”
- Confirm HTTP 200 and that the reply text is present.
- Change only the model id and repeat the same prompt.
If the second model fails while the first works, check the gateway's model list and spelling before changing other settings.
Evaluation checklist
- Can you rotate or revoke the key from the provider dashboard?
- Are 401 / 429 / 5xx errors documented with clear next steps?
- Does usage metering match what you see on the bill (check after a small test, not after a large run)?
- Is streaming (
stream=true) optional and documented?
Safety notes
Keep keys in environment variables or a secret store. Prefer least-privilege keys. Do not paste customer PII into a model until you have read the provider's data policy.
Choosing AI toolsPrompt basicsHow to try three free AI tools with your oTemperature vs top_p: how to tune and compSystem prompt mistakes: how to review and ← Back to home