---
title: "Modify an existing Shared Key"
method: PATCH
path: "/v2/sharedkeys/{sharedkey_id}"
tags: ["v2"]
---

# Modify an existing Shared Key

`PATCH /v2/sharedkeys/{sharedkey_id}`

## Headers

- `apikey` string, required
- `Client-Agent` string
- `X-Fields` string, mask

## Request body

- SharedKeyInput
  - `kudos` integer — The Kudos limit assigned to this key. If -1, then anyone with this key can use an unlimited amount of kudos from this account.
  - `expiry` integer — The amount of days after which this key will expire. If -1, this key will not expire.
  - `name` string — A descriptive name for this key.
  - `max_image_pixels` integer — The maximum amount of image pixels this key can generate per job. -1 means unlimited.
  - `max_image_steps` integer — The maximum amount of image steps this key can use per job. -1 means unlimited.
  - `max_text_tokens` integer — The maximum amount of text tokens this key can generate per job. -1 means unlimited.

## Response `200`

Shared Key Details

- SharedKeyDetails
  - `id` string — The SharedKey ID.
  - `username` string — The owning user's unique Username. It is a combination of their chosen alias plus their ID.
  - `name` string — The Shared Key Name.
  - `kudos` integer — The Kudos limit assigned to this key.
  - `expiry` string, date-time — The date at which this API key will expire.
  - `utilized` integer — How much kudos has been utilized via this shared key until now.
  - `max_image_pixels` integer — The maximum amount of image pixels this key can generate per job. -1 means unlimited.
  - `max_image_steps` integer — The maximum amount of image steps this key can use per job. -1 means unlimited.
  - `max_text_tokens` integer — The maximum amount of text tokens this key can generate per job. -1 means unlimited.

## Other responses

- `400` — Validation Error
- `401` — Invalid API Key
- `403` — Access Denied
- `404` — Shared Key Not Found

---

[API](https://skmtc.net/haidra-org/apis/ai-horde.md) · [All operations](https://skmtc.net/haidra-org/apis/ai-horde/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/haidra-org/ai-horde/versions/dfeb0bedd935/schema)
