OpenAICloudflare Developer PlatformJul 10, 2026, 12:00 AM

Workers AI - Plain text output for Markdown Conversion

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

openaienmodel: gpt-5-mini-2025-08-07

Workers AI - Plain text output for Markdown Conversion

Key Points

  • plain-text output option
  • removes Markdown syntax
  • works via env.AI and REST API

Summary

The Workers AI Markdown Conversion service adds a new output option. Set conversionOptions.output.format to text to receive plain text with Markdown syntax removed. The default remains markdown, so existing conversions are unaffected. When you request text output, each result's format field is set to text.

Key Points

  • New option: conversionOptions.output.format = "text" returns plain text with Markdown stripped.
  • Default behavior unchanged: markdown remains the default output format.
  • Supported in both env.AI bindings and the REST API; response format will be text for these requests.

Examples

  • env.AI (JavaScript/TypeScript): await env.AI.toMarkdown({ name: "page.html", blob: new Blob([html]) }, { conversionOptions: { output: { format: "text" } } })
  • REST API (curl): curl https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/tomarkdown -H 'Authorization: Bearer {API_TOKEN}' -F 'files=@index.html' -F 'conversionOptions={"output": {"format": "text"}}'

Migration / Notes

  • No changes required for existing integrations unless you want plain-text output.
  • Check the response format field to detect plain-text results.

Full Translation

Translations

A translation section that keeps the flow of the original article.

openaijamodel: gpt-5-mini-2025-08-07

Workers AI - Markdown 変換のプレーンテキスト出力

Workers AI — Markdown 変換のプレーンテキスト出力

公開日: 2026-07-10

概要

Markdown Conversion サービスは、変換されたコンテンツの形式を制御する新しい出力変換オプションをサポートするようになりました。output.formattext に設定すると、Markdown 構文が削除されたプレーンテキストを受け取ります。デフォルト値は markdown で、既存の変換は変更されません。

使用例(env.AI バインディング)

  • JavaScript

    await env . AI . toMarkdown ( { name : "page.html" , blob : new Blob ([ html ]) }, { conversionOptions : { output : { format : "text" }, }, }, ) ;

  • TypeScript

    await env . AI . toMarkdown ( { name : "page.html" , blob : new Blob ([ html ]) }, { conversionOptions : { output : { format : "text" }, }, }, ) ;

REST API を呼び出す

ターミナル:

curl https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/tomarkdown \
 -H 'Authorization: Bearer {API_TOKEN}' \
 -F 'files=@index.html' \
 -F 'conversionOptions={"output": {"format": "text"}}'

動作

  • テキスト出力を要求すると、各結果の format フィールドは text に設定されます。
  • 詳細は Conversion Options を参照してください。

参考

  • API
  • Support: Help Center, System Status

© 2026 Cloudflare, Inc. Privacy Policy Terms of Use