> For the complete documentation index, see [llms.txt](https://ai-agent-sdk-docs.crypto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai-agent-sdk-docs.crypto.com/outdated-contents/using-crypto.com-ai-agent-with-gemini.md).

# Using Crypto.com AI Agent with Gemini

A guide to using the Crypto.com AI Agent with Google's Gemini model for blockchain interactions.

### Quick Start

#### 1. Setup

Start by cloning the repository and navigating to the appropriate directory, and install the dependencies:

```bash
# Clone the repository
git clone git@github.com:crypto-com/developer-platform-sdk-examples.git
cd developer-platform-sdk-examples/ai/cryptocom-ai-agent-pychatbot

# Install dependencies
pip install -r requirements.txt
```

<figure><img src="https://524814724-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FktUMyU5bBece2vVjrTg7%2Fuploads%2FGmftVg48CWfZo0oASonB%2FScreenshot%202025-01-14%20at%201.19.39%E2%80%AFPM.png?alt=media&amp;token=d793a3be-5b14-4bff-b318-811e3661cc98" alt=""><figcaption></figcaption></figure>

#### 2. Configure API Keys

Direct to `Env`and set up the following API keys in your environment:

* `OPENAI_API_KEY` - For OpenAI functionality
* `GOOGLE_API_KEY` - For Gemini functionality
* `GOOGLE_PROJECT_ID`  - For Gemini functionality&#x20;

#### 3. Launch the Chat

```bash
python chat.py
```

<figure><img src="https://524814724-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FktUMyU5bBece2vVjrTg7%2Fuploads%2Fr1o5RelHZrJBOL2Ml4UD%2FScreenshot%202025-01-14%20at%201.54.16%E2%80%AFPM.png?alt=media&amp;token=e9227c49-b0a8-4690-ab16-62319f03db60" alt=""><figcaption></figcaption></figure>

When prompted, select `gemini` as your AI provider. <br>

### API Examples

#### Query Latest Block using Gemini

```bash
curl -X POST http://localhost:8000/api/v1/cdc-ai-agent-service/query \
-H "Content-Type: application/json" \
-d '{
  "query": "get latest block",
  "options": {
    "gemini": {
      "apiKey": "YOUR_GOOGLE_API_KEY"
    },
    "llmProvider": "gemini",    
    "context": []
  }
}'
```

#### Query Latest Block using OpenAI

```bash
curl -X POST http://localhost:8000/api/v1/cdc-ai-agent-service/query \
-H "Content-Type: application/json" \
-d '{
  "query": "get latest block",
  "options": {
    "openAI": {
      "apiKey": "YOUR_OPENAI_API_KEY"
    },
    "llmProvider": "openai",
    "context": []
  }
}'
```
