---
title: "releaseDemoCredential"
description: "Release a demo credential"
canonical: "https://pgbeam.com/docs/ts-sdk/demo/releaseDemoCredential"
last-updated: "2026-10-22T11:48:14.000Z"
---

# releaseDemoCredential

> Release a demo credential

URL: https://pgbeam.com/docs/ts-sdk/demo/releaseDemoCredential

{/* Auto-generated from OpenAPI. Do not edit. Run `pnpm generate:sdk-docs` to regenerate. */}

Revokes a demo credential before its TTL runs out and returns its slot to the global ceiling. Callers that finish early should do this so the next evaluating agent is not turned away by a session nobody is using. The MCP token issued with the credential proves the caller holds it. Releasing an already-expired or already-released session succeeds with released=false.

## Usage

```typescript
const result = await api.demo.releaseDemoCredential({
  pathParams: { session_id: "..." },
  body: {
    mcp_token: "...",
  },
});
```

## Parameters

| Parameter             | Type     | Required | Description                                                  |
| --------------------- | -------- | -------- | ------------------------------------------------------------ |
| pathParams.session_id | `string` | Yes      | The demo session to release, as returned when it was issued. |
| body.mcp_token        | `string` | Yes      | The mcp_token returned when the credential was issued.       |

## Response

`Promise<DemoReleaseResult>`: the session was released, or was already gone.

## Example

```typescript
import { PgBeamClient } from "pgbeam";

const client = new PgBeamClient({
  token: null,
  baseUrl: "https://api.pgbeam.com",
});

const result = await client.api.demo.releaseDemoCredential({
  pathParams: { session_id: "..." },
  body: {
    mcp_token: "...",
  },
});
```

## Errors

| Status | Description                                                                                                                         |
| ------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| 400    | The request was rejected. `code` is `INVALID_INPUT`, and `errors` names the offending fields when the failure was a validation one. |
| 401    | Missing or invalid authentication. `code` is `UNAUTHORIZED`.                                                                        |
| 404    | The resource does not exist, or the caller is not entitled to know that it does. `code` is `NOT_FOUND`.                             |
| 429    | Rate limited. `code` is `RATE_LIMITED`.                                                                                             |
| 503    | The service is temporarily unable to answer. `code` is `SERVICE_UNAVAILABLE`. Safe to retry after the delay in `Retry-After`.       |