openclaw - 💡(How to fix) Fix [Docs]: Document valid `models.providers.<name>.api` format options and baseUrl behavior [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#61984Fetched 2026-04-08 03:10:23
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

When configuring a custom model provider, the api field must be one of specific values, but these are only revealed in error messages:

models.providers.nvidia.api: Invalid option: expected one of
"openai-completions"|"openai-responses"|"openai-codex-responses"|"anthropic-messages"|
"google-generative-ai"|"github-copilot"|"bedrock-converse-stream"|"ollama"|"azure-openai-responses"

Error Message

When configuring a custom model provider, the api field must be one of specific values, but these are only revealed in error messages: Configuring a custom Anthropic-compatible provider required 6 trial-and-error attempts to find the correct combination of provider key, model ID prefix, API format, and baseUrl suffix. See related: #50711, #50647.

Root Cause

When configuring a custom model provider, the api field must be one of specific values, but these are only revealed in error messages:

models.providers.nvidia.api: Invalid option: expected one of
"openai-completions"|"openai-responses"|"openai-codex-responses"|"anthropic-messages"|
"google-generative-ai"|"github-copilot"|"bedrock-converse-stream"|"ollama"|"azure-openai-responses"

Code Example

models.providers.nvidia.api: Invalid option: expected one of
"openai-completions"|"openai-responses"|"openai-codex-responses"|"anthropic-messages"|
"google-generative-ai"|"github-copilot"|"bedrock-converse-stream"|"ollama"|"azure-openai-responses"
RAW_BUFFERClick to expand / collapse

Description

When configuring a custom model provider, the api field must be one of specific values, but these are only revealed in error messages:

models.providers.nvidia.api: Invalid option: expected one of
"openai-completions"|"openai-responses"|"openai-codex-responses"|"anthropic-messages"|
"google-generative-ai"|"github-copilot"|"bedrock-converse-stream"|"ollama"|"azure-openai-responses"

Request

  1. Add valid api values to openclaw config --help or openclaw models --help
  2. Document which api format to use for common endpoints:
    • Anthropic API: anthropic-messages with baseUrl without /v1 (e.g., https://api.anthropic.com)
    • OpenAI API: openai-completions with baseUrl with /v1 (e.g., https://api.openai.com/v1)
    • OpenAI-compatible providers (LiteLLM, vLLM, etc.): openai-completions
    • Ollama: ollama
    • Google: google-generative-ai
  3. Document baseUrl suffix behavior — some API formats auto-append /v1, others don't. This is a common source of confusion when configuring custom providers.
  4. Document the provider prefix stripping behavior — when a model ID like azure/anthropic/claude-opus-4-6 is configured under provider key azure, OpenClaw strips the first segment and sends anthropic/claude-opus-4-6 to the API. Users need to add an extra prefix to compensate.

Context

Configuring a custom Anthropic-compatible provider required 6 trial-and-error attempts to find the correct combination of provider key, model ID prefix, API format, and baseUrl suffix. See related: #50711, #50647.

extent analysis

TL;DR

To resolve configuration issues with custom model providers, document and utilize the valid api values and their corresponding baseUrl formats.

Guidance

  • Add the valid api values to the openclaw config --help or openclaw models --help output to improve user experience and reduce trial-and-error attempts.
  • Document the specific api format and baseUrl suffix requirements for each provider, such as anthropic-messages with baseUrl without /v1 for Anthropic API.
  • Clarify the provider prefix stripping behavior to help users understand how to configure model IDs correctly.
  • Consider adding examples or a configuration guide for common endpoints, such as OpenAI, Anthropic, and Google, to reduce confusion.

Example

No code snippet is provided as it is not explicitly supported by the issue.

Notes

The issue highlights the need for clear documentation and guidance on configuring custom model providers to avoid trial-and-error attempts and reduce user frustration.

Recommendation

Apply workaround by documenting valid api values, baseUrl formats, and provider prefix stripping behavior to improve user experience and configuration accuracy.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING