---
title: "Prepare a narrowed runtime key"
method: POST
path: "/functions/runtime-grant-presets/runner-request"
tags: ["Functions"]
---

# Prepare a narrowed runtime key

`POST /functions/runtime-grant-presets/runner-request`

## Request

- Base URL: `https://api.primitive.dev/v1`
- URL: `https://api.primitive.dev/v1/functions/runtime-grant-presets/runner-request`
- Auth: HTTP bearer

Ask for the capacity a per-function key needs before creating a function with a narrowed preset, then answer the presets as they now stand. Needs the same permission as deploying a function.

## Headers

- `Idempotency-Key` string

## Request body

- RequestFunctionRuntimeKeyRunnerRequest
  - `preset` string

## Response `200`

Prepare a narrowed runtime key

- object
  - `success` true, required
  - `data` RequestFunctionRuntimeKeyRunnerResult, required
    - `enabled` boolean, required
    - `presets` object[], required
      - `id` string, required
      - `label` string, required
      - `description` string, required
      - `available` boolean, required
      - `reason` string, nullable, required
      - `differs_from_today` boolean, required

## Other responses

- `400`: Invalid request parameters
- `401`: Invalid or missing API key
- `403`: Authenticated caller lacks permission for the operation
- `429`: Rate limit exceeded. The `ratelimit-*` headers describe the limiter that rejected this request, with its own limit and window, not the API budget that successful responses report. A limiter that reports only a wait sends `Retry-After` alone.

---

[API](https://skmtc.dev/primitive/apis/primitive-api.md) - [All operations](https://skmtc.dev/primitive/apis/primitive-api/llms.txt) - [OpenAPI document](https://skmtc.dev/primitive/apis/primitive-api/revisions/bce409c97acb?raw)
