Skip to main content
Providers wrap Composio tools in the format expected by your AI framework. Composio supports 10+ popular AI frameworks out of the box.

What are Providers?

Providers transform Composio tools into framework-specific formats:
  • OpenAI: OpenAI function calling format
  • Anthropic: Claude tool use format
  • Vercel AI SDK: Vercel AI tool format
  • LangChain: DynamicStructuredTool
  • LlamaIndex: LlamaIndex tool format
  • Google GenAI: Google function declarations
  • Mastra: Mastra tool format
  • Cloudflare: Cloudflare Workers AI format

Quick Start

import { Composio } from '@composio/core';
import { OpenAIProvider } from '@composio/openai';
import OpenAI from 'openai';

const composio = new Composio({
  apiKey: 'your-key',
  provider: new OpenAIProvider()
});

const tools = await composio.tools.get('default', {
  toolkits: ['github']
});

const openai = new OpenAI();
const response = await openai.chat.completions.create({
  model: 'gpt-4',
  tools,
  messages: [{ role: 'user', content: 'Create an issue' }]
});

Available Providers

OpenAI

OpenAI GPT-4 and function calling

OpenAI Agents

OpenAI Agents SDK (Swarm)

Anthropic

Claude with tool use

Vercel AI SDK

Vercel AI SDK integration

LangChain

LangChain.js tools

LlamaIndex

LlamaIndex.TS tools

Google GenAI

Google Gemini integration

Mastra

Mastra.ai framework

Cloudflare

Cloudflare Workers AI

Custom Provider

Build your own provider

Provider Types

Agentic Providers

Agentic providers handle tool execution automatically:
  • LangChain: Tools execute when agents call them
  • LlamaIndex: Tools execute during agent runs
  • Vercel AI SDK: Tools execute in the AI SDK flow
  • Mastra: Tools execute in Mastra workflows
// With agentic providers, tools execute automatically
const tools = await composio.tools.get('default', { toolkits: ['github'] });

// The framework handles execution
const agent = new Agent({ tools });
await agent.run('Create an issue');

Non-Agentic Providers

Non-agentic providers require manual tool execution:
  • OpenAI: You handle tool calls from the response
  • Anthropic: You process tool_use blocks
  • Google GenAI: You handle function calls
  • Cloudflare: You process tool calls
// With non-agentic providers, you handle execution
const tools = await composio.tools.get('default', { toolkits: ['github'] });

const response = await openai.chat.completions.create({
  model: 'gpt-4',
  tools,
  messages: [{ role: 'user', content: 'Create an issue' }]
});

// Manually execute tool calls
for (const toolCall of response.choices[0].message.tool_calls || []) {
  const result = await composio.tools.execute(toolCall.function.name, {
    userId: 'default',
    arguments: JSON.parse(toolCall.function.arguments)
  });
}

Choosing a Provider

Use CaseRecommended Provider
Production apps with OpenAIOpenAI
Claude-based applicationsAnthropic
Next.js with streamingVercel AI SDK
Complex agent workflowsLangChain
RAG and retrievalLlamaIndex
Google GeminiGoogle GenAI
Modern AI frameworksMastra
Edge deploymentCloudflare
Custom requirementsCustom Provider

Provider Configuration

Some providers accept configuration options:
import { AnthropicProvider } from '@composio/anthropic';
import { VercelProvider } from '@composio/vercel';

// Anthropic with caching
const composio = new Composio({
  provider: new AnthropicProvider({
    cacheTools: true // Enable ephemeral caching
  })
});

// Vercel with strict mode
const composio = new Composio({
  provider: new VercelProvider({
    strict: true // Remove non-required properties
  })
});

Multiple Providers

You can use multiple providers in the same application:
import { Composio } from '@composio/core';
import { OpenAIProvider } from '@composio/openai';
import { AnthropicProvider } from '@composio/anthropic';

// For OpenAI
const composioOpenAI = new Composio({
  apiKey: 'your-key',
  provider: new OpenAIProvider()
});

// For Anthropic
const composioAnthropic = new Composio({
  apiKey: 'your-key',
  provider: new AnthropicProvider()
});

const openaiTools = await composioOpenAI.tools.get('default', { toolkits: ['github'] });
const anthropicTools = await composioAnthropic.tools.get('default', { toolkits: ['github'] });

Default Provider

If no provider is specified, OpenAIProvider is used by default:
const composio = new Composio({ apiKey: 'your-key' });
// Equivalent to:
const composio = new Composio({
  apiKey: 'your-key',
  provider: new OpenAIProvider()
});

Next Steps

OpenAI Provider

Get started with OpenAI

Anthropic Provider

Use Claude with tools

Vercel AI SDK

Build with Vercel AI

Custom Provider

Create your own provider

Build docs developers (and LLMs) love