Quickstart
Complete your first API call in 5 minutes and start using aiapi.services powerful AI capabilities.
Step 1: Get Your API Key
- Visit aiapi.services Dashboard
- Sign up or log in to your account
- Navigate to “API Keys” and click “Create New Key”
- Copy your API key (format:
sk-...)
⚠️ Protect Your API Key: Never expose your API key in client-side code or public repositories. Store it in environment variables or secure configuration files.
Step 2: Make Your First Request
cURL
curl https://aiapi.services/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash",
"messages": [
{
"role": "user",
"content": "Hello! Please introduce yourself."
}
]
}'Step 3: Understand the Response
A successful request will return the following JSON response:
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"model": "gemini-2.5-flash",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm an AI assistant, pleased to help you. I can answer questions, provide information, and assist with various tasks. How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 28,
"total_tokens": 40
}
}Key Fields:
choices[0].message.content- The AI-generated responseusage.total_tokens- Total tokens consumed by this requestfinish_reason- Why generation stopped (stopmeans normal completion)
🎯 Next Steps
Explore More Features
Important Resources
- Available Models - View all supported AI models and pricing
- Error Handling - Learn how to handle API errors
- Rate Limits - Understand API usage limits
- Security Best Practices - Protect your API keys and data
💡 Common Questions
How do I get free credits?
New users receive free trial credits upon registration. Visit the Dashboard to check your current balance.
Which models are supported?
We support multiple leading AI models:
- Chat: Gemini 2.5 Flash/Pro, GPT-4, Claude, etc.
- Image: Imagen 4.0, DALL-E 3, Stable Diffusion, etc.
- Video: Veo 3.0, etc.
- Audio: Lyria, Text-to-Speech, etc.
See the Available Models page for the complete list.
How does billing work?
We charge based on usage, with different pricing for different models. See the Pricing page for details.
What if I encounter an error?
- Verify your API key is correct
- Ensure request format matches documentation
- Check the Error Handling docs for common errors
- If issues persist, contact technical support
🔐 Security Tips
Never expose API keys in client-side code!
If you’re using the API in a browser, proxy requests through your own backend server instead of calling directly from the frontend.
Recommended Approach:
// ❌ Don't do this (direct frontend call)
fetch('https://aiapi.services/v1/chat/completions', {
headers: {
'Authorization': 'Bearer sk-your-secret-key' // Key exposed!
}
})
// ✅ Correct approach (proxy through backend)
fetch('/api/chat', { // Call your own backend
method: 'POST',
body: JSON.stringify({ message: 'Hello' })
})For more security recommendations, see the Security Best Practices documentation.
🎉 Congratulations! You’ve completed the quickstart tutorial. Now you can start building your AI applications!