Documentation Index
Fetch the complete documentation index at: https://mintlify.com/composiohq/composio/llms.txt
Use this file to discover all available pages before exploring further.
The Cloudflare provider wraps Composio tools for use with Cloudflare Workers AI.
Installation
npm install @composio/cloudflare
Quick Start
import { Composio } from '@composio/core';
import { CloudflareProvider } from '@composio/cloudflare';
const composio = new Composio({
apiKey: 'your-composio-key',
provider: new CloudflareProvider()
});
const tools = await composio.tools.get('default', {
toolkits: ['github']
});
// In a Cloudflare Worker
export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext) {
const ai = new Ai(env.AI);
const response = await ai.run('@cf/meta/llama-3-8b-instruct', {
messages: [
{ role: 'user', content: 'Create a GitHub issue' }
],
tools: Object.values(tools)
});
return new Response(JSON.stringify(response));
}
};
interface CloudflareTool {
type: 'function';
function: {
name: string;
description: string;
parameters: {
type: 'object';
properties: Record<string, unknown>;
required: string[];
};
};
}
Next Steps
OpenAI Provider
Compare with OpenAI
Tools API
Learn about tools