Repository navigation
docs: SDK guide with Go examples and LiteLLM SDK migration - #1484
Open
jamesilse-solo wants to merge 4 commits into
Open
jamesilse-solo wants to merge 4 commits into
jamesilse-solo wants to merge 4 commits into
Conversation
…gration - Retitle the standalone OpenAI SDK page to cover Python, Node.js, and Go - Explain that the OpenAI SDK reaches any provider through agentgateway - Add a Go example with openai-go/v3 - Add multi-provider (provider prefix) and LiteLLM SDK migration sections (1.6.x+) - Add a short JWT section: pass the IdP token as the SDK API key - Link the LiteLLM config import guide to the SDK migration section
… note - Fix the base URL guidance: the OpenAI SDK needs /v1 in the base URL; without it, requests 404 - Add Go, multi-provider (AgentgatewayModel), LiteLLM SDK migration, and JWT sections - Warn that allowing AgentgatewayModel on a listener moves /v1 LLM paths from HTTPRoutes to models
jamesilse-solo
marked this pull request as ready for review
November 7, 2026 00:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reframes the standalone and Kubernetes OpenAI SDK pages as guides to using SDKs with agentgateway, per the Slack thread on SDK golden paths.
Changes
openai-sdk/.openai-go/v3).openai/*andanthropic/*provider-prefix pattern.provider/modelstrings, before/after code, and a call mapping table.main,latest) to the new migration section.Kubernetes page:
/v1out ofbase_url; the SDK appends only/chat/completions, so requests returned 404 with the default route and with the/openaicustom route. The page now says to end the base URL with/v1.AgentgatewayModelandAgentgatewayPolicy.AgentgatewayModel, it serves/v1/chat/completionsfrom models, so an unprefixed model name that an HTTPRoute used to serve returns model not found. HTTPRoutes on other paths, such as/openai, keep working.The multi-provider and LiteLLM sections render for 1.6.x and later only.
Testing
Ran against agentgateway 1.7.0 and 1.6.0-alpha.2 with the same results.
The page's Python, Node.js (
openai7.52.0), and Go (openai-go/v3v3.96.0) snippets, run as written against the page's catch-all config: OpenAI returned responses for all three.With
jwtAuth(strict) and the provider-prefix config:AsyncOpenAI; Goopenai-go/v3: OpenAI returned responses foropenai/gpt-4o-minianthropic/claude-sonnet-4-5: routed toapi.anthropic.comwith the prefix stripped (no Anthropic key, so it stopped at Anthropic auth)api_key: accepted,jwt.subin access logs; missing or bad token returns 401Kubernetes: agentgateway 1.7.0 on kind.
INGRESS_GW_ADDRESSset to a port-forward: OpenAI returned responses for all three./v1: 404 on the default route and the/openairoute. With/v1(or/openai/v1): 200.AgentgatewayModelwithopenai/*andanthropic/*, plus a strictjwtAuthenticationpolicy: same results as standalone for Python sync, streaming, async, and Go.gpt-4o-minireturns model not found,/openai/v1still works.Not covered: Kubernetes 1.6.x, and page titles for 1.6.x and older.