Mint a key; the response is the only time the key is shown
const url = 'http://localhost:11044/api/v1/api-keys';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"agents":["example"],"name":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”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
What to mint, the body of POST /api-keys
object
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
A label to recognise the key by. Required: 1 to 64 characters after trimming
Example generated
{ "agents": [ "example" ], "name": "example"}Responses
Section titled “Responses”The request was authenticated by an API key, which cannot manage keys
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
Why the request was refused, written to be shown
Example generated
{ "error": "example"}
