API Keys Setup Guide
October 3, 2025 ยท View on GitHub
This guide provides detailed instructions on how to obtain API keys for all LLM providers and tools used in AgentFlow.
1. OpenAI API Key
Purpose: Access OpenAI's language models (GPT-5, GPT-4o, etc.), used in AgentFlow for judging answer correctness.
How to obtain:
- Visit OpenAI Platform
- Sign up/Log in to your account
- Navigate to API Keys page
- Click "Create new secret key" to generate a new API key
Available models: OpenAI Models Documentation
Common model names: gpt-4o,gpt-4o-mini, gpt-4-turbo, gpt-3.5-turbo
2. Google API Key
Purpose: used in AgentFlow for Google Search tool.
How to obtain:
- Visit Google AI Studio
- Log in with your Google account
- Click "Get API key"
- Create or select a Google Cloud project
- Copy the generated API key
3. DashScope API Key (Alibaba Cloud)
Purpose: Access Alibaba Cloud's Qwen (Tongyi Qianwen) model series. In AgentFlow, we use DashScope to call Qwen-2.5-7B-Instruct as the LLM engine for agents (except planner) and tools.
How to obtain:
- Visit Alibaba Cloud DashScope Console
- Log in with your Alibaba Cloud account
- Navigate to API-KEY Management
- Create a new API key
Official guide: Get API Key (you may need to translate the page to English using your browser's translation feature)
Available models: DashScope Model Documentation
Common model names: qwen-turbo, qwen-plus, qwen-max, qwen2.5-7b-instruct, qwen2.5-72b-instruct
Note: For international users, we recommend using Together AI to access Qwen-2.5-7B-Instruct model. Alternatively, you can serve the model locally using vLLM.
4. Together API Key - Recommended for More International Users
Purpose: Access open-source models on TogetherAI platform, including Qwen, Llama, Mixtral, etc.
Recommended for: International users who want to access Qwen-2.5-7B-Instruct and other open-source models with better global network connectivity.
How to obtain:
- Visit Together.ai
- Sign up/Log in to your account
- Navigate to Settings > API Keys
- Create a new API key
Available models: Together Models Documentation
Common model names:
- Qwen models:
Qwen/Qwen2.5-7B-Instruct,Qwen/Qwen2.5-72B-Instruct - Other models:
meta-llama/Llama-3-70b-chat-hf,mistralai/Mixtral-8x7B-Instruct-v0.1
Important Note for Qwen Models: Together AI offers both Turbo (quantized) and standard (non-quantized) versions of Qwen models. For best performance and accuracy, we recommend using the non-quantized versions (e.g.,
Qwen/Qwen2.5-7B-Instructinstead ofQwen/Qwen2.5-7B-Instruct-Turbo). The Turbo versions are faster but may have reduced quality due to quantization.
Important Notes
- Security: All API keys are sensitive information - never expose them or commit to public repositories
- Costs: Most API services are paid - understand pricing before use
- Quotas: Some services have free tiers or rate limits - monitor your usage
- Environment Variables: Copy
.env.templateto.envand fill in your actual API keys - Regional Recommendations:
- China users: Use DashScope for Qwen models
- International users: Use Together AI for Qwen models
Quick Reference Table
| API Key | Purpose | Sign Up Link | Documentation |
|---|---|---|---|
| OPENAI_API_KEY | OpenAI GPT models | platform.openai.com | Docs |
| GOOGLE_API_KEY | Gemini models | aistudio.google.com | Docs |
| DASHSCOPE_API_KEY | Qwen models | dashscope.console.aliyun.com | Docs |
| TOGETHER_API_KEY | Qwen & open-source models | together.ai | Docs |