Skip to content

Add OpenRouter integration page (Python) - #5307

Open
DABH wants to merge 1 commit into
mainfrom
dabh/openrouter
Open

Add OpenRouter integration page (Python)#5307
DABH wants to merge 1 commit into
mainfrom
dabh/openrouter

Conversation

@DABH

@DABH DABH commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

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.

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.
@DABH
DABH requested a review from a team as a code owner September 11, 2026 06:16
@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
temporal-documentation Ready Ready Preview Sep 11, 2026 6:17am UTC

Request Review

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] <Temporal.Headings> reported by reviewdog 🐶
'Use OpenRouter with the OpenAI Agents SDK plugin' should use sentence-style capitalization.

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs PR preview links

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant