import instead of CommonJS require().TypeScript client configuration
Usecomposio.getConfig() to read SDK credentials. The client returned by composio.getClient() doesn’t expose apiKey, userApiKey, orgApiKey, or logger. Its baseURL, maxRetries, timeout, and logLevel are read-only. To change client options for specific calls, derive a client with const client = composio.getClient().withOptions({ maxRetries: 0 }) and use that client for those calls.
Pass custom headers through the SDK’s defaultHeaders option.
Credential and scope headers supplied through defaultHeaders or createSession({ headers }) become SDK configuration and don’t appear in getConfig().defaultHeaders. Supply at most one credential header: x-api-key, x-user-api-key, or x-org-api-key. Supplying multiple credential headers throws an error. Per-call client headers cannot override credentials or scope.
With apiKey: null and only an organization API key, API calls, trigger authorization, and session.mcp.headers use x-org-api-key.
AI SDKs
Use these when you call a model SDK directly.Anthropic
OpenAI
Vercel AI SDK
TypeSafe
Cloudflare Workers AI
TypeSafe
Use TypeSafe’s Jev model to select a Composio tool with a confidence score. The provider compiles tools into typed questions and returns a completecall, a partial call with missing arguments, or an abstain decision.
Set COMPOSIO_API_KEY and TYPESAFE_API_KEY in your environment before running decisions.
- Python
- TypeScript
provider.shortlist_tools() to narrow the tools before deciding, or provider.confidence_gate() to apply a minimum judgement score before execution. Destructive tools require explicit confirmation through provider.execute(..., confirm=True).arguments when executing. Handle abstain without executing a tool, and supply the missing arguments for a partial call.
The confidence score is the least certain judgement the call depends on, not the probability that the whole call is correct. Only pass confirmation after you’ve approved a destructive action.