Skip to main content
POST
Create a new API key

When to use this endpoint

You want to create a new API key from code, for example one per environment, so an old key can be retired without downtime. Give it a name you will recognise later.

Example request

cURL
Set FORAGER_API_KEY and FORAGER_ACCOUNT_ID as in the quickstart.

Example response

201 (illustrative values)
Keys are also created in the Web App at https://app.forager.ai/keys.

Credits

The credit cost of this operation is not documented yet. See API credits and pricing.

Authorizations

X-API-KEY
string
header
required

Body

Declares JSON representation of UserAPIKey model instances.

name
string

A free-form name for the API key. Need not be unique. 50 characters max.

Maximum string length: 50

Response

Declares JSON representation of UserAPIKey model instances.

prefix
string
required
read-only
created
string<date-time>
required
read-only
name
string

A free-form name for the API key. Need not be unique. 50 characters max.

Maximum string length: 50
Last modified on November 1, 2026