```python
from fastapi import FastAPI, status
from pydantic import BaseModel

import helpers  # noqa: F401  (the provided API)

app = FastAPI()


class DocumentCreate(BaseModel):
    name: str
    text: str


@app.post("/documents", status_code=status.HTTP_201_CREATED)
def create_document(doc: DocumentCreate):
    bytes_written = helpers.save_document(doc.name, doc.text)
    return {"bytes": bytes_written}
```