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

# Gemini

<Info>
  Before building an agent that uses a Gemini model, you'll need to create an
  [Google AI Studio account](https://aistudio.google.com/) and get an API key.
</Info>

## Configuration

<ParamField path="name" type="GeminiModel">
  The name of the [Gemini model](https://ai.google.dev/gemini-api/docs/models) you want your agent to use.
  By default, your agent will use `gemini-2.0-flash`.
</ParamField>

<ParamField path="secret" type="string">
  The name of the secret which contains your Gemini API key. **NOTE:** This is the *name* of the secret,
  not your actual secret key!
</ParamField>

## Creating the Model

Calling `gemini()` with no arguments will use all default values:

```ts theme={null}
import { Agent, gemini } from '@ardent-ai/sdk';

const agent = new Agent({
  model: gemini()
});
```

Passing a single `string` argument will set the model `name`:

```ts theme={null}
import { Agent, gemini } from '@ardent-ai/sdk';

const agent = new Agent({
  model: gemini('gemini-2.5-flash-preview-05-20')
});
```

Or, you can set every parameter by passing a configuration object:

```ts theme={null}
import { Agent, gemini } from '@ardent-ai/sdk';

const agent = new Agent({
  model: gemini({
    name: 'gemini-2.5-flash-preview-05-20',
    secret: 'MY_CUSTOM_GEMINI_SECRET_NAME'
  })
});
```
