> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shim.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Demo

> Try Shim without signing up

# Interactive Demo

Test Shim with real malformed JSON. No signup required.

Visit [shim.so/demo](https://shim.so/demo) to try the interactive playground.

***

## Features

The demo includes:

* **Monaco Editor**: Syntax highlighting for JSON
* **12 Real-World Examples**: Common LLM JSON failure patterns
* **Schema Editor**: Test with your own JSON schema
* **Repair Details**: View applied repairs, confidence levels, and latency
* **Copy Buttons**: Easily copy input/output to clipboard
* **Rate Limiting**: 10 requests per hour (no API key required)

***

## Limitations

The demo is for evaluation only. Production use requires an API key:

| Feature           | Demo    | Production  |
| ----------------- | ------- | ----------- |
| Batch repair      | ✅ Yes   | ✅ Yes       |
| Streaming repair  | ❌ No    | ✅ Yes       |
| Rate limit        | 10/hour | 100-10K/min |
| Schema validation | ✅ Yes   | ✅ Yes       |
| Historical logs   | ❌ No    | ✅ Yes       |
| SLA/Support       | ❌ No    | ✅ Yes       |

***

## Example Repairs

The demo showcases common repair scenarios:

### 1. Truncated Object

**Input:**

```json theme={null}
{"name": "John", "age": 30
```

**Repair:** Closes the missing bracket.

**Confidence:** High

***

### 2. Markdown Fence

**Input:**

````
```json
{"status": "active"}
```
````

**Repair:** Strips markdown code fences.

**Confidence:** High

***

### 3. Trailing Comma

**Input:**

```json theme={null}
{"items": [1, 2, 3,]}
```

**Repair:** Removes trailing comma.

**Confidence:** High

***

### 4. Unquoted Keys

**Input:**

```json theme={null}
{name: "John", age: 30}
```

**Repair:** Adds quotes around keys.

**Confidence:** High

***

### 5. Single Quotes

**Input:**

```json theme={null}
{'name': 'John', 'active': true}
```

**Repair:** Converts single quotes to double quotes.

**Confidence:** High

***

### 6. Unquoted Values

**Input:**

```json theme={null}
{"status": active, "count": 10}
```

**Repair:** Quotes the string value `active`.

**Confidence:** Medium

***

### 7. JavaScript Comments

**Input:**

```json theme={null}
{
  "name": "John", // person's name
  "age": 30
}
```

**Repair:** Removes comments.

**Confidence:** High

***

### 8. JavaScript Special Values

**Input:**

```json theme={null}
{"score": NaN, "max": Infinity}
```

**Repair:** Converts to `null`.

**Confidence:** High

***

### 9. Malformed Decimals

**Input:**

```json theme={null}
{"ratio": .5, "count": 5.}
```

**Repair:** Normalizes to `0.5` and `5`.

**Confidence:** High

***

### 10. Multiple Commas

**Input:**

```json theme={null}
{"name": "John",, "age": 30}
```

**Repair:** Removes duplicate comma.

**Confidence:** High

***

### 11. Leading Text

**Input:**

```
Here's the data:
{"name": "John"}
```

**Repair:** Strips leading text before JSON.

**Confidence:** High

***

### 12. Combined Issues

**Input:**

```json theme={null}
{name: 'John', // user name
 age: 30,, score: NaN}
```

**Repair:** Applies multiple fixes (unquoted keys, single quotes, comments, multiple commas, JS values).

**Confidence:** Medium (due to multiple repairs)

***

## Schema Validation

The demo includes a schema editor to test schema-aware repairs:

### Example: User Profile Schema

```json theme={null}
{
  "type": "object",
  "properties": {
    "name": { "type": "string" },
    "age": { "type": "number" },
    "email": { "type": "string" }
  },
  "required": ["name", "age"]
}
```

**Input:**

```json theme={null}
{"name": "John", "age": "30"}
```

**Repair:** Coerces `"30"` (string) to `30` (number) to match schema.

**Confidence:** Medium (schema repair)

***

## Rate Limiting

Demo endpoint is IP-based rate limited:

* **Limit:** 10 requests per hour per IP
* **Headers:** `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`
* **Reset:** 1 hour from first request

**Exceeded rate limit?** Sign up for a free API key to get 1,000 repairs/month with 100 requests/minute.

***

## Using Your Own JSON

The demo supports custom input:

1. Click in the input editor
2. Paste your malformed JSON
3. Optionally add a schema in the schema editor
4. Click "Repair JSON"
5. See the repaired output and repair details

***

## API Endpoint

The demo uses the public endpoint:

```bash theme={null}
POST https://api.shim.so/v1/demo/repair
```

**Request:**

```json theme={null}
{
  "raw_output": "{name: 'John', age: 30}",
  "schema": null,
  "mode": "lenient"
}
```

**Response:**

```json theme={null}
{
  "success": true,
  "repaired": {
    "name": "John",
    "age": 30
  },
  "metadata": {
    "confidence": "high",
    "was_repaired": true,
    "output_valid_json": true,
    "repairs_applied": [
      {
        "type": "quoted_unquoted_keys",
        "confidence": "high",
        "safe": true
      },
      {
        "type": "converted_single_quotes",
        "confidence": "high",
        "safe": true
      }
    ],
    "demo": true,
    "message": "Repaired by Shim Demo - Sign up for production access at https://shim.so/signup"
  }
}
```

***

## Get API Key

Ready for production? Sign up for a free API key:

<Card title="Sign Up" icon="key" href="https://console.shim.so/signup">
  Get your free API key (1,000 repairs/month)
</Card>

Free tier includes:

* 1,000 repairs/month
* 100 requests/minute
* Batch + streaming repair
* Schema validation
* Dashboard analytics

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/quick-start">
    Get your first repair working in 5 minutes
  </Card>

  <Card title="API Reference" icon="code" href="/reference/batch-endpoint">
    Complete API documentation
  </Card>

  <Card title="TypeScript SDK" icon="npm" href="/sdks/typescript">
    Install the official SDK
  </Card>

  <Card title="Streaming Repair" icon="zap" href="/guides/streaming-repair">
    Real-time repair for LLM streams
  </Card>
</CardGroup>
