# `Codex.OutputSchemaFile`
[🔗](https://github.com/nshkrdotcom/codex_sdk/blob/v0.18.1/lib/codex/output_schema_file.ex#L1)

Persists structured output schemas to temporary JSON files so they can be passed to the
Codex CLI. Returns the generated path alongside a cleanup function for RAII-style usage.

# `create`

```elixir
@spec create(term()) :: {:ok, String.t() | nil, (-&gt; :ok)} | {:error, term()}
```

Persists the provided schema to a temporary JSON file and returns `{path, cleanup_fun}`.

The schema may be any JSON-encodable term (map, list, primitive). When `nil` is supplied
no file is created and the return path is `nil`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
