Skip to content

Quick Start

Get up and running with the ModuCompia AI API in under 2 minutes.

1. Get Your API Key

  1. Sign up or log in at ModuCompia AI
  2. Go to API Keys in the left sidebar
  3. Create a key — give it a name and, optionally, a quota limit
  4. 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

curl https://ai.moducompia.com/v1/chat/completions \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {"role": "user", "content": "Hello! What can you do?"}
    ]
  }'
from openai import OpenAI

client = OpenAI(
    api_key="sk-YOUR_API_KEY",
    base_url="%%BASE_URL%%/v1"
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "user", "content": "Hello! What can you do?"}
    ]
)

print(response.choices[0].message.content)
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

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.