> ## Documentation Index
> Fetch the complete documentation index at: https://aimp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get an API Key

> Create a server-to-server credential for model execution.

# Get an API key

Create an API key when your backend service, script, worker, or automation needs
to call AIMP without a signed-in browser session.

## Create a key

1. Sign in to the product app.
2. Confirm the active workspace.
3. Open API Keys from the dashboard sidebar.
4. Create a new key with a clear name, such as `production-worker` or
   `staging-playground`.
5. Copy the key immediately. The full value is shown once.

## Use the key

Send the key with the `X-API-Key` header:

```bash theme={null}
curl "$AIMP_GATEWAY_URL/api/marketplace/models" \
  -H "X-API-Key: $AIMP_API_KEY"
```

For model runs:

```bash theme={null}
curl -X POST "$AIMP_GATEWAY_URL/api/runs" \
  -H "X-API-Key: $AIMP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"demo-model","mode":"execute","input":{"text":"Hello"},"params":{}}'
```

## Security rules

* Do not store API keys in frontend code.
* Use separate keys for production, staging, and local scripts.
* Revoke keys that are leaked, unused, or owned by departed team members.
* Rotate keys intentionally; do not rely on hidden retries or fallback keys.

## Browser apps

Signed-in browser flows use `Authorization: Bearer <access_token>` managed by the
product app. Long-lived API keys are for server-side use.
