---
title: "Create an access key"
description: "Create an access key. Needs the admin scope. Request and response shapes come from the OpenAPI description."
canonical: "https://lookio.app/docs/api/accesses/create-access-key"
updated: "2026-10-29"
---

# Create an access key



```http
POST https://api.lookio.app/v1/accesses/{access_id}/keys
```

## Authorizations

- `Authorization` (bearer, in header, required)

## Path parameters

- `access_id` (`string`, required)

## Header parameters

- `Idempotency-Key` (`string`, length: `1–255 chars`): A unique key for this request, such as a UUID, 1 to 255 visible ASCII characters. Send the same key when you retry: the first response is returned (with `Idempotent-Replayed: true`) instead of running the request again, for 24 hours, per credential. The same key on a different request is a 409 `conflict`. A streamed answer is not recorded.

## Body

`application/json`, required

- `name` (`string`, required, length: `1–100 chars`): Who it is for, e.g. the client's name.
- `daily_credits` (`integer | null`): Credits this key, per UTC day, inside the access's own ceilings, may spend; null is no ceiling. A call whose price does not fit is refused with `rate_limited` until the window resets.
- `monthly_credits` (`integer | null`): Credits this key, per UTC month, inside the access's own ceilings, may spend; null is no ceiling. A call whose price does not fit is refused with `rate_limited` until the window resets.

## Response

**201**: Create an access key

- `data` (`object`, required)
- `data.key` (`object`, required)
- `data.key.id` (`string`, required, pattern: `^aky_[abcdefghjkmnpqrstuvwxyz23456789]{12}$`)
- `data.key.name` (`string`, required): Who the key is for.
- `data.key.prefix` (`string`, required): The start of the key (`ak_live_<key id>`), to recognise it. The whole key is shown once, at creation.
- `data.key.daily_credits` (`integer | null`, required)
- `data.key.monthly_credits` (`integer | null`, required)
- `data.key.spent` (`object`, required): Credits spent with this key, this UTC day and month.
- `data.key.spent.today` (`integer`, required)
- `data.key.spent.month` (`integer`, required)
- `data.key.last_used_at` (`string,null`, required)
- `data.key.created_at` (`string`, required)
- `data.secret` (`string`, required): The whole key (`ak_live_…`). Shown once: store it now and hand it to its client.
- `request_id` (`string`, required)

```json
{
  "data": {
    "key": {
      "id": "aky_h4n8c2v6y9tk",
      "name": "Globex",
      "prefix": "ak_live_k7f2p9x4m1c8",
      "daily_credits": 3000,
      "monthly_credits": null,
      "spent": {
        "today": 60,
        "month": 1800
      },
      "last_used_at": "2026-10-29T10:00:00.000Z",
      "created_at": "2026-10-20T10:00:00.000Z"
    },
    "secret": "ak_live_k7f2p9x4m1c8_9a3d7e1fC4b29a3d7e1fC4b29a3d7e1fC4b29a3d7e1_1f3a9c07"
  },
  "request_id": "req_01K9X7M2Q4"
}
```

**400**: Possible codes: invalid_request, unknown_field, invalid_parameter, invalid_cursor

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**401**: Possible codes: authentication_required, invalid_api_key, api_key_expired, api_key_revoked, invalid_access_key

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**403**: Possible codes: insufficient_scope, feature_not_available, admin_required, permission_denied

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**404**: Possible codes: resource_not_found

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**409**: Possible codes: conflict, assistant_has_no_resources

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**413**: Possible codes: request_too_large

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**429**: Possible codes: rate_limited

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**500**: Possible codes: internal_error

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**503**: Possible codes: service_unavailable

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**Example request**

```bash
curl --request POST \
  --url 'https://api.lookio.app/v1/accesses/<access_id>/keys' \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>"
}'
```
