Test Your First Call
Make your first API request to Fusion AI and see NeuroSwitch intelligent routing in action. Get up and running in under 2 minutes.
Prerequisites
You have your Fusion AI API key from the quickstart guide
Option 1: cURL (Quick Test)
curl -X POST https://api.mcp4.ai/chat \ -H "Authorization: Bearer sk-fusion-your-api-key-here" \ -H "Content-Type: application/json" \ -d '{ "prompt": "Explain quantum computing in simple terms", "provider": "neuroswitch", "max_tokens": 150 }'
Important: Replace sk-fusion-your-api-key-here
with your actual API key.
Expected Response
{ "response": "Quantum computing is like having a super-powered calculator that can explore many solutions simultaneously...", "provider_used": "claude-3-opus", "routing_reason": "Educational content - Claude excels at clear explanations", "tokens_used": 142, "cost": 0.00213, "request_id": "req_abc123", "timestamp": "2024-01-15T10:30:00Z" }
NeuroSwitch Decision
See exactly why this model was chosen
Real-time Costs
Transparent token and cost tracking
Provider Info
Know which model handled your request
Option 2: JavaScript/Node.js
const response = await fetch('https://api.mcp4.ai/chat', { method: 'POST', headers: { 'Authorization': 'Bearer sk-fusion-your-api-key-here', 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt: 'Write a Python function to calculate fibonacci numbers', provider: 'neuroswitch', max_tokens: 200 }) }); const data = await response.json(); console.log('AI Response:', data.response); console.log('Model Used:', data.provider_used); console.log('Cost:', data.cost);
Option 3: Python
import requests response = requests.post( 'https://api.mcp4.ai/chat', headers={ 'Authorization': 'Bearer sk-fusion-your-api-key-here', 'Content-Type': 'application/json' }, json={ 'prompt': 'Analyze this data and provide insights', 'provider': 'neuroswitch', 'max_tokens': 300 } ) data = response.json() print(f"AI Response: {data['response']}") print(f"Model Used: {data['provider_used']}") print(f"Tokens Used: {data['tokens_used']}") print(f"Cost: $\{data['cost']}")
Try Different Providers
Test how different providers handle the same prompt. Change the provider
parameter:
Let NeuroSwitch Choose
"provider": "neuroswitch"
Automatically selects the best model for your prompt
Specific Providers
"provider": "openai"
"provider": "claude"
"provider": "gemini"
Common Parameters
Required Parameters
prompt
Your message or question to the AI
provider
Which AI provider to use (or "neuroswitch")
Optional Parameters
max_tokens
Maximum response length (default: 1000)
temperature
Response creativity (0.0-1.0, default: 0.7)
stream
Enable streaming responses (true/false)
Common Issues
❌ "Unauthorized" Error
Check that your API key is correct and includes the sk-fusion-
prefix.
❌ "Invalid JSON" Error
Ensure your request body is valid JSON and includes the Content-Type: application/json
header.
❌ Slow Response
First requests may take 2-3 seconds as models "warm up." Subsequent requests are typically sub-second.
Great! What's Next?
You've successfully made your first API call. Now explore more advanced features and integrations.