Skip to main content
Every dataset you build in FlexOrch can be exported as JSONL and used directly to fine-tune a language model. Self-managed JSONL export is available on all plans. If you’re on an Enterprise plan, you can also submit fine-tuning jobs to OpenAI directly from FlexOrch and track their progress through the API — no external tooling required.
JSONL export for self-managed fine-tuning is available on all plans. Managed fine-tuning job submission is an Enterprise feature.

Export a dataset for fine-tuning

Export any dataset in JSONL format using its dataset ID:
curl "https://api.flexorch.com/v1/datasets/{id}/export?format=jsonl" \
  -H "X-API-KEY: dfx_your_key_here" \
  -o training_data.jsonl
The resulting file is formatted for direct use with OpenAI’s fine-tuning API — each line is a valid JSON object with the messages structure that OpenAI’s fine-tuning endpoint expects. You can submit it to OpenAI, Anthropic, or any other provider that accepts JSONL fine-tuning datasets.
Before exporting, make sure PII masking is enabled on your pipeline. Fine-tuning on unmasked personal data can embed sensitive information into your model weights.

Managed fine-tuning (Enterprise)

Enterprise customers can submit a fine-tuning job to OpenAI directly from FlexOrch. FlexOrch handles the upload, job submission, and status tracking on your behalf.

Submit a fine-tuning job

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"
  }'

Request body

dataset_id
string
required
The ID of the FlexOrch dataset to use as training data. The dataset must be in a ready state before you can submit a fine-tuning job.
model
string
required
The base model to fine-tune. Must be a model that supports fine-tuning via the OpenAI API, such as gpt-4o-mini-2024-07-18 or gpt-3.5-turbo.
suffix
string
A short label appended to the fine-tuned model name to help you identify it. For example, invoice-extractor produces a model name like ft:gpt-4o-mini:your-org:invoice-extractor:abc123.

Track job status

After submitting, use the returned job_id to poll the status of your fine-tuning run:
curl "https://api.flexorch.com/v1/fine-tune/{job_id}" \
  -H "X-API-KEY: dfx_your_key_here"
The response includes the current status (queued, running, succeeded, or failed), estimated completion time, and — once the job succeeds — the fine-tuned model ID you can use in your BYO LLM configuration.