在过去几个月里,我们与 Speakeasy 紧密合作,为我们的 Interactions、Agents 和 Webhooks API 推出了新的 Google GenAI SDK。今天,我们很高兴地宣布,我们与 Speakeasy 达成合作,将其 OpenAPI 代码生成套件开源。
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3.8-flash",
input="Analyze this commit log and find regressions.",
)
print(interaction.output_text)
Python
从快速演进的 OpenAPI 规范生成干净、地道的多语言 SDK 是一项工程挑战。多年来,包括 Google 在内的前沿 AI 生态系统一直依赖专用工具来生成客户端库,这些库能够处理复杂的流式协议、严格的错误层次结构和丰富的类型联合,而不会显得像是机器生成的。
2026年5月,就在我们为 Google I/O 和 Interactions API 的正式商用(General Availability)做准备之际,我们使用的 SDK 生成提供商被收购并突然宣布关闭服务。
这一突发中断凸显出专有、闭源生成器会带来不可接受的平台风险。如果行业依赖 OpenAPI 来定义接口,那么将这些接口编译为客户端库、CLI 和代理工具的工具链应当是开放的基础设施。
评估前进路径
在紧促的时间表内重新构建我们的 SDK 管道时,我们的首要任务是最大限度地减少对开发者的干扰并避免破坏性变更。
我们与 Speakeasy 合作就地迁移了我们的客户端库,核心承诺是将生成器套件开源。此次迁移需要细致的工程工作:对齐所有目标语言的类型定义,保留严格的错误层次结构和流式行为,并将生成器直接集成到我们的内部单体仓库(monorepo)和构建系统中。
在 Google DeepMind,虽然我们在开发工作流中广泛使用 AI,但我们相信为堆栈的每一层选择正确的工具。将形式化的 API 规范转换为多语言 SDK 需要确定性和严格的类型安全。借助 Speakeasy,我们在核心部分搭配一个快速、确定性的生成器,同时利用 Antigravity AI 代理加速 SDK 的自定义部分。
以前维护手工编写的生成器需要多名工程师。如今,这一配置通过大约一名工程师即可维护我们的客户端管道,覆盖六个目标平台(已发布三个 SDK,更多即将陆续推出)。
今日开源的内容
为了确保更广泛的开发者生态系统能够访问高质量、维护良好的 SDK 生成工具,且无需面临类似中断的风险,Speakeasy 已在其 AGPLv3 许可下开源其完整的 OpenAPI 客户端套件。
多语言 SDK 生成器:为 7 种语言(Python、TypeScript、Go、Java、C#、PHP、Ruby)生成客户端库。每个库均包含静态类型、服务器发送事件(SSE)流式传输、重试机制和分页功能。
面向代理原生的 CLI 生成器:编译独立的 CLI 二进制文件。AI 编码代理可以直接从终端会话中运行您的 API,而无需编写一次性 HTTP 脚本。
文档 MCP 服务器生成器:将您的 OpenAPI 规范和 Markdown 文档转换为 Model Context Protocol (MCP) 服务器。像 Antigravity 这样的编码代理可以查询实时、经过验证的模式,而不是猜测过时的方法。
该生成器采用 AGPLv3 许可。这允许您在开发或 CI 管道中运行它,同时保留对您生成的代码/SDK 的完全所有权(使用您选择的许可证,如 MIT 或 Apache 2.0)。如果您修改了生成器编译器本身,AGPL 保证这些改进将对社区保持开放。
试用
您可以使用我们更新的 SDK 今天探索新的 Gemini Interactions API。如果您想生成自己的客户端库、CLI 或 MCP 服务器,您可以在 GitHub 上找到 Speakeasy 生成器,并将其针对您的 OpenAPI 规范运行。
感谢阅读!继续构建。
Over the last few months, we worked closely with Speakeasy to ship the new Google GenAI SDKs for our Interactions , Agents , and Webhooks APIs. Today, we're excited to announce that we’ve partnered with Speakeasy to make their OpenAPI code generation suite open source .
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3.8-flash",
input="Analyze this commit log and find regressions.",
)
print(interaction.output_text)
Python
Generating clean, idiomatic SDKs across multiple languages from rapidly evolving OpenAPI specs is an engineering challenge. For years, the frontier AI ecosystem, including Google, relied on specialized tooling to generate client libraries that could handle complex streaming protocols, strict error hierarchies, and rich type unions without feeling machine-generated.
In May 2026, right as we were gearing up for Google I/O and the General Availability of the Interactions API , the SDK generation provider we were using was acquired and abruptly announced its shutdown.
This sudden disruption highlighted that proprietary, closed-source generators create unacceptable platform risk. If the industry relies on OpenAPI to define interfaces, the tooling to compile those interfaces into client libraries, CLIs, and agent tools should be open infrastructure.
Evaluating the path forward
As we were reworking our SDK pipeline on a tight timeline, our top priority was minimizing developer disruption and avoiding breaking changes.
We partnered with Speakeasy to migrate our client libraries in place, with the core commitment to make the generator suite open source. The migration required careful engineering: aligning type definitions across all target languages, preserving strict error hierarchies and streaming behavior, and integrating the generator directly into our internal monorepo and build system.
At Google DeepMind, while we use AI across our development workflows, we believe in choosing the right tool for each layer of the stack. Transforming formal API specifications into multi-language SDKs demands determinism and strict type safety. With Speakeasy, we pair a fast, deterministic generator at the core with Antigravity AI agents accelerating the custom parts of the SDK.
Maintaining previously handcrafted generators used to take multiple engineers. Today, this setup powers our client pipeline across six targets (three released SDKs, with more rolling out shortly) with roughly one engineer to maintain.
What is open sourced today
To help ensure the broader developer ecosystem has access to high-quality, well-maintained SDK generation tooling without the risk of similar disruptions, Speakeasy is open sourcing its full OpenAPI client suite under the AGPLv3 license.
Multi-language SDK generators: Generates client libraries for 7 languages (Python, TypeScript, Go, Java, C#, PHP, Ruby). Each library includes static typing, server-sent events (SSE) streaming, retries, and pagination.
An agent-native CLI generator: Compiles standalone CLI binaries. AI coding agents can run your API directly from terminal sessions without writing throwaway HTTP scripts.
A documentation MCP server generator: Turns your OpenAPI specs and markdown documentation into a Model Context Protocol (MCP) server. Coding agents like Antigravity can query live, verified schemas instead of guessing outdated methods.
The generator is licensed under AGPLv3. This allows you to run it in your development or CI pipeline while keeping complete ownership of your generated code/SDKs under your chosen license (such as MIT or Apache 2.0). If you modify the generator compiler itself, the AGPL guarantees those improvements remain open to the community.
Try it out
You can explore the new Gemini Interactions API today using our updated SDKs. If you want to generate your own client libraries, CLIs, or MCP servers, you can find the Speakeasy generator on GitHub and run it against your OpenAPI specs.
Thanks for reading! Keep on building.
首次收录 · 2026-09-28 · 8.4 分