OpenAI Agents SDK -> GoModel /v1 -> selected provider
Before you start
- Install GoModel.
- Choose a GoModel master key, for example
change-me. - Configure at least one upstream model provider.
- Install the OpenAI Agents SDK for Python or JavaScript.
The SDK exports traces to OpenAI by default. If GoModel is your only OpenAI
client endpoint, disable tracing or configure a separate OpenAI tracing key.
1. Run GoModel
Start GoModel with a master key and an upstream provider key. This example uses OpenAI upstream:2. Confirm the Responses endpoint
Send one small request through GoModel:ok.
3. Configure the SDK
Point the SDK’s OpenAI client at GoModel:Namespaced model IDs
The Python SDK treats strings likeanthropic/claude-sonnet-4-20250514 and
gemini/gemini-2.0-flash as provider-prefixed model names by default. When you
want those namespaced GoModel IDs to reach the gateway unchanged, configure the
SDK model provider in model ID pass-through mode:
Supported SDK paths
GoModel supports the SDK’s normal HTTP Responses path:- non-streaming
Runner.run(...) - streaming
Runner.run_streamed(...)over HTTP/SSE - function tool loops
- handoffs and agents-as-tools when they compile to model tool calls
- SDK-managed local sessions that replay input history
/v1/conversationsfor server-managed conversation resources/v1/responses/input_tokens/v1/responses/compact- local response retrieval through
/v1/responses/{id}and/v1/responses/{id}/input_items
text output settings into the Chat Completions response_format (and passes
text.verbosity through) only for chat providers that support those fields,
while returning a clear error for stateful or provider-native Responses fields
such as previous_response_id, conversation, and hosted tool items.
See Responses compatibility for the full
feature matrix.
Storage behavior
GoModel stores local response snapshots so lifecycle endpoints can work even when the upstream provider does not support response retrieval. If the SDK sendsstore: false, GoModel does not persist that local response snapshot.
Current limitations
- Responses websocket transport is not implemented. Use the SDK’s HTTP/SSE transport with GoModel.
- Hosted tools such as web search, file search, and computer use require a native upstream provider that supports those tool payloads. Chat-translated providers such as Anthropic and Gemini reject those tools unless GoModel adds explicit provider capability mapping for them.
- Anthropic does not currently accept translated structured-output
response_formatortext.verbositysettings. GoModel rejects those fields instead of silently ignoring them. previous_response_idandconversationare forwarded to native Responses providers. Chat-translated providers reject them because GoModel cannot safely reconstruct provider-managed state across that translation boundary yet.- Tracing is separate from model routing. Disable SDK tracing or configure a real OpenAI tracing key.
More examples
See the runnable examples indocs/examples/openai-agents-sdk/.
References
- OpenAI Agents SDK Python configuration: https://openai.github.io/openai-agents-python/config/
- OpenAI Agents SDK JavaScript configuration: https://openai.github.io/openai-agents-js/guides/config/
- OpenAI Agents SDK running agents: https://openai.github.io/openai-agents-python/running_agents/