Skip to main content
POST
/
api
/
v1
/
proxy
/
api-keys
Create Api Key
curl --request POST \
  --url https://api.promptguard.dev/api/v1/proxy/api-keys \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "<string>",
  "project_id": "<string>",
  "permissions": [],
  "expires_at": "2023-11-07T05:31:56Z"
}
'
{
  "key": "<string>",
  "id": "<string>",
  "name": "<string>",
  "prefix": "<string>"
}

Authorizations

X-API-Key
string
header
required

PromptGuard API key for developer endpoints. Keys start with pg_live_ and are created in the dashboard.

Headers

x-api-key
string | null

Body

application/json
name
string
required

API key name

Required string length: 1 - 50
project_id
string | null
permissions
string[]
expires_at
string<date-time> | null

Response

Successful Response

key
string
required
id
string
required
name
string
required
prefix
string
required