Skip to main content
POST
/
api
/
v1
/
api-keys
Create Api Key
curl --request POST \
  --url https://api.promptguard.dev/api/v1/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "project_id": "<string>",
  "permissions": [
    "read"
  ]
}
'
{
  "key": "<string>",
  "id": "<string>",
  "name": "<string>",
  "prefix": "<string>"
}

Authorizations

Authorization
string
header
required

API Key authentication for developer endpoints (/api/v1/*). Use format: 'Bearer pg_api_your_key_here'

Headers

x-api-key
string | null

Body

application/json
name
string
required
project_id
string | null
permissions
string[]

Response

Successful Response

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