Skip to contentSkip to page list

Docs

List virtual keys

Returns the virtual keys the caller can see. A credential that names a project (a project key, or an API key with X-Project-Id) sees the keys scoped to that project, to its team, or to the whole organization. An API key that names no project sees every key in its organization it holds virtualKeys:view on. Newest first, paged by cursor; a page can hold fewer rows than the limit before the walk is done.

GET/api/gateway/v1/virtual-keys
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/gateway/v1/virtual-keys"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,}​response = requests.get(    origin + path,    headers=headers,)print(response.json())

Success

application/json · Generated from schema

{  "data": [    {      "id": "string",      "organization_id": "string",      "name": "string",      "description": "string",      "status": "active",      "purpose": "user",      "display_prefix": "string",      "principal_user_id": "string",      "trace_project_id": "string",      "trace_project_archived": false,      "external_id": "string",      "metadata": {},      "scopes": [        {          "scope_type": "organization",          "scope_id": "string"        }      ],      "routing_policy_id": "string",      "routing_mode": "none",      "config": null,      "revision": "string",      "created_at": "2026-01-01T00:00:00Z",      "updated_at": "2026-01-01T00:00:00Z",      "last_used_at": "2026-01-01T00:00:00Z",      "revoked_at": "2026-01-01T00:00:00Z",      "expires_at": "2026-01-01T00:00:00Z"    }  ],  "next_cursor": "string"}
api-reference/gateway-virtual-keys/list-virtual-keys

Authorization

X-Auth-Tokenstringheaderrequired

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.

Query parameters

cursorstring
Up to 500 characters
limitinteger
Maximum 200
external_idstring

Exact match on the resource's external_id.

Up to 128 characters

Responses

200

Success

application/json

dataobject[]required
idstringrequired
organization_idstringrequired
namestringrequired
descriptionstring | nullrequired
statusstringrequired
One of"active""disabled""revoked"
purposestringrequired
One of"user""langy"
display_prefixstringrequired
principal_user_idstring | nullrequired
trace_project_idstring | nullrequired

The project this key's traces and costs land in. Not a scope: it grants no access to the key. Null only on a key created before this was stored.

trace_project_archivedbooleanrequired

True when the project in trace_project_id has been deleted. The key goes on sending its traces there.

external_idstring | nullrequired
metadataobjectrequired
scopesobject[]required
routing_policy_idstring | nullrequired
routing_modestringrequired
One of"none""fallback_all""policy"
configanyrequired
revisionstringrequired
created_atstring (date-time)required
Pattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
updated_atstring (date-time)required
Pattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
last_used_atstring (date-time) | nullrequired
revoked_atstring (date-time) | nullrequired
expires_atstring (date-time) | nullrequired

When the key stops serving, or null for a key that never expires. status stays active past the date on purpose.

next_cursorstring | nullrequired

Pass back as cursor for the next page. Null means the walk is exhausted.

400

Bad Request

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
401

Unauthorized

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
403

Forbidden

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]
500

Internal Server Error

application/json

typestringrequired
codestringrequired
messagestringrequired
retryablebooleanrequired
metaobject
trace_idstring
span_idstring
traceobject
traceIdstring
spanIdstring
traceUrlstring
logsUrlstring
tipsstring[]
docs_urlstring
faultstring
One of"customer""platform""provider""presumed_platform"
reasonsany[]

Documentation