# Choose an agent and model

The AI agent is the provider TestVibe uses to generate feature drafts or Playwright code.

Most users should keep the default agent and model selected by the project. Change them when your team has a provider preference, key availability requirement, or quality/cost reason.

## Where Agent Settings Appear

You may see agent selection during:

| Place                          | What it controls                                          |
| ------------------------------ | --------------------------------------------------------- |
| Project or repository settings | The default agent for the repository.                     |
| Project setup                  | The first agent and API key used when creating a project. |
| Generation options             | Per-generation choices when TestVibe asks for them.       |

If you do not see agent options, your workspace may be using the repository default.

## What To Consider

| Choice         | Why it matters                                                           |
| -------------- | ------------------------------------------------------------------------ |
| Agent          | Selects the AI provider used for generation.                             |
| Model          | Controls the model used by that provider, when configurable.             |
| API key        | Some agents require a repository secret before generation can run.       |
| Quality        | Stronger models may handle complex flows or unclear instructions better. |
| Speed and cost | Your team may prefer faster or lower-cost generation for routine tests.  |

## API Keys

Some agents require a provider key stored as a GitHub Actions secret.

Common examples:

| Agent family        | Typical secret      |
| ------------------- | ------------------- |
| OpenAI or Codex     | `OPENAI_API_KEY`    |
| Anthropic or Claude | `ANTHROPIC_API_KEY` |

TestVibe stores entered keys as repository secrets and does not show them back in plain text after saving.

For setup help, see [Add API keys and secrets](/workspace/add-api-keys-and-secrets.md).

## When To Keep Defaults

Keep the default agent when:

* you are doing the quickstart
* your team already configured the repository
* generation is producing acceptable output
* you are unsure which provider to choose
* you want consistent results across the team

## When To Change

Consider changing the agent or model when:

| Situation                                      | Why change                                                |
| ---------------------------------------------- | --------------------------------------------------------- |
| Output quality is weak                         | A stronger model may understand the flow better.          |
| Your provider key is missing                   | Choose an agent your team has configured.                 |
| Generation is slow or expensive                | A different model may be more practical for routine work. |
| Your organization standardizes on one provider | Use the approved provider and secret.                     |

## After Changing

Run a small generation first. Compare the output against the same expectations:

* Does it follow the Gherkin?
* Does it use the correct UI?
* Does it include real assertions?
* Does it generate code your team can review?

If the agent works well, keep it as the repository default.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.testvibe.com/ai-generation/choose-agent-and-model.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
