Lộ trình cho người muốn ship API hoặc tool mà không quản máy chủ. Đọc bài kiến thức, rồi làm lab hub, rồi lab chính thức nếu có.A path for people who want to ship an API or a tool without running a server. Read the knowledge lesson, do the hub lab, then the official lab when one exists.ផ្លូវសម្រាប់អ្នកចង់ ship API ឬ tool ដោយមិនដំណើរការ server។ អានមេរៀនចំណេះដឹង រួចធ្វើ lab hub រួច lab ផ្លូវការ បើមាន។
Bài này nói cách gọi model từ Worker. Chính sách dùng AI trong công ty nằm ở track AI Security. Một task rõ trước, chat và nhiều provider sau.This page is about calling a model from a Worker. Company policy for AI use lives on the AI Security track. One clear task first. Chat and extra providers later.This page is about calling a model from a Worker. Company policy for AI use lives on the AI Security track. One clear task first. Chat and extra providers later.
Cách hoạt độngHow it worksHow it works
Binding AI cho phép Worker gọi model phía server. AI Gateway đứng giữa app và model: thấy request, cache khi hợp, đổi provider mà không đưa key xuống trình duyệt. RAG lấy đoạn tài liệu có nguồn rồi mới hỏi model. Agent là Worker có tool. Mỗi tool cần schema và quyền hẹp.An AI binding lets the Worker call a model on the server. AI Gateway sits between the app and the model: it can see the request, cache when that is safe, and change provider without sending the key to the browser. RAG fetches a sourced passage, then asks the model. An agent is a Worker with tools. Each tool needs a schema and a narrow permission.An AI binding lets the Worker call a model on the server. AI Gateway sits between the app and the model: it can see the request, cache when that is safe, and change provider without sending the key to the browser. RAG fetches a sourced passage, then asks the model. An agent is a Worker with tools. Each tool needs a schema and a narrow permission.
Kiến trúcArchitectureArchitecture
Kiểm tra secret và danh tính người dùng trước khi tới endpoint AI. Vector search không phải quyền đọc dữ liệu. Kết quả tìm được vẫn phải qua kiểm tra “user này được xem tài liệu này không”.Check the secret and the user’s identity before the request reaches the AI endpoint. Vector search is not permission to read data. A search hit still has to pass “is this user allowed to see this document?”.Check the secret and the user’s identity before the request reaches the AI endpoint. Vector search is not permission to read data. A search hit still has to pass “is this user allowed to see this document?”.
Khi nào dùngWhen to use itWhen to use it
Làm lab AI sau khi Worker và storage đã chạy. Sau các lab hub phần này là official lab MCP, Agents và Sandbox. Bước tóm tắt và Gateway trong official lab Workers (đã làm sau Phần 1) cũng khớp phần này.Do the AI lab after the Worker and storage already run. After this part’s hub labs come the official MCP, Agents, and Sandbox labs. The summary and Gateway steps of the official Workers lab (done after Part 1) also match this part.Do the AI lab after the Worker and storage already run. After this part’s hub labs come the official MCP, Agents, and Sandbox labs. The summary and Gateway steps of the official Workers lab (done after Part 1) also match this part.
Khi nào không dùngWhen not to use itWhen not to use it
Đừng bắt đầu bằng agent tự gọi nhiều tool. Đừng coi bài này là quy định Shadow AI. Việc đó sang track AI Security.Do not start with an agent that calls many tools. Do not treat this page as the Shadow AI policy. That belongs on the AI Security track.Do not start with an agent that calls many tools. Do not treat this page as the Shadow AI policy. That belongs on the AI Security track.
Gói và giới hạnPlans and limitsPlans and limits
Workers AI (2026-11-15): 10.000 neuron mỗi ngày, cả Free và Paid. Muốn hơn mức đó thì cần Workers Paid. Vài model lớn chỉ có trên Paid. Trang pricing ghi $0.011 / 1.000 neuron — đối chiếu trang đó, không lấy số này làm báo giá. AI Gateway: tính năng lõi (analytics, cache, rate limit) miễn phí trên mọi gói. Vectorize: một trang nói chỉ Paid, trang khác nói Free và Paid đều dùng được. Bài này không gán gói cho Vectorize. Nguồn: https://developers.cloudflare.com/workers-ai/platform/pricing/ https://developers.cloudflare.com/ai-gateway/reference/pricing/ https://developers.cloudflare.com/vectorize/get-started/intro/Workers AI (2026-11-15): 10,000 neurons per day, on both Free and Paid. More than that needs Workers Paid. A few large models are Paid only. The pricing page lists $0.011 per 1,000 neurons. Check that page. This is not a quote. AI Gateway: core features (analytics, cache, rate limiting) are free on all plans. Vectorize: one page says Paid only, another says both Free and Paid can use it. This lesson does not assign Vectorize a plan. Sources: https://developers.cloudflare.com/workers-ai/platform/pricing/ https://developers.cloudflare.com/ai-gateway/reference/pricing/ https://developers.cloudflare.com/vectorize/get-started/intro/Workers AI (2026-11-15): 10,000 neurons per day, on both Free and Paid. More than that needs Workers Paid. A few large models are Paid only. The pricing page lists $0.011 per 1,000 neurons. Check that page. This is not a quote. AI Gateway: core features (analytics, cache, rate limiting) are free on all plans. Vectorize: one page says Paid only, another says both Free and Paid can use it. This lesson does not assign Vectorize a plan. Sources: https://developers.cloudflare.com/workers-ai/platform/pricing/ https://developers.cloudflare.com/ai-gateway/reference/pricing/ https://developers.cloudflare.com/vectorize/get-started/intro/
Không phải báo giá. Đối chiếu docs và dashboard. Kiểm tra lần cuối: 2026-11-11.Not a price quote. Check the docs and the dashboard. Last checked: 2026-11-11.Not a price quote. Check the docs and the dashboard. Last checked: 2026-11-11.
Thuật ngữGlossaryGlossary
NeuronNeuronNeuroni
Đơn vị Workers AI dùng để tính mức gọi model mỗi ngày.The unit Workers AI uses to meter model calls each day.The unit Workers AI uses to meter model calls each day.
RAGRAGRAGi
Lấy đoạn tài liệu liên quan, rồi mới nhờ model trả lời.Fetch a relevant passage, then ask the model to answer.Fetch a relevant passage, then ask the model to answer.
Lab nằm ở bài riêng. Đọc ý chính trước, rồi mở lab.Labs live on their own pages. Read the main ideas, then open a lab.Labs live on their own pages. Read the main ideas, then open a lab.
Ví dụ chính thức từ Cloudflare Resources — gợi ý theo chủ đề bài học trong lộ trình này.Official examples from Cloudflare Resources — matched to this lesson within this path.Official examples from Cloudflare Resources — matched to this lesson within this path.
Trong phần 2, Kristian mở rộng trên môi trường hiện có được xây dựng trong phần 1, bằng cách cho bạn thấy cách tích hợp các mô hình AI mới và giới thiệu các thông số mới cho phép bạn tùy chỉnh cách images được tạo ra.
In part 2, Kristian expands upon the existing environment built in part 1, by showing you how to integrate new AI models and introduce new parameters that allow you to customize how images are generated.
នៅក្នុងផ្នែកទី 2 Kristian ពង្រីកលើបរិស្ថានដែលមានស្រាប់ដែលបានសាងសង់ក្នុងផ្នែកទី 1 ដោយបង្ហាញអ្នកពីរបៀបបញ្ចូលគំរូ AI ថ្មី និងណែនាំប៉ារ៉ាម៉ែត្រថ្មីដែលអនុញ្ញាតឱ្យអ្នកប្ដូរតាមបំណងពីរបៀបដែល images ត្រូវបានបង្កើត។
Học xong hoặc muốn đổi hướng?Finished or want a different path?Finished or want a different path?
Ba lộ trình độc lập — mỗi lộ trình chỉ gồm bài học và tài liệu trong phạm vi đó. Chọn lộ trình khác khi sẵn sàng, không cần học song song.Three independent paths — each includes only lessons and materials for that scope. Switch when you are ready; no need to study paths in parallel.Three independent paths — each includes only lessons and materials for that scope. Switch when you are ready; no need to study paths in parallel.