> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-codex-docs-audit-20260719-0149.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI Key Request While Using Other Models

> Identify whether the default agent model or a vector database embedder is requesting OPENAI_API_KEY.

If you see a request for an OpenAI API key but haven't configured OpenAI, check these defaults:

* The default model when `Agent` has no `model` set
* The default `OpenAIEmbedder` used by many vector database implementations

Vector database defaults vary. `PgVector` creates an `OpenAIEmbedder` when `embedder` is omitted. `UpstashVectorDb` uses Upstash hosted embeddings instead.

## Quick fix: Configure a Different Model

Specify the model explicitly. Without one, the agent defaults to `OpenAIResponses` with `gpt-5.4`, which requires `OPENAI_API_KEY`.

For example, to use Google's Gemini instead of OpenAI:

```python theme={null}
from agno.agent import Agent
from agno.models.google import Gemini

agent = Agent(
    model=Gemini(id="gemini-3.5-flash"),
    markdown=True,
)

# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story.")
```

See [Models](/models/overview) for the full provider list.

## Quick fix: Configure the Vector Database Embedder

If your vector database defaults to `OpenAIEmbedder`, pass a different embedder explicitly.

For example, to use Google's Gemini as an embedder, use `GeminiEmbedder`:

```python theme={null}
from agno.knowledge.knowledge import Knowledge
from agno.vectordb.pgvector import PgVector
from agno.knowledge.embedder.google import GeminiEmbedder

# Embed a sentence
embeddings = GeminiEmbedder().get_embedding("The quick brown fox jumps over the lazy dog.")

# Print the embeddings and their dimensions
print(f"Embeddings: {embeddings[:5]}")
print(f"Dimensions: {len(embeddings)}")

# Use an embedder in a knowledge base
knowledge = Knowledge(
    vector_db=PgVector(
        db_url="postgresql+psycopg://ai:ai@localhost:5532/ai",
        table_name="gemini_embeddings",
        embedder=GeminiEmbedder(),
    ),
    max_results=2,
)
```

See [Embedders](/knowledge/concepts/embedder/overview) for the available options.
