Skip to content

Create an API key

POST
/v1/api-keys
curl --request POST \
--url https://api.pixonaut.app/v1/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "allowedOrigins": [ "https://shop.acme.example" ], "kind": "pk", "label": "Storefront widget" }'

Operation ID: apiKeys.create

Answers with the key itself, which is never shown again. A publishable key is refused from any origin outside its allowedOrigins. An MCP key is created by a member, for their own AI assistant, and acts as them; in a sandbox it acts on the sandbox alone.

Media typeapplication/json
object
allowedOrigins
Array<string>
<= 20 items
expiresInDays
Any of:
number
Allowed values: 7
kind
required
string
Allowed values: pk sk mcp
label
string
<= 100 characters

Examples

Exampleexample

Example

{
"allowedOrigins": [
"https://shop.acme.example"
],
"kind": "pk",
"label": "Storefront widget"
}

The new key

Media typeapplication/json
object
allowedOrigins
required
Array<string>
createdAt
required
number
expiresAt
required
number | null
id
required
string
key
required

The key itself. Shown in this response only.

string
kind
required
string
label
required
string
mcpServer
required

Where an AI assistant reaches Pixel’s tools with an MCP key: this API’s own MCP address. Null for any other kind.

string | null

Examples

Exampleexample

Example

{
"allowedOrigins": [
"https://shop.acme.example"
],
"createdAt": 1760000000000,
"expiresAt": null,
"id": "3b2d9c1e-5a4f-4e7d-8c6b-1a0f9e8d7c6b",
"key": "pk_live_0123456789abcdef01234567",
"kind": "pk",
"label": "Storefront widget",
"mcpServer": null
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: invalid_origin, origins_not_allowed, expiry_not_allowed, invalid_input

Media typeapplication/json
object
error
required
string
origin

Always sent with invalid_origin.

string

Examples

expiry_not_allowed

{
"error": "expiry_not_allowed"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: unauthorized

Media typeapplication/json
object
error
required
string

Examples

Exampleunauthorized

unauthorized

{
"error": "unauthorized"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: forbidden, feature_disabled, plan_limit_reached, origin_forbidden

Media typeapplication/json
object
error
required
string
feature

The feature the tenant does not have. Always sent with feature_disabled.

string
limit

The limit the tenant is at: templates, connectedStores, apiKeys, shareLinks, customDomains, printsMadePerMonth (prints made without an order this month), members, orders (this month’s orders, which getting a print’s files without an order counts as), or a sandbox’s own caps: sandboxPrintsPerDay, sandboxPrintsPerMonth, sandboxOrdersPerMonth. A sandbox shares every other limit with its live workspace. Always sent with plan_limit_reached.

string
max

How many the plan allows. Always sent with plan_limit_reached.

number
plan

The plan whose limit it is. Always sent with plan_limit_reached.

string

Examples

feature_disabled

{
"error": "feature_disabled",
"feature": "api"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: payload_too_large

Media typeapplication/json
object
bytes
number
error
required
string
maxBytes

Always sent with payload_too_large.

number

Examples

Examplepayload_too_large

payload_too_large

{
"error": "payload_too_large",
"maxBytes": 0
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: rate_limited

Media typeapplication/json
object
error
required
string

Examples

Examplerate_limited

rate_limited

{
"error": "rate_limited"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: db_error. A request that failed unexpectedly answers as text instead.

object
error
required
string

Examples

Exampledb_error

db_error

{
"error": "db_error"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: lock_timeout

Media typeapplication/json
object
error
required
string

Examples

Examplelock_timeout

lock_timeout

{
"error": "lock_timeout"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Questions? Write to [email protected].

Status · Terms of service · Privacy policy · Subprocessors