Account

Update API Key

Update an API key's name, model access, budget, account permissions, expiry, description, or app settings. Omitted fields are unchanged. Requires account:keys permission when using API keys.

patch/account/keys/{id}

Request

  • Base URL: https://gen.pollinations.ai
  • URL: https://gen.pollinations.ai/account/keys/{id}
  • Auth: HTTP bearer

Path parameters

idstring required

Request body

allowedModelsstring[] nullable

Model categories this key can use: text, image, video, audio, 3d, embedding, realtime. A model ID from /models allows its whole category. null = all models

pollenBudgetnumber nullable

Pollen budget cap. Publishable keys accept only null, omission, or 0 and always use 0; secret keys use null for unlimited

questPollenOnlyboolean

Spend only Quest Pollen, never paid Pollen. Requests stop when Quest Pollen runs out. Keys created by a Quest Pollen only key are always Quest Pollen only

accountPermissionsstring[] nullable

Account permissions (e.g. ["usage"]). Include "keys" to let the new key create keys too, and "machines" to let it run hosted sandboxes.

redirectUrisstring[]

Allowed OAuth redirect URIs for publishable app keys. Required for OAuth app flows. Must be https:// except http:// loopback URIs for local apps. Matching pins scheme, host, port, and path; one trailing slash is ignored. If the registered URI has no query, incoming query params are allowed; if it has a query, the query must match exactly. Loopback ports are matched port-agnostically.

earningsEnabledboolean

Enable developer earnings for publishable app keys. Defaults to false; send true to opt in.

descriptionstring

Note shown with the key

namestring

Name for the API key

expiresAtstring date-time nullable

Expiry as an ISO 8601 timestamp. null = never expires

Response

Updated API key

Changes

No recorded changes to this operation across all 1 revision of this API.