---
title: "Set a sandbox's model credit"
method: POST
path: "/v1/admin/sandbox-orgs/{sandboxId}/credit"
tags: ["Admin"]
---

# Set a sandbox's model credit

`POST /v1/admin/sandbox-orgs/{sandboxId}/credit`

## Request

- Base URL: `https://api.openworklabs.com`
- URL: `https://api.openworklabs.com/v1/admin/sandbox-orgs/{sandboxId}/credit`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Sets the spending cap, in US dollars, on the sandbox's own OpenRouter key (the total, not an increment). 400 when the sandbox uses the deployment's shared key. Platform administrators only.

## Path parameters

- `sandboxId` string, required

## Request body

- object
  - `creditUsd` integer, required

## Response `200`

Updated sandbox.

- object
  - `sandbox` object, required
    - `id` string, required
    - `organizationId` string, required
    - `name` string, required
    - `state` 'open' | 'expired' | 'closed', required
    - `joinLink` string, uri, required
    - `memberCount` integer, required
    - `memberLimit` integer, required
    - `connectorBaseUrl` string, nullable, required
    - `connectorCount` integer, required
    - `modelProviderCount` integer
    - `planTier` 'free' | 'team' | 'enterprise'
    - `modelCredit` object, nullable
      - `limitUsd` number, required
      - `remainingUsd` number, nullable, required
    - `allowedEmailDomains` string[], required
    - `joinRole` 'member' | 'admin', required
    - `expiresAt` string, date-time, required
    - `closedAt` string, date-time, nullable, required
    - `createdAt` string, date-time, required

## Other responses

- `400`: Invalid sandbox or request.
- `401`: Sign in required.
- `403`: Platform administrator required.
- `404`: Sandbox not found, or sandbox organizations are turned off.

## Changes

- **2026-10-29** `93c386b4754d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/admin/sandbox-orgs/:sandboxId/credit/post.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) - [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openworklabs/apis/den-api/revisions/93c386b4754d?raw)
