Account

Create API Key

Create a new API key. To create an app key, use type: "publishable" with redirectUris. Publishable app keys default developer earnings off; send earningsEnabled: true to opt in. Requires account:keys permission when using API keys. The full key value is returned only once in the response. Child keys get the keys account permission only when accountPermissions requests it.

post/account/keys

Request

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

Request body

namestring required

Name for the API key

type'secret' | 'publishable'

Key type: secret (sk_) or publishable app key (pk_). Use publishable to create an app key.

expiresIninteger

Expiry in seconds from now

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

Response

Created API key with full secret

Changes

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