Add OpenRouter integration page (Python) - #5307
Conversation
Documents calling OpenRouter from Activities with Temporal-owned retries, error classification, response caching for free retries, fan-out, and a budget gate that pauses on a soft budget or a 402. Adds the sidebar entry and registry entries for Python and TypeScript under a new Model gateway tag. Snippets are rendered from temporalio/samples-python#TBD.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| Passing `models: ["a/first", "b/second"]` replaces the Auto Router: OpenRouter tries the list in order within one | ||
| request, and the response's `model` field reports which one answered. | ||
|
|
||
| ## Use OpenRouter with the OpenAI Agents SDK plugin |
There was a problem hiding this comment.
📝 [vale] <Temporal.Headings> reported by reviewdog 🐶
'Use OpenRouter with the OpenAI Agents SDK plugin' should use sentence-style capitalization.
📖 Docs PR preview links
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 469fb30284
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| Temporal decides *what happens over time*: waiting out a rate limit, surviving a crash, parking until someone raises a | ||
| budget, and keeping the audit trail. | ||
|
|
||
| This integration is a sample pattern rather than a plugin: OpenRouter needs nothing inside Workflow code. Code snippets |
There was a problem hiding this comment.
Update the parent index for this non-plugin integration
Because this page is now included in the Python integrations sidebar and grid, readers arriving through docs/develop/python/integrations/index.mdx are told that every listed integration is built on the Python SDK Plugin system, while this line explicitly says OpenRouter is only a sample pattern. Update that parent index to distinguish plugin-backed integrations from sample-based integrations.
AGENTS.md reference: AGENTS.md:L242-L243
Useful? React with 👍 / 👎.
Adds a Python integration page for OpenRouter, a sidebar entry, and registry entries for Python and TypeScript under a new "Model gateway" tag.
The page covers calling OpenRouter from an Activity with client retries off so Temporal owns every attempt, an error table (408/429/5xx retry, 4xx do not, 402 handled by the Workflow), OpenRouter response caching so a retried identical request is billed at $0, fan-out with the history and payload limits noted, a budget gate that pauses on a soft budget or a 402 and resumes on an Update, and OpenRouter as the model provider for the OpenAI Agents SDK plugin.
This is a sample-based integration rather than a plugin, which the page says in one sentence. The registry already holds non-plugin entries (Pydantic AI, Mastra).
Snippets are rendered from temporalio/samples-python#366; merge that first so snipsync finds them. The TypeScript registry entry links to temporalio/samples-typescript#520.