How to connect Apollo to Claude Agent SDK in 2 mins: No API key needed

You can build a list of prospects that fit your customer, get work emails for your top prospects and research a company before a sales call from Claude Agent SDK. Composio runs each call on its own Apollo account, so you don't need a Apollo API key, and your first $2 is free.

ApolloInstant · No API key

Claude Agent SDK runs Apollo through Composio, and the cost comes out of your free $2.

  • A work email and profile for a person$0.020
  • A company profile from its domain$0.020
  • A page of companies that match your filters$0.020

$2 ≈ 100 persons or 100 companies

Composio Instant

What you can do with your free $2

What your free $2 gets you with Apollo
When you ask Claude Agent SDK forClaude Agent SDK uses this toolCostWhat $2 gets you
A work email and profile for a personEnrich person with Apollo$0.020 per personAbout 100 persons
A company profile from its domainEnrich organization data$0.020 per companyAbout 100 companies
A page of companies that match your filtersSearch organizations in Apollo$0.020 per searchAbout 100 searches
Open job posts at a companyGet Organization Job Postings$0.020 per pageAbout 100 pages
News articles about a companySearch news articles$0.020 per pageAbout 100 pages

You pay Apollo's price for each call with 0% markup, plus the regular Composio tool call charge. There's no Apollo subscription, and you only pay for what you use.

9 of 72 Apollo tools work without a key. For Activate Sequence, Add Contacts to Sequence, Add People to Prospects, Archive Sequence, Bulk update account stage, Complete Apollo Task and 57 more, connect your own Apollo key. Read how Instant works.

How it works

How to connect Apollo to Claude Agent SDK

Composio adds Apollo to Claude Agent SDK as an Instant toolkit. You connect Composio to Claude Agent SDK once, and then Claude Agent SDK can use Apollo right away. There are two ways to do this:

  • Bring your own key

    You bring your own Apollo API key, set it up, and use it.

  • Use the Composio wallet

    Instant

    Composio runs each call on its own Apollo account, so you don't have to set anything up at Apollo, and your first $2 is free.

You do the setup one time and it takes about a minute. If you build Apollo into your own product, turn on Instant toolkits in your project settings so your agent can call Apollo for each of your users without a Apollo API key, and read Instant tools in the Composio docs for the setup steps and code examples.

Get started

Start to use Apollo in Claude Agent SDK in 3 steps

  1. Turn on Instant

    Open your Composio wallet and turn on Instant. Your free $2 shows up there.

  2. Add Composio to Claude Agent SDK

    Follow the setup below. You only do this once.

  3. Ask Claude Agent SDK for something

    Try a Apollo prompt. The cost comes out of your $2.

Setup

Step-by-step Guide

Step by step09 STEPS
1

Prerequisites

Before starting, make sure you have:
  • Composio API Key and Claude/Anthropic API Key
  • Primary know-how of Claude Agents SDK
  • A Apollo account
  • Some knowledge of Python
2

Getting API Keys for Claude/Anthropic and Composio

Claude/Anthropic API Key
  • Go to the Anthropic Console and create an API key. You'll need credits to use the models.
  • Keep the API key safe.
Composio API Key
  • Log in to the Composio dashboard.
  • Navigate to your API settings and generate a new API key.
  • Store this key securely as you'll need it for authentication.
3

Install dependencies

npm install @anthropic-ai/claude-agent-sdk @composio/core dotenv

Install the Composio SDK and the Claude Agents SDK.

What's happening:

  • @composio/core provides Composio integration for Anthropic
  • @anthropic-ai/claude-agent-sdk is the core agent framework
  • dotenv/config loads environment variables
4

Set up environment variables

bash
COMPOSIO_API_KEY=your_composio_api_key_here
USER_ID=your_user_id_here
ANTHROPIC_API_KEY=your_anthropic_api_key_here

Create a .env file in your project root.

What's happening:

  • COMPOSIO_API_KEY authenticates with Composio
  • USER_ID identifies the user for session management
  • ANTHROPIC_API_KEY authenticates with Anthropic/Claude
5

Import dependencies

import 'dotenv/config';
import readline from 'node:readline';
import { Composio } from '@composio/core';
import { query, type Options } from "@anthropic-ai/claude-agent-sdk";

dotenv.config();
What's happening:
  • We're importing all necessary libraries including the Claude Agent SDK and Composio
  • The dotenv.config() function loads environment variables from your .env file
  • This setup prepares the foundation for connecting Claude with Apollo functionality
6

Create a Composio instance and Tool Router session

async function chat() {
  const { COMPOSIO_API_KEY, USER_ID } = process.env;
  if (!COMPOSIO_API_KEY || !USER_ID) {
    throw new Error('COMPOSIO_API_KEY and USER_ID required in .env');
  }

  const composio = new Composio({ apiKey: COMPOSIO_API_KEY });

  // Create Tool Router session for Apollo
  const session = await composio.create(USER_ID, {
    toolkits: ['apollo'],
  });
  const mcpUrl = session?.mcp.url;
What's happening:
  • The function checks for the required COMPOSIO_API_KEY environment variable
  • We're creating a Composio instance using our API key
  • The create method creates a Tool Router session for Apollo
  • The returned url is the MCP server URL that your agent will use
7

Configure Claude Agent with MCP

const options: Options = {
  permissionMode: 'bypassPermissions',
  mcpServers: {
    composio: {
      type: 'http',
      url: mcpUrl,
      headers: { 'x-api-key': COMPOSIO_API_KEY }
    }
  },
  systemPrompt: 'You are a helpful assistant with access to Apollo tools via Composio.',
  maxTurns: 10,
};
What's happening:
  • We're configuring the Claude Agent options with the MCP server URL
  • permissionMode: 'bypassPermissions' allows the agent to execute operations without asking for permission each time
  • The system prompt instructs the agent that it has access to Apollo
  • maxTurns: 10 limits the conversation length to prevent excessive API usage
8

Create client and start chat loop

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: 'You: '
  });

  console.log('\nChat started. Type "exit" to quit.\n');

  let isProcessing = false;

  async function ask(prompt: string) {
    isProcessing = true;
    rl.pause();

    process.stdout.write('Claude is thinking...');
    const stream = query({ prompt, options });

    let firstChunk = true;
    for await (const msg of stream) {
      const content = (msg as any).message?.content || (msg as any).content;
      if (Array.isArray(content)) {
        for (const block of content) {
          if (block.type === 'text' && block.text) {
            if (firstChunk) {
              process.stdout.write('\r\x1b[K');
              process.stdout.write('Claude: ');
              firstChunk = false;
            }
            process.stdout.write(block.text);
          }
        }
      }
    }
    process.stdout.write('\n\n');

    isProcessing = false;
    rl.resume();
    rl.prompt();
  }

  rl.on('line', async (line) => {
    if (isProcessing) return;

    const input = line.trim();
    if (input === 'exit') {
      rl.close();
      process.exit(0);
    }
    if (input) await ask(input);
    else rl.prompt();
  });

  await ask('What can you help me with?');
}
What's happening:
  • The readline interface is created to handle user input and output
  • The query function is used to send the user's input to the agent
  • The chat loop continues until the user types 'exit' or 'quit'
9

Run the application

try {
  await chat();
} catch (error) {
  console.error(error);
  process.exit(1);
}
What's happening:
  • The chat function is the entry point for the application
  • The try-catch block is used to handle any errors that occur

Complete Code

Here's the complete code to get you started with Apollo and Claude Agent SDK:

import 'dotenv/config';
import readline from 'node:readline';
import { Composio } from '@composio/core';
import { query, type Options } from "@anthropic-ai/claude-agent-sdk";

async function chat() {
  const { COMPOSIO_API_KEY, USER_ID } = process.env;
  if (!COMPOSIO_API_KEY || !USER_ID) {
    throw new Error('COMPOSIO_API_KEY and USER_ID required in .env');
  }

  const composio = new Composio({ apiKey: COMPOSIO_API_KEY });
  const session = await composio.create(USER_ID, {
    toolkits: ['apollo']
  });
  const mcp_url = session?.mcp.url;

  const options: Options = {
    permissionMode: 'bypassPermissions',
    mcpServers: {
      composio: {
        type: 'http',
        url: mcp_url,
        headers: { 'x-api-key': COMPOSIO_API_KEY }
      }
    },
    systemPrompt: 'You are a helpful assistant with access to Apollo tools via Composio.',
    maxTurns: 10,
  };

  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
    prompt: 'You: '
  });

  console.log('\nChat started. Type "exit" to quit.\n');

  let isProcessing = false;

  async function ask(prompt: string) {
    isProcessing = true;
    rl.pause();

    process.stdout.write('Claude is thinking...');
    const stream = query({ prompt, options });

    let firstChunk = true;
    for await (const msg of stream) {
      const content = (msg as any).message?.content || (msg as any).content;
      if (Array.isArray(content)) {
        for (const block of content) {
          if (block.type === 'text' && block.text) {
            if (firstChunk) {
              process.stdout.write('\r\x1b[K');
              process.stdout.write('Claude: ');
              firstChunk = false;
            }
            process.stdout.write(block.text);
          }
        }
      }
    }
    process.stdout.write('\n\n');

    isProcessing = false;
    rl.resume();
    rl.prompt();
  }

  rl.on('line', async (line) => {
    if (isProcessing) return;

    const input = line.trim();
    if (input === 'exit') {
      rl.close();
      process.exit(0);
    }
    if (input) await ask(input);
    else rl.prompt();
  });

  await ask('What can you help me with?');
}

try {
  await chat();
} catch (error) {
  console.error(error);
  process.exit(1);
}
Try it

Ask Claude Agent SDK for something with Apollo

Start a new chat and try this prompt:

Find 25 [job title]s in [location] at companies with [min] to [max] employees. Give me a table with each person's title, company and location.

Claude Agent SDK runs it on Instant and shows you the result. It doesn't ask you for a Apollo key, and the cost comes out of your $2. You can see each call in your wallet.

Optional: connect your own Apollo key

If you want Activate Sequence, Add Contacts to Sequence, Add People to Prospects, Archive Sequence, Bulk update account stage, Complete Apollo Task and 57 more, you need your own key. Ask Claude Agent SDK to connect your Apollo account, and it gives you a Composio link:

Connect my Apollo account using Composio.

Open the link, paste your Apollo API key and click Connect Account. You can get a key from Apollo API keys page. After that, Composio uses your key first and doesn't charge Instant for those calls.

Starter prompts

Use your first $2: copy a prompt into Claude Agent SDK

Each prompt runs on Instant, and the cost next to it is about what it takes from your $2.

  • Build a list of prospects that fit your customer

    Free

    Finds people by job title, seniority, location and company size without using paid credits.

    Find 25 [job title]s in [location] at companies with [min] to [max] employees. Give me a table with each person's title, company and location.

  • Get work emails for your top prospects

    About $0.10

    Looks up work emails and current titles for up to 5 people you name, in one request.

    Find the work email and current title for these people: [first and last name plus company domain for each, up to 5]. Show me who you found and who you couldn't match.

  • Research a company before a sales call

    About $0.04

    Pulls a company's size, funding, technologies and open roles from its domain so you go in prepared.

    Look up [company domain] and give me a short brief: what they do, headcount, funding, the main technologies they use and the roles they're hiring for right now.

  • Find companies that match your ideal customer

    About $0.02

    Searches Apollo's company database by industry, location and headcount and returns a list to review.

    Find [industry] companies headquartered in [location] with [min] to [max] employees. Give me 50 of them in a table with name, domain, headcount and location.

  • Fill in company details for a list of domains

    About $0.20

    Adds industry, headcount, location and founding year to up to 10 company domains at once.

    Enrich these company domains and give me a table with industry, employee count, headquarters, founding year and annual revenue where available: [paste up to 10 domains].

  • Catch up on news about your accounts

    About $0.04

    Finds recent news on the companies you sell to, so you have a timely reason to reach out.

    Find news from the last 30 days about these companies: [paste up to 10 domains]. List each article with the company, date, headline and link.

What it can do

What Claude Agent SDK can do with Apollo

Works without a key

  • A work email and profile for a person
  • A company profile from its domain
  • A page of companies that match your filters
  • Open job posts at a company
  • News articles about a company

Needs your own Apollo key

  • Activate Sequence
  • Add Contacts to Sequence
  • Add People to Prospects
  • Archive Sequence
  • Bulk update account stage
  • Complete Apollo Task
  • Create an Apollo account
  • Bulk create Apollo accounts
  • and 55 more
Tools and prices

Supported tools (72)

Apollo tools and their Instant prices
ToolWhat it doesWorks without a keyCost on Instant
Bulk organization enrichmentEnriches data for up to 10 organizations simultaneously by providing a list of their base company domains (e.g., 'apollo.io', not 'www.apollo.io').YesEstimated $0.02 per organization enriched in the batch
Bulk people enrichmentEnriches up to 10 person profiles from Apollo's database; charges may apply per person enriched, and unmatched entries may be null.Yes$0.02–$0.18 per person enriched
Get Organization by IDRetrieves organization information by Apollo ID, including available funding, technology, and employee data.YesEstimated $0.02 per organization retrieved
Get Organization Job PostingsRetrieves paginated job postings for a specified organization by its ID, optionally filtering by domain; ensure `organization_id` is a valid identifier.YesEstimated $0.02 per job-posting result page
Enrich organization dataFetches comprehensive organization enrichment data from Apollo.io for a given company domain; results are most meaningful if the company exists in Apollo's database.YesEstimated $0.02 per organization enriched
Search organizations in ApolloSearch Apollo's organization database using filters and paginated results.YesEstimated $0.02 per organization search page
Enrich person with ApolloEnriches a person using an Apollo ID, email, hashed email, LinkedIn URL, or first and last name with organization name or domain.Yes$0.02–$0.18 per person enriched
Apollo people searchSearches Apollo's database for net-new prospects using filters, returning preview records with a display limit of 50,000.Yes$0 per request
Search news articlesTool to search for news articles about companies in Apollo's database.YesEstimated $0.02 per news-result page
Activate SequenceActivate an inactive Apollo sequence and begin its scheduled outreach.Needs your own keyBilled to your own Apollo key
Add Contacts to SequenceAdds contacts to a specified Apollo email sequence and returns the contact details.Needs your own keyBilled to your own Apollo key
Add People to ProspectsSave Apollo person IDs returned by APOLLO_PEOPLE_SEARCH as persistent prospect contacts.Needs your own keyBilled to your own Apollo key
Archive SequenceArchive an Apollo sequence, making it inactive and finishing all enrolled contacts.Needs your own keyBilled to your own Apollo key
Bulk update account stageBulk updates the stage for specified existing Apollo.io accounts, moving them to a valid new account stage.Needs your own keyBilled to your own Apollo key
Complete Apollo TaskRequests completion of an Apollo task and returns the resulting task state.Needs your own keyBilled to your own Apollo key
Create an Apollo accountCreates a new account in Apollo.io; a new record is created even if a similar account exists, and provided `owner_id` or `account_stage_id` must be valid existing IDs.Needs your own keyBilled to your own Apollo key
Bulk create Apollo accountsCreates multiple accounts in Apollo.io with a single API call (maximum 100 accounts per request).Needs your own keyBilled to your own Apollo key
Bulk create Apollo contactsTool to bulk create multiple contacts in Apollo with a single API call.Needs your own keyBilled to your own Apollo key
Create call record in ApolloTool to log call records in Apollo from external systems.Needs your own keyBilled to your own Apollo key
Create Apollo contactCreates a new contact in Apollo.io; use `account_id` to link to an organization and `contact_stage_id` for sales stage.Needs your own keyBilled to your own Apollo key
Show all 72 tools
More Apollo tools and their Instant prices
ToolWhat it doesWorks without a keyCost on Instant
Create custom fieldCreates a new custom field in Apollo.io for contacts, accounts, or opportunities.Needs your own keyBilled to your own Apollo key
Create Apollo dealCreates a new sales opportunity (deal) in Apollo.io; all provided IDs (`owner_id`, `account_id`, `opportunity_stage_id`) must be valid existing Apollo identifiers.Needs your own keyBilled to your own Apollo key
Create Email DraftCreate an unsent Apollo outreach draft, or return the existing draft already linked to outreach_task_id.Needs your own keyBilled to your own Apollo key
Create Apollo SequenceCreate an Apollo outreach sequence, optionally including steps and email variants.Needs your own keyBilled to your own Apollo key
Create Apollo Sequence StepCreate one step at a specified position in an existing Apollo outreach sequence.Needs your own keyBilled to your own Apollo key
Create Apollo TaskTool to create a single task in Apollo.io.Needs your own keyBilled to your own Apollo key
Deactivate SequenceDeactivate an active Apollo sequence.Needs your own keyBilled to your own Apollo key
Export ConversationsStart an asynchronous gzipped JSON conversation export and email a team member when it is ready.Needs your own keyBilled to your own Apollo key
Get Account by IDTool to retrieve detailed information about a specific account by its Apollo ID.Needs your own keyBilled to your own Apollo key
Check Apollo API key statusTool to check whether the provided Apollo API key is valid and accepted by Apollo (health/auth check).Needs your own keyBilled to your own Apollo key
Get Apollo ContactRetrieves detailed information about a specific contact by its ID.Needs your own keyBilled to your own Apollo key
Get ConversationRetrieve full Apollo conversation details, including transcript, participants, recordings, and opportunities.Needs your own keyBilled to your own Apollo key
Get Conversation ExportRetrieve the download redirect URL for a previously started Apollo conversation export.Needs your own keyBilled to your own Apollo key
Get Current User ProfileReturn the authenticated Apollo user's identity and optional credit balances.Needs your own keyBilled to your own Apollo key
Get Apollo dealRetrieves information about a specific deal by its ID.Needs your own keyBilled to your own Apollo key
Get Email ActivitiesRetrieves content, open and click activity, and recipient details for one Apollo sequence email.Needs your own keyBilled to your own Apollo key
Get Email ContentRetrieve content for up to 10 sent team outreach emails.Needs your own keyBilled to your own Apollo key
Get LabelsRetrieves all labels from Apollo.io, used for organizing contacts and accounts.Needs your own keyBilled to your own Apollo key
Get opportunity stagesRetrieves all configured opportunity (deal) stages from the Apollo.io account.Needs your own keyBilled to your own Apollo key
Get Apollo TaskRetrieves the full details of one Apollo task by ID, including associated records and type-specific data when present.Needs your own keyBilled to your own Apollo key
Get typed custom fieldsRetrieves all typed custom field definitions available in the Apollo.io instance, detailing their types and configurations.Needs your own keyBilled to your own Apollo key
Get Apollo UserRetrieve one teammate in the connected Apollo workspace by Apollo user ID.Needs your own keyBilled to your own Apollo key
List Apollo account stagesRetrieves the IDs for all available account stages in your team's Apollo account.Needs your own keyBilled to your own Apollo key
List apollo contact stagesRetrieves all available contact stages from an Apollo account, including their unique IDs and names.Needs your own keyBilled to your own Apollo key
List Apollo dealsRetrieves a list of deals from Apollo, using Apollo's default sort order if 'sort_by_field' is omitted.Needs your own keyBilled to your own Apollo key
List email accountsRetrieves all email accounts and their details for the authenticated user; takes no parameters.Needs your own keyBilled to your own Apollo key
List FieldsRetrieves all field definitions from Apollo.io, including system fields and custom fields.Needs your own keyBilled to your own Apollo key
List Apollo NotesList notes associated with Apollo records.Needs your own keyBilled to your own Apollo key
List Apollo UsersRetrieves a list of all users (teammates) associated with the Apollo account, supporting pagination via `page` and `per_page` parameters.Needs your own keyBilled to your own Apollo key
Query Analytics ReportQuery Apollo analytics metrics, dimensions, filters, and date ranges.Needs your own keyBilled to your own Apollo key
Search Apollo AccountsSearches for accounts within your existing Apollo.io database using various criteria; requires a paid plan and is limited to 50,000 records.Needs your own keyBilled to your own Apollo key
Search for CallsSearches for call records in Apollo.io using filters like date range, duration, direction (inbound/outgoing), users, contacts, purposes, outcomes, and keywords.Needs your own keyBilled to your own Apollo key
Search Apollo contactsSearches Apollo contacts using keywords, stage IDs (from 'List Contact Stages' action), or sorting (max 50,000 records; `sort_ascending` requires `sort_by_field`).Needs your own keyBilled to your own Apollo key
Search Apollo ConversationsSearch Apollo video meetings and dialer calls using record, participant, date, scorecard, sorting, and visibility filters.Needs your own keyBilled to your own Apollo key
Search outreach emailsTool to search for outreach emails sent through Apollo sequences.Needs your own keyBilled to your own Apollo key
Search sequencesSearch Apollo sequences, such as automated email campaigns, optionally filtering by full or partial name.Needs your own keyBilled to your own Apollo key
Search tasksSearches for tasks in Apollo.io using filters like keywords, date ranges (due, created, updated), priorities, types, assigned users, associated contacts/accounts, supporting sorting and pagination.Needs your own keyBilled to your own Apollo key
Send Email NowQueue an Apollo email for external sending; success means queued, not delivered.Needs your own keyBilled to your own Apollo key
Update an Apollo accountUpdates specified attributes of an existing account in Apollo.io.Needs your own keyBilled to your own Apollo key
Update account ownershipUpdates the ownership of multiple Apollo accounts to a specified user.Needs your own keyBilled to your own Apollo key
Update Apollo call recordTool to update an existing call record in Apollo.io.Needs your own keyBilled to your own Apollo key
Update Apollo contact detailsTool to update an existing contact's information in Apollo.Needs your own keyBilled to your own Apollo key
Update contact ownershipUpdates the ownership of specified Apollo contacts to a given Apollo user, who must be part of the same team.Needs your own keyBilled to your own Apollo key
Bulk update Apollo contactsTool to bulk update multiple Apollo contacts with a single API call.Needs your own keyBilled to your own Apollo key
Update contact stageUpdates the stage for one or more existing contacts in Apollo.io to a new valid contact stage, useful for managing sales funnel progression.Needs your own keyBilled to your own Apollo key
Update contact status in sequencePauses or marks a contact as finished in a designated Apollo sequence.Needs your own keyBilled to your own Apollo key
Update Apollo dealUpdates specified fields of an existing Apollo.io deal (opportunity), requiring a valid `opportunity_id`.Needs your own keyBilled to your own Apollo key
Update Apollo ListRename an Apollo list and optionally change its Book of Business status.Needs your own keyBilled to your own Apollo key
Update SequenceUpdate an Apollo sequence's settings, ownership, sharing, steps, and touches.Needs your own keyBilled to your own Apollo key
Update Apollo TaskUpdate editable details of an existing Apollo task.Needs your own keyBilled to your own Apollo key
View API Usage StatsFetches Apollo API usage statistics and rate limits for the connected team.Needs your own keyBilled to your own Apollo key
View Credit Usage StatsRead team balances by credit type for Apollo's current billing cycle.Needs your own keyBilled to your own Apollo key
Pricing

How you pay for Apollo

  • Your first $2 is freeIt's added to your Composio wallet when you turn on Instant.
  • You pay for each callYou pay Apollo's price with 0% markup, plus the regular Composio tool call charge.
  • Your own key comes firstIf you connect your own Apollo key, Composio uses it and doesn't charge Instant for those calls.
  • You control the costYou can ask your agent to check with you before each paid call, and you can turn Instant off at any time.
  • You can see each callYour wallet shows each call and what it cost.
  • When your balance runs outYou can add funds to your wallet on a Pro plan or connect your own key.
Help

Troubleshooting

  1. 1. Claude Agent SDK asks me for a Apollo API key

    You may have asked for something that needs your own key, like Activate Sequence, Add Contacts to Sequence, Add People to Prospects, Archive Sequence, Bulk update account stage, Complete Apollo Task and 57 more. Those tools don't run on Instant. For everything else, check that Instant is turned on in your Composio wallet, then ask again.

  2. 2. I can't see my free $2

    Open your wallet in the Composio dashboard and check that Instant is turned on. If the $2 still isn't there, email support@composio.dev from the address you signed up with.

  3. 3. A Apollo call failed with a balance error

    Your balance is empty. Add funds to your wallet on a Pro plan, or connect your own Apollo key, then try again.

FAQ

Frequently asked questions

Start with Apollo.It takes 30 seconds.

New accounts get a one-time $2 starter credit for Instant calls.Run Apollo from your agent with no Apollo key.

Get $2 starter credit