If you have ever configured an AI coding assistant, local agent, or LLM gateway (like OpenCode, Cline, Cursor, or LiteLLM), you have probably stared at a settings screen that looks like this:
Most developers pick Chat completions by muscle memory, cross their fingers, and hope it works. When it throws a 404 Not Found or 401 Unauthorized , debugging feels like guesswork.
Once you understand how Base URL and API Format work together—and why three incompatible JSON dialects exist—you will never misconfigure an AI client again.
1. The Core Formula: Base URL + API Format
Think of your AI client settings as a two-part URL builder combined with a JSON translator:
Full Request URL = Base URL + API Format Path
Enter fullscreen mode
Exit fullscreen mode
For example, if you set:
Base URL: https://opencode.ai/zen/go/v1
API Format: Chat completions (/chat/completions)
Your client fires an HTTP POST request to:
https://opencode.ai/zen/go/v1/chat/completions
Enter fullscreen mode
Exit fullscreen mode
This…