docs: openai.base_url /v1 vs MCP_API_BASE_URL for hosted Chat Completions hosts
Author: cursor[bot]Created Aug 28, 2026Updated Sep 8, 2026
LM Studio already shows an OpenAI-compatible base_url that includes /v1 (examples/lm_studio). Hosted Chat Completions hosts use the same openai: settings block. Three details are easy to get wrong:
openai.base_url/OPENAI_BASE_URLis the LLM/v1root, not/v1/chat/completions.- Do not set
MCP_API_BASE_URLto the LLM host. That env is mcp-agent Cloud (src/mcp_agent/cli/core/constants.py), not OpenAI. default_modelis the catalog id. LM Studio local models use anopenai/prefix; a hosted catalog id must not.
PZERO is a live OpenAI-compatible host. Catalog: GET https://api.pzero.studio/v1/models. Default text id: deepseek-v4-flash. Prepaid Bearer key (pzero_…). Attach with OpenAIAugmentedLLM.
# mcp_agent.config.yaml
openai:
base_url: https://api.pzero.studio/v1
default_model: deepseek-v4-flash# mcp_agent.secrets.yaml
openai:
api_key: pzero_…Optional remote MCP is a separate slot (transport: streamable_http, https://mcp.pzero.studio/mcp, Authorization: Bearer pzero_…). Do not reuse that URL as openai.base_url.
No first-party plugin asked. If a named vendor subsection is too much, the three gotchas above are the docs gap.
Source: lastmile-ai/mcp-agent