All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

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

3mo ago

Source

CloudflareAI Search - New AI Search REST API endpoints for /search and /chat/completionscloudflare.com
Snippet from the RSS feed
AI Search now offers new REST API endpoints for search and chat that use an OpenAI compatible format. This means you can use the familiar messages array structure that works with existing OpenAI SDKs and tools. The messages array also lets you pass previous messages within a session, so the model can maintain context across multiple turns. Endpoint Path Chat Completions POST /accounts/{account_id}/ai-search/instances/{name}/chat/completions Search POST /accounts/{account_id}/ai-search/instances/{name}/search Here is an example request to the Chat Completions endpoint using the new messages array format: curl \ -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?" } ] }' For more details, refer to the AI Search REST API guide . Migration from existing AutoRAG API (recommended) If you are using the previous AutoRAG API endpoints ( /autorag/rags/ ), we recommend migrating to the new endpoints. The previous AutoRAG API endpoints will continue to be fully supported. Refer to the migration guide for step-by-step instructions.

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.