Bespoke Nimble pass-through
The /bespoke/v1/systemone route forwards a native System One decisions request to the Bespoke Nimble server named by BESPOKE_API_BASE. System One asks typed questions about a piece of text and returns answers with probabilities. The gateway checks the virtual key, adds the Bespoke key when one is set and records the call. The model must be one of nimble-latest, nimble or bespokelabs/Bespoke-Nimble-9B, and streaming is not supported.
A real-world scenario
A customer insights team runs the Bespoke Nimble model on its own GPUs for ticket triage. Several internal tools send System One requests. They point the tools at /bespoke/v1/systemone on the gateway with virtual keys, the server accepts traffic only from the gateway, and every triage call shows up on the Logs page per tool.
Before you start
The gateway needs the Bespoke Nimble server address.
| Variable | Purpose |
|---|---|
BESPOKE_API_BASE | The server, as a plain HTTP or HTTPS URL with no credentials, query or fragment. |
BESPOKE_API_KEY | Optional. Sent as a bearer token when the server requires one. |
Steps
-
Set
BESPOKE_API_BASEin the gateway environment and restart. There is no provider entry to add on the Models + Endpoints page for this route. -
Issue a virtual key on
/ui/api-keyswith + Create New Key, then Create Key. -
Send a System One request through the gateway.
curl -X POST http://localhost:4000/bespoke/v1/systemone \-H "Authorization: Bearer $SPANWAY_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "nimble-latest", "state": "Customer wrote: I was charged twice for order #4411 and want one charge refunded today.", "questions": {"is_refund_request": {"type": "noul", "instructions": "Is the customer asking for a refund?"}, "urgency": {"type": "choice", "instructions": "How urgent is this?", "criteria": {"low": "can wait a week", "high": "needs action today"}}}}' -
Open
/ui/logsand click the newest row to see the request and the key that made it.
Expected result
The server's own response, with its status code and headers.
{
"model": "nimble-latest",
"answers": {
"is_refund_request": {"type": "noul", "value": true, "probability": 0.97},
"urgency": {"type": "choice", "value": "high", "probabilities": {"low": 0.08, "high": 0.92}}
}
}
The spend log row carries the key, team and user.
Errors
| Status | Message | What it means and how to fix it |
|---|---|---|
401 | Authentication Error, Invalid proxy server token passed | The virtual key is missing, wrong, expired or blocked. |
403 | Key/team denied access to passthrough route /bespoke/v1/systemone | The key or team lists the route in denied_passthrough_routes. The message goes on with Matched <pattern> in denied_passthrough_routes, naming the pattern to remove from the key or team. |
400 | bespoke model must be one of nimble-latest, nimble, bespokelabs/Bespoke-Nimble-9B | The model is not one the server serves. |
400 | Streaming is not supported for bespoke requests or custom_body is not supported for bespoke requests | Remove stream or custom_body from the body. |
503 | bespoke server is not configured correctly; check BESPOKE_API_BASE | BESPOKE_API_BASE is missing or is not a plain server URL. |
| Any other | The server's own error body | The server refused the request. The message is returned unchanged. |
Related
Pass-through endpoints lists every built-in route. The Decisions API accepts both decision formats and any decision model. Laya pass-through and Typesafe pass-through cover the other System One servers.