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

# Fine-Tuning

> Export JSONL datasets and submit fine-tuning jobs to OpenAI.

<Note>
  Fine-tuning job management is a **Pro+** feature. JSONL export for self-managed fine-tuning is available on all plans.
</Note>

## Export for fine-tuning

Export any dataset as JSONL:

```bash theme={null}
curl "https://api.flexorch.com/v1/datasets/{id}/export?format=jsonl" \
  -H "X-API-KEY: dfx_your_key_here" \
  -o training_data.jsonl
```

The JSONL file is formatted for direct use with OpenAI's fine-tuning API.

## Managed fine-tuning (Pro+)

Pro and Enterprise customers can submit fine-tuning jobs directly from the platform:

```bash theme={null}
curl -X POST https://api.flexorch.com/v1/fine-tune \
  -H "X-API-KEY: dfx_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "dataset_id": "ds_abc123",
    "model": "gpt-4o-mini-2024-07-18",
    "suffix": "invoice-extractor"
  }'
```

Track job status:

```bash theme={null}
curl https://api.flexorch.com/v1/fine-tune/{job_id} \
  -H "X-API-KEY: dfx_your_key_here"
```
