Common Error Symptoms
When you see error messages like this:What is Base URL?
Base URL (Base URL / Request Address) is the target server address for API requests. Different API service providers use different Base URLs.Base URL and API Key Must Match
| Service Provider | Base URL | API Key Format | Match? |
|---|---|---|---|
| API易 | https://api.apiyi.com | sk-xxxx...... | ✅ Correct |
| OpenAI Official | https://api.openai.com | sk-xxxx...... | ✅ Correct |
| ❌ API易 Key | https://api.openai.com | sk-xxxx...... | ❌ Wrong |
| ❌ OpenAI Key | https://api.apiyi.com | sk-xxxx...... | ❌ Wrong |
Key Principle: Use the Base URL that matches your API Key provider.
Correct Configuration
Method 1: Modify Base URL (Recommended)
Simply replace the OpenAI endpoint with API易’s, keep everything else unchanged:Method 2: Use Environment Variables
Set environment variables so you don’t need to specify Base URL in code:Supported Base URL Formats
API易 supports three Base URL formats depending on your code:- Format 1: With /v1 (Recommended)
- Format 2: With /v1/ (Trailing Slash)
- Format 3: Full Path
Troubleshooting
I've confirmed Base URL is correct but still getting errors
I've confirmed Base URL is correct but still getting errors
Possible Causes:
- Multiple configuration points: Check if Base URL is set in config files, environment variables, code initialization, etc.
- Proxy or middleware: Some proxy tools may redirect requests
- Cache issues: Restart the program or clear cache and retry
- Typo: Verify
apiyiis spelled correctly (notapiyiiorapiyl)
How to verify if my Key is valid?
How to verify if my Key is valid?
Check in API易 dashboard:
- Login to API易 dashboard
console.apiyi.com - Go to “Tokens” page
- Check if Key status is “Enabled”
- Confirm account has sufficient balance
How to configure third-party tools (like ChatBox, OpenCat)?
How to configure third-party tools (like ChatBox, OpenCat)?
Most third-party tools have “Custom API” or “Self-hosted Server” options:
- API Address / Base URL:
https://api.apiyi.com/v1 - API Key: Copy your Key from API易 dashboard
- Model Name: Refer to model list in API易 documentation
Where can I find code examples?
Where can I find code examples?
API易 provides complete code examples in multiple languages:
- Quick Start Documentation: Homepage → Code Examples
- Online Testing Tool: Dashboard → ApiFox Online Testing
- GitHub Repository:
github.com/apiyi/docs→ knowledge-base directory
Wrong vs Correct Examples
❌ Wrong Configuration
✅ Correct Configuration
Quick Test Method
Use cURL command to quickly verify your configuration:- API Key copied correctly (watch for leading/trailing spaces)
- Network connection is working
- Account has sufficient balance