Quick Start¶
Get up and running with the ModuCompia AI API in under 2 minutes.
1. Get Your API Key¶
- Sign up or log in at ModuCompia AI
- Go to API Keys in the left sidebar
- Create a key — give it a name and, optionally, a quota limit
- Copy the generated key (starts with
sk-)
Keep your key safe
Your API key grants access to your account balance. Never share it publicly or commit it to version control. If you lose it, you can reveal it again from the API Keys page.
2. Make Your First Request¶
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'sk-YOUR_API_KEY',
baseURL: 'https://ai.moducompia.com/v1',
});
const response = await client.chat.completions.create({
model: 'gpt-4o',
messages: [
{ role: 'user', content: 'Hello! What can you do?' },
],
});
console.log(response.choices[0].message.content);
3. Explore¶
- Browse available models to find the right one for your use case
- Check your balance and usage in the dashboard
- Read the Chat Completions reference for advanced features (streaming, function calling, vision)
OpenAI SDK Compatibility¶
Our API is fully compatible with the official OpenAI SDK. To switch from OpenAI to ModuCompia AI, you only need to change two things:
| Parameter | OpenAI | ModuCompia AI |
|---|---|---|
base_url |
https://api.openai.com/v1 |
https://ai.moducompia.com/v1 |
api_key |
Your OpenAI key | Your ModuCompia AI key (sk-...) |
Everything else — models, parameters, response format — works exactly the same.