Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

The key's domains, variables and limits

name
string
required

A name to recognise the key by

Required string length: 1 - 100
allowed_domains
string[]
required

The websites the key works on, as hostnames with no scheme, port or path. acme.com matches only https://acme.com; *.acme.com matches its subdomains over HTTPS but not acme.com itself. localhost and 127.0.0.1 allow local testing over HTTP. Wildcards over shared hosting domains such as *.vercel.app are refused.

Required array length: 1 - 20 elements
allowed_variables
string[]

The prompt variable names a page may send. A call that sends any other name is refused.

Maximum array length: 20
max_concurrent_calls
integer | null

Most live calls on this key at once, at most your account's web-call concurrency. null lets the key use all of your web-call concurrency.

Required range: x >= 1
per_minute_limit
integer
default:30

New calls on this key a minute, across all visitors

Required range: 1 <= x <= 120
per_day_limit
integer
default:500

Calls on this key a day

Required range: 10 <= x <= 5000
per_ip_minute_limit
integer
default:3

Calls from one visitor IP address a minute

Required range: 1 <= x <= 10
per_ip_day_limit
integer
default:20

Calls from one visitor IP address a day

Required range: 5 <= x <= 100
max_call_seconds
integer
default:600

The longest a call on this key may last, in seconds. The call ends when it reaches it.

Required range: 60 <= x <= 1800

Response

Key created

key
string

The widget key to put in the public-key attribute

Example:

"pk_4f6c1d2e3a5b4c7d8e9f0a1b2c3d4e5f"

name
string

A name to recognise the key by

allowed_domains
string[]

The websites the key works on, as hostnames with no scheme, port or path. acme.com matches only https://acme.com; *.acme.com matches its subdomains over HTTPS but not acme.com itself. localhost and 127.0.0.1 allow local testing over HTTP. Wildcards over shared hosting domains such as *.vercel.app are refused.

allowed_variables
string[]

The prompt variable names a page may send. A call that sends any other name is refused.

max_concurrent_calls
integer | null

Most live calls on this key at once, at most your account's web-call concurrency. null lets the key use all of your web-call concurrency.

per_minute_limit
integer

New calls on this key a minute, across all visitors

per_day_limit
integer

Calls on this key a day

per_ip_minute_limit
integer

Calls from one visitor IP address a minute

per_ip_day_limit
integer

Calls from one visitor IP address a day

max_call_seconds
integer

The longest a call on this key may last, in seconds. The call ends when it reaches it.

is_active
boolean

Always true for a key returned by these endpoints

created_at
string<date-time>
updated_at
string<date-time>