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.
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
OpenAI
Anthropic
Vercel AI SDK
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' }]
});
import { Composio } from '@composio/core';
import { AnthropicProvider } from '@composio/anthropic';
import Anthropic from '@anthropic-ai/sdk';
const composio = new Composio({
apiKey: 'your-key',
provider: new AnthropicProvider()
});
const tools = await composio.tools.get('default', {
toolkits: ['github']
});
const anthropic = new Anthropic();
const message = await anthropic.messages.create({
model: 'claude-3-opus-20240229',
max_tokens: 1024,
tools,
messages: [{ role: 'user', content: 'Create an issue' }]
});
import { Composio } from '@composio/core';
import { VercelProvider } from '@composio/vercel';
import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
const composio = new Composio({
apiKey: 'your-key',
provider: new VercelProvider()
});
const tools = await composio.tools.get('default', {
toolkits: ['github']
});
const result = await generateText({
model: openai('gpt-4'),
tools,
prompt: 'Create a GitHub 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 Case | Recommended Provider |
|---|
| Production apps with OpenAI | OpenAI |
| Claude-based applications | Anthropic |
| Next.js with streaming | Vercel AI SDK |
| Complex agent workflows | LangChain |
| RAG and retrieval | LlamaIndex |
| Google Gemini | Google GenAI |
| Modern AI frameworks | Mastra |
| Edge deployment | Cloudflare |
| Custom requirements | Custom 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