Workbench developer docs中文

Limits and errors

Every refusal is JSON with the HTTP status below:

{
  "category": "permission_denied",
  "message": "The CLI isn't on for your company",
  "details": {}
}

message is safe to show. details may add reason (a fixed code), reasonZh (the reason in Chinese) and upstreamStatus (the vendor's own status). A 429 for a spending limit also has retryAfterSeconds beside message.

Limits

LimitValue
WhoCompany admins, in a company with the CLI on
Token lifetime90 days
Request body8 MB
Answer8 MB
Path2,000 characters
StreamingAn event at a time; each event at most 8 MB
SpendingYour company's and your own monthly AI limits

Signing in and tokens

StatusCategorydetails.reasonWhen
401unauthenticatedThe token is missing, expired or revoked, or its holder can no longer hold one. Run wb login.
401unauthenticated"Sign-in expired. Try again.": the browser step of wb login took more than 5 minutes or was used already.
400bad_request"The CLI's sign-in link is not valid; run wb login again".
403permission_deniedcli_off"The Workbench CLI is not on for your company."
403permission_deniedpat_admins_only"Only company admins can make personal access tokens during the CLI trial."
403permission_deniedpat_needs_sign_inListing, making or revoking tokens needs a sign-in in the Workbench app, not a personal token.
400bad_request"A token's name is 1 to 100 characters".
404not_found"No such personal access token": it isn't one of yours.

Calling a connection

StatusCategoryWhen (the message)
403permission_denied"The CLI acts only for a signed-in person of the company": the token isn't a person's own (for example, a guest from another company).
403permission_denied"The CLI isn't on for your company".
403permission_denied"During the CLI trial only the company's admins can call connections" (or "call models").
404not_found"No such connection": the name isn't one wb connections lists.
400bad_request"Your company has no DigiKey key: a company admin adds it under Company keys" (with the connection's name).
400bad_request"The CLI sends GET, POST, PUT, PATCH, DELETE": another method.
400bad_request"The CLI sends Anthropic model calls as POST /v1/proxy/anthropic/v1/messages; its other paths take GET" (OpenAI: v1/responses).
400bad_request"Request too large: the CLI sends at most 8 MB".
400bad_request"That path can't be sent": over 2,000 characters, or it has spaces, control characters or a backslash.
400bad_request"That address can't be sent": the port isn't a number.
400bad_request"TrustedParts takes a JSON object body".
403permission_denied"The CLI calls connections over HTTPS only".
403permission_denied"The DigiKey connection doesn't reach that host": another host, port, or user name in the address.
429rate_limited"Your company has used this month's spending limit ($… of $…). A company admin can raise it." retryAfterSeconds is the time to the next month.
429rate_limited"You have used this month's spending limit ($… of $…). A company admin can raise it."
502internal"The DigiKey connection couldn't be reached", or "DigiKey sign-in failed (HTTP …)".
502internal"The DigiKey answer held your company's key, so Workbench withheld it."
502internal"The DigiKey answer couldn't be checked for your company's key, so Workbench withheld it.": over 8 MB, or compressed in a way Workbench can't undo.

A stream that has started can't change its status. When an event holds your company's key or can't be checked (over 8 MB), or the vendor breaks off, the stream ends there with one last event, event: error, whose data is {"type": "error", "error": {...}}: the same Error as above, or "The DigiKey stream broke off, so Workbench ended it." The event that was stopped is never sent.

Model calls also follow the AI relay's own rules: the models your company allows and its per-person limits. Their refusals use the same shape.

When the vendor says no

Workbench never passes a vendor's error body on, because vendors sometimes echo keys in it. You get a Workbench error instead, with the vendor's status in details.upstreamStatus, and the vendor's error type and code in details.vendorType and details.vendorCode when it sent them:

Vendor's statusYoursCategory
400, 409, 413, 415, 422the samebad_request
401, 403403permission_denied
404404not_found
429429, with the vendor's Retry-Afterrate_limited
Any other (redirects and 5xx included)502internal

The message reads, for example, "DigiKey answered HTTP 404. Workbench doesn't pass on a vendor's error body." A vendor 401 or 403 usually means your company's key for it is wrong or expired: ask a company admin to update it under Company keys.