---
name: mia-ai-proxy-user
description: "Help individuals use their own MIA AI Proxy key: setup, model discovery, calls, client configuration, and Points questions. Excludes service integrations, administrator operations, and credential-free support investigations."
---

# MIA AI Proxy user

Help the user complete the next practical step in their own environment. Answer in
their language. A new user usually needs to know where to get a key, which URL
and model to use, whether a request works, and where to see Points and errors.
Do not turn an ordinary onboarding question into an administrator workflow.

## Start with the user's context

- Distinguish a personal MIA AI Proxy key from a Service-owned key. This Skill
  covers the former. Route service integrations to their Product contract and
  credential-free support investigations to the support procedure.
- Use the MIA AI Proxy portal and model-detail Quick Start for the user's selected
  deployment. A VK and model catalog from one deployment do not imply access to another.
  Before inspecting credentials or calling even a read-only endpoint, establish
  the deployment from the user's explicit target or non-secret portal/base URL.
  If it is unknown, ask for that URL and stop the test until they answer. The
  invoked Skill path, repository, available environment variables, and existing
  credentials do not select a deployment. Do not probe several deployments or
  fall back to another one after a failed request.
- For a selected deployment, use only its Quick Start API base URL and a personal
  VK belonging to that same deployment. Check the non-secret URL and credential
  presence before a request; if their pairing is unclear, ask the user to set up
  the matching pair privately. Do not substitute generic or unrelated local
  variables just because they exist.
- Never ask for a VK or paste one into chat. Treat the VK as a secret even if
  it is called an “API Key” in the portal. Check only whether a local credential
  is present; do not print, reveal, log, or put it in a repository or shell
  history. Use placeholders in examples. Do not run a billable model request
  merely to answer a documentation question.

## Get a personal key

1. Direct the user to sign in to **MIA AI Proxy → API Keys** (`/console/keys` on
   the selected deployment's public origin), choose a name, and create a key.
   The portal derives the Account and User from the login; the personal key
   form asks only for a name.
2. Have them copy the new VK into their own client secret store. On a model's
   detail page, **Quick Start** shows the API base URL and a call for that
   model. The key is tied to the Account at creation.
   **Copy key** retrieves the original value again for an active key in the
   current Account. If the key is suspected exposed, revoke it and create a
   replacement. Do not handle the key value in chat.
   **Set limits** accepts a total Points limit and a daily, weekly, or monthly
   Points limit. Blank total and no recurring limit mean unlimited. Limits
   include already completed usage; changing a limit does not reset history.
   Calendar periods use UTC (weeks start Monday). Reaching either limit pauses
   new requests; in-flight requests can still complete and add Points.
   The page shows total and 7/30-day usage, daily values, and revoked history.
3. If the user has no access to MIA AI Proxy or cannot create a key, explain the
   missing sign-in or Account access and refer them to the portal owner. Use [Contact MIA](https://mia.ambr.io/contact) if they do not have an existing contact.

## Discover and call

For OpenAI-compatible HTTP, use `MIA_API_BASE_URL` for the **exact API base URL
shown by Quick Start**, including `/v1`, and `MIA_API_KEY` for the personal
key (the portal's example name). The user sets the key privately in their own
environment or client secret store. Never echo it or persist it in a shared or
tracked startup file.
The model-list request below is read-only and does not execute a model:

```bash
curl --fail-with-body --silent --show-error \
  "$MIA_API_BASE_URL/models" \
  -H "Authorization: Bearer $MIA_API_KEY"
```

Read `data[].id` in the JSON response (or pipe through `jq -r '.data[].id'`
if available). Use the exact ID returned for that VK. Model names and access
change; do not copy a historical list into an answer. The MIA AI Proxy directory
and model-detail Quick Start explain published capabilities and Points pricing.
They show configured choices, not a guarantee that every supplier route is
currently reachable. If the user needs a live availability claim, use a recent
verified call for the same deployment/model/route or contact MIA support; do not infer it from the listing or a different supplier's success.
For a first call, choose a model whose Quick Start shows a chat interface. If
an API-listed model has no detail page, do not guess its protocol. For a
**chat-capable** model, a minimal call is:

```bash
curl --fail-with-body --silent --show-error \
  "$MIA_API_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $MIA_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"model":"<model-id-from-v1-models>","messages":[{"role":"user","content":"你好"}]}'
```

For an OpenAI-compatible SDK, set its API key to the VK and its base URL to
the **same Quick Start API base URL**. For Anthropic or Google native clients,
use the selected model's Quick Start and that protocol's URL form. Keep
client-specific configuration narrow to the client and version the user uses.
Quick Start's API choice and the model's API/parameter details distinguish Chat,
Responses and Messages; support for one does not imply every field of another.
Use `max_retries=0` (Python) or `maxRetries: 0` (JavaScript) for paid generation;
the gateway owns safe same-model supplier fallback. Preserve complete SDK output
for the next turn: Responses output/response ID, Messages assistant content, or
Chat assistant message including `reasoning_items`. Gateway-produced opaque
state prefers its original supplier automatically with the same key/Account;
clients need no internal Endpoint selector. Reasoning another supplier or model
cannot verify is omitted and counted in `X-Mia-History-Changes`. A field a
route cannot carry verbatim (a cache hint across a protocol bridge, a field the
supplier rejects, an output limit above its ceiling) is omitted or adjusted
rather than refused. Only a field whose loss would change the answer is
refused, with a 400 naming the field and reason. A 409 on
continuation means a gateway marker was altered or belongs to another key or
Account. `400 supplier_state_not_portable` means a stored response,
conversation or file reference cannot continue on the requested model or route;
explain it and use an explicit new turn with portable history if the user
chooses. Native storage/expiry still belongs to the supplier.

## Understand status, Points, and failures

If a request ends with an HTTP failure before model output (including a gateway
first-event timeout), its customer Points fee is zero and the hold is released.
The user does not need to supply usage evidence or resolve recovery records.
Successful fallback, already-started streams, and cancellation retain their
existing charging rules; a client timeout alone does not establish this server
outcome.

- `GET /v1/key` with the VK can show its redacted identity and status.
  `GET /v1/my-keys` can list the user's keys without secret values. Prefer the
  portal for normal key management. Never call a reveal endpoint merely to
  inspect status.
- Personal model calls use MIA Platform Points. Check the user's Account
  balance, collected charges, and uncollected usage through **API Keys → View
  Account Points**. This opens MIA Account for the signed-in Account; key
  details show Points incurred by each key. The Account Points page is the balance authority; `/v1/key` is not a wallet balance.
- For a failed call, use a **redacted** HTTP status, `x-mia-error-code`,
  `x-should-retry`, `Retry-After`, model ID, endpoint path, deployment, and
  request ID when available. `401` suggests a key or status problem; a model
  mismatch calls for checking `/v1/models`; `429` needs its error code and
  headers to distinguish rate limit from quota. `413 request_too_large` means
  no permitted route accepts a body that large; reduce attachments or compact
  the history. A non-streaming 504 (`provider_timeout` with
  `x-should-retry: false`, or the public edge's HTML gateway-timeout page)
  usually means the generation exceeded the gateway response budget; stream
  long generations instead of retrying. A `group_not_found` response
  applies only to the URL and VK pair that produced it; do not attribute it to
  another deployment or infer model availability from it. A Points or policy
  rejection needs the portal/Account owner. For uncertain outcomes, do not
  replay a potentially billable call without an appropriate stable idempotency key.
  Escalate persistent upstream or gateway failures with redacted evidence.

When a question needs more detail, use the selected deployment's model detail
and Quick Start for interfaces and URL forms, API Keys for key status, and
Account Points for balances and charges. Treat examples as illustrative;
the selected deployment's live UI and API own current model and URL values.

For voice and realtime requests, use the selected model's Quick Start for its
supported connection and audio format. A connection check does not prove audio
input and output work. Keep API keys on the backend; use a browser connection
only when the guide provides the appropriate client credential flow. If an
example is unavailable or a request keeps failing, [contact MIA](https://mia.ambr.io/contact)
with the model ID, API path, status and request ID. Do not send keys or private
request content.
