Skip to main content
Most API endpoints require authentication via a Bearer token in the Authorization header. Keys start with the gx_ prefix. The Messages-compatible endpoint and the MCP server also accept the same key in the x-api-key header for client compatibility. Both header forms use the same key validation, rate limits, scopes, and credit accounting; send one or the other, not two different keys. The only public no-auth exceptions in this API reference are GET /v1/models/catalog, which returns non-sensitive generation-model metadata for pickers and pricing displays; and GET /v1/llm/models.json, which returns the public language-model catalog.

Using your API key

Create and manage keys from Settings → API Keys in the Magica app.

Creating a key

1

Sign in

Open magica.com and sign in.
2

Open Settings

Select More at the bottom of the left sidebar, then Settings.
Account menu showing the Settings button highlighted

Account menu — click Settings

3

Open API Keys

Select the API Keys tab in the settings sidebar, then click Manage.
Settings sidebar with the API Keys tab highlighted

Settings sidebar — API Keys tab

API Keys settings panel with the Manage button highlighted

API Keys panel — click Manage

4

Create the key

Enter a label (e.g. “Production”) and click Create key. To set request limits or an expiration date first, open Advanced options.
5

Copy the key

Copy the full key immediately — it’s only shown once.
The full API key is only displayed at creation time. Store it securely. If you lose it, revoke the key and create a new one.

Key properties

You can create up to 10 API keys per account. Each key has its own label, rate limits, and optional expiration.

Managing keys

Edit a key

Update label or rate limits from Settings → API Keys. Click the pencil icon next to any key.

Revoke a key

Click the revoke button next to any key. Revocation is immediate — requests using that key start returning 401.
Revoking a key does not affect other keys on your account. Your other keys continue working normally.

Key expiration

You can optionally set an expiration date when creating a key. After it passes:
  • The key is automatically invalidated by the system
  • API requests using the key return 401 Unauthorized
  • The key shows an “Expired” badge in the dashboard
  • You can revoke expired keys to clean up your list
Use expiration dates for temporary integrations, CI/CD pipelines, or contractor access. For long-lived production keys, leave the expiration empty.

Rate limits

Each API key has its own rate limits that you can configure: When you exceed a rate limit, the API returns a 429 Too Many Requests response with a Retry-After header:
Rate-limit info is included in response headers:
Use exponential backoff when retrying after a 429. If you consistently hit limits, raise the rate on that key in the dashboard, or create separate keys for different services.

Error responses