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.
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.
Try this endpoint
app.langwatch.ai
API key · X-Auth-Token
Kept in this tab. Cleared when you reload.
Human-readable name for this key
A personal key acts as the user who created it and needs explicit bindings. A service key is not tied to a user.
In UTC. ISO 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.
'all' and 'readonly' take their meaning from the bindings alone; 'restricted' additionally requires an explicit permissions list.
What this key may do, and where. Required for a personal key.
This sends a live request to app.langwatch.ai.
Request and response examples
import osimport requestsorigin = "https://app.langwatch.ai"path = "/api/v1/api-keys/full-access"api_key = os.environ["LANGWATCH_API_KEY"]headers = { "X-Auth-Token": api_key, "Content-Type": "application/json",}payload = {}response = requests.post( origin + path, headers=headers, json=payload,)print(response.json())const url = "https://app.langwatch.ai/api/v1/api-keys/full-access";const response = await fetch(url, { method: "POST", headers: { "X-Auth-Token": process.env.LANGWATCH_API_KEY!, "Content-Type": "application/json", }, body: JSON.stringify({}),});const data = await response.json();curl --request POST \ --url 'https://app.langwatch.ai/api/v1/api-keys/full-access' \ --header "X-Auth-Token: $LANGWATCH_API_KEY" \ --header 'Content-Type: application/json' \ --data '{}'Call the LangWatch API from this project: Create a full-access API key.Request: POST https://app.langwatch.ai/api/v1/api-keys/full-accessReference: https://langwatch.ai/docs/api-reference/api-keys/create-a-full-access-api-key.mdAuthentication: send the X-Auth-Token header, read from the LANGWATCH_API_KEY environment variable. Never hard-code the key.Body (application/json):```json{}```Use the HTTP client this project already uses, handle non-2xx responses, and show me the parsed result.Success
application/json · Generated from schema
{ "token": "string", "apiKey": { "id": "string", "name": "string", "createdAt": "2026-01-01T00:00:00Z" }}Invalid or missing API key token
The caller is not a person's sign-in session, lacks project:manage, or asked for any other shape (api_key_scope_violation)
Validation error (validation_error)
Request body
application/json · Required
keyTypestringA personal key acts as the user who created it and needs explicit bindings. A service key is not tied to a user.
"personal""service""personal"namestringrequiredHuman-readable name for this key
descriptionstringexpiresAtstring (date-time)ISO 8601 timestamp after which the key stops working
assignedToUserIdstringOrganization admins only: the member who owns the key and whose access caps it. Defaults to the caller.
permissionModestring'all' and 'readonly' take their meaning from the bindings alone; 'restricted' additionally requires an explicit permissions list.
"all""readonly""restricted""all"permissionsstring[]Restricted mode only: the exact resource:action permissions the key's CUSTOM bindings grant.
bindingsobject[]What this key may do, and where. Required for a personal key.
projectIdsstring[]Service keys only: restricts the key to these projects
Responses
201Success
application/json
tokenstringrequiredapiKeyobjectrequired