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

# Playground

> Test extraction without an API key

## Overview

The `/v1/playground` endpoint allows you to test Parsefy without an API key. It's designed for:

* Testing and evaluation
* Demos and proof-of-concept
* Learning how Parsefy works

<Warning>
  The playground has strict rate limits. For production use, join the [waitlist](https://parsefy.io) to get an API key and use the [/v1/extract](/api-reference/endpoint/extract) endpoint.
</Warning>

## Request

<ParamField body="file" type="file" required>
  The document to extract data from.

  * **Supported formats**: PDF (`.pdf`), Microsoft Word (`.docx`)
  * **Maximum size**: 10 MB
</ParamField>

<ParamField body="output_schema" type="string" required>
  A JSON Schema string defining the structure of data to extract.
</ParamField>

<ParamField body="confidence_threshold" type="number" default="0.85">
  Minimum confidence score (0.0 to 1.0) required before accepting Tier 1 results.
</ParamField>

<ParamField body="enable_verification" type="boolean" default="false">
  Enable math verification (totals, subtotals, taxes).
</ParamField>

<ParamField header="Origin" type="string" required>
  The origin of the request. Must be from an authorized domain (`https://parsefy.io`).
</ParamField>

## Response

The response format is identical to the [/v1/extract](/api-reference/endpoint/extract) endpoint:

<ResponseField name="object" type="object">
  The extracted data matching your schema, including `_meta` with confidence score and issues.
</ResponseField>

<ResponseField name="metadata" type="object">
  Processing information including tokens, credits, and timing.
</ResponseField>

<ResponseField name="error" type="object">
  Present only if extraction failed.
</ResponseField>

## Limits

| Limit                 | Value                       |
| --------------------- | --------------------------- |
| **Request Rate**      | 1 request per second per IP |
| **Daily Credits**     | 10 credits per day per IP   |
| **Maximum File Size** | 10 MB                       |

<Note>
  Credits reset at **midnight UTC** each day.
</Note>

## Example

<Note>
  The playground is available through the [Parsefy website](https://parsefy.io). Direct API calls to this endpoint require an authorized origin.
</Note>

### Response

```json theme={null}
{
  "object": {
    "merchant": "Coffee House",
    "total": 12.50,
    "date": "2024-01-15",
    "_meta": {
      "confidence_score": 0.98,
      "field_confidence": [
        { "field": "$.merchant", "score": 0.99, "reason": "Exact match", "page": 1, "text": "Coffee House" },
        { "field": "$.total", "score": 0.98, "reason": "Exact match", "page": 1, "text": "Total: $12.50" },
        { "field": "$.date", "score": 0.97, "reason": "Exact match", "page": 1, "text": "2024-01-15" }
      ],
      "issues": []
    }
  },
  "metadata": {
    "processing_time_ms": 1850,
    "credits": 1,
    "fallback_triggered": false
  }
}
```

## Error Responses

### Origin Not Allowed (403)

```json theme={null}
{
  "detail": "Origin not allowed"
}
```

This error occurs when the `Origin` header is missing or from a non-authorized domain.

**Solution**: Use the playground through [parsefy.io](https://parsefy.io) or join the [waitlist](https://parsefy.io) to get an API key for direct API access.

### Daily Limit Exceeded (429)

```json theme={null}
{
  "detail": "Daily credit limit exceeded. Resets at midnight UTC."
}
```

You've used all 10 daily credits.

**Solutions**:

* Wait until midnight UTC for reset
* Join the [waitlist](https://parsefy.io) for an API key with unlimited extractions

### Rate Limited (429)

```json theme={null}
{
  "detail": "Rate limit exceeded. Please retry after 1 second."
}
```

You're making requests too quickly.

**Solution**: Add at least 1 second delay between requests.

## When to Use Playground vs Extract

| Use Case                 | Endpoint         |
| ------------------------ | ---------------- |
| Testing and evaluation   | `/v1/playground` |
| Learning the API         | `/v1/playground` |
| Development/debugging    | `/v1/playground` |
| Production applications  | `/v1/extract`    |
| High volume processing   | `/v1/extract`    |
| Server-side integrations | `/v1/extract`    |

## Upgrading to Production

Ready to move beyond the playground? Here's how to switch:

<Steps>
  <Step title="Get an API Key">
    Join the [waitlist](https://parsefy.io) to get your API key.
  </Step>

  <Step title="Update Endpoint">
    Change from `/v1/playground` to `/v1/extract`.
  </Step>

  <Step title="Add Authentication">
    Include the `Authorization: Bearer pk_your_key` header.
  </Step>

  <Step title="Remove Origin Header">
    The `Origin` header is not needed for authenticated requests.
  </Step>
</Steps>

### Production Example

```bash theme={null}
curl -X POST "https://api.parsefy.io/v1/extract" \
  -H "Authorization: Bearer pk_your_api_key" \
  -F "file=@document.pdf" \
  -F 'output_schema={...}'
```
