Skip to content

Comments

Clarify custom provider URL routing docs#28125

Merged
elithrar merged 1 commit intoproductionfrom
opencode/issue27699-20260205214759
Feb 17, 2026
Merged

Clarify custom provider URL routing docs#28125
elithrar merged 1 commit intoproductionfrom
opencode/issue27699-20260205214759

Conversation

@ask-bonk
Copy link
Contributor

@ask-bonk ask-bonk bot commented Feb 5, 2026

Here's a summary of the changes made to src/content/docs/ai-gateway/configuration/custom-providers.mdx:

What changed

The "Using custom providers with AI Gateway" section was significantly expanded to address the three gaps identified in the issue:

1. New "How URL routing works" subsection — Explains the core formula ({base_url} + {provider-path} = upstream URL) and clarifies that base_url should contain only the root domain, not API path segments.

2. New "Choosing between Unified API and provider-specific endpoint" subsection — Adds a comparison table and guidance on when to use each approach. The Unified API works for OpenAI-compatible providers; the provider-specific endpoint is needed when the provider uses non-standard paths or request formats.

3. Four concrete examples with URL mapping tables:

  • Example 1: OpenAI-compatible provider with standard /v1/ path (shows both Unified API and provider-specific approaches)
  • Example 2: Provider with a non-standard API path (like /api/coding/paas/v4/) — directly addresses the Z.AI scenario from the issue
  • Example 3: Self-hosted model with a non-OpenAI prediction endpoint (/serving/models/my-model:predict)
  • Example 4: Using the OpenAI Python SDK with a custom provider, showing how the SDK's base_url maps through the gateway

4. New "404 when making requests to a custom provider" troubleshooting entry — Addresses the most common mistakes: putting API paths in base_url, missing path segments in the request URL, and accidentally duplicating path segments like /v1/v1/.

Closes #27699

github run

Co-authored-by: elithrar <elithrar@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/ai-gateway/ @abhishekkankani, @palashgo, @thebongy, @roerohan, @kathayl, @mchenco, @cloudflare/pcx-technical-writing

@elithrar elithrar merged commit b8ee237 into production Feb 17, 2026
12 checks passed
@elithrar elithrar deleted the opencode/issue27699-20260205214759 branch February 17, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:ai-gateway AI Gateway: https://developers.cloudflare.com/ai-gateway/ size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom provider documentation lacks clarity on endpoint path structure differences

7 participants