Retrieve a workspace

Get a workspace of the organization

GET https://tokenlane.de/api/workspaces/{id}

Authorizations

[ [ { "name": "Authorization", "description": "Organization management key: Authorization: Bearer sk-tl-v1-…. Existing sk-eu- keys remain valid. Required scopes are listed in x-scopes; gateway inference keys cannot authorize management operations.", "type": "http bearer", "location": "", "scopes": [] } ] ]

curl

curl --request GET \
  --url 'https://tokenlane.de/api/workspaces/wsp_01k7tm3w8vfz6b2r4m9q5xyz7c' \
  --header 'Authorization: Bearer YOUR_API_KEY'

node

const response = await fetch("https://tokenlane.de/api/workspaces/wsp_01k7tm3w8vfz6b2r4m9q5xyz7c", {
  method: "GET",
  headers: {
    "Authorization": "Bearer " + process.env.TOKENLANE_API_KEY,
  },
});
console.log(await response.text());

python

import os
import urllib.request

request = urllib.request.Request(
    "https://tokenlane.de/api/workspaces/wsp_01k7tm3w8vfz6b2r4m9q5xyz7c",
    method="GET",
    headers={
        "Authorization": "Bearer " + os.environ["TOKENLANE_API_KEY"],
    },
)

with urllib.request.urlopen(request) as response:
    print(response.read().decode("utf-8"))

vercel

// This operation uses HTTP directly.
const response = await fetch("https://tokenlane.de/api/workspaces/wsp_01k7tm3w8vfz6b2r4m9q5xyz7c", {
  method: "GET",
  headers: {
    "Authorization": "Bearer " + process.env.TOKENLANE_API_KEY,
  },
});
console.log(await response.text());

path: id (required)

Workspace identity

s38: string

Workspace identity

{}

"wsp_01k7tm3w8vfz6b2r4m9q5xyz7c"

Response 200: application/json

Request successful

{
  "id": "wsp_01k7tm3w8vfz6b2r4m9q5xyz7c",
  "name": "Default",
  "isDefault": false,
  "createdAt": "YOUR_CREATEDAT"
}

s39: object

{}

  • id (required): s100

s100: string

{}

"wsp_01k7tm3w8vfz6b2r4m9q5xyz7c"
  • description (optional): s87

s87: string | null

{}

  • budget (optional): s101

s101: anyOf

{}

anyOf: s45

s45: allOf

{}

allOf: s46

s46: object

{"additionalProperties":"false"}

  • limit (required): s146

s146: string

Non-negative EUR decimal, at most 12 fractional digits, within signed 64-bit pico-EUR.

{"maxLength":"32","pattern":"\"^\\\\d+(?:\\\\.\\\\d{1,12})?$/u\""}

  • period (required): s147

s147: string

"daily", "weekly", "monthly", "once"

{}

  • mode (required): s148

s148: string

"stop", "warn"

{}

allOf: s145

s145: object

{"additionalProperties":"false"}

  • currency (required): s81

s81: string

"EUR"

{}

  • spentPicoEur (required): s174

s174: string | null

{"pattern":"\"^\\\\d+$\""}

  • reservedPicoEur (required): s175

s175: string

{"pattern":"\"^\\\\d+$\""}

  • resetAt (required): s86

s86: string | null

date-time

{}

  • threshold (required): s176

s176: anyOf

{}

anyOf: s187

s187: number

0

{}

anyOf: s188

s188: number

50

{}

anyOf: s189

s189: number

80

{}

anyOf: s190

s190: number

100

{}

  • stopped (required): s89

s89: boolean

{}

  • revision (required): s35

s35: string

{}

anyOf: s162

s162: null

{}

  • budgetRevision (optional): s35
  • accessRole (optional): s102

s102: string

Fresh effective role of the caller in this workspace; organization administrators manage every workspace

"organization", "viewer", "developer", "admin"

{}

  • name (required): s103

s103: string

{}

"Default"
  • isDefault (required): s104

s104: boolean

New keys land here unless another workspace is chosen

{}

  • createdAt (required): s105

s105: string

date-time

{}

Response 400: application/json

Bad request (validation error, invalid input)

{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}

s11: object

{}

  • requestId (optional): s56

s56: string

Server correlation ID for an internal error. Also returned in X-Request-Id.

uuid

{}

  • status (required): s57

s57: number

HTTP status code

{}

400
  • code (required): s58

s58: string

Error code

{}

"VALIDATION_ERROR"
  • message (required): s59

s59: string

Error message

{}

"Request validation failed"
  • remedy_hint (optional): s60

s60: string

A safe, actionable remedy from the error catalog.

{}

  • details (optional): s61

s61: array

Detailed validation errors

{}

s154: object

{}

  • path (required): s179

s179: string

Field path

{}

"title"
  • message (required): s180

s180: string

Field error message

{}

"Required"

Response 401: application/json

Authentication required (missing or invalid credentials)

{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}

Response 403: application/json

Insufficient scope (authenticated but not authorized)

{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}

Response 404: application/json

Resource not found

{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}

Response 409: application/json

Conflict with the current state (e.g. a name that already exists)

{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}

Response 500: application/json

Internal server error

{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}

Response 503: application/json

Configured upstream timed out, failed or returned an invalid response

{
  "status": 400,
  "code": "VALIDATION_ERROR",
  "message": "Request validation failed"
}