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

# API Keys

> Create and manage API keys for authenticating with the Runcrate Models API and Infrastructure API.

export const RuncrateStyles = () => {
  if (typeof document !== 'undefined' && !document.getElementById('runcrate-overrides')) {
    const s = document.createElement('style');
    s.id = 'runcrate-overrides';
    s.textContent = `
      /* Match Runcrate's rounding scale (--radius: 0.75rem) */
      .rounded-sm { border-radius: 0.5rem !important; }   /* 8px */
      .rounded-md { border-radius: 0.625rem !important; } /* 10px */
      .rounded-lg { border-radius: 0.75rem !important; }  /* 12px */
      .rounded-l-sm { border-top-left-radius: 0.5rem !important; border-bottom-left-radius: 0.5rem !important; }
      .rounded-r-sm { border-top-right-radius: 0.5rem !important; border-bottom-right-radius: 0.5rem !important; }
      .rounded-l-md { border-top-left-radius: 0.625rem !important; border-bottom-left-radius: 0.625rem !important; }
      .rounded-r-md { border-top-right-radius: 0.625rem !important; border-bottom-right-radius: 0.625rem !important; }
      .rounded-l-lg { border-top-left-radius: 0.75rem !important; border-bottom-left-radius: 0.75rem !important; }
      .rounded-r-lg { border-top-right-radius: 0.75rem !important; border-bottom-right-radius: 0.75rem !important; }

      /* Cards: never pure white in light mode */
      .card { background-color: #fcfcfc !important; border-radius: 0.75rem !important; }
      html.dark .card { background-color: #141414 !important; }

      /* Docs hero box */
      .rc-hero { background-color: #fcfcfc; border: 1px solid #e0e0e0; }
      html.dark .rc-hero { background-color: #141414; border-color: #242424; }
      html.dark .rc-hero h1 { color: #f5f5f5; }

      /* Runcrate scrollbar — thin, transparent track, hide-until-hover thumb */
      ::-webkit-scrollbar { width: 6px; height: 6px; background-color: transparent; }
      ::-webkit-scrollbar-track { background-color: transparent; }
      ::-webkit-scrollbar-thumb { background-color: rgba(155, 155, 155, 0.5); border-radius: 10px; transition: opacity 0.3s ease; opacity: 0; }
      ::-webkit-scrollbar-thumb:hover { background-color: rgba(155, 155, 155, 0.7); }
      *:hover::-webkit-scrollbar-thumb,
      *:focus::-webkit-scrollbar-thumb,
      *:active::-webkit-scrollbar-thumb { opacity: 1; }
      * { scrollbar-width: thin; scrollbar-color: rgba(155, 155, 155, 0.5) transparent; }
    `;
    document.head.appendChild(s);
  }
  return null;
};

<RuncrateStyles />

API keys authenticate your requests to the Runcrate Models API and Infrastructure API. Each key is scoped to a workspace.

## Creating an API Key

<Steps>
  <Step title="Navigate to Keys">
    Go to **Dashboard → Keys** and select the **API Keys** tab.
  </Step>

  <Step title="Click Create Key">
    Click **Create API Key**.
  </Step>

  <Step title="Name Your Key">
    Give the key a descriptive name (e.g., `production`, `dev-testing`).
  </Step>

  <Step title="Copy the Key">
    Your full API key is displayed. **Copy it immediately** — it will not be shown again.
  </Step>
</Steps>

<Warning>
  The full API key is shown **only once** at creation. If you lose it, you will need to create a new key.
</Warning>

## Key Format

API keys follow the format:

```
rc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

The `rc_live_` prefix identifies it as a Runcrate API key. The prefix is always visible in the dashboard for identification purposes.

## Managing Keys

### Activate / Deactivate

Toggle a key between active and inactive states. Deactivated keys will reject all API requests until reactivated.

### Delete

Permanently delete a key. Any applications using the deleted key will immediately lose API access.

### Last Used

The dashboard shows when each key was last used, helping you identify unused or stale keys.

## Default Key

When you create a workspace, a default API key is auto-provisioned for use with the [Playground](/models/playground). You can use this key for testing or create additional keys for your applications.

## Security Best Practices

<CardGroup cols={2}>
  <Card title="Never Commit Keys" icon="code">
    Do not hardcode API keys in source code or commit them to version control. Use environment variables instead.
  </Card>

  <Card title="Rotate Regularly" icon="refresh">
    Create new keys periodically and deactivate old ones to limit exposure.
  </Card>

  <Card title="One Key Per Application" icon="key">
    Use separate keys for different applications or environments (dev, staging, production).
  </Card>

  <Card title="Deactivate Unused Keys" icon="toggle-left">
    Deactivate keys that are no longer in use rather than leaving them active.
  </Card>
</CardGroup>

<Note>
  API keys are scoped to the workspace they were created in. They cannot access resources in other workspaces.
</Note>
