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

# Create an API key

> Create a scoped workspace key and reveal its secret once.

Requires an authenticated dashboard session. Returns `201 Created`.

<ParamField path="workspace_id" type="uuid" required>
  Workspace that will own the credential.
</ParamField>

<ParamField body="name" type="string" required>
  Human-readable key name. 1–100 characters.
</ParamField>

<ParamField body="scopes" type="string[]" required>
  One or more unique public API scopes.
</ParamField>

<ParamField body="expires_at" type="string | null">
  Optional ISO 8601 expiration timestamp.
</ParamField>

Allowed scopes: `runs:read`, `runs:write`, `blueprints:read`, `blueprints:run`, `blueprint_runs:read`, and `blueprint_runs:cancel`.

## Response

<ResponseField name="key" type="string" required>
  Plaintext `ig_live_` secret. Returned only once.
</ResponseField>

<ResponseField name="key_prefix" type="string" required>
  Safe prefix used to identify the credential later.
</ResponseField>

<ResponseField name="scopes" type="string[]" required>
  Granted scopes.
</ResponseField>

<Warning>
  Copy the `key` value directly into a server-side secret manager. It cannot be recovered after this response.
</Warning>


## Related topics

- [Quickstart](/get-started/quickstart.md)
- [Rotate an API key](/reference/api-keys/rotate.md)
- [Revoke an API key](/reference/api-keys/revoke.md)
- [List API keys](/reference/api-keys/list.md)
- [Create a run](/reference/runs/create.md)
