- Developer home
- AI API quick start
AI API quick start
Make a key, set the base URL and send your first request to every model, billed in credits after your free allowance.
1. Make a key
- Open the developer platformSign in, open your account menu and choose Developer platform, then AI API. Keys come with Plus.
- Create a keyUnder New key, give it a name (one per app is best) and choose Create key.
- Copy it nowThe key starts with mr- and is shown only this once. Keep it in a password manager or your app's secret store.
export MR_API_KEY="mr-YOUR_KEY"2. The base URLs
| Protocol | Base URL | Endpoint |
|---|---|---|
| Anthropic-compatible | https://mroffice.ai/api/ai | POST /v1/messages, POST /v1/messages/count_tokens |
| OpenAI-compatible | https://mroffice.ai/api/ai/v1 | POST /chat/completions |
| Both | https://mroffice.ai/api/ai/v1 | GET /models |
Send the key as Authorization: Bearer <key> or as x-api-key: <key>. Both endpoints reach every model.
3. Your first request
curl https://mroffice.ai/api/ai/v1/messages \
-H "x-api-key: $MR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5.5",
"max_tokens": 256,
"messages": [{"role": "user", "content": "Hello"}]
}'curl https://mroffice.ai/api/ai/v1/chat/completions \
-H "Authorization: Bearer $MR_API_KEY" \
-H "content-type: application/json" \
-d '{
"model": "gpt-6.2-sol",
"messages": [{"role": "user", "content": "Hello"}]
}'4. Check your balance and usage
Each request is paid from your free allowance first, then from your credits. Settings → Usage & billing shows the balance, the free allowance left and every charge, with the key that made it; Developer platform → AI API shows each key's requests and credits for the last 30 days.