Skip to main content

Common Error Symptoms

When you see error messages like this:
This usually means NOT that your API Key is wrong, but that the Base URL is misconfigured.
Most Common Mistake: Using APIYI’s Key but sending requests to OpenAI’s official endpoint https://api.openai.com

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

Key Principle: Use the Base URL that matches your API Key provider.

Correct Configuration

Simply replace the OpenAI endpoint with APIYI’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

APIYI supports three Base URL formats depending on your code:

Troubleshooting

Possible Causes:
  1. Multiple configuration points: Check if Base URL is set in config files, environment variables, code initialization, etc.
  2. Proxy or middleware: Some proxy tools may redirect requests
  3. Cache issues: Restart the program or clear cache and retry
  4. Typo: Verify apiyi is spelled correctly (not apiyii or apiyl)
Check in APIYI dashboard:
  1. Login to APIYI dashboard console.apiyi.com
  2. Go to “Tokens” page
  3. Check if Key status is “Enabled”
  4. Confirm account has sufficient balance
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 APIYI dashboard
  • Model Name: Refer to model list in APIYI documentation
Configuration options are usually found in “Settings” → “API” or “Server” sections
APIYI provides complete code examples in multiple languages:
  1. Quick Start Documentation: Homepage → Code Examples
  2. Online Testing Tool: Dashboard → ApiFox Online Testing
  3. GitHub Repository: github.com/apiyi/docs → knowledge-base directory

Wrong vs Correct Examples

❌ Wrong Configuration

Result: OpenAI server will reject APIYI’s Key

✅ Correct Configuration

Result: Request successfully sent to APIYI server

Quick Test Method

Use cURL command to quickly verify your configuration:
Expected Result: Returns list of available models
If you get an error, check:
  1. API Key copied correctly (watch for leading/trailing spaces)
  2. Network connection is working
  3. Account has sufficient balance
Remember the core principle: Match the URL to the Key provider. APIYI’s Key uses https://api.apiyi.com/v1