Skip to content

Add OpenRouter integration page (Python) - #5307

Merged
Duncanma merged 11 commits into
mainfrom
dabh/openrouter
Oct 9, 2026
Merged

Duncanma merged 11 commits 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.

@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 Oct 9, 2026 5:08pm UTC

Request Review

@github-actions

github-actions Bot commented Sep 11, 2026 •

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

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.

@Duncanma

Duncanma commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@DABH it looks like the two samples PRs are mergeable, not everyone flagged on them has approved though... not sure of the process over there

DABH added 6 commits October 9, 2026 12:05
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.
Copilot AI balanced review requested due to automatic review settings October 9, 2026 17:05
@DABH
DABH force-pushed the dabh/openrouter branch from 8b68fe5 to c6e570c Compare October 9, 2026 17:05

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Snipsync coverage

SDK code lines in docs/ that come from Snipsync: 15.0% → 15.4% (+0.4 pts), 5,798 of 37,553 lines.

Section Snipsync lines Inline lines Snipsync % Change
develop/python 1,550 → 1,737 2,868 → 2,875 35.1% → 37.7% +2.6 pts
All sections

All languages: 13.4% (6,010 of 44,918 lines).

Section Snipsync lines Inline lines Snipsync %
design-patterns 0 7,834 0.0%
develop/python 1,737 2,875 37.7%
guides 34 4,494 0.8%
develop/go 829 3,212 20.5%
develop/typescript 1,948 2,026 49.0%
develop/java 575 3,091 15.7%
develop/dotnet 27 2,063 1.3%
develop/rust 0 1,257 0.0%
develop/php 30 1,144 2.6%
develop/ruby 21 1,145 1.8%
develop 484 604 44.5%
production-deployment 54 804 6.3%
encyclopedia 0 837 0.0%
develop/worker-performance 48 177 21.3%
cloud 0 127 0.0%
references 0 48 0.0%
best-practices 11 17 39.3%
Language Snipsync lines Inline lines Snipsync %
Python 1,880 8,953 17.4%
Go 969 6,307 13.3%
TypeScript 2,089 4,510 31.7%
Java 660 5,640 10.5%
C# 102 2,527 3.9%
Ruby 68 1,326 4.9%
Rust 0 1,324 0.0%
PHP 30 1,168 2.5%
Snipsync origin Lines
temporalio/samples-typescript 1,799
temporalio/samples-python 1,719
temporalio/features 835
temporalio/samples-go 693
temporalio/samples-java 459
temporalio/sdk-typescript 119
temporalio/documentation-sdk-code-examples 98
unattributed 35
temporalio/samples-php 30
temporalio/reference-app-orders-go 11

Compared with 74cc1b1. Counts non-blank lines in fenced code blocks tagged with an SDK language. Hand-written code isn't compiled anywhere; code Snipsync pulls from a sample repository is built in that repository's CI. See UTILITIES.md.

@Duncanma
Duncanma merged commit c205748 into main Oct 9, 2026
17 checks passed
@Duncanma
Duncanma deleted the dabh/openrouter branch October 9, 2026 17:32

This branch was successfully deployed

1 active deployment
Preview — c6e570c5 Deployed Oct 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked-on-release These changes are waiting for official release okay

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants