Skip to content

Mint a key; the response is the only time the key is shown

POST
/api/v1/api-keys
curl --request POST \
--url http://localhost:11044/api/v1/api-keys \
--header 'Content-Type: application/json' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \
--data '{ "agents": [ "example" ], "name": "example" }'

name labels the key: trimmed, 1 to 64 characters (400 otherwise). agents, when present, makes an agent key that talks only to the agents it names, * for any, and reaches nothing else; it must name at least one. Omitted, the key is a full key acting as the caller

Media typeapplication/json

What to mint, the body of POST /api-keys

object
agents

Absent or null mints a full key. A list mints an agent key that may talk only to these agents (* for any) and reaches nothing else, not even the world itself (model world), which needs a full key; blank entries are dropped, and at least one must remain

Array<string>
name
required

A label to recognise the key by. Required: 1 to 64 characters after trimming

string

Example generated

{
"agents": [
"example"
],
"name": "example"
}

The request was authenticated by an API key, which cannot manage keys

Media typeapplication/json

A refusal from the account surface. Carries only the reason; the status code is the only other fact and the body does not repeat it

object
error
required

Why the request was refused, written to be shown

string

Example generated

{
"error": "example"
}