> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sambanova.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Composio integration guide

[Composio](https://composio.dev/) is a developer-oriented integration platform for AI agents and large language model (LLM) applications. It acts as a bridge between AI systems and real-world tools and services (like Slack, GitHub, Gmail, CRMs, and productivity apps), enabling agents to authenticate and interact across apps without building every integration yourself. This guide walks you through setting up the Composio integration with SambaNova's LLMs to connect your AI agents to real-world tools and services.

<Warning>
  The example in the integrations repository pins `composio-crewai==0.7.19`, which calls Composio's retired v1 API. Composio now serves v3, so the example fails with `HTTP 410` at the point where it connects your GitHub account, even with valid API keys. Read [Troubleshooting](#troubleshooting) before you install. Steps 1 through 5 below still verify your SambaNova key, model access, and environment, and the connection check in step 5 succeeds independently of Composio.
</Warning>

## Prerequisites

Before starting, ensure you have:

* A [SambaCloud](https://cloud.sambanova.ai?utm_source=composio\&utm_medium=external\&utm_campaign=cloud_signup) account and API key
* A [Composio](https://composio.dev/) account and API key
* A [SerpAPI](https://serpapi.com/) account. The example agent calls SerpAPI for web search through Composio, and `.env.example` in the repository includes `SERPAPI_API_KEY`.
* A GitHub account. The example connects to GitHub through Composio on first run.
* `git` installed on your system
* Python 3.10 to 3.13. The pinned `crewai` release does not support Python 3.9 or earlier, or Python 3.14 or later.

<Note>
  macOS ships with Python 3.9, which is below the required floor, and exposes it as `python3` rather than `python`. Check your version with `python3 --version`. If it is below 3.10, install a supported version with [pyenv](https://github.com/pyenv/pyenv), [uv](https://docs.astral.sh/uv/), or `brew install python@3.12` before continuing.
</Note>

## Installation and setup

Follow the steps below to clone the repository, set up your environment, and run the example:

<Steps>
  <Step title="Clone the repository">
    ```bash theme={}
    git clone https://github.com/sambanova/integrations.git
    cd integrations/composio
    ```
  </Step>

  <Step title="Create a virtual environment">
    ```bash theme={}
    python3 -m venv .venv
    source .venv/bin/activate
    ```

    Confirm the environment uses a supported version before installing:

    ```bash theme={}
    python --version
    ```
  </Step>

  <Step title="Install dependencies">
    ```bash theme={}
    pip install -r requirements.txt
    ```

    `requirements.txt` pins every dependency, so the install is reproducible:

    ```text theme={}
    composio-crewai==0.7.19
    composio-openai==0.7.19
    crewai==0.130.0
    openai==1.91.0
    ```

    The `crewai==0.130.0` pin is what sets the Python 3.10 to 3.13 range. `crewai` also supplies `python-dotenv`, which `main.py` imports to read your `.env` file.
  </Step>

  <Step title="Set environment variables">
    Create a `.env` file in the project directory:

    ```bash theme={}
    SAMBANOVA_API_KEY=your-sambanova-api-key
    COMPOSIO_API_KEY=your-composio-api-key
    SERPAPI_API_KEY=your-serpapi-api-key
    ```

    Or export directly in your terminal:

    ```bash theme={}
    export SAMBANOVA_API_KEY=your-sambanova-api-key
    export COMPOSIO_API_KEY=your-composio-api-key
    export SERPAPI_API_KEY=your-serpapi-api-key
    ```

    Get your SambaNova API key from the [SambaCloud portal](https://cloud.sambanova.ai/apis), your Composio API key from the [Composio dashboard](https://app.composio.dev/), and your SerpAPI key from the [SerpAPI dashboard](https://serpapi.com/manage-api-key).
  </Step>

  <Step title="Verify your SambaNova connection">
    Before you involve Composio, confirm that your SambaNova key and model access work. Save the following as `check_sambanova.py` in the project directory and run it. It uses the `openai==1.91.0` client that `requirements.txt` already installed.

    ```python check_sambanova.py theme={}
    import os

    from openai import OpenAI

    client = OpenAI(
        base_url="https://api.sambanova.ai/v1",
        api_key=os.environ["SAMBANOVA_API_KEY"],
    )

    completion = client.chat.completions.create(
        model="Meta-Llama-3.3-70B-Instruct",
        messages=[{"role": "user", "content": "Reply with the single word: connected"}],
    )

    print(completion.choices[0].message.content)
    ```

    ```bash theme={}
    python check_sambanova.py
    ```

    A working key and model print a one-word answer:

    ```text theme={}
    connected
    ```

    If this step fails, the problem is your SambaNova key, base URL, or model ID, not Composio. See [API keys and URLs](/docs/en/get-started/api-keys-urls) and the [SambaCloud models](/docs/en/models/sambacloud-models) page.
  </Step>

  <Step title="Run the example">
    ```bash theme={}
    python main.py
    ```

    The example builds a CrewAI agent that uses SerpAPI to search the web for information about SambaNova and its RDU chip. It calls the model through CrewAI's LiteLLM layer, so `main.py` names the model with a provider prefix:

    ```python theme={}
    llm = LLM(model='sambanova/Meta-Llama-3.3-70B-Instruct', api_key=os.getenv('SAMBANOVA_API_KEY'))
    ```

    Keep the `sambanova/` prefix when you swap in another model ID from the [SambaCloud models](/docs/en/models/sambacloud-models) page. The prefix is what routes the request to SambaNova, and it is only used in this CrewAI form, not in the direct client call shown in the previous step.

    On the first run, the script prints a GitHub authorization URL and waits:

    ```text theme={}
    Open this URL to authenticate: https://backend.composio.dev/api/v1/auth-apps/add?...
    ```

    Open the URL in a browser and approve the connection. The agent then runs and prints its reasoning steps followed by the final answer.

    <Note>
      This is the step that currently fails with `HTTP 410`, because the pinned `composio-crewai` release requests Composio's retired v1 API. See [Troubleshooting](#troubleshooting).
    </Note>
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="command not found: python">
    macOS does not provide a `python` executable, only `python3`. Use `python3 -m venv .venv` to create the environment. After you activate it with `source .venv/bin/activate`, `python` works as expected inside the environment.
  </Accordion>

  <Accordion title="ERROR: Could not find a version that satisfies the requirement crewai==0.130.0">
    Your Python version is outside the supported range. `pip` reports this as a long list of "Ignored the following versions that require a different python version" before the final error. Run `python --version` inside the activated environment. If it is not 3.10 to 3.13, delete `.venv`, install a supported Python, and recreate the environment.
  </Accordion>

  <Accordion title="composio.exceptions.ApiKeyError: Unexpected error: HTTP 410">
    The pinned `composio-crewai` release calls Composio's v1 API, which has been retired. The endpoint returns `This endpoint is no longer available. Please upgrade to v3 APIs.` for every request, valid API key or not. The example cannot complete until the [integrations repository](https://github.com/sambanova/integrations/tree/main/composio) upgrades to a Composio SDK that targets v3.
  </Accordion>

  <Accordion title="composio.exceptions.ApiKeyNotProvidedError">
    `COMPOSIO_API_KEY` is not set. The script reads it when it constructs the toolset, before it contacts SambaNova, so this is the first failure you hit if you skip the environment step. The traceback is long; the actionable message is the last line.
  </Accordion>
</AccordionGroup>

## Additional resources

* [SambaCloud models](/docs/en/models/sambacloud-models) - model IDs you can use with this integration
* [API keys and URLs](/docs/en/get-started/api-keys-urls) - generate a key and find your base URL
* [CrewAI integration guide](/docs/en/integrations/crew-ai) - build CrewAI agents on SambaNova without Composio
* [Composio documentation](https://docs.composio.dev/docs/welcome)
* [SambaNova integrations repository](https://github.com/sambanova/integrations/tree/main/composio)
