Skip to content

Authentication

The Macaron hosted model API authenticates requests with an API key created in the dashboard. There is no email/password flow for API clients — the dashboard login is for the web UI only.

Create an API key

  1. Sign in at the dashboard: https://mint.macaron.im (outside Mainland China) or https://mintcn.macaron.xin (Mainland China).
  2. Open API Keys and create a new key.
  3. Copy the key immediately. It is prefixed with sk- and is shown only once.

API Keys list — each key shows its masked value, spending, status, and creation time.

Create-key dialog — a key only needs a name; the secret is generated and shown once.

Treat the key as a secret: do not commit it to source control or expose it in client-side code. The examples in these docs use the placeholder <MACARON_API_KEY>.

Use the key

Pass the key in the Authorization header as a bearer token on every request:

curl https://mint.macaron.im/v1/chat/completions \
  -H "Authorization: Bearer <MACARON_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "macaron-v1-venti",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

For SDK and tool integrations that read the key from an environment variable or config file, see Integrations.

Regional endpoints

Region Base URL
Outside Mainland China https://mint.macaron.im
Mainland China https://mintcn.macaron.xin

Use the endpoint closest to your users. Both serve the same model lineup and accept the same API keys.

Key management

  • Keys are scoped to your account. Rotate a key from the dashboard if it is compromised.
  • Usage and billing are tracked per key in the dashboard; see Usage.
  • The dashboard reports your account's rate limits (RPM) and concurrency quota.