Skip to main content

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.

VariablePurpose
BESPOKE_API_BASEThe server, as a plain HTTP or HTTPS URL with no credentials, query or fragment.
BESPOKE_API_KEYOptional. Sent as a bearer token when the server requires one.

Steps​

  1. Set BESPOKE_API_BASE in the gateway environment and restart. There is no provider entry to add on the Models + Endpoints page for this route.

  2. Issue a virtual key on /ui/api-keys with + Create New Key, then Create Key.

  3. 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"}}}}'
  4. Open /ui/logs and 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​

StatusMessageWhat it means and how to fix it
401Authentication Error, Invalid proxy server token passedThe virtual key is missing, wrong, expired or blocked.
403Key/team denied access to passthrough route /bespoke/v1/systemoneThe 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.
400bespoke model must be one of nimble-latest, nimble, bespokelabs/Bespoke-Nimble-9BThe model is not one the server serves.
400Streaming is not supported for bespoke requests or custom_body is not supported for bespoke requestsRemove stream or custom_body from the body.
503bespoke server is not configured correctly; check BESPOKE_API_BASEBESPOKE_API_BASE is missing or is not a plain server URL.
Any otherThe server's own error bodyThe server refused the request. The message is returned unchanged.

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.