Summary
POST /v1/devboxes/{id}/create_gateway_token (exposed as sdk.api.devboxes.createGatewayToken in 1.32.0) consistently returns HTTP 500:
500 Failed to mint gateway token: INTERNAL: INTERNAL: UNAUTHENTICATED: Missing x-account-id header
This is the only documented way to mint a fresh devbox-bound gateway token, so it blocks the workaround for the suspend/resume gateway-token invalidation (separate report).
Reproduction
const sdk = new RunloopSDK({ bearerToken: process.env.RUNLOOP_API_KEY });
const db = await sdk.devbox.create({
name: "mintsdk",
blueprint_name: "...",
gateways: { OPENROUTER: { gateway: "openrouter-gateway", secret: "OPENROUTER_KEY" } },
});
await sdk.api.accounts.me(); // works, returns account id
await sdk.api.devboxes.createGatewayToken(db.id, {
gateway: "openrouter-gateway",
secret: "OPENROUTER_KEY",
});
// -> 500 Failed to mint gateway token: INTERNAL: INTERNAL: UNAUTHENTICATED: Missing x-account-id header
Also reproduces via raw REST:
curl -sS -X POST "https://api.runloop.ai/v1/devboxes/$ID/create_gateway_token" \
-H "Authorization: Bearer $RUNLOOP_API_KEY" \
-H "content-type: application/json" \
-d '{"gateway":"openrouter-gateway","secret":"OPENROUTER_KEY"}'
Adding the account id from GET /v1/accounts/me as x-account-id does not help — the header appears to be dropped before the internal mint call.
Expected
Returns GatewayTokenView (token, url, endpoint, gateway_config_id, …) as documented.
Notes
sdk.api.accounts.me() succeeds and returns the account id, so the API key/session is valid.
- The failure is
INTERNAL, suggesting the public API → minting service call isn't forwarding the account context.
- Client version 1.32.0 (the version that introduced this endpoint).
Environment
@runloop/api-client 1.32.0
- Account is on
ACCOUNT_TIER_PRO
Summary
POST /v1/devboxes/{id}/create_gateway_token(exposed assdk.api.devboxes.createGatewayTokenin 1.32.0) consistently returns HTTP 500:This is the only documented way to mint a fresh devbox-bound gateway token, so it blocks the workaround for the suspend/resume gateway-token invalidation (separate report).
Reproduction
Also reproduces via raw REST:
Adding the account id from
GET /v1/accounts/measx-account-iddoes not help — the header appears to be dropped before the internal mint call.Expected
Returns
GatewayTokenView(token,url,endpoint,gateway_config_id, …) as documented.Notes
sdk.api.accounts.me()succeeds and returns the account id, so the API key/session is valid.INTERNAL, suggesting the public API → minting service call isn't forwarding the account context.Environment
@runloop/api-client1.32.0ACCOUNT_TIER_PRO