# OpenAI Key Request While Using Other Models (/faq/openai-key-request-for-other-models)



If you see a request for an OpenAI API key but haven't configured OpenAI, it's because Agno uses OpenAI by default in two places:

* The default model when `Agent` has no `model` set
* The default embedder (`OpenAIEmbedder`) for vector databases

## Quick fix: Configure a Different Model [#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`.

Install the Google dependencies and set its API key:

```bash
uv pip install "agno[google,postgres,pgvector]"
export GOOGLE_API_KEY="your-google-api-key"
```

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

```python
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 a Different Embedder [#quick-fix-configure-a-different-embedder]

The same applies to embeddings. To use an embedder other than `OpenAIEmbedder`, configure it explicitly.

For example, use `GeminiEmbedder` with the same `GOOGLE_API_KEY`. The Knowledge example also needs a reachable PostgreSQL database at the shown URL with pgvector available:

```python
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.
