# compare-gpt-vs-claude-vs-gemini (GPT vs Claude vs Gemini Comparison) This example compares OpenAI's GPT-5.4, Anthropic's Claude Sonnet 4.6, and Google's Gemini 3.1 Pro Preview on riddle-solving tasks with cost, latency, and quality assertions. You can run this example with: ```bash npx promptfoo@latest init --example compare-gpt-vs-claude-vs-gemini cd compare-gpt-vs-claude-vs-gemini ``` See the [guide](https://www.promptfoo.dev/docs/guides/gpt-vs-claude-vs-gemini/) for more details. ## Setup Set the required environment variables: ```sh export OPENAI_API_KEY=your-openai-key export ANTHROPIC_API_KEY=your-anthropic-key export GOOGLE_API_KEY=your-google-key ``` ## Run ```sh npx promptfoo@latest eval ``` ## View ```sh npx promptfoo@latest view ```