
AI WorkersAI
CertifiedUse Cloudflare Workers AI models
AI WorkersAI
Use Cloudflare Workers AI models
Invokes Workers AI chat, embedding, and image models using account ID and API key. Ensure the selected model is available in your account/region.
type: io.kestra.plugin.ai.provider.WorkersAIExamples
Chat completion with WorkersAI
id: chat_completion
namespace: company.ai
inputs:
- id: prompt
type: STRING
tasks:
- id: chat_completion
type: io.kestra.plugin.ai.completion.ChatCompletion
provider:
type: io.kestra.plugin.ai.provider.WorkersAI
accountId: "{{ secret('WORKERS_AI_ACCOUNT_ID') }}"
apiKey: "{{ secret('WORKERS_AI_API_KEY') }}"
modelName: "@cf/meta/llama-2-7b-chat-fp16"
messages:
- type: SYSTEM
content: You are a helpful assistant, answer concisely, avoid overly casual language or unnecessary verbosity.
- type: USER
content: "{{ inputs.prompt }}"
Properties
accountId *string
Account Identifier
Cloudflare account ID that owns the Workers AI deployment. No default: this property is required.
apiKey *string
API Key
Cloudflare API token with Workers AI access. Store it as a Kestra secret rather than inline. No default: this property is required.
baseUrl string
Base URL
Custom base URL overriding the provider's default endpoint. Useful for enterprise gateways, proxies, self-hosted deployments, or test doubles such as WireMock. Defaults to the provider's public endpoint.
caPem string
CA PEM certificate content
PEM-encoded certificate authority chain, as text, used to verify the TLS certificate presented by a custom endpoint. Not set by default, in which case the JVM's default trust store is used.
clientPem string
Client PEM certificate content
PEM-encoded client certificate and private key, as text, used for mutual-TLS authentication against enterprise AI endpoints. Not set by default, in which case the default HTTP client is used.
modelName string
Model name