import requests
url = "https://app.langwatch.ai/api/v1/api-keys/full-access"
payload = { "name": "<string>" }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://app.langwatch.ai/api/v1/api-keys/full-access', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/api-keys/full-access \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"name": "<string>"
}
'{
"token": "<string>",
"apiKey": {
"id": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
}This response has no body data.This response has no body data.This response has no body data.Create a full-access API key
Mint the caller’s own API key for the project their sign-in session is bound to, as langwatch login --project does: it can do everything the caller can do in that project (prompts, datasets, evaluations, simulations, traces). Only one shape is accepted: keyType “personal”, owned by the caller, one ADMIN binding to that project and permissionMode “all”. Name it after the machine; omit expiresAt for a key that never expires. Requires a person’s project session holding project:manage; an API key cannot mint one.
import requests
url = "https://app.langwatch.ai/api/v1/api-keys/full-access"
payload = { "name": "<string>" }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://app.langwatch.ai/api/v1/api-keys/full-access', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/api-keys/full-access \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"name": "<string>"
}
'{
"token": "<string>",
"apiKey": {
"id": "<string>",
"name": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
}This response has no body data.This response has no body data.This response has no body data.Authorizations
Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.
Body
Human-readable name for this key
1 - 100A personal key acts as the user who created it and needs explicit bindings. A service key is not tied to a user.
personal, service 500ISO 8601 timestamp after which the key stops working
Organization admins only: the member who owns the key and whose access caps it. Defaults to the caller.
1'all' and 'readonly' take their meaning from the bindings alone; 'restricted' additionally requires an explicit permissions list.
all, readonly, restricted Restricted mode only: the exact resource:action permissions the key's CUSTOM bindings grant.
^[a-z][a-zA-Z0-9_-]*:[a-z][a-zA-Z0-9_-]*$What this key may do, and where. Required for a personal key.
20Show child attributes
Show child attributes
Service keys only: restricts the key to these projects
501Was this page helpful?