Dashboard Setup
app.maig.dev
This guide walks through setting up a MAIG project from scratch. By the end you will have a project API key and a configured routing rule ready to use from your app or SDK.
Prerequisites
- A Google or GitHub account (used for OAuth sign-in)
- At least one AI provider API key — OpenAI, Anthropic, or Google
Steps
-
Sign in
Go to app.maig.dev and click Sign in with Google or Sign in with GitHub. You will be redirected back to the dashboard after authentication completes.
-
Create a project
Click New project and give it a name (e.g. "My iOS App"). A project groups your provider credentials, routing rules, and API key together. MAIG generates a unique
maig_...key immediately.Note: Free plan accounts are limited to one project. Upgrade to Pro or Business for additional projects. -
Add provider credentials
Open the Providers tab inside your project. Click Add provider, select OpenAI, Anthropic, or Google, and paste in your provider API key. MAIG encrypts and stores it server-side — your mobile app never holds your provider credentials, only a scoped
maig_...project key.- OpenAI keys are available at platform.openai.com/api-keys
- Anthropic keys are available at console.anthropic.com/settings/keys
- Google keys are available at aistudio.google.com/app/apikey
-
Configure a routing rule
Open the Routing tab. Click Add route and configure:
- Route name — a short identifier you choose (e.g.
chat,summarizer,fast). Your app passes this name as themodelfield in requests to target this route directly. - Primary model — the AI model MAIG will use (e.g.
gpt-4oorclaude-3-5-sonnet-20241022) - Fallback model (optional, Pro and above) — the model to try if the primary provider returns an error or times out
- Retry on failure (optional, Starter and above) — automatically retry failed requests. Starter allows up to 1 retry; Pro up to 3; Business up to 5. Retries use exponential back-off starting at 100 ms.
- Rate limiting (optional, Pro and above) — cap requests to this route at a fixed number per minute or per hour. Useful for controlling costs on high-traffic routes.
- Request quota (optional, Pro and above) — set a hard ceiling on total requests per day, week, or month for this route.
Naming routes lets you decouple your app code from specific model names. You can swap the underlying model in the dashboard at any time without releasing an app update.
Plan limits: Advanced route features (fallback, retry, throttling) are gated by plan. Controls are visible to all users in the dashboard but locked with an upgrade prompt if your plan does not include them. - Route name — a short identifier you choose (e.g.
-
Copy your project API key
Go to the Settings tab for your project. Your project API key is shown at the top — it starts with
maig_. Click the copy icon to copy it to the clipboard.Important: Store this key securely. Do not commit it to source control or embed it in a public binary. Use the MAIG iOS SDK, which keeps the key in memory, or inject it at runtime from a secure configuration source.
Making requests directly
Once your project is configured you can route requests to MAIG's OpenAI-compatible endpoint from any HTTP client. Pass your route name as the model field to target that route, or pass a literal model name to bypass routing:
# Using a named route
curl https://api.maig.dev/v1/chat/completions \
-H "Authorization: Bearer maig_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "chat",
"messages": [{ "role": "user", "content": "Hello!" }]
}'
# Using a literal model name
curl https://api.maig.dev/v1/chat/completions \
-H "Authorization: Bearer maig_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{ "role": "user", "content": "Hello!" }]
}'
The response follows the standard OpenAI chat completions schema.