Skip to content

Authentication

Pro feature

The BetterPrompt API is available exclusively to Pro subscribers. You must have an active Pro plan before you can create API keys or make API requests. If your plan lapses, existing keys will stop working and requests will return a 402 PAYMENT_REQUIRED_ERROR.

Creating an API key

  1. Sign in to your BetterPrompt account.
  2. Navigate to the API Keys page.
  3. Click Create API key and give it a descriptive name.
  4. Copy the key immediately — it is only shown once.

You can create up to 10 API keys per account. Unused keys can be revoked at any time from the same page.

Using your API key

Authenticate every request by sending your key in the Authorization header using the Bearer scheme:

http
Authorization: Bearer <YOUR_API_KEY>

Example with curl:

bash
curl -X GET "https://api.betterprompt.me/v1/me" \
  -H "Authorization: Bearer $BETTERPROMPT_API_KEY"

TIP

Store your key in an environment variable (e.g. BETTERPROMPT_API_KEY) rather than hard-coding it. Never expose keys in client-side code or public repositories.

Key management

ActionHow
View keysVisit API Keys.
Rename a keyClick the key name on the API Keys page and edit it.
Revoke a keyClick Delete next to the key. This is immediate and permanent.

Error responses

HTTP statusstatus codeMeaning
401UNAUTHORIZED_ERRORMissing, invalid, or revoked API key.
402PAYMENT_REQUIRED_ERRORAccount does not have an active Pro plan.

See also: Error Handling