Skip to Content
EnglishQuick Start

Quickstart

Complete your first API call in 5 minutes and start using aiapi.services powerful AI capabilities.

Step 1: Get Your API Key

  1. Visit aiapi.services Dashboard 
  2. Sign up or log in to your account
  3. Navigate to “API Keys” and click “Create New Key”
  4. 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 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 response
  • usage.total_tokens - Total tokens consumed by this request
  • finish_reason - Why generation stopped (stop means normal completion)

🎯 Next Steps

Explore More Features

🖼️

Image Generation

Create high-quality images with Imagen models

View Docs →
🎬

Video Generation

Generate video content with Veo models

View Docs →
🎵

Audio Generation

Text-to-speech and music generation

View Docs →
🔢

Embeddings

Text vectorization for semantic search

View Docs →

Important Resources


💡 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?

  1. Verify your API key is correct
  2. Ensure request format matches documentation
  3. Check the Error Handling docs for common errors
  4. 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!

Last updated on