ClaudeCloudflare Developer PlatformMar 23, 2026, 12:00 AM

AI Search - New AI Search REST API endpoints for /search and /chat/completions

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

claudeenmodel: claude-sonnet-4-20250514

AI Search introduces OpenAI-compatible REST API endpoints with chat completions support

Key Points

  • OpenAI-compatible REST API endpoints launched
  • Multi-turn conversation context support added
  • Migration from AutoRAG API recommended

Summary

Cloudflare AI Search has released new REST API endpoints that provide OpenAI-compatible formatting for search and chat completions. The new endpoints support familiar messages array structure and maintain conversational context across multiple turns.

Key Points

  • New Endpoints Available:

    • POST /accounts/{account_id}/ai-search/instances/{name}/chat/completions
    • POST /accounts/{account_id}/ai-search/instances/{name}/search
  • OpenAI Compatibility: Uses standard messages array format compatible with existing OpenAI SDKs and tools

  • Context Preservation: Supports passing previous messages within sessions for multi-turn conversations

  • Migration Recommended: Users should migrate from legacy AutoRAG API endpoints (/autorag/rags/) as new features will only be added to the new endpoints

  • Deprecation Timeline: Legacy AutoRAG endpoints will continue working with at least 90 days notice before any breaking changes

Full Translation

Translations

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

claudejamodel: claude-sonnet-4-20250514

AI Search - /searchと/chat/completions用の新しいAI Search REST APIエンドポイント

AI Search - /searchと/chat/completions用の新しいAI Search REST APIエンドポイント

2026年3月23日公開

AI Searchに、OpenAI互換フォーマットを使用する検索とチャット用の新しいREST APIエンドポイントが追加されました。これにより、既存のOpenAI SDKやツールで動作する馴染みのあるmessages配列構造を使用できます。messages配列により、セッション内の以前のメッセージを渡すことも可能で、モデルが複数のターンにわたってコンテキストを維持できます。

エンドポイント

エンドポイントパス
Chat CompletionsPOST /accounts/{account_id}/ai-search/instances/{name}/chat/completions
SearchPOST /accounts/{account_id}/ai-search/instances/{name}/search

使用例

新しいmessages配列フォーマットを使用したChat Completionsエンドポイントへのリクエスト例:

curl https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai-search/instances/{NAME}/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -d '{
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful documentation assistant."
      },
      {
        "role": "user",
        "content": "How do I get started?"
      }
    ]
  }'

詳細については、AI Search REST APIガイドを参照してください。

既存のAutoRAG APIからの移行(推奨)

以前のAutoRAG APIエンドポイント(/autorag/rags/)を使用している場合は、可能な限り早急に移行することをお勧めします。新機能は新しいエンドポイントにのみ追加される予定です。

以前のAutoRAG APIエンドポイントは当面の間、期待通りに動作し続けますが、変更を行う場合は少なくとも90日前に通知いたします。

ステップバイステップの手順については、移行ガイドを参照してください。

AI Search - New AI Search REST API endpoints for /search and /chat/completions | Cloudflare Developer Platform | DocsDigest