Overview
FoxAPI provides a unified API gateway compatible with OpenAI standards. You can integrate with any AI model through a single API key and base URL.
Base URL: https://api.foxapi.cc
Step 1: Get Your API Key
- Log in to the FoxAPI Dashboard
- Navigate to API Keys section
- Click “Create New Key”
- Copy the generated key (starts with
sk-)
Keep your API key secure. Never expose it in client-side code or public repositories.
Step 2: Make Your First Request
curl --request POST \
--url https://api.foxapi.cc/v1/images/generations \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "gemini-3.1-flash-image-preview",
"prompt": "A cat playing in the grass"
}'
import requests
response = requests.post(
"https://api.foxapi.cc/v1/images/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"model": "gemini-3.1-flash-image-preview",
"prompt": "A cat playing in the grass"
}
)
result = response.json()
task_id = result["id"]
print(f"Task created: {task_id}")
const response = await fetch('https://api.foxapi.cc/v1/images/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'gemini-3.1-flash-image-preview',
prompt: 'A cat playing in the grass'
})
});
const result = await response.json();
console.log('Task created:', result.id);
Step 3: Query Task Result
Most generation APIs use asynchronous processing. Use the returned task ID to check the result:
curl --request GET \
--url https://api.foxapi.cc/v1/tasks/YOUR_TASK_ID \
--header 'Authorization: Bearer YOUR_API_KEY'
When status changes to completed, the output field will contain your generated content.
Step 4: Use with Text Models
FoxAPI is fully compatible with OpenAI’s Chat Completions API:
curl --request POST \
--url https://api.foxapi.cc/v1/chat/completions \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "claude-sonnet-4-6",
"messages": [
{"role": "user", "content": "Hello, who are you?"}
]
}'
Authentication
All APIs require Bearer Token authentication. Add this header to every request:
Authorization: Bearer YOUR_API_KEY
What’s Next?
API Manual
Explore all available API endpoints
Integration Guide
Connect Claude Code CLI and other tools