Guides de la plateforme
Quick start
Go from zero to a working MoLoop API request.
How MoLoop works
MoLoop exposes models from multiple providers through one gateway. Configure the API address and key once, then change the model name when you need a different model.
API requests and Console access are separate Console sign-in manages your account. Model requests use an API key you create. Do not use a sign-in token as a model key.
API address and key
| Setting | Value |
|---|---|
| BASE_URL | https://api.moloop.io/v1 |
| API_KEY | YOUR_API_KEY |
Register or sign in to MoLoop.
Open API Keys and create a key for the client you are configuring.
Open Models and pricing and copy an available model name.
Send the first request
Confirm the key and model name in the example; anonymous views show a placeholder. Keep the key only in a controlled environment.
bash
curl https://api.moloop.io/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"model":"YOUR_MODEL_ID","messages":[{"role":"user","content":"Hello"}]}'Use an SDK
Any SDK that accepts a custom OpenAI base URL can use the same configuration.
python
from openai import OpenAI
client = OpenAI(base_url="https://api.moloop.io/v1", api_key="YOUR_API_KEY")
response = client.chat.completions.create(
model="YOUR_MODEL_ID",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)javascript
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.moloop.io/v1",
apiKey: "YOUR_API_KEY",
});
const response = await client.chat.completions.create({
model: "YOUR_MODEL_ID",
messages: [{ role: "user", content: "Hello" }],
});