SPB Git

Repository Public

fine_tuning.md 306.1 KB 11,871 lines markdown

1# Fine Tuning23> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.45# Alpha67# Graders89## Run grader1011**post** `/fine_tuning/alpha/graders/run`1213Run a grader.1415### Body Parameters1617- `grader: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`1819  The grader used for the fine-tuning job.2021  - `StringCheckGrader object { input, name, operation, 2 more }`2223    A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.2425    - `input: string`2627      The input text. This may include template strings.2829    - `name: string`3031      The name of the grader.3233    - `operation: "eq" or "ne" or "like" or "ilike"`3435      The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.3637      - `"eq"`3839      - `"ne"`4041      - `"like"`4243      - `"ilike"`4445    - `reference: string`4647      The reference text. This may include template strings.4849    - `type: "string_check"`5051      The object type, which is always `string_check`.5253      - `"string_check"`5455  - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`5657    A TextSimilarityGrader object which grades text based on similarity metrics.5859    - `evaluation_metric: "cosine" or "fuzzy_match" or "bleu" or 8 more`6061      The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,62      `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,63      or `rouge_l`.6465      - `"cosine"`6667      - `"fuzzy_match"`6869      - `"bleu"`7071      - `"gleu"`7273      - `"meteor"`7475      - `"rouge_1"`7677      - `"rouge_2"`7879      - `"rouge_3"`8081      - `"rouge_4"`8283      - `"rouge_5"`8485      - `"rouge_l"`8687    - `input: string`8889      The text being graded.9091    - `name: string`9293      The name of the grader.9495    - `reference: string`9697      The text being graded against.9899    - `type: "text_similarity"`100101      The type of grader.102103      - `"text_similarity"`104105  - `PythonGrader object { name, source, type, image_tag }`106107    A PythonGrader object that runs a python script on the input.108109    - `name: string`110111      The name of the grader.112113    - `source: string`114115      The source code of the python script.116117    - `type: "python"`118119      The object type, which is always `python`.120121      - `"python"`122123    - `image_tag: optional string`124125      The image tag to use for the python script.126127  - `ScoreModelGrader object { input, model, name, 3 more }`128129    A ScoreModelGrader object that uses a model to assign a score to the input.130131    - `input: array of object { content, role, type }`132133      The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.134135      - `content: string or ResponseInputText or object { text, type }  or 3 more`136137        Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.138139        - `TextInput = string`140141          A text input to the model.142143        - `ResponseInputText object { text, type, prompt_cache_breakpoint }`144145          A text input to the model.146147          - `text: string`148149            The text input to the model.150151          - `type: "input_text"`152153            The type of the input item. Always `input_text`.154155            - `"input_text"`156157          - `prompt_cache_breakpoint: optional object { mode }`158159            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.160161            - `mode: "explicit"`162163              The breakpoint mode. Always `explicit`.164165              - `"explicit"`166167        - `OutputText object { text, type }`168169          A text output from the model.170171          - `text: string`172173            The text output from the model.174175          - `type: "output_text"`176177            The type of the output text. Always `output_text`.178179            - `"output_text"`180181        - `InputImage object { image_url, type, detail }`182183          An image input block used within EvalItem content arrays.184185          - `image_url: string`186187            The URL of the image input.188189          - `type: "input_image"`190191            The type of the image input. Always `input_image`.192193            - `"input_image"`194195          - `detail: optional string`196197            The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.198199        - `ResponseInputAudio object { input_audio, type }`200201          An audio input to the model.202203          - `input_audio: object { data, format }`204205            - `data: string`206207              Base64-encoded audio data.208209            - `format: "mp3" or "wav"`210211              The format of the audio data. Currently supported formats are `mp3` and212              `wav`.213214              - `"mp3"`215216              - `"wav"`217218          - `type: "input_audio"`219220            The type of the input item. Always `input_audio`.221222            - `"input_audio"`223224        - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`225226          A list of inputs, each of which may be either an input text, output text, input227          image, or input audio object.228229          - `TextInput = string`230231            A text input to the model.232233          - `ResponseInputText object { text, type, prompt_cache_breakpoint }`234235            A text input to the model.236237          - `OutputText object { text, type }`238239            A text output from the model.240241            - `text: string`242243              The text output from the model.244245            - `type: "output_text"`246247              The type of the output text. Always `output_text`.248249              - `"output_text"`250251          - `InputImage object { image_url, type, detail }`252253            An image input block used within EvalItem content arrays.254255            - `image_url: string`256257              The URL of the image input.258259            - `type: "input_image"`260261              The type of the image input. Always `input_image`.262263              - `"input_image"`264265            - `detail: optional string`266267              The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.268269          - `ResponseInputAudio object { input_audio, type }`270271            An audio input to the model.272273      - `role: "user" or "assistant" or "system" or "developer"`274275        The role of the message input. One of `user`, `assistant`, `system`, or276        `developer`.277278        - `"user"`279280        - `"assistant"`281282        - `"system"`283284        - `"developer"`285286      - `type: optional "message"`287288        The type of the message input. Always `message`.289290        - `"message"`291292    - `model: string`293294      The model to use for the evaluation.295296    - `name: string`297298      The name of the grader.299300    - `type: "score_model"`301302      The object type, which is always `score_model`.303304      - `"score_model"`305306    - `range: optional array of number`307308      The range of the score. Defaults to `[0, 1]`.309310    - `sampling_params: optional object { max_completions_tokens, reasoning_effort, seed, 2 more }`311312      The sampling parameters for the model.313314      - `max_completions_tokens: optional number or null`315316        The maximum number of tokens the grader model may generate in its response.317318      - `reasoning_effort: optional ReasoningEffort or null`319320        Constrains effort on reasoning for reasoning models. Currently supported321        values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.322        Reducing reasoning effort can result in faster responses and fewer tokens323        used on reasoning in a response. Not all reasoning models support every324        value. See the325        [reasoning guide](/api/docs/guides/reasoning)326        for model-specific support.327328        - `"none"`329330        - `"minimal"`331332        - `"low"`333334        - `"medium"`335336        - `"high"`337338        - `"xhigh"`339340        - `"max"`341342      - `seed: optional number or null`343344        A seed value to initialize the randomness, during sampling.345346      - `temperature: optional number or null`347348        A higher temperature increases randomness in the outputs.349350      - `top_p: optional number or null`351352        An alternative to temperature for nucleus sampling; 1.0 includes all tokens.353354  - `MultiGrader object { calculate_output, graders, name, type }`355356    A MultiGrader object combines the output of multiple graders to produce a single score.357358    - `calculate_output: string`359360      A formula to calculate the output based on grader results.361362    - `graders: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`363364      A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.365366      - `StringCheckGrader object { input, name, operation, 2 more }`367368        A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.369370      - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`371372        A TextSimilarityGrader object which grades text based on similarity metrics.373374      - `PythonGrader object { name, source, type, image_tag }`375376        A PythonGrader object that runs a python script on the input.377378      - `ScoreModelGrader object { input, model, name, 3 more }`379380        A ScoreModelGrader object that uses a model to assign a score to the input.381382      - `LabelModelGrader object { input, labels, model, 3 more }`383384        A LabelModelGrader object which uses a model to assign labels to each item385        in the evaluation.386387        - `input: array of object { content, role, type }`388389          - `content: string or ResponseInputText or object { text, type }  or 3 more`390391            Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.392393            - `TextInput = string`394395              A text input to the model.396397            - `ResponseInputText object { text, type, prompt_cache_breakpoint }`398399              A text input to the model.400401            - `OutputText object { text, type }`402403              A text output from the model.404405              - `text: string`406407                The text output from the model.408409              - `type: "output_text"`410411                The type of the output text. Always `output_text`.412413                - `"output_text"`414415            - `InputImage object { image_url, type, detail }`416417              An image input block used within EvalItem content arrays.418419              - `image_url: string`420421                The URL of the image input.422423              - `type: "input_image"`424425                The type of the image input. Always `input_image`.426427                - `"input_image"`428429              - `detail: optional string`430431                The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.432433            - `ResponseInputAudio object { input_audio, type }`434435              An audio input to the model.436437            - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`438439              A list of inputs, each of which may be either an input text, output text, input440              image, or input audio object.441442          - `role: "user" or "assistant" or "system" or "developer"`443444            The role of the message input. One of `user`, `assistant`, `system`, or445            `developer`.446447            - `"user"`448449            - `"assistant"`450451            - `"system"`452453            - `"developer"`454455          - `type: optional "message"`456457            The type of the message input. Always `message`.458459            - `"message"`460461        - `labels: array of string`462463          The labels to assign to each item in the evaluation.464465        - `model: string`466467          The model to use for the evaluation. Must support structured outputs.468469        - `name: string`470471          The name of the grader.472473        - `passing_labels: array of string`474475          The labels that indicate a passing result. Must be a subset of labels.476477        - `type: "label_model"`478479          The object type, which is always `label_model`.480481          - `"label_model"`482483    - `name: string`484485      The name of the grader.486487    - `type: "multi"`488489      The object type, which is always `multi`.490491      - `"multi"`492493- `model_sample: string`494495  The model sample to be evaluated. This value will be used to populate496  the `sample` namespace. See [the guide](/api/docs/guides/graders) for more details.497  The `output_json` variable will be populated if the model sample is a498  valid JSON string.499500- `item: optional unknown`501502  The dataset item provided to the grader. This will be used to populate503  the `item` namespace. See [the guide](/api/docs/guides/graders) for more details.504505### Returns506507- `metadata: object { errors, execution_time, name, 4 more }`508509  - `errors: object { formula_parse_error, invalid_variable_error, model_grader_parse_error, 11 more }`510511    - `formula_parse_error: boolean`512513    - `invalid_variable_error: boolean`514515    - `model_grader_parse_error: boolean`516517    - `model_grader_refusal_error: boolean`518519    - `model_grader_server_error: boolean`520521    - `model_grader_server_error_details: string or null`522523    - `other_error: boolean`524525    - `python_grader_runtime_error: boolean`526527    - `python_grader_runtime_error_details: string or null`528529    - `python_grader_server_error: boolean`530531    - `python_grader_server_error_type: string or null`532533    - `sample_parse_error: boolean`534535    - `truncated_observation_error: boolean`536537    - `unresponsive_reward_error: boolean`538539  - `execution_time: number`540541  - `name: string`542543  - `sampled_model_name: string or null`544545  - `scores: map[unknown]`546547  - `token_usage: number or null`548549  - `type: string`550551- `model_grader_token_usage_per_model: map[unknown]`552553- `reward: number`554555- `sub_rewards: map[unknown]`556557### Example558559```http560curl https://api.openai.com/v1/fine_tuning/alpha/graders/run \561    -H 'Content-Type: application/json' \562    -H "Authorization: Bearer $OPENAI_API_KEY" \563    -d '{564          "grader": {565            "input": "input",566            "name": "name",567            "operation": "eq",568            "reference": "reference",569            "type": "string_check"570          },571          "model_sample": "model_sample"572        }'573```574575#### Response576577```json578{579  "metadata": {580    "errors": {581      "formula_parse_error": true,582      "invalid_variable_error": true,583      "model_grader_parse_error": true,584      "model_grader_refusal_error": true,585      "model_grader_server_error": true,586      "model_grader_server_error_details": "model_grader_server_error_details",587      "other_error": true,588      "python_grader_runtime_error": true,589      "python_grader_runtime_error_details": "python_grader_runtime_error_details",590      "python_grader_server_error": true,591      "python_grader_server_error_type": "python_grader_server_error_type",592      "sample_parse_error": true,593      "truncated_observation_error": true,594      "unresponsive_reward_error": true595    },596    "execution_time": 0,597    "name": "name",598    "sampled_model_name": "sampled_model_name",599    "scores": {600      "foo": "bar"601    },602    "token_usage": 0,603    "type": "type"604  },605  "model_grader_token_usage_per_model": {606    "foo": "bar"607  },608  "reward": 0,609  "sub_rewards": {610    "foo": "bar"611  }612}613```614615### Score an audio response616617```http618curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \619  -H "Content-Type: application/json" \620  -H "Authorization: Bearer $OPENAI_API_KEY" \621  -d '{622    "grader": {623      "type": "score_model",624      "name": "Audio clarity grader",625      "input": [626        {627          "role": "user",628          "content": [629            {630              "type": "input_text",631              "text": "Listen to the clip and return a confidence score from 0 to 1 that the speaker said: {{item.target_phrase}}"632            },633            {634              "type": "input_audio",635              "input_audio": {636                "data": "{{item.audio_clip_b64}}",637                "format": "mp3"638              }639            }640          ]641        }642      ],643      "model": "gpt-audio",644      "sampling_params": {645        "temperature": 0.2,646        "top_p": 1,647        "seed": 123648      }649    },650    "item": {651      "target_phrase": "Please deliver the package on Tuesday",652      "audio_clip_b64": "<base64-encoded mp3>"653    },654    "model_sample": "Please deliver the package on Tuesday"655  }'656```657658### Score an image caption659660```http661curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \662  -H "Content-Type: application/json" \663  -H "Authorization: Bearer $OPENAI_API_KEY" \664  -d '{665    "grader": {666      "type": "score_model",667      "name": "Image caption grader",668      "input": [669        {670          "role": "user",671          "content": [672            {673              "type": "input_text",674              "text": "Score how well the provided caption matches the image on a 0-1 scale. Only return the score.\n\nCaption: {{sample.output_text}}"675            },676            {677              "type": "input_image",678              "image_url": "https://example.com/dog-catching-ball.png",679              "file_id": null,680              "detail": "high"681            }682          ]683        }684      ],685      "model": "gpt-5-mini",686      "sampling_params": {687        "temperature": 0.2688      }689    },690    "item": {691      "expected_caption": "A golden retriever jumps to catch a tennis ball"692    },693    "model_sample": "A dog leaps to grab a tennis ball mid-air"694  }'695```696697### Score text alignment698699```http700curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \701  -H "Content-Type: application/json" \702  -H "Authorization: Bearer $OPENAI_API_KEY" \703  -d '{704    "grader": {705      "type": "score_model",706      "name": "Example score model grader",707      "input": [708        {709          "role": "user",710          "content": [711            {712              "type": "input_text",713              "text": "Score how close the reference answer is to the model answer on a 0-1 scale. Return only the score.\n\nReference answer: {{item.reference_answer}}\n\nModel answer: {{sample.output_text}}"714            }715          ]716        }717      ],718      "model": "gpt-5-mini",719      "sampling_params": {720        "temperature": 1,721        "top_p": 1,722        "seed": 42723      }724    },725    "item": {726      "reference_answer": "fuzzy wuzzy was a bear"727    },728    "model_sample": "fuzzy wuzzy was a bear"729  }'730```731732#### Response733734```json735{736  "reward": 1.0,737  "metadata": {738    "name": "Example score model grader",739    "type": "score_model",740    "errors": {741      "formula_parse_error": false,742      "sample_parse_error": false,743      "truncated_observation_error": false,744      "unresponsive_reward_error": false,745      "invalid_variable_error": false,746      "other_error": false,747      "python_grader_server_error": false,748      "python_grader_server_error_type": null,749      "python_grader_runtime_error": false,750      "python_grader_runtime_error_details": null,751      "model_grader_server_error": false,752      "model_grader_refusal_error": false,753      "model_grader_parse_error": false,754      "model_grader_server_error_details": null755    },756    "execution_time": 4.365238428115845,757    "scores": {},758    "token_usage": {759      "prompt_tokens": 190,760      "total_tokens": 324,761      "completion_tokens": 134,762      "cached_tokens": 0763    },764    "sampled_model_name": "gpt-5-mini"765  },766  "sub_rewards": {},767  "model_grader_token_usage_per_model": {768    "gpt-5-mini": {769      "prompt_tokens": 190,770      "total_tokens": 324,771      "completion_tokens": 134,772      "cached_tokens": 0773    }774  }775}776```777778## Validate grader779780**post** `/fine_tuning/alpha/graders/validate`781782Validate a grader.783784### Body Parameters785786- `grader: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`787788  The grader used for the fine-tuning job.789790  - `StringCheckGrader object { input, name, operation, 2 more }`791792    A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.793794    - `input: string`795796      The input text. This may include template strings.797798    - `name: string`799800      The name of the grader.801802    - `operation: "eq" or "ne" or "like" or "ilike"`803804      The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.805806      - `"eq"`807808      - `"ne"`809810      - `"like"`811812      - `"ilike"`813814    - `reference: string`815816      The reference text. This may include template strings.817818    - `type: "string_check"`819820      The object type, which is always `string_check`.821822      - `"string_check"`823824  - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`825826    A TextSimilarityGrader object which grades text based on similarity metrics.827828    - `evaluation_metric: "cosine" or "fuzzy_match" or "bleu" or 8 more`829830      The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,831      `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,832      or `rouge_l`.833834      - `"cosine"`835836      - `"fuzzy_match"`837838      - `"bleu"`839840      - `"gleu"`841842      - `"meteor"`843844      - `"rouge_1"`845846      - `"rouge_2"`847848      - `"rouge_3"`849850      - `"rouge_4"`851852      - `"rouge_5"`853854      - `"rouge_l"`855856    - `input: string`857858      The text being graded.859860    - `name: string`861862      The name of the grader.863864    - `reference: string`865866      The text being graded against.867868    - `type: "text_similarity"`869870      The type of grader.871872      - `"text_similarity"`873874  - `PythonGrader object { name, source, type, image_tag }`875876    A PythonGrader object that runs a python script on the input.877878    - `name: string`879880      The name of the grader.881882    - `source: string`883884      The source code of the python script.885886    - `type: "python"`887888      The object type, which is always `python`.889890      - `"python"`891892    - `image_tag: optional string`893894      The image tag to use for the python script.895896  - `ScoreModelGrader object { input, model, name, 3 more }`897898    A ScoreModelGrader object that uses a model to assign a score to the input.899900    - `input: array of object { content, role, type }`901902      The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.903904      - `content: string or ResponseInputText or object { text, type }  or 3 more`905906        Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.907908        - `TextInput = string`909910          A text input to the model.911912        - `ResponseInputText object { text, type, prompt_cache_breakpoint }`913914          A text input to the model.915916          - `text: string`917918            The text input to the model.919920          - `type: "input_text"`921922            The type of the input item. Always `input_text`.923924            - `"input_text"`925926          - `prompt_cache_breakpoint: optional object { mode }`927928            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.929930            - `mode: "explicit"`931932              The breakpoint mode. Always `explicit`.933934              - `"explicit"`935936        - `OutputText object { text, type }`937938          A text output from the model.939940          - `text: string`941942            The text output from the model.943944          - `type: "output_text"`945946            The type of the output text. Always `output_text`.947948            - `"output_text"`949950        - `InputImage object { image_url, type, detail }`951952          An image input block used within EvalItem content arrays.953954          - `image_url: string`955956            The URL of the image input.957958          - `type: "input_image"`959960            The type of the image input. Always `input_image`.961962            - `"input_image"`963964          - `detail: optional string`965966            The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.967968        - `ResponseInputAudio object { input_audio, type }`969970          An audio input to the model.971972          - `input_audio: object { data, format }`973974            - `data: string`975976              Base64-encoded audio data.977978            - `format: "mp3" or "wav"`979980              The format of the audio data. Currently supported formats are `mp3` and981              `wav`.982983              - `"mp3"`984985              - `"wav"`986987          - `type: "input_audio"`988989            The type of the input item. Always `input_audio`.990991            - `"input_audio"`992993        - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`994995          A list of inputs, each of which may be either an input text, output text, input996          image, or input audio object.997998          - `TextInput = string`9991000            A text input to the model.10011002          - `ResponseInputText object { text, type, prompt_cache_breakpoint }`10031004            A text input to the model.10051006          - `OutputText object { text, type }`10071008            A text output from the model.10091010            - `text: string`10111012              The text output from the model.10131014            - `type: "output_text"`10151016              The type of the output text. Always `output_text`.10171018              - `"output_text"`10191020          - `InputImage object { image_url, type, detail }`10211022            An image input block used within EvalItem content arrays.10231024            - `image_url: string`10251026              The URL of the image input.10271028            - `type: "input_image"`10291030              The type of the image input. Always `input_image`.10311032              - `"input_image"`10331034            - `detail: optional string`10351036              The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.10371038          - `ResponseInputAudio object { input_audio, type }`10391040            An audio input to the model.10411042      - `role: "user" or "assistant" or "system" or "developer"`10431044        The role of the message input. One of `user`, `assistant`, `system`, or1045        `developer`.10461047        - `"user"`10481049        - `"assistant"`10501051        - `"system"`10521053        - `"developer"`10541055      - `type: optional "message"`10561057        The type of the message input. Always `message`.10581059        - `"message"`10601061    - `model: string`10621063      The model to use for the evaluation.10641065    - `name: string`10661067      The name of the grader.10681069    - `type: "score_model"`10701071      The object type, which is always `score_model`.10721073      - `"score_model"`10741075    - `range: optional array of number`10761077      The range of the score. Defaults to `[0, 1]`.10781079    - `sampling_params: optional object { max_completions_tokens, reasoning_effort, seed, 2 more }`10801081      The sampling parameters for the model.10821083      - `max_completions_tokens: optional number or null`10841085        The maximum number of tokens the grader model may generate in its response.10861087      - `reasoning_effort: optional ReasoningEffort or null`10881089        Constrains effort on reasoning for reasoning models. Currently supported1090        values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.1091        Reducing reasoning effort can result in faster responses and fewer tokens1092        used on reasoning in a response. Not all reasoning models support every1093        value. See the1094        [reasoning guide](/api/docs/guides/reasoning)1095        for model-specific support.10961097        - `"none"`10981099        - `"minimal"`11001101        - `"low"`11021103        - `"medium"`11041105        - `"high"`11061107        - `"xhigh"`11081109        - `"max"`11101111      - `seed: optional number or null`11121113        A seed value to initialize the randomness, during sampling.11141115      - `temperature: optional number or null`11161117        A higher temperature increases randomness in the outputs.11181119      - `top_p: optional number or null`11201121        An alternative to temperature for nucleus sampling; 1.0 includes all tokens.11221123  - `MultiGrader object { calculate_output, graders, name, type }`11241125    A MultiGrader object combines the output of multiple graders to produce a single score.11261127    - `calculate_output: string`11281129      A formula to calculate the output based on grader results.11301131    - `graders: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`11321133      A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.11341135      - `StringCheckGrader object { input, name, operation, 2 more }`11361137        A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.11381139      - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`11401141        A TextSimilarityGrader object which grades text based on similarity metrics.11421143      - `PythonGrader object { name, source, type, image_tag }`11441145        A PythonGrader object that runs a python script on the input.11461147      - `ScoreModelGrader object { input, model, name, 3 more }`11481149        A ScoreModelGrader object that uses a model to assign a score to the input.11501151      - `LabelModelGrader object { input, labels, model, 3 more }`11521153        A LabelModelGrader object which uses a model to assign labels to each item1154        in the evaluation.11551156        - `input: array of object { content, role, type }`11571158          - `content: string or ResponseInputText or object { text, type }  or 3 more`11591160            Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.11611162            - `TextInput = string`11631164              A text input to the model.11651166            - `ResponseInputText object { text, type, prompt_cache_breakpoint }`11671168              A text input to the model.11691170            - `OutputText object { text, type }`11711172              A text output from the model.11731174              - `text: string`11751176                The text output from the model.11771178              - `type: "output_text"`11791180                The type of the output text. Always `output_text`.11811182                - `"output_text"`11831184            - `InputImage object { image_url, type, detail }`11851186              An image input block used within EvalItem content arrays.11871188              - `image_url: string`11891190                The URL of the image input.11911192              - `type: "input_image"`11931194                The type of the image input. Always `input_image`.11951196                - `"input_image"`11971198              - `detail: optional string`11991200                The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.12011202            - `ResponseInputAudio object { input_audio, type }`12031204              An audio input to the model.12051206            - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`12071208              A list of inputs, each of which may be either an input text, output text, input1209              image, or input audio object.12101211          - `role: "user" or "assistant" or "system" or "developer"`12121213            The role of the message input. One of `user`, `assistant`, `system`, or1214            `developer`.12151216            - `"user"`12171218            - `"assistant"`12191220            - `"system"`12211222            - `"developer"`12231224          - `type: optional "message"`12251226            The type of the message input. Always `message`.12271228            - `"message"`12291230        - `labels: array of string`12311232          The labels to assign to each item in the evaluation.12331234        - `model: string`12351236          The model to use for the evaluation. Must support structured outputs.12371238        - `name: string`12391240          The name of the grader.12411242        - `passing_labels: array of string`12431244          The labels that indicate a passing result. Must be a subset of labels.12451246        - `type: "label_model"`12471248          The object type, which is always `label_model`.12491250          - `"label_model"`12511252    - `name: string`12531254      The name of the grader.12551256    - `type: "multi"`12571258      The object type, which is always `multi`.12591260      - `"multi"`12611262### Returns12631264- `grader: optional StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`12651266  The grader used for the fine-tuning job.12671268  - `StringCheckGrader object { input, name, operation, 2 more }`12691270    A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.12711272    - `input: string`12731274      The input text. This may include template strings.12751276    - `name: string`12771278      The name of the grader.12791280    - `operation: "eq" or "ne" or "like" or "ilike"`12811282      The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.12831284      - `"eq"`12851286      - `"ne"`12871288      - `"like"`12891290      - `"ilike"`12911292    - `reference: string`12931294      The reference text. This may include template strings.12951296    - `type: "string_check"`12971298      The object type, which is always `string_check`.12991300      - `"string_check"`13011302  - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`13031304    A TextSimilarityGrader object which grades text based on similarity metrics.13051306    - `evaluation_metric: "cosine" or "fuzzy_match" or "bleu" or 8 more`13071308      The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,1309      `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,1310      or `rouge_l`.13111312      - `"cosine"`13131314      - `"fuzzy_match"`13151316      - `"bleu"`13171318      - `"gleu"`13191320      - `"meteor"`13211322      - `"rouge_1"`13231324      - `"rouge_2"`13251326      - `"rouge_3"`13271328      - `"rouge_4"`13291330      - `"rouge_5"`13311332      - `"rouge_l"`13331334    - `input: string`13351336      The text being graded.13371338    - `name: string`13391340      The name of the grader.13411342    - `reference: string`13431344      The text being graded against.13451346    - `type: "text_similarity"`13471348      The type of grader.13491350      - `"text_similarity"`13511352  - `PythonGrader object { name, source, type, image_tag }`13531354    A PythonGrader object that runs a python script on the input.13551356    - `name: string`13571358      The name of the grader.13591360    - `source: string`13611362      The source code of the python script.13631364    - `type: "python"`13651366      The object type, which is always `python`.13671368      - `"python"`13691370    - `image_tag: optional string`13711372      The image tag to use for the python script.13731374  - `ScoreModelGrader object { input, model, name, 3 more }`13751376    A ScoreModelGrader object that uses a model to assign a score to the input.13771378    - `input: array of object { content, role, type }`13791380      The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.13811382      - `content: string or ResponseInputText or object { text, type }  or 3 more`13831384        Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.13851386        - `TextInput = string`13871388          A text input to the model.13891390        - `ResponseInputText object { text, type, prompt_cache_breakpoint }`13911392          A text input to the model.13931394          - `text: string`13951396            The text input to the model.13971398          - `type: "input_text"`13991400            The type of the input item. Always `input_text`.14011402            - `"input_text"`14031404          - `prompt_cache_breakpoint: optional object { mode }`14051406            Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.14071408            - `mode: "explicit"`14091410              The breakpoint mode. Always `explicit`.14111412              - `"explicit"`14131414        - `OutputText object { text, type }`14151416          A text output from the model.14171418          - `text: string`14191420            The text output from the model.14211422          - `type: "output_text"`14231424            The type of the output text. Always `output_text`.14251426            - `"output_text"`14271428        - `InputImage object { image_url, type, detail }`14291430          An image input block used within EvalItem content arrays.14311432          - `image_url: string`14331434            The URL of the image input.14351436          - `type: "input_image"`14371438            The type of the image input. Always `input_image`.14391440            - `"input_image"`14411442          - `detail: optional string`14431444            The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.14451446        - `ResponseInputAudio object { input_audio, type }`14471448          An audio input to the model.14491450          - `input_audio: object { data, format }`14511452            - `data: string`14531454              Base64-encoded audio data.14551456            - `format: "mp3" or "wav"`14571458              The format of the audio data. Currently supported formats are `mp3` and1459              `wav`.14601461              - `"mp3"`14621463              - `"wav"`14641465          - `type: "input_audio"`14661467            The type of the input item. Always `input_audio`.14681469            - `"input_audio"`14701471        - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`14721473          A list of inputs, each of which may be either an input text, output text, input1474          image, or input audio object.14751476          - `TextInput = string`14771478            A text input to the model.14791480          - `ResponseInputText object { text, type, prompt_cache_breakpoint }`14811482            A text input to the model.14831484          - `OutputText object { text, type }`14851486            A text output from the model.14871488            - `text: string`14891490              The text output from the model.14911492            - `type: "output_text"`14931494              The type of the output text. Always `output_text`.14951496              - `"output_text"`14971498          - `InputImage object { image_url, type, detail }`14991500            An image input block used within EvalItem content arrays.15011502            - `image_url: string`15031504              The URL of the image input.15051506            - `type: "input_image"`15071508              The type of the image input. Always `input_image`.15091510              - `"input_image"`15111512            - `detail: optional string`15131514              The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.15151516          - `ResponseInputAudio object { input_audio, type }`15171518            An audio input to the model.15191520      - `role: "user" or "assistant" or "system" or "developer"`15211522        The role of the message input. One of `user`, `assistant`, `system`, or1523        `developer`.15241525        - `"user"`15261527        - `"assistant"`15281529        - `"system"`15301531        - `"developer"`15321533      - `type: optional "message"`15341535        The type of the message input. Always `message`.15361537        - `"message"`15381539    - `model: string`15401541      The model to use for the evaluation.15421543    - `name: string`15441545      The name of the grader.15461547    - `type: "score_model"`15481549      The object type, which is always `score_model`.15501551      - `"score_model"`15521553    - `range: optional array of number`15541555      The range of the score. Defaults to `[0, 1]`.15561557    - `sampling_params: optional object { max_completions_tokens, reasoning_effort, seed, 2 more }`15581559      The sampling parameters for the model.15601561      - `max_completions_tokens: optional number or null`15621563        The maximum number of tokens the grader model may generate in its response.15641565      - `reasoning_effort: optional ReasoningEffort or null`15661567        Constrains effort on reasoning for reasoning models. Currently supported1568        values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.1569        Reducing reasoning effort can result in faster responses and fewer tokens1570        used on reasoning in a response. Not all reasoning models support every1571        value. See the1572        [reasoning guide](/api/docs/guides/reasoning)1573        for model-specific support.15741575        - `"none"`15761577        - `"minimal"`15781579        - `"low"`15801581        - `"medium"`15821583        - `"high"`15841585        - `"xhigh"`15861587        - `"max"`15881589      - `seed: optional number or null`15901591        A seed value to initialize the randomness, during sampling.15921593      - `temperature: optional number or null`15941595        A higher temperature increases randomness in the outputs.15961597      - `top_p: optional number or null`15981599        An alternative to temperature for nucleus sampling; 1.0 includes all tokens.16001601  - `MultiGrader object { calculate_output, graders, name, type }`16021603    A MultiGrader object combines the output of multiple graders to produce a single score.16041605    - `calculate_output: string`16061607      A formula to calculate the output based on grader results.16081609    - `graders: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`16101611      A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.16121613      - `StringCheckGrader object { input, name, operation, 2 more }`16141615        A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.16161617      - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`16181619        A TextSimilarityGrader object which grades text based on similarity metrics.16201621      - `PythonGrader object { name, source, type, image_tag }`16221623        A PythonGrader object that runs a python script on the input.16241625      - `ScoreModelGrader object { input, model, name, 3 more }`16261627        A ScoreModelGrader object that uses a model to assign a score to the input.16281629      - `LabelModelGrader object { input, labels, model, 3 more }`16301631        A LabelModelGrader object which uses a model to assign labels to each item1632        in the evaluation.16331634        - `input: array of object { content, role, type }`16351636          - `content: string or ResponseInputText or object { text, type }  or 3 more`16371638            Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.16391640            - `TextInput = string`16411642              A text input to the model.16431644            - `ResponseInputText object { text, type, prompt_cache_breakpoint }`16451646              A text input to the model.16471648            - `OutputText object { text, type }`16491650              A text output from the model.16511652              - `text: string`16531654                The text output from the model.16551656              - `type: "output_text"`16571658                The type of the output text. Always `output_text`.16591660                - `"output_text"`16611662            - `InputImage object { image_url, type, detail }`16631664              An image input block used within EvalItem content arrays.16651666              - `image_url: string`16671668                The URL of the image input.16691670              - `type: "input_image"`16711672                The type of the image input. Always `input_image`.16731674                - `"input_image"`16751676              - `detail: optional string`16771678                The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.16791680            - `ResponseInputAudio object { input_audio, type }`16811682              An audio input to the model.16831684            - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`16851686              A list of inputs, each of which may be either an input text, output text, input1687              image, or input audio object.16881689          - `role: "user" or "assistant" or "system" or "developer"`16901691            The role of the message input. One of `user`, `assistant`, `system`, or1692            `developer`.16931694            - `"user"`16951696            - `"assistant"`16971698            - `"system"`16991700            - `"developer"`17011702          - `type: optional "message"`17031704            The type of the message input. Always `message`.17051706            - `"message"`17071708        - `labels: array of string`17091710          The labels to assign to each item in the evaluation.17111712        - `model: string`17131714          The model to use for the evaluation. Must support structured outputs.17151716        - `name: string`17171718          The name of the grader.17191720        - `passing_labels: array of string`17211722          The labels that indicate a passing result. Must be a subset of labels.17231724        - `type: "label_model"`17251726          The object type, which is always `label_model`.17271728          - `"label_model"`17291730    - `name: string`17311732      The name of the grader.17331734    - `type: "multi"`17351736      The object type, which is always `multi`.17371738      - `"multi"`17391740### Example17411742```http1743curl https://api.openai.com/v1/fine_tuning/alpha/graders/validate \1744    -H 'Content-Type: application/json' \1745    -H "Authorization: Bearer $OPENAI_API_KEY" \1746    -d '{1747          "grader": {1748            "input": "input",1749            "name": "name",1750            "operation": "eq",1751            "reference": "reference",1752            "type": "string_check"1753          }1754        }'1755```17561757#### Response17581759```json1760{1761  "grader": {1762    "input": "input",1763    "name": "name",1764    "operation": "eq",1765    "reference": "reference",1766    "type": "string_check"1767  }1768}1769```17701771### Example17721773```http1774curl https://api.openai.com/v1/fine_tuning/alpha/graders/validate \1775  -H "Authorization: Bearer $OPENAI_API_KEY" \1776  -H "Content-Type: application/json" \1777  -d '{1778    "grader": {1779      "type": "string_check",1780      "name": "Example string check grader",1781      "input": "{{sample.output_text}}",1782      "reference": "{{item.label}}",1783      "operation": "eq"1784    }1785  }'1786```17871788#### Response17891790```json1791{1792  "grader": {1793    "type": "string_check",1794    "name": "Example string check grader",1795    "input": "{{sample.output_text}}",1796    "reference": "{{item.label}}",1797    "operation": "eq"1798  }1799}1800```18011802## Domain Types18031804### Grader Run Response18051806- `GraderRunResponse object { metadata, model_grader_token_usage_per_model, reward, sub_rewards }`18071808  - `metadata: object { errors, execution_time, name, 4 more }`18091810    - `errors: object { formula_parse_error, invalid_variable_error, model_grader_parse_error, 11 more }`18111812      - `formula_parse_error: boolean`18131814      - `invalid_variable_error: boolean`18151816      - `model_grader_parse_error: boolean`18171818      - `model_grader_refusal_error: boolean`18191820      - `model_grader_server_error: boolean`18211822      - `model_grader_server_error_details: string or null`18231824      - `other_error: boolean`18251826      - `python_grader_runtime_error: boolean`18271828      - `python_grader_runtime_error_details: string or null`18291830      - `python_grader_server_error: boolean`18311832      - `python_grader_server_error_type: string or null`18331834      - `sample_parse_error: boolean`18351836      - `truncated_observation_error: boolean`18371838      - `unresponsive_reward_error: boolean`18391840    - `execution_time: number`18411842    - `name: string`18431844    - `sampled_model_name: string or null`18451846    - `scores: map[unknown]`18471848    - `token_usage: number or null`18491850    - `type: string`18511852  - `model_grader_token_usage_per_model: map[unknown]`18531854  - `reward: number`18551856  - `sub_rewards: map[unknown]`18571858### Grader Validate Response18591860- `GraderValidateResponse object { grader }`18611862  - `grader: optional StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`18631864    The grader used for the fine-tuning job.18651866    - `StringCheckGrader object { input, name, operation, 2 more }`18671868      A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.18691870      - `input: string`18711872        The input text. This may include template strings.18731874      - `name: string`18751876        The name of the grader.18771878      - `operation: "eq" or "ne" or "like" or "ilike"`18791880        The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.18811882        - `"eq"`18831884        - `"ne"`18851886        - `"like"`18871888        - `"ilike"`18891890      - `reference: string`18911892        The reference text. This may include template strings.18931894      - `type: "string_check"`18951896        The object type, which is always `string_check`.18971898        - `"string_check"`18991900    - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`19011902      A TextSimilarityGrader object which grades text based on similarity metrics.19031904      - `evaluation_metric: "cosine" or "fuzzy_match" or "bleu" or 8 more`19051906        The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,1907        `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,1908        or `rouge_l`.19091910        - `"cosine"`19111912        - `"fuzzy_match"`19131914        - `"bleu"`19151916        - `"gleu"`19171918        - `"meteor"`19191920        - `"rouge_1"`19211922        - `"rouge_2"`19231924        - `"rouge_3"`19251926        - `"rouge_4"`19271928        - `"rouge_5"`19291930        - `"rouge_l"`19311932      - `input: string`19331934        The text being graded.19351936      - `name: string`19371938        The name of the grader.19391940      - `reference: string`19411942        The text being graded against.19431944      - `type: "text_similarity"`19451946        The type of grader.19471948        - `"text_similarity"`19491950    - `PythonGrader object { name, source, type, image_tag }`19511952      A PythonGrader object that runs a python script on the input.19531954      - `name: string`19551956        The name of the grader.19571958      - `source: string`19591960        The source code of the python script.19611962      - `type: "python"`19631964        The object type, which is always `python`.19651966        - `"python"`19671968      - `image_tag: optional string`19691970        The image tag to use for the python script.19711972    - `ScoreModelGrader object { input, model, name, 3 more }`19731974      A ScoreModelGrader object that uses a model to assign a score to the input.19751976      - `input: array of object { content, role, type }`19771978        The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.19791980        - `content: string or ResponseInputText or object { text, type }  or 3 more`19811982          Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.19831984          - `TextInput = string`19851986            A text input to the model.19871988          - `ResponseInputText object { text, type, prompt_cache_breakpoint }`19891990            A text input to the model.19911992            - `text: string`19931994              The text input to the model.19951996            - `type: "input_text"`19971998              The type of the input item. Always `input_text`.19992000              - `"input_text"`20012002            - `prompt_cache_breakpoint: optional object { mode }`20032004              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.20052006              - `mode: "explicit"`20072008                The breakpoint mode. Always `explicit`.20092010                - `"explicit"`20112012          - `OutputText object { text, type }`20132014            A text output from the model.20152016            - `text: string`20172018              The text output from the model.20192020            - `type: "output_text"`20212022              The type of the output text. Always `output_text`.20232024              - `"output_text"`20252026          - `InputImage object { image_url, type, detail }`20272028            An image input block used within EvalItem content arrays.20292030            - `image_url: string`20312032              The URL of the image input.20332034            - `type: "input_image"`20352036              The type of the image input. Always `input_image`.20372038              - `"input_image"`20392040            - `detail: optional string`20412042              The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.20432044          - `ResponseInputAudio object { input_audio, type }`20452046            An audio input to the model.20472048            - `input_audio: object { data, format }`20492050              - `data: string`20512052                Base64-encoded audio data.20532054              - `format: "mp3" or "wav"`20552056                The format of the audio data. Currently supported formats are `mp3` and2057                `wav`.20582059                - `"mp3"`20602061                - `"wav"`20622063            - `type: "input_audio"`20642065              The type of the input item. Always `input_audio`.20662067              - `"input_audio"`20682069          - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`20702071            A list of inputs, each of which may be either an input text, output text, input2072            image, or input audio object.20732074            - `TextInput = string`20752076              A text input to the model.20772078            - `ResponseInputText object { text, type, prompt_cache_breakpoint }`20792080              A text input to the model.20812082            - `OutputText object { text, type }`20832084              A text output from the model.20852086              - `text: string`20872088                The text output from the model.20892090              - `type: "output_text"`20912092                The type of the output text. Always `output_text`.20932094                - `"output_text"`20952096            - `InputImage object { image_url, type, detail }`20972098              An image input block used within EvalItem content arrays.20992100              - `image_url: string`21012102                The URL of the image input.21032104              - `type: "input_image"`21052106                The type of the image input. Always `input_image`.21072108                - `"input_image"`21092110              - `detail: optional string`21112112                The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.21132114            - `ResponseInputAudio object { input_audio, type }`21152116              An audio input to the model.21172118        - `role: "user" or "assistant" or "system" or "developer"`21192120          The role of the message input. One of `user`, `assistant`, `system`, or2121          `developer`.21222123          - `"user"`21242125          - `"assistant"`21262127          - `"system"`21282129          - `"developer"`21302131        - `type: optional "message"`21322133          The type of the message input. Always `message`.21342135          - `"message"`21362137      - `model: string`21382139        The model to use for the evaluation.21402141      - `name: string`21422143        The name of the grader.21442145      - `type: "score_model"`21462147        The object type, which is always `score_model`.21482149        - `"score_model"`21502151      - `range: optional array of number`21522153        The range of the score. Defaults to `[0, 1]`.21542155      - `sampling_params: optional object { max_completions_tokens, reasoning_effort, seed, 2 more }`21562157        The sampling parameters for the model.21582159        - `max_completions_tokens: optional number or null`21602161          The maximum number of tokens the grader model may generate in its response.21622163        - `reasoning_effort: optional ReasoningEffort or null`21642165          Constrains effort on reasoning for reasoning models. Currently supported2166          values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.2167          Reducing reasoning effort can result in faster responses and fewer tokens2168          used on reasoning in a response. Not all reasoning models support every2169          value. See the2170          [reasoning guide](/api/docs/guides/reasoning)2171          for model-specific support.21722173          - `"none"`21742175          - `"minimal"`21762177          - `"low"`21782179          - `"medium"`21802181          - `"high"`21822183          - `"xhigh"`21842185          - `"max"`21862187        - `seed: optional number or null`21882189          A seed value to initialize the randomness, during sampling.21902191        - `temperature: optional number or null`21922193          A higher temperature increases randomness in the outputs.21942195        - `top_p: optional number or null`21962197          An alternative to temperature for nucleus sampling; 1.0 includes all tokens.21982199    - `MultiGrader object { calculate_output, graders, name, type }`22002201      A MultiGrader object combines the output of multiple graders to produce a single score.22022203      - `calculate_output: string`22042205        A formula to calculate the output based on grader results.22062207      - `graders: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`22082209        A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.22102211        - `StringCheckGrader object { input, name, operation, 2 more }`22122213          A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.22142215        - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`22162217          A TextSimilarityGrader object which grades text based on similarity metrics.22182219        - `PythonGrader object { name, source, type, image_tag }`22202221          A PythonGrader object that runs a python script on the input.22222223        - `ScoreModelGrader object { input, model, name, 3 more }`22242225          A ScoreModelGrader object that uses a model to assign a score to the input.22262227        - `LabelModelGrader object { input, labels, model, 3 more }`22282229          A LabelModelGrader object which uses a model to assign labels to each item2230          in the evaluation.22312232          - `input: array of object { content, role, type }`22332234            - `content: string or ResponseInputText or object { text, type }  or 3 more`22352236              Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.22372238              - `TextInput = string`22392240                A text input to the model.22412242              - `ResponseInputText object { text, type, prompt_cache_breakpoint }`22432244                A text input to the model.22452246              - `OutputText object { text, type }`22472248                A text output from the model.22492250                - `text: string`22512252                  The text output from the model.22532254                - `type: "output_text"`22552256                  The type of the output text. Always `output_text`.22572258                  - `"output_text"`22592260              - `InputImage object { image_url, type, detail }`22612262                An image input block used within EvalItem content arrays.22632264                - `image_url: string`22652266                  The URL of the image input.22672268                - `type: "input_image"`22692270                  The type of the image input. Always `input_image`.22712272                  - `"input_image"`22732274                - `detail: optional string`22752276                  The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.22772278              - `ResponseInputAudio object { input_audio, type }`22792280                An audio input to the model.22812282              - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`22832284                A list of inputs, each of which may be either an input text, output text, input2285                image, or input audio object.22862287            - `role: "user" or "assistant" or "system" or "developer"`22882289              The role of the message input. One of `user`, `assistant`, `system`, or2290              `developer`.22912292              - `"user"`22932294              - `"assistant"`22952296              - `"system"`22972298              - `"developer"`22992300            - `type: optional "message"`23012302              The type of the message input. Always `message`.23032304              - `"message"`23052306          - `labels: array of string`23072308            The labels to assign to each item in the evaluation.23092310          - `model: string`23112312            The model to use for the evaluation. Must support structured outputs.23132314          - `name: string`23152316            The name of the grader.23172318          - `passing_labels: array of string`23192320            The labels that indicate a passing result. Must be a subset of labels.23212322          - `type: "label_model"`23232324            The object type, which is always `label_model`.23252326            - `"label_model"`23272328      - `name: string`23292330        The name of the grader.23312332      - `type: "multi"`23332334        The object type, which is always `multi`.23352336        - `"multi"`23372338# Checkpoints23392340# Permissions23412342## Create checkpoint permissions23432344**post** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions`23452346**NOTE:** Calling this endpoint requires an [admin API key](/api/reference/resources/admin/subresources/organization/subresources/admin_api_keys).23472348This enables organization owners to share fine-tuned models with other projects in their organization.23492350### Path Parameters23512352- `fine_tuned_model_checkpoint: string`23532354### Body Parameters23552356- `project_ids: array of string`23572358  The project identifiers to grant access to.23592360### Returns23612362- `data: array of object { id, created_at, object, project_id }`23632364  - `id: string`23652366    The permission identifier, which can be referenced in the API endpoints.23672368  - `created_at: number`23692370    The Unix timestamp (in seconds) for when the permission was created.23712372  - `object: "checkpoint.permission"`23732374    The object type, which is always "checkpoint.permission".23752376    - `"checkpoint.permission"`23772378  - `project_id: string`23792380    The project identifier that the permission is for.23812382- `has_more: boolean`23832384- `object: "list"`23852386  - `"list"`23872388- `first_id: optional string or null`23892390- `last_id: optional string or null`23912392### Example23932394```http2395curl https://api.openai.com/v1/fine_tuning/checkpoints/$FINE_TUNED_MODEL_CHECKPOINT/permissions \2396    -H 'Content-Type: application/json' \2397    -H "Authorization: Bearer $OPENAI_API_KEY" \2398    -d '{2399          "project_ids": [2400            "string"2401          ]2402        }'2403```24042405#### Response24062407```json2408{2409  "data": [2410    {2411      "id": "id",2412      "created_at": 0,2413      "object": "checkpoint.permission",2414      "project_id": "project_id"2415    }2416  ],2417  "has_more": true,2418  "object": "list",2419  "first_id": "first_id",2420  "last_id": "last_id"2421}2422```24232424### Example24252426```http2427curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \2428  -H "Authorization: Bearer $OPENAI_API_KEY"2429  -d '{"project_ids": ["proj_abGMw1llN8IrBb6SvvY5A1iH"]}'2430```24312432#### Response24332434```json2435{2436  "object": "list",2437  "data": [2438    {2439      "object": "checkpoint.permission",2440      "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",2441      "created_at": 1721764867,2442      "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH"2443    }2444  ],2445  "first_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",2446  "last_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",2447  "has_more": false2448}2449```24502451## Delete checkpoint permission24522453**delete** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}`24542455**NOTE:** This endpoint requires an [admin API key](/api/reference/resources/admin/subresources/organization/subresources/admin_api_keys).24562457Organization owners can use this endpoint to delete a permission for a fine-tuned model checkpoint.24582459### Path Parameters24602461- `fine_tuned_model_checkpoint: string`24622463- `permission_id: string`24642465### Returns24662467- `id: string`24682469  The ID of the fine-tuned model checkpoint permission that was deleted.24702471- `deleted: boolean`24722473  Whether the fine-tuned model checkpoint permission was successfully deleted.24742475- `object: "checkpoint.permission"`24762477  The object type, which is always "checkpoint.permission".24782479  - `"checkpoint.permission"`24802481### Example24822483```http2484curl https://api.openai.com/v1/fine_tuning/checkpoints/$FINE_TUNED_MODEL_CHECKPOINT/permissions/$PERMISSION_ID \2485    -X DELETE \2486    -H "Authorization: Bearer $OPENAI_API_KEY"2487```24882489#### Response24902491```json2492{2493  "id": "id",2494  "deleted": true,2495  "object": "checkpoint.permission"2496}2497```24982499### Example25002501```http2502curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions/cp_zc4Q7MP6XxulcVzj4MZdwsAB \2503  -H "Authorization: Bearer $OPENAI_API_KEY"2504```25052506#### Response25072508```json2509{2510  "object": "checkpoint.permission",2511  "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",2512  "deleted": true2513}2514```25152516## List checkpoint permissions25172518**get** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions`25192520**NOTE:** This endpoint requires an [admin API key](/api/reference/resources/admin/subresources/organization/subresources/admin_api_keys).25212522Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint.25232524### Path Parameters25252526- `fine_tuned_model_checkpoint: string`25272528### Query Parameters25292530- `after: optional string`25312532  Identifier for the last permission ID from the previous pagination request.25332534- `limit: optional number`25352536  Number of permissions to retrieve.25372538- `order: optional "ascending" or "descending"`25392540  The order in which to retrieve permissions.25412542  - `"ascending"`25432544  - `"descending"`25452546- `project_id: optional string`25472548  The ID of the project to get permissions for.25492550### Returns25512552- `data: array of object { id, created_at, object, project_id }`25532554  - `id: string`25552556    The permission identifier, which can be referenced in the API endpoints.25572558  - `created_at: number`25592560    The Unix timestamp (in seconds) for when the permission was created.25612562  - `object: "checkpoint.permission"`25632564    The object type, which is always "checkpoint.permission".25652566    - `"checkpoint.permission"`25672568  - `project_id: string`25692570    The project identifier that the permission is for.25712572- `has_more: boolean`25732574- `object: "list"`25752576  - `"list"`25772578- `first_id: optional string or null`25792580- `last_id: optional string or null`25812582### Example25832584```http2585curl https://api.openai.com/v1/fine_tuning/checkpoints/$FINE_TUNED_MODEL_CHECKPOINT/permissions \2586    -H "Authorization: Bearer $OPENAI_API_KEY"2587```25882589#### Response25902591```json2592{2593  "data": [2594    {2595      "id": "id",2596      "created_at": 0,2597      "object": "checkpoint.permission",2598      "project_id": "project_id"2599    }2600  ],2601  "has_more": true,2602  "object": "list",2603  "first_id": "first_id",2604  "last_id": "last_id"2605}2606```26072608### Example26092610```http2611curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \2612  -H "Authorization: Bearer $OPENAI_API_KEY"2613```26142615#### Response26162617```json2618{2619  "object": "list",2620  "data": [2621    {2622      "object": "checkpoint.permission",2623      "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",2624      "created_at": 1721764867,2625      "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH"2626    },2627    {2628      "object": "checkpoint.permission",2629      "id": "cp_enQCFmOTGj3syEpYVhBRLTSy",2630      "created_at": 1721764800,2631      "project_id": "proj_iqGMw1llN8IrBb6SvvY5A1oF"2632    },2633  ],2634  "first_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",2635  "last_id": "cp_enQCFmOTGj3syEpYVhBRLTSy",2636  "has_more": false2637}2638```26392640## List checkpoint permissions26412642**get** `/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions`26432644**NOTE:** This endpoint requires an [admin API key](/api/reference/resources/admin/subresources/organization/subresources/admin_api_keys).26452646Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint.26472648### Path Parameters26492650- `fine_tuned_model_checkpoint: string`26512652### Query Parameters26532654- `after: optional string`26552656  Identifier for the last permission ID from the previous pagination request.26572658- `limit: optional number`26592660  Number of permissions to retrieve.26612662- `order: optional "ascending" or "descending"`26632664  The order in which to retrieve permissions.26652666  - `"ascending"`26672668  - `"descending"`26692670- `project_id: optional string`26712672  The ID of the project to get permissions for.26732674### Returns26752676- `data: array of object { id, created_at, object, project_id }`26772678  - `id: string`26792680    The permission identifier, which can be referenced in the API endpoints.26812682  - `created_at: number`26832684    The Unix timestamp (in seconds) for when the permission was created.26852686  - `object: "checkpoint.permission"`26872688    The object type, which is always "checkpoint.permission".26892690    - `"checkpoint.permission"`26912692  - `project_id: string`26932694    The project identifier that the permission is for.26952696- `has_more: boolean`26972698- `object: "list"`26992700  - `"list"`27012702- `first_id: optional string or null`27032704- `last_id: optional string or null`27052706### Example27072708```http2709curl https://api.openai.com/v1/fine_tuning/checkpoints/$FINE_TUNED_MODEL_CHECKPOINT/permissions \2710    -H "Authorization: Bearer $OPENAI_API_KEY"2711```27122713#### Response27142715```json2716{2717  "data": [2718    {2719      "id": "id",2720      "created_at": 0,2721      "object": "checkpoint.permission",2722      "project_id": "project_id"2723    }2724  ],2725  "has_more": true,2726  "object": "list",2727  "first_id": "first_id",2728  "last_id": "last_id"2729}2730```27312732### Example27332734```http2735curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \2736  -H "Authorization: Bearer $OPENAI_API_KEY"2737```27382739#### Response27402741```json2742{2743  "object": "list",2744  "data": [2745    {2746      "object": "checkpoint.permission",2747      "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",2748      "created_at": 1721764867,2749      "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH"2750    },2751    {2752      "object": "checkpoint.permission",2753      "id": "cp_enQCFmOTGj3syEpYVhBRLTSy",2754      "created_at": 1721764800,2755      "project_id": "proj_iqGMw1llN8IrBb6SvvY5A1oF"2756    },2757  ],2758  "first_id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB",2759  "last_id": "cp_enQCFmOTGj3syEpYVhBRLTSy",2760  "has_more": false2761}2762```27632764## Domain Types27652766### Permission Create Response27672768- `PermissionCreateResponse object { id, created_at, object, project_id }`27692770  The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.27712772  - `id: string`27732774    The permission identifier, which can be referenced in the API endpoints.27752776  - `created_at: number`27772778    The Unix timestamp (in seconds) for when the permission was created.27792780  - `object: "checkpoint.permission"`27812782    The object type, which is always "checkpoint.permission".27832784    - `"checkpoint.permission"`27852786  - `project_id: string`27872788    The project identifier that the permission is for.27892790### Permission Delete Response27912792- `PermissionDeleteResponse object { id, deleted, object }`27932794  - `id: string`27952796    The ID of the fine-tuned model checkpoint permission that was deleted.27972798  - `deleted: boolean`27992800    Whether the fine-tuned model checkpoint permission was successfully deleted.28012802  - `object: "checkpoint.permission"`28032804    The object type, which is always "checkpoint.permission".28052806    - `"checkpoint.permission"`28072808### Permission List Response28092810- `PermissionListResponse object { id, created_at, object, project_id }`28112812  The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.28132814  - `id: string`28152816    The permission identifier, which can be referenced in the API endpoints.28172818  - `created_at: number`28192820    The Unix timestamp (in seconds) for when the permission was created.28212822  - `object: "checkpoint.permission"`28232824    The object type, which is always "checkpoint.permission".28252826    - `"checkpoint.permission"`28272828  - `project_id: string`28292830    The project identifier that the permission is for.28312832### Permission Retrieve Response28332834- `PermissionRetrieveResponse object { data, has_more, object, 2 more }`28352836  - `data: array of object { id, created_at, object, project_id }`28372838    - `id: string`28392840      The permission identifier, which can be referenced in the API endpoints.28412842    - `created_at: number`28432844      The Unix timestamp (in seconds) for when the permission was created.28452846    - `object: "checkpoint.permission"`28472848      The object type, which is always "checkpoint.permission".28492850      - `"checkpoint.permission"`28512852    - `project_id: string`28532854      The project identifier that the permission is for.28552856  - `has_more: boolean`28572858  - `object: "list"`28592860    - `"list"`28612862  - `first_id: optional string or null`28632864  - `last_id: optional string or null`28652866# Jobs28672868## Cancel fine-tuning28692870**post** `/fine_tuning/jobs/{fine_tuning_job_id}/cancel`28712872Immediately cancel a fine-tune job.28732874### Path Parameters28752876- `fine_tuning_job_id: string`28772878### Returns28792880- `FineTuningJob object { id, created_at, error, 16 more }`28812882  The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.28832884  - `id: string`28852886    The object identifier, which can be referenced in the API endpoints.28872888  - `created_at: number`28892890    The Unix timestamp (in seconds) for when the fine-tuning job was created.28912892  - `error: object { code, message, param }  or null`28932894    For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure.28952896    - `code: string`28972898      A machine-readable error code.28992900    - `message: string`29012902      A human-readable error message.29032904    - `param: string or null`29052906      The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific.29072908  - `fine_tuned_model: string or null`29092910    The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.29112912  - `finished_at: number or null`29132914    The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running.29152916  - `hyperparameters: object { batch_size, learning_rate_multiplier, n_epochs }`29172918    The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs.29192920    - `batch_size: optional "auto" or number or null`29212922      Number of examples in each batch. A larger batch size means that model parameters2923      are updated less frequently, but with lower variance.29242925      - `"auto"`29262927        - `"auto"`29282929      - `number`29302931    - `learning_rate_multiplier: optional "auto" or number`29322933      Scaling factor for the learning rate. A smaller learning rate may be useful to avoid2934      overfitting.29352936      - `"auto"`29372938        - `"auto"`29392940      - `number`29412942    - `n_epochs: optional "auto" or number`29432944      The number of epochs to train the model for. An epoch refers to one full cycle2945      through the training dataset.29462947      - `"auto"`29482949        - `"auto"`29502951      - `number`29522953  - `model: string`29542955    The base model that is being fine-tuned.29562957  - `object: "fine_tuning.job"`29582959    The object type, which is always "fine_tuning.job".29602961    - `"fine_tuning.job"`29622963  - `organization_id: string`29642965    The organization that owns the fine-tuning job.29662967  - `result_files: array of string`29682969    The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/api/reference/resources/files/methods/content).29702971  - `seed: number`29722973    The seed used for the fine-tuning job.29742975  - `status: "validating_files" or "queued" or "running" or 3 more`29762977    The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.29782979    - `"validating_files"`29802981    - `"queued"`29822983    - `"running"`29842985    - `"succeeded"`29862987    - `"failed"`29882989    - `"cancelled"`29902991  - `trained_tokens: number or null`29922993    The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.29942995  - `training_file: string`29962997    The file ID used for training. You can retrieve the training data with the [Files API](/api/reference/resources/files/methods/content).29982999  - `validation_file: string or null`30003001    The file ID used for validation. You can retrieve the validation results with the [Files API](/api/reference/resources/files/methods/content).30023003  - `estimated_finish: optional number or null`30043005    The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running.30063007  - `integrations: optional array of FineTuningJobWandbIntegrationObject or null`30083009    A list of integrations to enable for this fine-tuning job.30103011    - `type: "wandb"`30123013      The type of the integration being enabled for the fine-tuning job30143015      - `"wandb"`30163017    - `wandb: FineTuningJobWandbIntegration`30183019      The settings for your integration with Weights and Biases. This payload specifies the project that3020      metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags3021      to your run, and set a default entity (team, username, etc) to be associated with your run.30223023      - `project: string`30243025        The name of the project that the new run will be created under.30263027      - `entity: optional string or null`30283029        The entity to use for the run. This allows you to set the team or username of the WandB user that you would3030        like associated with the run. If not set, the default entity for the registered WandB API key is used.30313032      - `name: optional string or null`30333034        A display name to set for the run. If not set, we will use the Job ID as the name.30353036      - `tags: optional array of string`30373038        A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some3039        default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}".30403041  - `metadata: optional Metadata or null`30423043    Set of 16 key-value pairs that can be attached to an object. This can be3044    useful for storing additional information about the object in a structured3045    format, and querying for objects via API or the dashboard.30463047    Keys are strings with a maximum length of 64 characters. Values are strings3048    with a maximum length of 512 characters.30493050  - `method: optional object { type, dpo, reinforcement, supervised }`30513052    The method used for fine-tuning.30533054    - `type: "supervised" or "dpo" or "reinforcement"`30553056      The type of method. Is either `supervised`, `dpo`, or `reinforcement`.30573058      - `"supervised"`30593060      - `"dpo"`30613062      - `"reinforcement"`30633064    - `dpo: optional DpoMethod`30653066      Configuration for the DPO fine-tuning method.30673068      - `hyperparameters: optional DpoHyperparameters`30693070        The hyperparameters used for the DPO fine-tuning job.30713072        - `batch_size: optional "auto" or number`30733074          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.30753076          - `"auto"`30773078            - `"auto"`30793080          - `number`30813082        - `beta: optional "auto" or number`30833084          The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.30853086          - `"auto"`30873088            - `"auto"`30893090          - `number`30913092        - `learning_rate_multiplier: optional "auto" or number`30933094          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.30953096          - `"auto"`30973098            - `"auto"`30993100          - `number`31013102        - `n_epochs: optional "auto" or number`31033104          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.31053106          - `"auto"`31073108            - `"auto"`31093110          - `number`31113112    - `reinforcement: optional ReinforcementMethod`31133114      Configuration for the reinforcement fine-tuning method.31153116      - `grader: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`31173118        The grader used for the fine-tuning job.31193120        - `StringCheckGrader object { input, name, operation, 2 more }`31213122          A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.31233124          - `input: string`31253126            The input text. This may include template strings.31273128          - `name: string`31293130            The name of the grader.31313132          - `operation: "eq" or "ne" or "like" or "ilike"`31333134            The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.31353136            - `"eq"`31373138            - `"ne"`31393140            - `"like"`31413142            - `"ilike"`31433144          - `reference: string`31453146            The reference text. This may include template strings.31473148          - `type: "string_check"`31493150            The object type, which is always `string_check`.31513152            - `"string_check"`31533154        - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`31553156          A TextSimilarityGrader object which grades text based on similarity metrics.31573158          - `evaluation_metric: "cosine" or "fuzzy_match" or "bleu" or 8 more`31593160            The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,3161            `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,3162            or `rouge_l`.31633164            - `"cosine"`31653166            - `"fuzzy_match"`31673168            - `"bleu"`31693170            - `"gleu"`31713172            - `"meteor"`31733174            - `"rouge_1"`31753176            - `"rouge_2"`31773178            - `"rouge_3"`31793180            - `"rouge_4"`31813182            - `"rouge_5"`31833184            - `"rouge_l"`31853186          - `input: string`31873188            The text being graded.31893190          - `name: string`31913192            The name of the grader.31933194          - `reference: string`31953196            The text being graded against.31973198          - `type: "text_similarity"`31993200            The type of grader.32013202            - `"text_similarity"`32033204        - `PythonGrader object { name, source, type, image_tag }`32053206          A PythonGrader object that runs a python script on the input.32073208          - `name: string`32093210            The name of the grader.32113212          - `source: string`32133214            The source code of the python script.32153216          - `type: "python"`32173218            The object type, which is always `python`.32193220            - `"python"`32213222          - `image_tag: optional string`32233224            The image tag to use for the python script.32253226        - `ScoreModelGrader object { input, model, name, 3 more }`32273228          A ScoreModelGrader object that uses a model to assign a score to the input.32293230          - `input: array of object { content, role, type }`32313232            The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.32333234            - `content: string or ResponseInputText or object { text, type }  or 3 more`32353236              Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.32373238              - `TextInput = string`32393240                A text input to the model.32413242              - `ResponseInputText object { text, type, prompt_cache_breakpoint }`32433244                A text input to the model.32453246                - `text: string`32473248                  The text input to the model.32493250                - `type: "input_text"`32513252                  The type of the input item. Always `input_text`.32533254                  - `"input_text"`32553256                - `prompt_cache_breakpoint: optional object { mode }`32573258                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.32593260                  - `mode: "explicit"`32613262                    The breakpoint mode. Always `explicit`.32633264                    - `"explicit"`32653266              - `OutputText object { text, type }`32673268                A text output from the model.32693270                - `text: string`32713272                  The text output from the model.32733274                - `type: "output_text"`32753276                  The type of the output text. Always `output_text`.32773278                  - `"output_text"`32793280              - `InputImage object { image_url, type, detail }`32813282                An image input block used within EvalItem content arrays.32833284                - `image_url: string`32853286                  The URL of the image input.32873288                - `type: "input_image"`32893290                  The type of the image input. Always `input_image`.32913292                  - `"input_image"`32933294                - `detail: optional string`32953296                  The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.32973298              - `ResponseInputAudio object { input_audio, type }`32993300                An audio input to the model.33013302                - `input_audio: object { data, format }`33033304                  - `data: string`33053306                    Base64-encoded audio data.33073308                  - `format: "mp3" or "wav"`33093310                    The format of the audio data. Currently supported formats are `mp3` and3311                    `wav`.33123313                    - `"mp3"`33143315                    - `"wav"`33163317                - `type: "input_audio"`33183319                  The type of the input item. Always `input_audio`.33203321                  - `"input_audio"`33223323              - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`33243325                A list of inputs, each of which may be either an input text, output text, input3326                image, or input audio object.33273328                - `TextInput = string`33293330                  A text input to the model.33313332                - `ResponseInputText object { text, type, prompt_cache_breakpoint }`33333334                  A text input to the model.33353336                - `OutputText object { text, type }`33373338                  A text output from the model.33393340                  - `text: string`33413342                    The text output from the model.33433344                  - `type: "output_text"`33453346                    The type of the output text. Always `output_text`.33473348                    - `"output_text"`33493350                - `InputImage object { image_url, type, detail }`33513352                  An image input block used within EvalItem content arrays.33533354                  - `image_url: string`33553356                    The URL of the image input.33573358                  - `type: "input_image"`33593360                    The type of the image input. Always `input_image`.33613362                    - `"input_image"`33633364                  - `detail: optional string`33653366                    The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.33673368                - `ResponseInputAudio object { input_audio, type }`33693370                  An audio input to the model.33713372            - `role: "user" or "assistant" or "system" or "developer"`33733374              The role of the message input. One of `user`, `assistant`, `system`, or3375              `developer`.33763377              - `"user"`33783379              - `"assistant"`33803381              - `"system"`33823383              - `"developer"`33843385            - `type: optional "message"`33863387              The type of the message input. Always `message`.33883389              - `"message"`33903391          - `model: string`33923393            The model to use for the evaluation.33943395          - `name: string`33963397            The name of the grader.33983399          - `type: "score_model"`34003401            The object type, which is always `score_model`.34023403            - `"score_model"`34043405          - `range: optional array of number`34063407            The range of the score. Defaults to `[0, 1]`.34083409          - `sampling_params: optional object { max_completions_tokens, reasoning_effort, seed, 2 more }`34103411            The sampling parameters for the model.34123413            - `max_completions_tokens: optional number or null`34143415              The maximum number of tokens the grader model may generate in its response.34163417            - `reasoning_effort: optional ReasoningEffort or null`34183419              Constrains effort on reasoning for reasoning models. Currently supported3420              values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.3421              Reducing reasoning effort can result in faster responses and fewer tokens3422              used on reasoning in a response. Not all reasoning models support every3423              value. See the3424              [reasoning guide](/api/docs/guides/reasoning)3425              for model-specific support.34263427              - `"none"`34283429              - `"minimal"`34303431              - `"low"`34323433              - `"medium"`34343435              - `"high"`34363437              - `"xhigh"`34383439              - `"max"`34403441            - `seed: optional number or null`34423443              A seed value to initialize the randomness, during sampling.34443445            - `temperature: optional number or null`34463447              A higher temperature increases randomness in the outputs.34483449            - `top_p: optional number or null`34503451              An alternative to temperature for nucleus sampling; 1.0 includes all tokens.34523453        - `MultiGrader object { calculate_output, graders, name, type }`34543455          A MultiGrader object combines the output of multiple graders to produce a single score.34563457          - `calculate_output: string`34583459            A formula to calculate the output based on grader results.34603461          - `graders: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`34623463            A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.34643465            - `StringCheckGrader object { input, name, operation, 2 more }`34663467              A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.34683469            - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`34703471              A TextSimilarityGrader object which grades text based on similarity metrics.34723473            - `PythonGrader object { name, source, type, image_tag }`34743475              A PythonGrader object that runs a python script on the input.34763477            - `ScoreModelGrader object { input, model, name, 3 more }`34783479              A ScoreModelGrader object that uses a model to assign a score to the input.34803481            - `LabelModelGrader object { input, labels, model, 3 more }`34823483              A LabelModelGrader object which uses a model to assign labels to each item3484              in the evaluation.34853486              - `input: array of object { content, role, type }`34873488                - `content: string or ResponseInputText or object { text, type }  or 3 more`34893490                  Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.34913492                  - `TextInput = string`34933494                    A text input to the model.34953496                  - `ResponseInputText object { text, type, prompt_cache_breakpoint }`34973498                    A text input to the model.34993500                  - `OutputText object { text, type }`35013502                    A text output from the model.35033504                    - `text: string`35053506                      The text output from the model.35073508                    - `type: "output_text"`35093510                      The type of the output text. Always `output_text`.35113512                      - `"output_text"`35133514                  - `InputImage object { image_url, type, detail }`35153516                    An image input block used within EvalItem content arrays.35173518                    - `image_url: string`35193520                      The URL of the image input.35213522                    - `type: "input_image"`35233524                      The type of the image input. Always `input_image`.35253526                      - `"input_image"`35273528                    - `detail: optional string`35293530                      The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.35313532                  - `ResponseInputAudio object { input_audio, type }`35333534                    An audio input to the model.35353536                  - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`35373538                    A list of inputs, each of which may be either an input text, output text, input3539                    image, or input audio object.35403541                - `role: "user" or "assistant" or "system" or "developer"`35423543                  The role of the message input. One of `user`, `assistant`, `system`, or3544                  `developer`.35453546                  - `"user"`35473548                  - `"assistant"`35493550                  - `"system"`35513552                  - `"developer"`35533554                - `type: optional "message"`35553556                  The type of the message input. Always `message`.35573558                  - `"message"`35593560              - `labels: array of string`35613562                The labels to assign to each item in the evaluation.35633564              - `model: string`35653566                The model to use for the evaluation. Must support structured outputs.35673568              - `name: string`35693570                The name of the grader.35713572              - `passing_labels: array of string`35733574                The labels that indicate a passing result. Must be a subset of labels.35753576              - `type: "label_model"`35773578                The object type, which is always `label_model`.35793580                - `"label_model"`35813582          - `name: string`35833584            The name of the grader.35853586          - `type: "multi"`35873588            The object type, which is always `multi`.35893590            - `"multi"`35913592      - `hyperparameters: optional ReinforcementHyperparameters`35933594        The hyperparameters used for the reinforcement fine-tuning job.35953596        - `batch_size: optional "auto" or number`35973598          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.35993600          - `"auto"`36013602            - `"auto"`36033604          - `number`36053606        - `compute_multiplier: optional "auto" or number`36073608          Multiplier on amount of compute used for exploring search space during training.36093610          - `"auto"`36113612            - `"auto"`36133614          - `number`36153616        - `eval_interval: optional "auto" or number`36173618          The number of training steps between evaluation runs.36193620          - `"auto"`36213622            - `"auto"`36233624          - `number`36253626        - `eval_samples: optional "auto" or number`36273628          Number of evaluation samples to generate per training step.36293630          - `"auto"`36313632            - `"auto"`36333634          - `number`36353636        - `learning_rate_multiplier: optional "auto" or number`36373638          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.36393640          - `"auto"`36413642            - `"auto"`36433644          - `number`36453646        - `n_epochs: optional "auto" or number`36473648          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.36493650          - `"auto"`36513652            - `"auto"`36533654          - `number`36553656        - `reasoning_effort: optional "default" or "low" or "medium" or "high"`36573658          Level of reasoning effort.36593660          - `"default"`36613662          - `"low"`36633664          - `"medium"`36653666          - `"high"`36673668    - `supervised: optional SupervisedMethod`36693670      Configuration for the supervised fine-tuning method.36713672      - `hyperparameters: optional SupervisedHyperparameters`36733674        The hyperparameters used for the fine-tuning job.36753676        - `batch_size: optional "auto" or number`36773678          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.36793680          - `"auto"`36813682            - `"auto"`36833684          - `number`36853686        - `learning_rate_multiplier: optional "auto" or number`36873688          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.36893690          - `"auto"`36913692            - `"auto"`36933694          - `number`36953696        - `n_epochs: optional "auto" or number`36973698          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.36993700          - `"auto"`37013702            - `"auto"`37033704          - `number`37053706### Example37073708```http3709curl https://api.openai.com/v1/fine_tuning/jobs/$FINE_TUNING_JOB_ID/cancel \3710    -X POST \3711    -H "Authorization: Bearer $OPENAI_API_KEY"3712```37133714#### Response37153716```json3717{3718  "id": "id",3719  "created_at": 0,3720  "error": {3721    "code": "code",3722    "message": "message",3723    "param": "param"3724  },3725  "fine_tuned_model": "fine_tuned_model",3726  "finished_at": 0,3727  "hyperparameters": {3728    "batch_size": "auto",3729    "learning_rate_multiplier": "auto",3730    "n_epochs": "auto"3731  },3732  "model": "model",3733  "object": "fine_tuning.job",3734  "organization_id": "organization_id",3735  "result_files": [3736    "file-abc123"3737  ],3738  "seed": 0,3739  "status": "validating_files",3740  "trained_tokens": 0,3741  "training_file": "training_file",3742  "validation_file": "validation_file",3743  "estimated_finish": 0,3744  "integrations": [3745    {3746      "type": "wandb",3747      "wandb": {3748        "project": "my-wandb-project",3749        "entity": "entity",3750        "name": "name",3751        "tags": [3752          "custom-tag"3753        ]3754      }3755    }3756  ],3757  "metadata": {3758    "foo": "string"3759  },3760  "method": {3761    "type": "supervised",3762    "dpo": {3763      "hyperparameters": {3764        "batch_size": "auto",3765        "beta": "auto",3766        "learning_rate_multiplier": "auto",3767        "n_epochs": "auto"3768      }3769    },3770    "reinforcement": {3771      "grader": {3772        "input": "input",3773        "name": "name",3774        "operation": "eq",3775        "reference": "reference",3776        "type": "string_check"3777      },3778      "hyperparameters": {3779        "batch_size": "auto",3780        "compute_multiplier": "auto",3781        "eval_interval": "auto",3782        "eval_samples": "auto",3783        "learning_rate_multiplier": "auto",3784        "n_epochs": "auto",3785        "reasoning_effort": "default"3786      }3787    },3788    "supervised": {3789      "hyperparameters": {3790        "batch_size": "auto",3791        "learning_rate_multiplier": "auto",3792        "n_epochs": "auto"3793      }3794    }3795  }3796}3797```37983799### Example38003801```http3802curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/cancel \3803  -H "Authorization: Bearer $OPENAI_API_KEY"3804```38053806#### Response38073808```json3809{3810  "object": "fine_tuning.job",3811  "id": "ftjob-abc123",3812  "model": "gpt-4o-mini-2024-07-18",3813  "created_at": 1721764800,3814  "fine_tuned_model": null,3815  "organization_id": "org-123",3816  "result_files": [],3817  "status": "cancelled",3818  "validation_file": "file-abc123",3819  "training_file": "file-abc123"3820}3821```38223823## Create fine-tuning job38243825**post** `/fine_tuning/jobs`38263827Creates a fine-tuning job which begins the process of creating a new model from a given dataset.38283829Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete.38303831[Learn more about fine-tuning](/api/docs/guides/model-optimization)38323833### Body Parameters38343835- `model: string or "babbage-002" or "davinci-002" or "gpt-3.5-turbo" or "gpt-4o-mini"`38363837  The name of the model to fine-tune. You can select one of the3838  [supported models](/api/docs/guides/model-optimization#fine-tuning-methods).38393840  - `string`38413842  - `"babbage-002" or "davinci-002" or "gpt-3.5-turbo" or "gpt-4o-mini"`38433844    The name of the model to fine-tune. You can select one of the3845    [supported models](/api/docs/guides/model-optimization#fine-tuning-methods).38463847    - `"babbage-002"`38483849    - `"davinci-002"`38503851    - `"gpt-3.5-turbo"`38523853    - `"gpt-4o-mini"`38543855- `training_file: string`38563857  The ID of an uploaded file that contains training data.38583859  See [upload file](/api/reference/resources/files/methods/create) for how to upload a file.38603861  Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`.38623863  The contents of the file should differ depending on if the model uses the [chat](/api/docs/guides/supervised-fine-tuning#formatting-your-data), [completions](/api/docs/guides/supervised-fine-tuning#formatting-your-data) format, or if the fine-tuning method uses the [preference](/api/docs/guides/direct-preference-optimization) format.38643865  See the [fine-tuning guide](/api/docs/guides/model-optimization) for more details.38663867- `hyperparameters: optional object { batch_size, learning_rate_multiplier, n_epochs }`38683869  The hyperparameters used for the fine-tuning job.3870  This value is now deprecated in favor of `method`, and should be passed in under the `method` parameter.38713872  - `batch_size: optional "auto" or number`38733874    Number of examples in each batch. A larger batch size means that model parameters3875    are updated less frequently, but with lower variance.38763877    - `"auto"`38783879      - `"auto"`38803881    - `number`38823883  - `learning_rate_multiplier: optional "auto" or number`38843885    Scaling factor for the learning rate. A smaller learning rate may be useful to avoid3886    overfitting.38873888    - `"auto"`38893890      - `"auto"`38913892    - `number`38933894  - `n_epochs: optional "auto" or number`38953896    The number of epochs to train the model for. An epoch refers to one full cycle3897    through the training dataset.38983899    - `"auto"`39003901      - `"auto"`39023903    - `number`39043905- `integrations: optional array of object { type, wandb }  or null`39063907  A list of integrations to enable for your fine-tuning job.39083909  - `type: "wandb"`39103911    The type of integration to enable. Currently, only "wandb" (Weights and Biases) is supported.39123913    - `"wandb"`39143915  - `wandb: object { project, entity, name, tags }`39163917    The settings for your integration with Weights and Biases. This payload specifies the project that3918    metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags3919    to your run, and set a default entity (team, username, etc) to be associated with your run.39203921    - `project: string`39223923      The name of the project that the new run will be created under.39243925    - `entity: optional string or null`39263927      The entity to use for the run. This allows you to set the team or username of the WandB user that you would3928      like associated with the run. If not set, the default entity for the registered WandB API key is used.39293930    - `name: optional string or null`39313932      A display name to set for the run. If not set, we will use the Job ID as the name.39333934    - `tags: optional array of string`39353936      A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some3937      default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}".39383939- `metadata: optional Metadata or null`39403941  Set of 16 key-value pairs that can be attached to an object. This can be3942  useful for storing additional information about the object in a structured3943  format, and querying for objects via API or the dashboard.39443945  Keys are strings with a maximum length of 64 characters. Values are strings3946  with a maximum length of 512 characters.39473948- `method: optional object { type, dpo, reinforcement, supervised }`39493950  The method used for fine-tuning.39513952  - `type: "supervised" or "dpo" or "reinforcement"`39533954    The type of method. Is either `supervised`, `dpo`, or `reinforcement`.39553956    - `"supervised"`39573958    - `"dpo"`39593960    - `"reinforcement"`39613962  - `dpo: optional DpoMethod`39633964    Configuration for the DPO fine-tuning method.39653966    - `hyperparameters: optional DpoHyperparameters`39673968      The hyperparameters used for the DPO fine-tuning job.39693970      - `batch_size: optional "auto" or number`39713972        Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.39733974        - `"auto"`39753976          - `"auto"`39773978        - `number`39793980      - `beta: optional "auto" or number`39813982        The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.39833984        - `"auto"`39853986          - `"auto"`39873988        - `number`39893990      - `learning_rate_multiplier: optional "auto" or number`39913992        Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.39933994        - `"auto"`39953996          - `"auto"`39973998        - `number`39994000      - `n_epochs: optional "auto" or number`40014002        The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.40034004        - `"auto"`40054006          - `"auto"`40074008        - `number`40094010  - `reinforcement: optional ReinforcementMethod`40114012    Configuration for the reinforcement fine-tuning method.40134014    - `grader: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`40154016      The grader used for the fine-tuning job.40174018      - `StringCheckGrader object { input, name, operation, 2 more }`40194020        A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.40214022        - `input: string`40234024          The input text. This may include template strings.40254026        - `name: string`40274028          The name of the grader.40294030        - `operation: "eq" or "ne" or "like" or "ilike"`40314032          The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.40334034          - `"eq"`40354036          - `"ne"`40374038          - `"like"`40394040          - `"ilike"`40414042        - `reference: string`40434044          The reference text. This may include template strings.40454046        - `type: "string_check"`40474048          The object type, which is always `string_check`.40494050          - `"string_check"`40514052      - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`40534054        A TextSimilarityGrader object which grades text based on similarity metrics.40554056        - `evaluation_metric: "cosine" or "fuzzy_match" or "bleu" or 8 more`40574058          The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,4059          `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,4060          or `rouge_l`.40614062          - `"cosine"`40634064          - `"fuzzy_match"`40654066          - `"bleu"`40674068          - `"gleu"`40694070          - `"meteor"`40714072          - `"rouge_1"`40734074          - `"rouge_2"`40754076          - `"rouge_3"`40774078          - `"rouge_4"`40794080          - `"rouge_5"`40814082          - `"rouge_l"`40834084        - `input: string`40854086          The text being graded.40874088        - `name: string`40894090          The name of the grader.40914092        - `reference: string`40934094          The text being graded against.40954096        - `type: "text_similarity"`40974098          The type of grader.40994100          - `"text_similarity"`41014102      - `PythonGrader object { name, source, type, image_tag }`41034104        A PythonGrader object that runs a python script on the input.41054106        - `name: string`41074108          The name of the grader.41094110        - `source: string`41114112          The source code of the python script.41134114        - `type: "python"`41154116          The object type, which is always `python`.41174118          - `"python"`41194120        - `image_tag: optional string`41214122          The image tag to use for the python script.41234124      - `ScoreModelGrader object { input, model, name, 3 more }`41254126        A ScoreModelGrader object that uses a model to assign a score to the input.41274128        - `input: array of object { content, role, type }`41294130          The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.41314132          - `content: string or ResponseInputText or object { text, type }  or 3 more`41334134            Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.41354136            - `TextInput = string`41374138              A text input to the model.41394140            - `ResponseInputText object { text, type, prompt_cache_breakpoint }`41414142              A text input to the model.41434144              - `text: string`41454146                The text input to the model.41474148              - `type: "input_text"`41494150                The type of the input item. Always `input_text`.41514152                - `"input_text"`41534154              - `prompt_cache_breakpoint: optional object { mode }`41554156                Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.41574158                - `mode: "explicit"`41594160                  The breakpoint mode. Always `explicit`.41614162                  - `"explicit"`41634164            - `OutputText object { text, type }`41654166              A text output from the model.41674168              - `text: string`41694170                The text output from the model.41714172              - `type: "output_text"`41734174                The type of the output text. Always `output_text`.41754176                - `"output_text"`41774178            - `InputImage object { image_url, type, detail }`41794180              An image input block used within EvalItem content arrays.41814182              - `image_url: string`41834184                The URL of the image input.41854186              - `type: "input_image"`41874188                The type of the image input. Always `input_image`.41894190                - `"input_image"`41914192              - `detail: optional string`41934194                The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.41954196            - `ResponseInputAudio object { input_audio, type }`41974198              An audio input to the model.41994200              - `input_audio: object { data, format }`42014202                - `data: string`42034204                  Base64-encoded audio data.42054206                - `format: "mp3" or "wav"`42074208                  The format of the audio data. Currently supported formats are `mp3` and4209                  `wav`.42104211                  - `"mp3"`42124213                  - `"wav"`42144215              - `type: "input_audio"`42164217                The type of the input item. Always `input_audio`.42184219                - `"input_audio"`42204221            - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`42224223              A list of inputs, each of which may be either an input text, output text, input4224              image, or input audio object.42254226              - `TextInput = string`42274228                A text input to the model.42294230              - `ResponseInputText object { text, type, prompt_cache_breakpoint }`42314232                A text input to the model.42334234              - `OutputText object { text, type }`42354236                A text output from the model.42374238                - `text: string`42394240                  The text output from the model.42414242                - `type: "output_text"`42434244                  The type of the output text. Always `output_text`.42454246                  - `"output_text"`42474248              - `InputImage object { image_url, type, detail }`42494250                An image input block used within EvalItem content arrays.42514252                - `image_url: string`42534254                  The URL of the image input.42554256                - `type: "input_image"`42574258                  The type of the image input. Always `input_image`.42594260                  - `"input_image"`42614262                - `detail: optional string`42634264                  The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.42654266              - `ResponseInputAudio object { input_audio, type }`42674268                An audio input to the model.42694270          - `role: "user" or "assistant" or "system" or "developer"`42714272            The role of the message input. One of `user`, `assistant`, `system`, or4273            `developer`.42744275            - `"user"`42764277            - `"assistant"`42784279            - `"system"`42804281            - `"developer"`42824283          - `type: optional "message"`42844285            The type of the message input. Always `message`.42864287            - `"message"`42884289        - `model: string`42904291          The model to use for the evaluation.42924293        - `name: string`42944295          The name of the grader.42964297        - `type: "score_model"`42984299          The object type, which is always `score_model`.43004301          - `"score_model"`43024303        - `range: optional array of number`43044305          The range of the score. Defaults to `[0, 1]`.43064307        - `sampling_params: optional object { max_completions_tokens, reasoning_effort, seed, 2 more }`43084309          The sampling parameters for the model.43104311          - `max_completions_tokens: optional number or null`43124313            The maximum number of tokens the grader model may generate in its response.43144315          - `reasoning_effort: optional ReasoningEffort or null`43164317            Constrains effort on reasoning for reasoning models. Currently supported4318            values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.4319            Reducing reasoning effort can result in faster responses and fewer tokens4320            used on reasoning in a response. Not all reasoning models support every4321            value. See the4322            [reasoning guide](/api/docs/guides/reasoning)4323            for model-specific support.43244325            - `"none"`43264327            - `"minimal"`43284329            - `"low"`43304331            - `"medium"`43324333            - `"high"`43344335            - `"xhigh"`43364337            - `"max"`43384339          - `seed: optional number or null`43404341            A seed value to initialize the randomness, during sampling.43424343          - `temperature: optional number or null`43444345            A higher temperature increases randomness in the outputs.43464347          - `top_p: optional number or null`43484349            An alternative to temperature for nucleus sampling; 1.0 includes all tokens.43504351      - `MultiGrader object { calculate_output, graders, name, type }`43524353        A MultiGrader object combines the output of multiple graders to produce a single score.43544355        - `calculate_output: string`43564357          A formula to calculate the output based on grader results.43584359        - `graders: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`43604361          A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.43624363          - `StringCheckGrader object { input, name, operation, 2 more }`43644365            A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.43664367          - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`43684369            A TextSimilarityGrader object which grades text based on similarity metrics.43704371          - `PythonGrader object { name, source, type, image_tag }`43724373            A PythonGrader object that runs a python script on the input.43744375          - `ScoreModelGrader object { input, model, name, 3 more }`43764377            A ScoreModelGrader object that uses a model to assign a score to the input.43784379          - `LabelModelGrader object { input, labels, model, 3 more }`43804381            A LabelModelGrader object which uses a model to assign labels to each item4382            in the evaluation.43834384            - `input: array of object { content, role, type }`43854386              - `content: string or ResponseInputText or object { text, type }  or 3 more`43874388                Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.43894390                - `TextInput = string`43914392                  A text input to the model.43934394                - `ResponseInputText object { text, type, prompt_cache_breakpoint }`43954396                  A text input to the model.43974398                - `OutputText object { text, type }`43994400                  A text output from the model.44014402                  - `text: string`44034404                    The text output from the model.44054406                  - `type: "output_text"`44074408                    The type of the output text. Always `output_text`.44094410                    - `"output_text"`44114412                - `InputImage object { image_url, type, detail }`44134414                  An image input block used within EvalItem content arrays.44154416                  - `image_url: string`44174418                    The URL of the image input.44194420                  - `type: "input_image"`44214422                    The type of the image input. Always `input_image`.44234424                    - `"input_image"`44254426                  - `detail: optional string`44274428                    The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.44294430                - `ResponseInputAudio object { input_audio, type }`44314432                  An audio input to the model.44334434                - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`44354436                  A list of inputs, each of which may be either an input text, output text, input4437                  image, or input audio object.44384439              - `role: "user" or "assistant" or "system" or "developer"`44404441                The role of the message input. One of `user`, `assistant`, `system`, or4442                `developer`.44434444                - `"user"`44454446                - `"assistant"`44474448                - `"system"`44494450                - `"developer"`44514452              - `type: optional "message"`44534454                The type of the message input. Always `message`.44554456                - `"message"`44574458            - `labels: array of string`44594460              The labels to assign to each item in the evaluation.44614462            - `model: string`44634464              The model to use for the evaluation. Must support structured outputs.44654466            - `name: string`44674468              The name of the grader.44694470            - `passing_labels: array of string`44714472              The labels that indicate a passing result. Must be a subset of labels.44734474            - `type: "label_model"`44754476              The object type, which is always `label_model`.44774478              - `"label_model"`44794480        - `name: string`44814482          The name of the grader.44834484        - `type: "multi"`44854486          The object type, which is always `multi`.44874488          - `"multi"`44894490    - `hyperparameters: optional ReinforcementHyperparameters`44914492      The hyperparameters used for the reinforcement fine-tuning job.44934494      - `batch_size: optional "auto" or number`44954496        Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.44974498        - `"auto"`44994500          - `"auto"`45014502        - `number`45034504      - `compute_multiplier: optional "auto" or number`45054506        Multiplier on amount of compute used for exploring search space during training.45074508        - `"auto"`45094510          - `"auto"`45114512        - `number`45134514      - `eval_interval: optional "auto" or number`45154516        The number of training steps between evaluation runs.45174518        - `"auto"`45194520          - `"auto"`45214522        - `number`45234524      - `eval_samples: optional "auto" or number`45254526        Number of evaluation samples to generate per training step.45274528        - `"auto"`45294530          - `"auto"`45314532        - `number`45334534      - `learning_rate_multiplier: optional "auto" or number`45354536        Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.45374538        - `"auto"`45394540          - `"auto"`45414542        - `number`45434544      - `n_epochs: optional "auto" or number`45454546        The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.45474548        - `"auto"`45494550          - `"auto"`45514552        - `number`45534554      - `reasoning_effort: optional "default" or "low" or "medium" or "high"`45554556        Level of reasoning effort.45574558        - `"default"`45594560        - `"low"`45614562        - `"medium"`45634564        - `"high"`45654566  - `supervised: optional SupervisedMethod`45674568    Configuration for the supervised fine-tuning method.45694570    - `hyperparameters: optional SupervisedHyperparameters`45714572      The hyperparameters used for the fine-tuning job.45734574      - `batch_size: optional "auto" or number`45754576        Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.45774578        - `"auto"`45794580          - `"auto"`45814582        - `number`45834584      - `learning_rate_multiplier: optional "auto" or number`45854586        Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.45874588        - `"auto"`45894590          - `"auto"`45914592        - `number`45934594      - `n_epochs: optional "auto" or number`45954596        The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.45974598        - `"auto"`45994600          - `"auto"`46014602        - `number`46034604- `seed: optional number or null`46054606  The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases.4607  If a seed is not specified, one will be generated for you.46084609- `suffix: optional string or null`46104611  A string of up to 64 characters that will be added to your fine-tuned model name.46124613  For example, a `suffix` of "custom-model-name" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`.46144615- `validation_file: optional string or null`46164617  The ID of an uploaded file that contains validation data.46184619  If you provide this file, the data is used to generate validation4620  metrics periodically during fine-tuning. These metrics can be viewed in4621  the fine-tuning results file.4622  The same data should not be present in both train and validation files.46234624  Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`.46254626  See the [fine-tuning guide](/api/docs/guides/model-optimization) for more details.46274628### Returns46294630- `FineTuningJob object { id, created_at, error, 16 more }`46314632  The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.46334634  - `id: string`46354636    The object identifier, which can be referenced in the API endpoints.46374638  - `created_at: number`46394640    The Unix timestamp (in seconds) for when the fine-tuning job was created.46414642  - `error: object { code, message, param }  or null`46434644    For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure.46454646    - `code: string`46474648      A machine-readable error code.46494650    - `message: string`46514652      A human-readable error message.46534654    - `param: string or null`46554656      The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific.46574658  - `fine_tuned_model: string or null`46594660    The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.46614662  - `finished_at: number or null`46634664    The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running.46654666  - `hyperparameters: object { batch_size, learning_rate_multiplier, n_epochs }`46674668    The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs.46694670    - `batch_size: optional "auto" or number or null`46714672      Number of examples in each batch. A larger batch size means that model parameters4673      are updated less frequently, but with lower variance.46744675      - `"auto"`46764677        - `"auto"`46784679      - `number`46804681    - `learning_rate_multiplier: optional "auto" or number`46824683      Scaling factor for the learning rate. A smaller learning rate may be useful to avoid4684      overfitting.46854686      - `"auto"`46874688        - `"auto"`46894690      - `number`46914692    - `n_epochs: optional "auto" or number`46934694      The number of epochs to train the model for. An epoch refers to one full cycle4695      through the training dataset.46964697      - `"auto"`46984699        - `"auto"`47004701      - `number`47024703  - `model: string`47044705    The base model that is being fine-tuned.47064707  - `object: "fine_tuning.job"`47084709    The object type, which is always "fine_tuning.job".47104711    - `"fine_tuning.job"`47124713  - `organization_id: string`47144715    The organization that owns the fine-tuning job.47164717  - `result_files: array of string`47184719    The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/api/reference/resources/files/methods/content).47204721  - `seed: number`47224723    The seed used for the fine-tuning job.47244725  - `status: "validating_files" or "queued" or "running" or 3 more`47264727    The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.47284729    - `"validating_files"`47304731    - `"queued"`47324733    - `"running"`47344735    - `"succeeded"`47364737    - `"failed"`47384739    - `"cancelled"`47404741  - `trained_tokens: number or null`47424743    The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.47444745  - `training_file: string`47464747    The file ID used for training. You can retrieve the training data with the [Files API](/api/reference/resources/files/methods/content).47484749  - `validation_file: string or null`47504751    The file ID used for validation. You can retrieve the validation results with the [Files API](/api/reference/resources/files/methods/content).47524753  - `estimated_finish: optional number or null`47544755    The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running.47564757  - `integrations: optional array of FineTuningJobWandbIntegrationObject or null`47584759    A list of integrations to enable for this fine-tuning job.47604761    - `type: "wandb"`47624763      The type of the integration being enabled for the fine-tuning job47644765      - `"wandb"`47664767    - `wandb: FineTuningJobWandbIntegration`47684769      The settings for your integration with Weights and Biases. This payload specifies the project that4770      metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags4771      to your run, and set a default entity (team, username, etc) to be associated with your run.47724773      - `project: string`47744775        The name of the project that the new run will be created under.47764777      - `entity: optional string or null`47784779        The entity to use for the run. This allows you to set the team or username of the WandB user that you would4780        like associated with the run. If not set, the default entity for the registered WandB API key is used.47814782      - `name: optional string or null`47834784        A display name to set for the run. If not set, we will use the Job ID as the name.47854786      - `tags: optional array of string`47874788        A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some4789        default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}".47904791  - `metadata: optional Metadata or null`47924793    Set of 16 key-value pairs that can be attached to an object. This can be4794    useful for storing additional information about the object in a structured4795    format, and querying for objects via API or the dashboard.47964797    Keys are strings with a maximum length of 64 characters. Values are strings4798    with a maximum length of 512 characters.47994800  - `method: optional object { type, dpo, reinforcement, supervised }`48014802    The method used for fine-tuning.48034804    - `type: "supervised" or "dpo" or "reinforcement"`48054806      The type of method. Is either `supervised`, `dpo`, or `reinforcement`.48074808      - `"supervised"`48094810      - `"dpo"`48114812      - `"reinforcement"`48134814    - `dpo: optional DpoMethod`48154816      Configuration for the DPO fine-tuning method.48174818      - `hyperparameters: optional DpoHyperparameters`48194820        The hyperparameters used for the DPO fine-tuning job.48214822        - `batch_size: optional "auto" or number`48234824          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.48254826          - `"auto"`48274828            - `"auto"`48294830          - `number`48314832        - `beta: optional "auto" or number`48334834          The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.48354836          - `"auto"`48374838            - `"auto"`48394840          - `number`48414842        - `learning_rate_multiplier: optional "auto" or number`48434844          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.48454846          - `"auto"`48474848            - `"auto"`48494850          - `number`48514852        - `n_epochs: optional "auto" or number`48534854          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.48554856          - `"auto"`48574858            - `"auto"`48594860          - `number`48614862    - `reinforcement: optional ReinforcementMethod`48634864      Configuration for the reinforcement fine-tuning method.48654866      - `grader: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`48674868        The grader used for the fine-tuning job.48694870        - `StringCheckGrader object { input, name, operation, 2 more }`48714872          A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.48734874          - `input: string`48754876            The input text. This may include template strings.48774878          - `name: string`48794880            The name of the grader.48814882          - `operation: "eq" or "ne" or "like" or "ilike"`48834884            The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.48854886            - `"eq"`48874888            - `"ne"`48894890            - `"like"`48914892            - `"ilike"`48934894          - `reference: string`48954896            The reference text. This may include template strings.48974898          - `type: "string_check"`48994900            The object type, which is always `string_check`.49014902            - `"string_check"`49034904        - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`49054906          A TextSimilarityGrader object which grades text based on similarity metrics.49074908          - `evaluation_metric: "cosine" or "fuzzy_match" or "bleu" or 8 more`49094910            The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,4911            `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,4912            or `rouge_l`.49134914            - `"cosine"`49154916            - `"fuzzy_match"`49174918            - `"bleu"`49194920            - `"gleu"`49214922            - `"meteor"`49234924            - `"rouge_1"`49254926            - `"rouge_2"`49274928            - `"rouge_3"`49294930            - `"rouge_4"`49314932            - `"rouge_5"`49334934            - `"rouge_l"`49354936          - `input: string`49374938            The text being graded.49394940          - `name: string`49414942            The name of the grader.49434944          - `reference: string`49454946            The text being graded against.49474948          - `type: "text_similarity"`49494950            The type of grader.49514952            - `"text_similarity"`49534954        - `PythonGrader object { name, source, type, image_tag }`49554956          A PythonGrader object that runs a python script on the input.49574958          - `name: string`49594960            The name of the grader.49614962          - `source: string`49634964            The source code of the python script.49654966          - `type: "python"`49674968            The object type, which is always `python`.49694970            - `"python"`49714972          - `image_tag: optional string`49734974            The image tag to use for the python script.49754976        - `ScoreModelGrader object { input, model, name, 3 more }`49774978          A ScoreModelGrader object that uses a model to assign a score to the input.49794980          - `input: array of object { content, role, type }`49814982            The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.49834984            - `content: string or ResponseInputText or object { text, type }  or 3 more`49854986              Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.49874988              - `TextInput = string`49894990                A text input to the model.49914992              - `ResponseInputText object { text, type, prompt_cache_breakpoint }`49934994                A text input to the model.49954996                - `text: string`49974998                  The text input to the model.49995000                - `type: "input_text"`50015002                  The type of the input item. Always `input_text`.50035004                  - `"input_text"`50055006                - `prompt_cache_breakpoint: optional object { mode }`50075008                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.50095010                  - `mode: "explicit"`50115012                    The breakpoint mode. Always `explicit`.50135014                    - `"explicit"`50155016              - `OutputText object { text, type }`50175018                A text output from the model.50195020                - `text: string`50215022                  The text output from the model.50235024                - `type: "output_text"`50255026                  The type of the output text. Always `output_text`.50275028                  - `"output_text"`50295030              - `InputImage object { image_url, type, detail }`50315032                An image input block used within EvalItem content arrays.50335034                - `image_url: string`50355036                  The URL of the image input.50375038                - `type: "input_image"`50395040                  The type of the image input. Always `input_image`.50415042                  - `"input_image"`50435044                - `detail: optional string`50455046                  The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.50475048              - `ResponseInputAudio object { input_audio, type }`50495050                An audio input to the model.50515052                - `input_audio: object { data, format }`50535054                  - `data: string`50555056                    Base64-encoded audio data.50575058                  - `format: "mp3" or "wav"`50595060                    The format of the audio data. Currently supported formats are `mp3` and5061                    `wav`.50625063                    - `"mp3"`50645065                    - `"wav"`50665067                - `type: "input_audio"`50685069                  The type of the input item. Always `input_audio`.50705071                  - `"input_audio"`50725073              - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`50745075                A list of inputs, each of which may be either an input text, output text, input5076                image, or input audio object.50775078                - `TextInput = string`50795080                  A text input to the model.50815082                - `ResponseInputText object { text, type, prompt_cache_breakpoint }`50835084                  A text input to the model.50855086                - `OutputText object { text, type }`50875088                  A text output from the model.50895090                  - `text: string`50915092                    The text output from the model.50935094                  - `type: "output_text"`50955096                    The type of the output text. Always `output_text`.50975098                    - `"output_text"`50995100                - `InputImage object { image_url, type, detail }`51015102                  An image input block used within EvalItem content arrays.51035104                  - `image_url: string`51055106                    The URL of the image input.51075108                  - `type: "input_image"`51095110                    The type of the image input. Always `input_image`.51115112                    - `"input_image"`51135114                  - `detail: optional string`51155116                    The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.51175118                - `ResponseInputAudio object { input_audio, type }`51195120                  An audio input to the model.51215122            - `role: "user" or "assistant" or "system" or "developer"`51235124              The role of the message input. One of `user`, `assistant`, `system`, or5125              `developer`.51265127              - `"user"`51285129              - `"assistant"`51305131              - `"system"`51325133              - `"developer"`51345135            - `type: optional "message"`51365137              The type of the message input. Always `message`.51385139              - `"message"`51405141          - `model: string`51425143            The model to use for the evaluation.51445145          - `name: string`51465147            The name of the grader.51485149          - `type: "score_model"`51505151            The object type, which is always `score_model`.51525153            - `"score_model"`51545155          - `range: optional array of number`51565157            The range of the score. Defaults to `[0, 1]`.51585159          - `sampling_params: optional object { max_completions_tokens, reasoning_effort, seed, 2 more }`51605161            The sampling parameters for the model.51625163            - `max_completions_tokens: optional number or null`51645165              The maximum number of tokens the grader model may generate in its response.51665167            - `reasoning_effort: optional ReasoningEffort or null`51685169              Constrains effort on reasoning for reasoning models. Currently supported5170              values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.5171              Reducing reasoning effort can result in faster responses and fewer tokens5172              used on reasoning in a response. Not all reasoning models support every5173              value. See the5174              [reasoning guide](/api/docs/guides/reasoning)5175              for model-specific support.51765177              - `"none"`51785179              - `"minimal"`51805181              - `"low"`51825183              - `"medium"`51845185              - `"high"`51865187              - `"xhigh"`51885189              - `"max"`51905191            - `seed: optional number or null`51925193              A seed value to initialize the randomness, during sampling.51945195            - `temperature: optional number or null`51965197              A higher temperature increases randomness in the outputs.51985199            - `top_p: optional number or null`52005201              An alternative to temperature for nucleus sampling; 1.0 includes all tokens.52025203        - `MultiGrader object { calculate_output, graders, name, type }`52045205          A MultiGrader object combines the output of multiple graders to produce a single score.52065207          - `calculate_output: string`52085209            A formula to calculate the output based on grader results.52105211          - `graders: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`52125213            A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.52145215            - `StringCheckGrader object { input, name, operation, 2 more }`52165217              A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.52185219            - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`52205221              A TextSimilarityGrader object which grades text based on similarity metrics.52225223            - `PythonGrader object { name, source, type, image_tag }`52245225              A PythonGrader object that runs a python script on the input.52265227            - `ScoreModelGrader object { input, model, name, 3 more }`52285229              A ScoreModelGrader object that uses a model to assign a score to the input.52305231            - `LabelModelGrader object { input, labels, model, 3 more }`52325233              A LabelModelGrader object which uses a model to assign labels to each item5234              in the evaluation.52355236              - `input: array of object { content, role, type }`52375238                - `content: string or ResponseInputText or object { text, type }  or 3 more`52395240                  Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.52415242                  - `TextInput = string`52435244                    A text input to the model.52455246                  - `ResponseInputText object { text, type, prompt_cache_breakpoint }`52475248                    A text input to the model.52495250                  - `OutputText object { text, type }`52515252                    A text output from the model.52535254                    - `text: string`52555256                      The text output from the model.52575258                    - `type: "output_text"`52595260                      The type of the output text. Always `output_text`.52615262                      - `"output_text"`52635264                  - `InputImage object { image_url, type, detail }`52655266                    An image input block used within EvalItem content arrays.52675268                    - `image_url: string`52695270                      The URL of the image input.52715272                    - `type: "input_image"`52735274                      The type of the image input. Always `input_image`.52755276                      - `"input_image"`52775278                    - `detail: optional string`52795280                      The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.52815282                  - `ResponseInputAudio object { input_audio, type }`52835284                    An audio input to the model.52855286                  - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`52875288                    A list of inputs, each of which may be either an input text, output text, input5289                    image, or input audio object.52905291                - `role: "user" or "assistant" or "system" or "developer"`52925293                  The role of the message input. One of `user`, `assistant`, `system`, or5294                  `developer`.52955296                  - `"user"`52975298                  - `"assistant"`52995300                  - `"system"`53015302                  - `"developer"`53035304                - `type: optional "message"`53055306                  The type of the message input. Always `message`.53075308                  - `"message"`53095310              - `labels: array of string`53115312                The labels to assign to each item in the evaluation.53135314              - `model: string`53155316                The model to use for the evaluation. Must support structured outputs.53175318              - `name: string`53195320                The name of the grader.53215322              - `passing_labels: array of string`53235324                The labels that indicate a passing result. Must be a subset of labels.53255326              - `type: "label_model"`53275328                The object type, which is always `label_model`.53295330                - `"label_model"`53315332          - `name: string`53335334            The name of the grader.53355336          - `type: "multi"`53375338            The object type, which is always `multi`.53395340            - `"multi"`53415342      - `hyperparameters: optional ReinforcementHyperparameters`53435344        The hyperparameters used for the reinforcement fine-tuning job.53455346        - `batch_size: optional "auto" or number`53475348          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.53495350          - `"auto"`53515352            - `"auto"`53535354          - `number`53555356        - `compute_multiplier: optional "auto" or number`53575358          Multiplier on amount of compute used for exploring search space during training.53595360          - `"auto"`53615362            - `"auto"`53635364          - `number`53655366        - `eval_interval: optional "auto" or number`53675368          The number of training steps between evaluation runs.53695370          - `"auto"`53715372            - `"auto"`53735374          - `number`53755376        - `eval_samples: optional "auto" or number`53775378          Number of evaluation samples to generate per training step.53795380          - `"auto"`53815382            - `"auto"`53835384          - `number`53855386        - `learning_rate_multiplier: optional "auto" or number`53875388          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.53895390          - `"auto"`53915392            - `"auto"`53935394          - `number`53955396        - `n_epochs: optional "auto" or number`53975398          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.53995400          - `"auto"`54015402            - `"auto"`54035404          - `number`54055406        - `reasoning_effort: optional "default" or "low" or "medium" or "high"`54075408          Level of reasoning effort.54095410          - `"default"`54115412          - `"low"`54135414          - `"medium"`54155416          - `"high"`54175418    - `supervised: optional SupervisedMethod`54195420      Configuration for the supervised fine-tuning method.54215422      - `hyperparameters: optional SupervisedHyperparameters`54235424        The hyperparameters used for the fine-tuning job.54255426        - `batch_size: optional "auto" or number`54275428          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.54295430          - `"auto"`54315432            - `"auto"`54335434          - `number`54355436        - `learning_rate_multiplier: optional "auto" or number`54375438          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.54395440          - `"auto"`54415442            - `"auto"`54435444          - `number`54455446        - `n_epochs: optional "auto" or number`54475448          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.54495450          - `"auto"`54515452            - `"auto"`54535454          - `number`54555456### Example54575458```http5459curl https://api.openai.com/v1/fine_tuning/jobs \5460    -H 'Content-Type: application/json' \5461    -H "Authorization: Bearer $OPENAI_API_KEY" \5462    -d '{5463          "model": "gpt-4o-mini",5464          "training_file": "file-abc123",5465          "seed": 42,5466          "validation_file": "file-abc123"5467        }'5468```54695470#### Response54715472```json5473{5474  "id": "id",5475  "created_at": 0,5476  "error": {5477    "code": "code",5478    "message": "message",5479    "param": "param"5480  },5481  "fine_tuned_model": "fine_tuned_model",5482  "finished_at": 0,5483  "hyperparameters": {5484    "batch_size": "auto",5485    "learning_rate_multiplier": "auto",5486    "n_epochs": "auto"5487  },5488  "model": "model",5489  "object": "fine_tuning.job",5490  "organization_id": "organization_id",5491  "result_files": [5492    "file-abc123"5493  ],5494  "seed": 0,5495  "status": "validating_files",5496  "trained_tokens": 0,5497  "training_file": "training_file",5498  "validation_file": "validation_file",5499  "estimated_finish": 0,5500  "integrations": [5501    {5502      "type": "wandb",5503      "wandb": {5504        "project": "my-wandb-project",5505        "entity": "entity",5506        "name": "name",5507        "tags": [5508          "custom-tag"5509        ]5510      }5511    }5512  ],5513  "metadata": {5514    "foo": "string"5515  },5516  "method": {5517    "type": "supervised",5518    "dpo": {5519      "hyperparameters": {5520        "batch_size": "auto",5521        "beta": "auto",5522        "learning_rate_multiplier": "auto",5523        "n_epochs": "auto"5524      }5525    },5526    "reinforcement": {5527      "grader": {5528        "input": "input",5529        "name": "name",5530        "operation": "eq",5531        "reference": "reference",5532        "type": "string_check"5533      },5534      "hyperparameters": {5535        "batch_size": "auto",5536        "compute_multiplier": "auto",5537        "eval_interval": "auto",5538        "eval_samples": "auto",5539        "learning_rate_multiplier": "auto",5540        "n_epochs": "auto",5541        "reasoning_effort": "default"5542      }5543    },5544    "supervised": {5545      "hyperparameters": {5546        "batch_size": "auto",5547        "learning_rate_multiplier": "auto",5548        "n_epochs": "auto"5549      }5550    }5551  }5552}5553```55545555### DPO55565557```http5558curl https://api.openai.com/v1/fine_tuning/jobs \5559  -H "Content-Type: application/json" \5560  -H "Authorization: Bearer $OPENAI_API_KEY" \5561  -d '{5562    "training_file": "file-abc123",5563    "validation_file": "file-abc123",5564    "model": "gpt-4o-mini",5565    "method": {5566      "type": "dpo",5567      "dpo": {5568        "hyperparameters": {5569          "beta": 0.15570        }5571      }5572    }5573  }'5574```55755576#### Response55775578```json5579{5580  "object": "fine_tuning.job",5581  "id": "ftjob-abc",5582  "model": "gpt-4o-mini",5583  "created_at": 1746130590,5584  "fine_tuned_model": null,5585  "organization_id": "org-abc",5586  "result_files": [],5587  "status": "queued",5588  "validation_file": "file-123",5589  "training_file": "file-abc",5590  "method": {5591    "type": "dpo",5592    "dpo": {5593      "hyperparameters": {5594        "beta": 0.1,5595        "batch_size": "auto",5596        "learning_rate_multiplier": "auto",5597        "n_epochs": "auto"5598      }5599    }5600  },5601  "metadata": null,5602  "error": {5603    "code": null,5604    "message": null,5605    "param": null5606  },5607  "finished_at": null,5608  "hyperparameters": null,5609  "seed": 1036326793,5610  "estimated_finish": null,5611  "integrations": [],5612  "user_provided_suffix": null,5613  "usage_metrics": null,5614  "shared_with_openai": false5615}5616```56175618### Example56195620```http5621curl https://api.openai.com/v1/fine_tuning/jobs \5622  -H "Content-Type: application/json" \5623  -H "Authorization: Bearer $OPENAI_API_KEY" \5624  -d '{5625    "training_file": "file-BK7bzQj3FfZFXr7DbL6xJwfo",5626    "model": "gpt-4o-mini"5627  }'5628```56295630#### Response56315632```json5633{5634  "object": "fine_tuning.job",5635  "id": "ftjob-abc123",5636  "model": "gpt-4o-mini-2024-07-18",5637  "created_at": 1721764800,5638  "fine_tuned_model": null,5639  "organization_id": "org-123",5640  "result_files": [],5641  "status": "queued",5642  "validation_file": null,5643  "training_file": "file-abc123",5644  "method": {5645    "type": "supervised",5646    "supervised": {5647      "hyperparameters": {5648        "batch_size": "auto",5649        "learning_rate_multiplier": "auto",5650        "n_epochs": "auto",5651      }5652    }5653  },5654  "metadata": null5655}5656```56575658### Epochs56595660```http5661curl https://api.openai.com/v1/fine_tuning/jobs \5662  -H "Content-Type: application/json" \5663  -H "Authorization: Bearer $OPENAI_API_KEY" \5664  -d '{5665    "training_file": "file-abc123",5666    "model": "gpt-4o-mini",5667    "method": {5668      "type": "supervised",5669      "supervised": {5670        "hyperparameters": {5671          "n_epochs": 25672        }5673      }5674    }5675  }'5676```56775678#### Response56795680```json5681{5682  "object": "fine_tuning.job",5683  "id": "ftjob-abc123",5684  "model": "gpt-4o-mini",5685  "created_at": 1721764800,5686  "fine_tuned_model": null,5687  "organization_id": "org-123",5688  "result_files": [],5689  "status": "queued",5690  "validation_file": null,5691  "training_file": "file-abc123",5692  "hyperparameters": {5693    "batch_size": "auto",5694    "learning_rate_multiplier": "auto",5695    "n_epochs": 25696  },5697  "method": {5698    "type": "supervised",5699    "supervised": {5700      "hyperparameters": {5701        "batch_size": "auto",5702        "learning_rate_multiplier": "auto",5703        "n_epochs": 25704      }5705    }5706  },5707  "metadata": null,5708  "error": {5709    "code": null,5710    "message": null,5711    "param": null5712  },5713  "finished_at": null,5714  "seed": 683058546,5715  "trained_tokens": null,5716  "estimated_finish": null,5717  "integrations": [],5718  "user_provided_suffix": null,5719  "usage_metrics": null,5720  "shared_with_openai": false5721}5722```57235724### Reinforcement57255726```http5727curl https://api.openai.com/v1/fine_tuning/jobs \5728  -H "Content-Type: application/json" \5729  -H "Authorization: Bearer $OPENAI_API_KEY" \5730  -d '{5731    "training_file": "file-abc",5732    "validation_file": "file-123",5733    "model": "o4-mini",5734    "method": {5735      "type": "reinforcement",5736      "reinforcement": {5737        "grader": {5738          "type": "string_check",5739          "name": "Example string check grader",5740          "input": "{{sample.output_text}}",5741          "reference": "{{item.label}}",5742          "operation": "eq"5743        },5744        "hyperparameters": {5745          "reasoning_effort": "medium"5746        }5747      }5748    }5749  }'5750```57515752#### Response57535754```json5755{5756  "object": "fine_tuning.job",5757  "id": "ftjob-abc123",5758  "model": "o4-mini",5759  "created_at": 1721764800,5760  "finished_at": null,5761  "fine_tuned_model": null,5762  "organization_id": "org-123",5763  "result_files": [],5764  "status": "validating_files",5765  "validation_file": "file-123",5766  "training_file": "file-abc",5767  "trained_tokens": null,5768  "error": {},5769  "user_provided_suffix": null,5770  "seed": 950189191,5771  "estimated_finish": null,5772  "integrations": [],5773  "method": {5774    "type": "reinforcement",5775    "reinforcement": {5776      "hyperparameters": {5777        "batch_size": "auto",5778        "learning_rate_multiplier": "auto",5779        "n_epochs": "auto",5780        "eval_interval": "auto",5781        "eval_samples": "auto",5782        "compute_multiplier": "auto",5783        "reasoning_effort": "medium"5784      },5785      "grader": {5786        "type": "string_check",5787        "name": "Example string check grader",5788        "input": "{{sample.output_text}}",5789        "reference": "{{item.label}}",5790        "operation": "eq"5791      },5792      "response_format": null5793    }5794  },5795  "metadata": null,5796  "usage_metrics": null,5797  "shared_with_openai": false5798}5799      5800```58015802### Validation file58035804```http5805curl https://api.openai.com/v1/fine_tuning/jobs \5806  -H "Content-Type: application/json" \5807  -H "Authorization: Bearer $OPENAI_API_KEY" \5808  -d '{5809    "training_file": "file-abc123",5810    "validation_file": "file-abc123",5811    "model": "gpt-4o-mini"5812  }'5813```58145815#### Response58165817```json5818{5819  "object": "fine_tuning.job",5820  "id": "ftjob-abc123",5821  "model": "gpt-4o-mini-2024-07-18",5822  "created_at": 1721764800,5823  "fine_tuned_model": null,5824  "organization_id": "org-123",5825  "result_files": [],5826  "status": "queued",5827  "validation_file": "file-abc123",5828  "training_file": "file-abc123",5829  "method": {5830    "type": "supervised",5831    "supervised": {5832      "hyperparameters": {5833        "batch_size": "auto",5834        "learning_rate_multiplier": "auto",5835        "n_epochs": "auto",5836      }5837    }5838  },5839  "metadata": null5840}5841```58425843### W&B Integration58445845```http5846curl https://api.openai.com/v1/fine_tuning/jobs \5847  -H "Content-Type: application/json" \5848  -H "Authorization: Bearer $OPENAI_API_KEY" \5849  -d '{5850    "training_file": "file-abc123",5851    "validation_file": "file-abc123",5852    "model": "gpt-4o-mini",5853    "integrations": [5854      {5855        "type": "wandb",5856        "wandb": {5857          "project": "my-wandb-project",5858          "name": "ft-run-display-name"5859          "tags": [5860            "first-experiment", "v2"5861          ]5862        }5863      }5864    ]5865  }'5866```58675868#### Response58695870```json5871{5872  "object": "fine_tuning.job",5873  "id": "ftjob-abc123",5874  "model": "gpt-4o-mini-2024-07-18",5875  "created_at": 1721764800,5876  "fine_tuned_model": null,5877  "organization_id": "org-123",5878  "result_files": [],5879  "status": "queued",5880  "validation_file": "file-abc123",5881  "training_file": "file-abc123",5882  "integrations": [5883    {5884      "type": "wandb",5885      "wandb": {5886        "project": "my-wandb-project",5887        "entity": None,5888        "run_id": "ftjob-abc123"5889      }5890    }5891  ],5892  "method": {5893    "type": "supervised",5894    "supervised": {5895      "hyperparameters": {5896        "batch_size": "auto",5897        "learning_rate_multiplier": "auto",5898        "n_epochs": "auto",5899      }5900    }5901  },5902  "metadata": null5903}5904```59055906## List fine-tuning jobs59075908**get** `/fine_tuning/jobs`59095910List your organization's fine-tuning jobs59115912### Query Parameters59135914- `after: optional string`59155916  Identifier for the last job from the previous pagination request.59175918- `limit: optional number`59195920  Number of fine-tuning jobs to retrieve.59215922- `metadata: optional map[string] or null`59235924  Optional metadata filter. To filter, use the syntax `metadata[k]=v`. Alternatively, set `metadata=null` to indicate no metadata.59255926### Returns59275928- `data: array of FineTuningJob`59295930  - `id: string`59315932    The object identifier, which can be referenced in the API endpoints.59335934  - `created_at: number`59355936    The Unix timestamp (in seconds) for when the fine-tuning job was created.59375938  - `error: object { code, message, param }  or null`59395940    For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure.59415942    - `code: string`59435944      A machine-readable error code.59455946    - `message: string`59475948      A human-readable error message.59495950    - `param: string or null`59515952      The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific.59535954  - `fine_tuned_model: string or null`59555956    The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.59575958  - `finished_at: number or null`59595960    The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running.59615962  - `hyperparameters: object { batch_size, learning_rate_multiplier, n_epochs }`59635964    The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs.59655966    - `batch_size: optional "auto" or number or null`59675968      Number of examples in each batch. A larger batch size means that model parameters5969      are updated less frequently, but with lower variance.59705971      - `"auto"`59725973        - `"auto"`59745975      - `number`59765977    - `learning_rate_multiplier: optional "auto" or number`59785979      Scaling factor for the learning rate. A smaller learning rate may be useful to avoid5980      overfitting.59815982      - `"auto"`59835984        - `"auto"`59855986      - `number`59875988    - `n_epochs: optional "auto" or number`59895990      The number of epochs to train the model for. An epoch refers to one full cycle5991      through the training dataset.59925993      - `"auto"`59945995        - `"auto"`59965997      - `number`59985999  - `model: string`60006001    The base model that is being fine-tuned.60026003  - `object: "fine_tuning.job"`60046005    The object type, which is always "fine_tuning.job".60066007    - `"fine_tuning.job"`60086009  - `organization_id: string`60106011    The organization that owns the fine-tuning job.60126013  - `result_files: array of string`60146015    The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/api/reference/resources/files/methods/content).60166017  - `seed: number`60186019    The seed used for the fine-tuning job.60206021  - `status: "validating_files" or "queued" or "running" or 3 more`60226023    The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.60246025    - `"validating_files"`60266027    - `"queued"`60286029    - `"running"`60306031    - `"succeeded"`60326033    - `"failed"`60346035    - `"cancelled"`60366037  - `trained_tokens: number or null`60386039    The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.60406041  - `training_file: string`60426043    The file ID used for training. You can retrieve the training data with the [Files API](/api/reference/resources/files/methods/content).60446045  - `validation_file: string or null`60466047    The file ID used for validation. You can retrieve the validation results with the [Files API](/api/reference/resources/files/methods/content).60486049  - `estimated_finish: optional number or null`60506051    The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running.60526053  - `integrations: optional array of FineTuningJobWandbIntegrationObject or null`60546055    A list of integrations to enable for this fine-tuning job.60566057    - `type: "wandb"`60586059      The type of the integration being enabled for the fine-tuning job60606061      - `"wandb"`60626063    - `wandb: FineTuningJobWandbIntegration`60646065      The settings for your integration with Weights and Biases. This payload specifies the project that6066      metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags6067      to your run, and set a default entity (team, username, etc) to be associated with your run.60686069      - `project: string`60706071        The name of the project that the new run will be created under.60726073      - `entity: optional string or null`60746075        The entity to use for the run. This allows you to set the team or username of the WandB user that you would6076        like associated with the run. If not set, the default entity for the registered WandB API key is used.60776078      - `name: optional string or null`60796080        A display name to set for the run. If not set, we will use the Job ID as the name.60816082      - `tags: optional array of string`60836084        A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some6085        default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}".60866087  - `metadata: optional Metadata or null`60886089    Set of 16 key-value pairs that can be attached to an object. This can be6090    useful for storing additional information about the object in a structured6091    format, and querying for objects via API or the dashboard.60926093    Keys are strings with a maximum length of 64 characters. Values are strings6094    with a maximum length of 512 characters.60956096  - `method: optional object { type, dpo, reinforcement, supervised }`60976098    The method used for fine-tuning.60996100    - `type: "supervised" or "dpo" or "reinforcement"`61016102      The type of method. Is either `supervised`, `dpo`, or `reinforcement`.61036104      - `"supervised"`61056106      - `"dpo"`61076108      - `"reinforcement"`61096110    - `dpo: optional DpoMethod`61116112      Configuration for the DPO fine-tuning method.61136114      - `hyperparameters: optional DpoHyperparameters`61156116        The hyperparameters used for the DPO fine-tuning job.61176118        - `batch_size: optional "auto" or number`61196120          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.61216122          - `"auto"`61236124            - `"auto"`61256126          - `number`61276128        - `beta: optional "auto" or number`61296130          The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.61316132          - `"auto"`61336134            - `"auto"`61356136          - `number`61376138        - `learning_rate_multiplier: optional "auto" or number`61396140          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.61416142          - `"auto"`61436144            - `"auto"`61456146          - `number`61476148        - `n_epochs: optional "auto" or number`61496150          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.61516152          - `"auto"`61536154            - `"auto"`61556156          - `number`61576158    - `reinforcement: optional ReinforcementMethod`61596160      Configuration for the reinforcement fine-tuning method.61616162      - `grader: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`61636164        The grader used for the fine-tuning job.61656166        - `StringCheckGrader object { input, name, operation, 2 more }`61676168          A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.61696170          - `input: string`61716172            The input text. This may include template strings.61736174          - `name: string`61756176            The name of the grader.61776178          - `operation: "eq" or "ne" or "like" or "ilike"`61796180            The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.61816182            - `"eq"`61836184            - `"ne"`61856186            - `"like"`61876188            - `"ilike"`61896190          - `reference: string`61916192            The reference text. This may include template strings.61936194          - `type: "string_check"`61956196            The object type, which is always `string_check`.61976198            - `"string_check"`61996200        - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`62016202          A TextSimilarityGrader object which grades text based on similarity metrics.62036204          - `evaluation_metric: "cosine" or "fuzzy_match" or "bleu" or 8 more`62056206            The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,6207            `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,6208            or `rouge_l`.62096210            - `"cosine"`62116212            - `"fuzzy_match"`62136214            - `"bleu"`62156216            - `"gleu"`62176218            - `"meteor"`62196220            - `"rouge_1"`62216222            - `"rouge_2"`62236224            - `"rouge_3"`62256226            - `"rouge_4"`62276228            - `"rouge_5"`62296230            - `"rouge_l"`62316232          - `input: string`62336234            The text being graded.62356236          - `name: string`62376238            The name of the grader.62396240          - `reference: string`62416242            The text being graded against.62436244          - `type: "text_similarity"`62456246            The type of grader.62476248            - `"text_similarity"`62496250        - `PythonGrader object { name, source, type, image_tag }`62516252          A PythonGrader object that runs a python script on the input.62536254          - `name: string`62556256            The name of the grader.62576258          - `source: string`62596260            The source code of the python script.62616262          - `type: "python"`62636264            The object type, which is always `python`.62656266            - `"python"`62676268          - `image_tag: optional string`62696270            The image tag to use for the python script.62716272        - `ScoreModelGrader object { input, model, name, 3 more }`62736274          A ScoreModelGrader object that uses a model to assign a score to the input.62756276          - `input: array of object { content, role, type }`62776278            The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.62796280            - `content: string or ResponseInputText or object { text, type }  or 3 more`62816282              Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.62836284              - `TextInput = string`62856286                A text input to the model.62876288              - `ResponseInputText object { text, type, prompt_cache_breakpoint }`62896290                A text input to the model.62916292                - `text: string`62936294                  The text input to the model.62956296                - `type: "input_text"`62976298                  The type of the input item. Always `input_text`.62996300                  - `"input_text"`63016302                - `prompt_cache_breakpoint: optional object { mode }`63036304                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.63056306                  - `mode: "explicit"`63076308                    The breakpoint mode. Always `explicit`.63096310                    - `"explicit"`63116312              - `OutputText object { text, type }`63136314                A text output from the model.63156316                - `text: string`63176318                  The text output from the model.63196320                - `type: "output_text"`63216322                  The type of the output text. Always `output_text`.63236324                  - `"output_text"`63256326              - `InputImage object { image_url, type, detail }`63276328                An image input block used within EvalItem content arrays.63296330                - `image_url: string`63316332                  The URL of the image input.63336334                - `type: "input_image"`63356336                  The type of the image input. Always `input_image`.63376338                  - `"input_image"`63396340                - `detail: optional string`63416342                  The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.63436344              - `ResponseInputAudio object { input_audio, type }`63456346                An audio input to the model.63476348                - `input_audio: object { data, format }`63496350                  - `data: string`63516352                    Base64-encoded audio data.63536354                  - `format: "mp3" or "wav"`63556356                    The format of the audio data. Currently supported formats are `mp3` and6357                    `wav`.63586359                    - `"mp3"`63606361                    - `"wav"`63626363                - `type: "input_audio"`63646365                  The type of the input item. Always `input_audio`.63666367                  - `"input_audio"`63686369              - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`63706371                A list of inputs, each of which may be either an input text, output text, input6372                image, or input audio object.63736374                - `TextInput = string`63756376                  A text input to the model.63776378                - `ResponseInputText object { text, type, prompt_cache_breakpoint }`63796380                  A text input to the model.63816382                - `OutputText object { text, type }`63836384                  A text output from the model.63856386                  - `text: string`63876388                    The text output from the model.63896390                  - `type: "output_text"`63916392                    The type of the output text. Always `output_text`.63936394                    - `"output_text"`63956396                - `InputImage object { image_url, type, detail }`63976398                  An image input block used within EvalItem content arrays.63996400                  - `image_url: string`64016402                    The URL of the image input.64036404                  - `type: "input_image"`64056406                    The type of the image input. Always `input_image`.64076408                    - `"input_image"`64096410                  - `detail: optional string`64116412                    The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.64136414                - `ResponseInputAudio object { input_audio, type }`64156416                  An audio input to the model.64176418            - `role: "user" or "assistant" or "system" or "developer"`64196420              The role of the message input. One of `user`, `assistant`, `system`, or6421              `developer`.64226423              - `"user"`64246425              - `"assistant"`64266427              - `"system"`64286429              - `"developer"`64306431            - `type: optional "message"`64326433              The type of the message input. Always `message`.64346435              - `"message"`64366437          - `model: string`64386439            The model to use for the evaluation.64406441          - `name: string`64426443            The name of the grader.64446445          - `type: "score_model"`64466447            The object type, which is always `score_model`.64486449            - `"score_model"`64506451          - `range: optional array of number`64526453            The range of the score. Defaults to `[0, 1]`.64546455          - `sampling_params: optional object { max_completions_tokens, reasoning_effort, seed, 2 more }`64566457            The sampling parameters for the model.64586459            - `max_completions_tokens: optional number or null`64606461              The maximum number of tokens the grader model may generate in its response.64626463            - `reasoning_effort: optional ReasoningEffort or null`64646465              Constrains effort on reasoning for reasoning models. Currently supported6466              values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.6467              Reducing reasoning effort can result in faster responses and fewer tokens6468              used on reasoning in a response. Not all reasoning models support every6469              value. See the6470              [reasoning guide](/api/docs/guides/reasoning)6471              for model-specific support.64726473              - `"none"`64746475              - `"minimal"`64766477              - `"low"`64786479              - `"medium"`64806481              - `"high"`64826483              - `"xhigh"`64846485              - `"max"`64866487            - `seed: optional number or null`64886489              A seed value to initialize the randomness, during sampling.64906491            - `temperature: optional number or null`64926493              A higher temperature increases randomness in the outputs.64946495            - `top_p: optional number or null`64966497              An alternative to temperature for nucleus sampling; 1.0 includes all tokens.64986499        - `MultiGrader object { calculate_output, graders, name, type }`65006501          A MultiGrader object combines the output of multiple graders to produce a single score.65026503          - `calculate_output: string`65046505            A formula to calculate the output based on grader results.65066507          - `graders: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`65086509            A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.65106511            - `StringCheckGrader object { input, name, operation, 2 more }`65126513              A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.65146515            - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`65166517              A TextSimilarityGrader object which grades text based on similarity metrics.65186519            - `PythonGrader object { name, source, type, image_tag }`65206521              A PythonGrader object that runs a python script on the input.65226523            - `ScoreModelGrader object { input, model, name, 3 more }`65246525              A ScoreModelGrader object that uses a model to assign a score to the input.65266527            - `LabelModelGrader object { input, labels, model, 3 more }`65286529              A LabelModelGrader object which uses a model to assign labels to each item6530              in the evaluation.65316532              - `input: array of object { content, role, type }`65336534                - `content: string or ResponseInputText or object { text, type }  or 3 more`65356536                  Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.65376538                  - `TextInput = string`65396540                    A text input to the model.65416542                  - `ResponseInputText object { text, type, prompt_cache_breakpoint }`65436544                    A text input to the model.65456546                  - `OutputText object { text, type }`65476548                    A text output from the model.65496550                    - `text: string`65516552                      The text output from the model.65536554                    - `type: "output_text"`65556556                      The type of the output text. Always `output_text`.65576558                      - `"output_text"`65596560                  - `InputImage object { image_url, type, detail }`65616562                    An image input block used within EvalItem content arrays.65636564                    - `image_url: string`65656566                      The URL of the image input.65676568                    - `type: "input_image"`65696570                      The type of the image input. Always `input_image`.65716572                      - `"input_image"`65736574                    - `detail: optional string`65756576                      The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.65776578                  - `ResponseInputAudio object { input_audio, type }`65796580                    An audio input to the model.65816582                  - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`65836584                    A list of inputs, each of which may be either an input text, output text, input6585                    image, or input audio object.65866587                - `role: "user" or "assistant" or "system" or "developer"`65886589                  The role of the message input. One of `user`, `assistant`, `system`, or6590                  `developer`.65916592                  - `"user"`65936594                  - `"assistant"`65956596                  - `"system"`65976598                  - `"developer"`65996600                - `type: optional "message"`66016602                  The type of the message input. Always `message`.66036604                  - `"message"`66056606              - `labels: array of string`66076608                The labels to assign to each item in the evaluation.66096610              - `model: string`66116612                The model to use for the evaluation. Must support structured outputs.66136614              - `name: string`66156616                The name of the grader.66176618              - `passing_labels: array of string`66196620                The labels that indicate a passing result. Must be a subset of labels.66216622              - `type: "label_model"`66236624                The object type, which is always `label_model`.66256626                - `"label_model"`66276628          - `name: string`66296630            The name of the grader.66316632          - `type: "multi"`66336634            The object type, which is always `multi`.66356636            - `"multi"`66376638      - `hyperparameters: optional ReinforcementHyperparameters`66396640        The hyperparameters used for the reinforcement fine-tuning job.66416642        - `batch_size: optional "auto" or number`66436644          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.66456646          - `"auto"`66476648            - `"auto"`66496650          - `number`66516652        - `compute_multiplier: optional "auto" or number`66536654          Multiplier on amount of compute used for exploring search space during training.66556656          - `"auto"`66576658            - `"auto"`66596660          - `number`66616662        - `eval_interval: optional "auto" or number`66636664          The number of training steps between evaluation runs.66656666          - `"auto"`66676668            - `"auto"`66696670          - `number`66716672        - `eval_samples: optional "auto" or number`66736674          Number of evaluation samples to generate per training step.66756676          - `"auto"`66776678            - `"auto"`66796680          - `number`66816682        - `learning_rate_multiplier: optional "auto" or number`66836684          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.66856686          - `"auto"`66876688            - `"auto"`66896690          - `number`66916692        - `n_epochs: optional "auto" or number`66936694          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.66956696          - `"auto"`66976698            - `"auto"`66996700          - `number`67016702        - `reasoning_effort: optional "default" or "low" or "medium" or "high"`67036704          Level of reasoning effort.67056706          - `"default"`67076708          - `"low"`67096710          - `"medium"`67116712          - `"high"`67136714    - `supervised: optional SupervisedMethod`67156716      Configuration for the supervised fine-tuning method.67176718      - `hyperparameters: optional SupervisedHyperparameters`67196720        The hyperparameters used for the fine-tuning job.67216722        - `batch_size: optional "auto" or number`67236724          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.67256726          - `"auto"`67276728            - `"auto"`67296730          - `number`67316732        - `learning_rate_multiplier: optional "auto" or number`67336734          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.67356736          - `"auto"`67376738            - `"auto"`67396740          - `number`67416742        - `n_epochs: optional "auto" or number`67436744          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.67456746          - `"auto"`67476748            - `"auto"`67496750          - `number`67516752- `has_more: boolean`67536754- `object: "list"`67556756  - `"list"`67576758### Example67596760```http6761curl https://api.openai.com/v1/fine_tuning/jobs \6762    -H "Authorization: Bearer $OPENAI_API_KEY"6763```67646765#### Response67666767```json6768{6769  "data": [6770    {6771      "id": "id",6772      "created_at": 0,6773      "error": {6774        "code": "code",6775        "message": "message",6776        "param": "param"6777      },6778      "fine_tuned_model": "fine_tuned_model",6779      "finished_at": 0,6780      "hyperparameters": {6781        "batch_size": "auto",6782        "learning_rate_multiplier": "auto",6783        "n_epochs": "auto"6784      },6785      "model": "model",6786      "object": "fine_tuning.job",6787      "organization_id": "organization_id",6788      "result_files": [6789        "file-abc123"6790      ],6791      "seed": 0,6792      "status": "validating_files",6793      "trained_tokens": 0,6794      "training_file": "training_file",6795      "validation_file": "validation_file",6796      "estimated_finish": 0,6797      "integrations": [6798        {6799          "type": "wandb",6800          "wandb": {6801            "project": "my-wandb-project",6802            "entity": "entity",6803            "name": "name",6804            "tags": [6805              "custom-tag"6806            ]6807          }6808        }6809      ],6810      "metadata": {6811        "foo": "string"6812      },6813      "method": {6814        "type": "supervised",6815        "dpo": {6816          "hyperparameters": {6817            "batch_size": "auto",6818            "beta": "auto",6819            "learning_rate_multiplier": "auto",6820            "n_epochs": "auto"6821          }6822        },6823        "reinforcement": {6824          "grader": {6825            "input": "input",6826            "name": "name",6827            "operation": "eq",6828            "reference": "reference",6829            "type": "string_check"6830          },6831          "hyperparameters": {6832            "batch_size": "auto",6833            "compute_multiplier": "auto",6834            "eval_interval": "auto",6835            "eval_samples": "auto",6836            "learning_rate_multiplier": "auto",6837            "n_epochs": "auto",6838            "reasoning_effort": "default"6839          }6840        },6841        "supervised": {6842          "hyperparameters": {6843            "batch_size": "auto",6844            "learning_rate_multiplier": "auto",6845            "n_epochs": "auto"6846          }6847        }6848      }6849    }6850  ],6851  "has_more": true,6852  "object": "list"6853}6854```68556856### Example68576858```http6859curl https://api.openai.com/v1/fine_tuning/jobs?limit=2&metadata[key]=value \6860  -H "Authorization: Bearer $OPENAI_API_KEY"6861```68626863#### Response68646865```json6866{6867  "object": "list",6868  "data": [6869    {6870      "object": "fine_tuning.job",6871      "id": "ftjob-abc123",6872      "model": "gpt-4o-mini-2024-07-18",6873      "created_at": 1721764800,6874      "fine_tuned_model": null,6875      "organization_id": "org-123",6876      "result_files": [],6877      "status": "queued",6878      "validation_file": null,6879      "training_file": "file-abc123",6880      "metadata": {6881        "key": "value"6882      }6883    },6884    { ... },6885    { ... }6886  ], "has_more": true6887}6888```68896890## List fine-tuning events68916892**get** `/fine_tuning/jobs/{fine_tuning_job_id}/events`68936894Get status updates for a fine-tuning job.68956896### Path Parameters68976898- `fine_tuning_job_id: string`68996900### Query Parameters69016902- `after: optional string`69036904  Identifier for the last event from the previous pagination request.69056906- `limit: optional number`69076908  Number of events to retrieve.69096910### Returns69116912- `data: array of FineTuningJobEvent`69136914  - `id: string`69156916    The object identifier.69176918  - `created_at: number`69196920    The Unix timestamp (in seconds) for when the fine-tuning job was created.69216922  - `level: "info" or "warn" or "error"`69236924    The log level of the event.69256926    - `"info"`69276928    - `"warn"`69296930    - `"error"`69316932  - `message: string`69336934    The message of the event.69356936  - `object: "fine_tuning.job.event"`69376938    The object type, which is always "fine_tuning.job.event".69396940    - `"fine_tuning.job.event"`69416942  - `data: optional unknown`69436944    The data associated with the event.69456946  - `type: optional "message" or "metrics"`69476948    The type of event.69496950    - `"message"`69516952    - `"metrics"`69536954- `has_more: boolean`69556956- `object: "list"`69576958  - `"list"`69596960### Example69616962```http6963curl https://api.openai.com/v1/fine_tuning/jobs/$FINE_TUNING_JOB_ID/events \6964    -H "Authorization: Bearer $OPENAI_API_KEY"6965```69666967#### Response69686969```json6970{6971  "data": [6972    {6973      "id": "id",6974      "created_at": 0,6975      "level": "info",6976      "message": "message",6977      "object": "fine_tuning.job.event",6978      "data": {},6979      "type": "message"6980    }6981  ],6982  "has_more": true,6983  "object": "list"6984}6985```69866987### Example69886989```http6990curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/events \6991  -H "Authorization: Bearer $OPENAI_API_KEY"6992```69936994#### Response69956996```json6997{6998  "object": "list",6999  "data": [7000    {7001      "object": "fine_tuning.job.event",7002      "id": "ft-event-ddTJfwuMVpfLXseO0Am0Gqjm",7003      "created_at": 1721764800,7004      "level": "info",7005      "message": "Fine tuning job successfully completed",7006      "data": null,7007      "type": "message"7008    },7009    {7010      "object": "fine_tuning.job.event",7011      "id": "ft-event-tyiGuB72evQncpH87xe505Sv",7012      "created_at": 1721764800,7013      "level": "info",7014      "message": "New fine-tuned model created: ft:gpt-4o-mini:openai::7p4lURel",7015      "data": null,7016      "type": "message"7017    }7018  ],7019  "has_more": true7020}7021```70227023## Pause fine-tuning70247025**post** `/fine_tuning/jobs/{fine_tuning_job_id}/pause`70267027Pause a fine-tune job.70287029### Path Parameters70307031- `fine_tuning_job_id: string`70327033### Returns70347035- `FineTuningJob object { id, created_at, error, 16 more }`70367037  The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.70387039  - `id: string`70407041    The object identifier, which can be referenced in the API endpoints.70427043  - `created_at: number`70447045    The Unix timestamp (in seconds) for when the fine-tuning job was created.70467047  - `error: object { code, message, param }  or null`70487049    For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure.70507051    - `code: string`70527053      A machine-readable error code.70547055    - `message: string`70567057      A human-readable error message.70587059    - `param: string or null`70607061      The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific.70627063  - `fine_tuned_model: string or null`70647065    The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.70667067  - `finished_at: number or null`70687069    The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running.70707071  - `hyperparameters: object { batch_size, learning_rate_multiplier, n_epochs }`70727073    The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs.70747075    - `batch_size: optional "auto" or number or null`70767077      Number of examples in each batch. A larger batch size means that model parameters7078      are updated less frequently, but with lower variance.70797080      - `"auto"`70817082        - `"auto"`70837084      - `number`70857086    - `learning_rate_multiplier: optional "auto" or number`70877088      Scaling factor for the learning rate. A smaller learning rate may be useful to avoid7089      overfitting.70907091      - `"auto"`70927093        - `"auto"`70947095      - `number`70967097    - `n_epochs: optional "auto" or number`70987099      The number of epochs to train the model for. An epoch refers to one full cycle7100      through the training dataset.71017102      - `"auto"`71037104        - `"auto"`71057106      - `number`71077108  - `model: string`71097110    The base model that is being fine-tuned.71117112  - `object: "fine_tuning.job"`71137114    The object type, which is always "fine_tuning.job".71157116    - `"fine_tuning.job"`71177118  - `organization_id: string`71197120    The organization that owns the fine-tuning job.71217122  - `result_files: array of string`71237124    The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/api/reference/resources/files/methods/content).71257126  - `seed: number`71277128    The seed used for the fine-tuning job.71297130  - `status: "validating_files" or "queued" or "running" or 3 more`71317132    The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.71337134    - `"validating_files"`71357136    - `"queued"`71377138    - `"running"`71397140    - `"succeeded"`71417142    - `"failed"`71437144    - `"cancelled"`71457146  - `trained_tokens: number or null`71477148    The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.71497150  - `training_file: string`71517152    The file ID used for training. You can retrieve the training data with the [Files API](/api/reference/resources/files/methods/content).71537154  - `validation_file: string or null`71557156    The file ID used for validation. You can retrieve the validation results with the [Files API](/api/reference/resources/files/methods/content).71577158  - `estimated_finish: optional number or null`71597160    The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running.71617162  - `integrations: optional array of FineTuningJobWandbIntegrationObject or null`71637164    A list of integrations to enable for this fine-tuning job.71657166    - `type: "wandb"`71677168      The type of the integration being enabled for the fine-tuning job71697170      - `"wandb"`71717172    - `wandb: FineTuningJobWandbIntegration`71737174      The settings for your integration with Weights and Biases. This payload specifies the project that7175      metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags7176      to your run, and set a default entity (team, username, etc) to be associated with your run.71777178      - `project: string`71797180        The name of the project that the new run will be created under.71817182      - `entity: optional string or null`71837184        The entity to use for the run. This allows you to set the team or username of the WandB user that you would7185        like associated with the run. If not set, the default entity for the registered WandB API key is used.71867187      - `name: optional string or null`71887189        A display name to set for the run. If not set, we will use the Job ID as the name.71907191      - `tags: optional array of string`71927193        A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some7194        default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}".71957196  - `metadata: optional Metadata or null`71977198    Set of 16 key-value pairs that can be attached to an object. This can be7199    useful for storing additional information about the object in a structured7200    format, and querying for objects via API or the dashboard.72017202    Keys are strings with a maximum length of 64 characters. Values are strings7203    with a maximum length of 512 characters.72047205  - `method: optional object { type, dpo, reinforcement, supervised }`72067207    The method used for fine-tuning.72087209    - `type: "supervised" or "dpo" or "reinforcement"`72107211      The type of method. Is either `supervised`, `dpo`, or `reinforcement`.72127213      - `"supervised"`72147215      - `"dpo"`72167217      - `"reinforcement"`72187219    - `dpo: optional DpoMethod`72207221      Configuration for the DPO fine-tuning method.72227223      - `hyperparameters: optional DpoHyperparameters`72247225        The hyperparameters used for the DPO fine-tuning job.72267227        - `batch_size: optional "auto" or number`72287229          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.72307231          - `"auto"`72327233            - `"auto"`72347235          - `number`72367237        - `beta: optional "auto" or number`72387239          The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.72407241          - `"auto"`72427243            - `"auto"`72447245          - `number`72467247        - `learning_rate_multiplier: optional "auto" or number`72487249          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.72507251          - `"auto"`72527253            - `"auto"`72547255          - `number`72567257        - `n_epochs: optional "auto" or number`72587259          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.72607261          - `"auto"`72627263            - `"auto"`72647265          - `number`72667267    - `reinforcement: optional ReinforcementMethod`72687269      Configuration for the reinforcement fine-tuning method.72707271      - `grader: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`72727273        The grader used for the fine-tuning job.72747275        - `StringCheckGrader object { input, name, operation, 2 more }`72767277          A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.72787279          - `input: string`72807281            The input text. This may include template strings.72827283          - `name: string`72847285            The name of the grader.72867287          - `operation: "eq" or "ne" or "like" or "ilike"`72887289            The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.72907291            - `"eq"`72927293            - `"ne"`72947295            - `"like"`72967297            - `"ilike"`72987299          - `reference: string`73007301            The reference text. This may include template strings.73027303          - `type: "string_check"`73047305            The object type, which is always `string_check`.73067307            - `"string_check"`73087309        - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`73107311          A TextSimilarityGrader object which grades text based on similarity metrics.73127313          - `evaluation_metric: "cosine" or "fuzzy_match" or "bleu" or 8 more`73147315            The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,7316            `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,7317            or `rouge_l`.73187319            - `"cosine"`73207321            - `"fuzzy_match"`73227323            - `"bleu"`73247325            - `"gleu"`73267327            - `"meteor"`73287329            - `"rouge_1"`73307331            - `"rouge_2"`73327333            - `"rouge_3"`73347335            - `"rouge_4"`73367337            - `"rouge_5"`73387339            - `"rouge_l"`73407341          - `input: string`73427343            The text being graded.73447345          - `name: string`73467347            The name of the grader.73487349          - `reference: string`73507351            The text being graded against.73527353          - `type: "text_similarity"`73547355            The type of grader.73567357            - `"text_similarity"`73587359        - `PythonGrader object { name, source, type, image_tag }`73607361          A PythonGrader object that runs a python script on the input.73627363          - `name: string`73647365            The name of the grader.73667367          - `source: string`73687369            The source code of the python script.73707371          - `type: "python"`73727373            The object type, which is always `python`.73747375            - `"python"`73767377          - `image_tag: optional string`73787379            The image tag to use for the python script.73807381        - `ScoreModelGrader object { input, model, name, 3 more }`73827383          A ScoreModelGrader object that uses a model to assign a score to the input.73847385          - `input: array of object { content, role, type }`73867387            The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.73887389            - `content: string or ResponseInputText or object { text, type }  or 3 more`73907391              Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.73927393              - `TextInput = string`73947395                A text input to the model.73967397              - `ResponseInputText object { text, type, prompt_cache_breakpoint }`73987399                A text input to the model.74007401                - `text: string`74027403                  The text input to the model.74047405                - `type: "input_text"`74067407                  The type of the input item. Always `input_text`.74087409                  - `"input_text"`74107411                - `prompt_cache_breakpoint: optional object { mode }`74127413                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.74147415                  - `mode: "explicit"`74167417                    The breakpoint mode. Always `explicit`.74187419                    - `"explicit"`74207421              - `OutputText object { text, type }`74227423                A text output from the model.74247425                - `text: string`74267427                  The text output from the model.74287429                - `type: "output_text"`74307431                  The type of the output text. Always `output_text`.74327433                  - `"output_text"`74347435              - `InputImage object { image_url, type, detail }`74367437                An image input block used within EvalItem content arrays.74387439                - `image_url: string`74407441                  The URL of the image input.74427443                - `type: "input_image"`74447445                  The type of the image input. Always `input_image`.74467447                  - `"input_image"`74487449                - `detail: optional string`74507451                  The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.74527453              - `ResponseInputAudio object { input_audio, type }`74547455                An audio input to the model.74567457                - `input_audio: object { data, format }`74587459                  - `data: string`74607461                    Base64-encoded audio data.74627463                  - `format: "mp3" or "wav"`74647465                    The format of the audio data. Currently supported formats are `mp3` and7466                    `wav`.74677468                    - `"mp3"`74697470                    - `"wav"`74717472                - `type: "input_audio"`74737474                  The type of the input item. Always `input_audio`.74757476                  - `"input_audio"`74777478              - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`74797480                A list of inputs, each of which may be either an input text, output text, input7481                image, or input audio object.74827483                - `TextInput = string`74847485                  A text input to the model.74867487                - `ResponseInputText object { text, type, prompt_cache_breakpoint }`74887489                  A text input to the model.74907491                - `OutputText object { text, type }`74927493                  A text output from the model.74947495                  - `text: string`74967497                    The text output from the model.74987499                  - `type: "output_text"`75007501                    The type of the output text. Always `output_text`.75027503                    - `"output_text"`75047505                - `InputImage object { image_url, type, detail }`75067507                  An image input block used within EvalItem content arrays.75087509                  - `image_url: string`75107511                    The URL of the image input.75127513                  - `type: "input_image"`75147515                    The type of the image input. Always `input_image`.75167517                    - `"input_image"`75187519                  - `detail: optional string`75207521                    The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.75227523                - `ResponseInputAudio object { input_audio, type }`75247525                  An audio input to the model.75267527            - `role: "user" or "assistant" or "system" or "developer"`75287529              The role of the message input. One of `user`, `assistant`, `system`, or7530              `developer`.75317532              - `"user"`75337534              - `"assistant"`75357536              - `"system"`75377538              - `"developer"`75397540            - `type: optional "message"`75417542              The type of the message input. Always `message`.75437544              - `"message"`75457546          - `model: string`75477548            The model to use for the evaluation.75497550          - `name: string`75517552            The name of the grader.75537554          - `type: "score_model"`75557556            The object type, which is always `score_model`.75577558            - `"score_model"`75597560          - `range: optional array of number`75617562            The range of the score. Defaults to `[0, 1]`.75637564          - `sampling_params: optional object { max_completions_tokens, reasoning_effort, seed, 2 more }`75657566            The sampling parameters for the model.75677568            - `max_completions_tokens: optional number or null`75697570              The maximum number of tokens the grader model may generate in its response.75717572            - `reasoning_effort: optional ReasoningEffort or null`75737574              Constrains effort on reasoning for reasoning models. Currently supported7575              values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.7576              Reducing reasoning effort can result in faster responses and fewer tokens7577              used on reasoning in a response. Not all reasoning models support every7578              value. See the7579              [reasoning guide](/api/docs/guides/reasoning)7580              for model-specific support.75817582              - `"none"`75837584              - `"minimal"`75857586              - `"low"`75877588              - `"medium"`75897590              - `"high"`75917592              - `"xhigh"`75937594              - `"max"`75957596            - `seed: optional number or null`75977598              A seed value to initialize the randomness, during sampling.75997600            - `temperature: optional number or null`76017602              A higher temperature increases randomness in the outputs.76037604            - `top_p: optional number or null`76057606              An alternative to temperature for nucleus sampling; 1.0 includes all tokens.76077608        - `MultiGrader object { calculate_output, graders, name, type }`76097610          A MultiGrader object combines the output of multiple graders to produce a single score.76117612          - `calculate_output: string`76137614            A formula to calculate the output based on grader results.76157616          - `graders: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`76177618            A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.76197620            - `StringCheckGrader object { input, name, operation, 2 more }`76217622              A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.76237624            - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`76257626              A TextSimilarityGrader object which grades text based on similarity metrics.76277628            - `PythonGrader object { name, source, type, image_tag }`76297630              A PythonGrader object that runs a python script on the input.76317632            - `ScoreModelGrader object { input, model, name, 3 more }`76337634              A ScoreModelGrader object that uses a model to assign a score to the input.76357636            - `LabelModelGrader object { input, labels, model, 3 more }`76377638              A LabelModelGrader object which uses a model to assign labels to each item7639              in the evaluation.76407641              - `input: array of object { content, role, type }`76427643                - `content: string or ResponseInputText or object { text, type }  or 3 more`76447645                  Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.76467647                  - `TextInput = string`76487649                    A text input to the model.76507651                  - `ResponseInputText object { text, type, prompt_cache_breakpoint }`76527653                    A text input to the model.76547655                  - `OutputText object { text, type }`76567657                    A text output from the model.76587659                    - `text: string`76607661                      The text output from the model.76627663                    - `type: "output_text"`76647665                      The type of the output text. Always `output_text`.76667667                      - `"output_text"`76687669                  - `InputImage object { image_url, type, detail }`76707671                    An image input block used within EvalItem content arrays.76727673                    - `image_url: string`76747675                      The URL of the image input.76767677                    - `type: "input_image"`76787679                      The type of the image input. Always `input_image`.76807681                      - `"input_image"`76827683                    - `detail: optional string`76847685                      The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.76867687                  - `ResponseInputAudio object { input_audio, type }`76887689                    An audio input to the model.76907691                  - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`76927693                    A list of inputs, each of which may be either an input text, output text, input7694                    image, or input audio object.76957696                - `role: "user" or "assistant" or "system" or "developer"`76977698                  The role of the message input. One of `user`, `assistant`, `system`, or7699                  `developer`.77007701                  - `"user"`77027703                  - `"assistant"`77047705                  - `"system"`77067707                  - `"developer"`77087709                - `type: optional "message"`77107711                  The type of the message input. Always `message`.77127713                  - `"message"`77147715              - `labels: array of string`77167717                The labels to assign to each item in the evaluation.77187719              - `model: string`77207721                The model to use for the evaluation. Must support structured outputs.77227723              - `name: string`77247725                The name of the grader.77267727              - `passing_labels: array of string`77287729                The labels that indicate a passing result. Must be a subset of labels.77307731              - `type: "label_model"`77327733                The object type, which is always `label_model`.77347735                - `"label_model"`77367737          - `name: string`77387739            The name of the grader.77407741          - `type: "multi"`77427743            The object type, which is always `multi`.77447745            - `"multi"`77467747      - `hyperparameters: optional ReinforcementHyperparameters`77487749        The hyperparameters used for the reinforcement fine-tuning job.77507751        - `batch_size: optional "auto" or number`77527753          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.77547755          - `"auto"`77567757            - `"auto"`77587759          - `number`77607761        - `compute_multiplier: optional "auto" or number`77627763          Multiplier on amount of compute used for exploring search space during training.77647765          - `"auto"`77667767            - `"auto"`77687769          - `number`77707771        - `eval_interval: optional "auto" or number`77727773          The number of training steps between evaluation runs.77747775          - `"auto"`77767777            - `"auto"`77787779          - `number`77807781        - `eval_samples: optional "auto" or number`77827783          Number of evaluation samples to generate per training step.77847785          - `"auto"`77867787            - `"auto"`77887789          - `number`77907791        - `learning_rate_multiplier: optional "auto" or number`77927793          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.77947795          - `"auto"`77967797            - `"auto"`77987799          - `number`78007801        - `n_epochs: optional "auto" or number`78027803          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.78047805          - `"auto"`78067807            - `"auto"`78087809          - `number`78107811        - `reasoning_effort: optional "default" or "low" or "medium" or "high"`78127813          Level of reasoning effort.78147815          - `"default"`78167817          - `"low"`78187819          - `"medium"`78207821          - `"high"`78227823    - `supervised: optional SupervisedMethod`78247825      Configuration for the supervised fine-tuning method.78267827      - `hyperparameters: optional SupervisedHyperparameters`78287829        The hyperparameters used for the fine-tuning job.78307831        - `batch_size: optional "auto" or number`78327833          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.78347835          - `"auto"`78367837            - `"auto"`78387839          - `number`78407841        - `learning_rate_multiplier: optional "auto" or number`78427843          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.78447845          - `"auto"`78467847            - `"auto"`78487849          - `number`78507851        - `n_epochs: optional "auto" or number`78527853          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.78547855          - `"auto"`78567857            - `"auto"`78587859          - `number`78607861### Example78627863```http7864curl https://api.openai.com/v1/fine_tuning/jobs/$FINE_TUNING_JOB_ID/pause \7865    -X POST \7866    -H "Authorization: Bearer $OPENAI_API_KEY"7867```78687869#### Response78707871```json7872{7873  "id": "id",7874  "created_at": 0,7875  "error": {7876    "code": "code",7877    "message": "message",7878    "param": "param"7879  },7880  "fine_tuned_model": "fine_tuned_model",7881  "finished_at": 0,7882  "hyperparameters": {7883    "batch_size": "auto",7884    "learning_rate_multiplier": "auto",7885    "n_epochs": "auto"7886  },7887  "model": "model",7888  "object": "fine_tuning.job",7889  "organization_id": "organization_id",7890  "result_files": [7891    "file-abc123"7892  ],7893  "seed": 0,7894  "status": "validating_files",7895  "trained_tokens": 0,7896  "training_file": "training_file",7897  "validation_file": "validation_file",7898  "estimated_finish": 0,7899  "integrations": [7900    {7901      "type": "wandb",7902      "wandb": {7903        "project": "my-wandb-project",7904        "entity": "entity",7905        "name": "name",7906        "tags": [7907          "custom-tag"7908        ]7909      }7910    }7911  ],7912  "metadata": {7913    "foo": "string"7914  },7915  "method": {7916    "type": "supervised",7917    "dpo": {7918      "hyperparameters": {7919        "batch_size": "auto",7920        "beta": "auto",7921        "learning_rate_multiplier": "auto",7922        "n_epochs": "auto"7923      }7924    },7925    "reinforcement": {7926      "grader": {7927        "input": "input",7928        "name": "name",7929        "operation": "eq",7930        "reference": "reference",7931        "type": "string_check"7932      },7933      "hyperparameters": {7934        "batch_size": "auto",7935        "compute_multiplier": "auto",7936        "eval_interval": "auto",7937        "eval_samples": "auto",7938        "learning_rate_multiplier": "auto",7939        "n_epochs": "auto",7940        "reasoning_effort": "default"7941      }7942    },7943    "supervised": {7944      "hyperparameters": {7945        "batch_size": "auto",7946        "learning_rate_multiplier": "auto",7947        "n_epochs": "auto"7948      }7949    }7950  }7951}7952```79537954### Example79557956```http7957curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/pause \7958  -H "Authorization: Bearer $OPENAI_API_KEY"7959```79607961#### Response79627963```json7964{7965  "object": "fine_tuning.job",7966  "id": "ftjob-abc123",7967  "model": "gpt-4o-mini-2024-07-18",7968  "created_at": 1721764800,7969  "fine_tuned_model": null,7970  "organization_id": "org-123",7971  "result_files": [],7972  "status": "paused",7973  "validation_file": "file-abc123",7974  "training_file": "file-abc123"7975}7976```79777978## Resume fine-tuning79797980**post** `/fine_tuning/jobs/{fine_tuning_job_id}/resume`79817982Resume a fine-tune job.79837984### Path Parameters79857986- `fine_tuning_job_id: string`79877988### Returns79897990- `FineTuningJob object { id, created_at, error, 16 more }`79917992  The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.79937994  - `id: string`79957996    The object identifier, which can be referenced in the API endpoints.79977998  - `created_at: number`79998000    The Unix timestamp (in seconds) for when the fine-tuning job was created.80018002  - `error: object { code, message, param }  or null`80038004    For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure.80058006    - `code: string`80078008      A machine-readable error code.80098010    - `message: string`80118012      A human-readable error message.80138014    - `param: string or null`80158016      The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific.80178018  - `fine_tuned_model: string or null`80198020    The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.80218022  - `finished_at: number or null`80238024    The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running.80258026  - `hyperparameters: object { batch_size, learning_rate_multiplier, n_epochs }`80278028    The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs.80298030    - `batch_size: optional "auto" or number or null`80318032      Number of examples in each batch. A larger batch size means that model parameters8033      are updated less frequently, but with lower variance.80348035      - `"auto"`80368037        - `"auto"`80388039      - `number`80408041    - `learning_rate_multiplier: optional "auto" or number`80428043      Scaling factor for the learning rate. A smaller learning rate may be useful to avoid8044      overfitting.80458046      - `"auto"`80478048        - `"auto"`80498050      - `number`80518052    - `n_epochs: optional "auto" or number`80538054      The number of epochs to train the model for. An epoch refers to one full cycle8055      through the training dataset.80568057      - `"auto"`80588059        - `"auto"`80608061      - `number`80628063  - `model: string`80648065    The base model that is being fine-tuned.80668067  - `object: "fine_tuning.job"`80688069    The object type, which is always "fine_tuning.job".80708071    - `"fine_tuning.job"`80728073  - `organization_id: string`80748075    The organization that owns the fine-tuning job.80768077  - `result_files: array of string`80788079    The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/api/reference/resources/files/methods/content).80808081  - `seed: number`80828083    The seed used for the fine-tuning job.80848085  - `status: "validating_files" or "queued" or "running" or 3 more`80868087    The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.80888089    - `"validating_files"`80908091    - `"queued"`80928093    - `"running"`80948095    - `"succeeded"`80968097    - `"failed"`80988099    - `"cancelled"`81008101  - `trained_tokens: number or null`81028103    The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.81048105  - `training_file: string`81068107    The file ID used for training. You can retrieve the training data with the [Files API](/api/reference/resources/files/methods/content).81088109  - `validation_file: string or null`81108111    The file ID used for validation. You can retrieve the validation results with the [Files API](/api/reference/resources/files/methods/content).81128113  - `estimated_finish: optional number or null`81148115    The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running.81168117  - `integrations: optional array of FineTuningJobWandbIntegrationObject or null`81188119    A list of integrations to enable for this fine-tuning job.81208121    - `type: "wandb"`81228123      The type of the integration being enabled for the fine-tuning job81248125      - `"wandb"`81268127    - `wandb: FineTuningJobWandbIntegration`81288129      The settings for your integration with Weights and Biases. This payload specifies the project that8130      metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags8131      to your run, and set a default entity (team, username, etc) to be associated with your run.81328133      - `project: string`81348135        The name of the project that the new run will be created under.81368137      - `entity: optional string or null`81388139        The entity to use for the run. This allows you to set the team or username of the WandB user that you would8140        like associated with the run. If not set, the default entity for the registered WandB API key is used.81418142      - `name: optional string or null`81438144        A display name to set for the run. If not set, we will use the Job ID as the name.81458146      - `tags: optional array of string`81478148        A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some8149        default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}".81508151  - `metadata: optional Metadata or null`81528153    Set of 16 key-value pairs that can be attached to an object. This can be8154    useful for storing additional information about the object in a structured8155    format, and querying for objects via API or the dashboard.81568157    Keys are strings with a maximum length of 64 characters. Values are strings8158    with a maximum length of 512 characters.81598160  - `method: optional object { type, dpo, reinforcement, supervised }`81618162    The method used for fine-tuning.81638164    - `type: "supervised" or "dpo" or "reinforcement"`81658166      The type of method. Is either `supervised`, `dpo`, or `reinforcement`.81678168      - `"supervised"`81698170      - `"dpo"`81718172      - `"reinforcement"`81738174    - `dpo: optional DpoMethod`81758176      Configuration for the DPO fine-tuning method.81778178      - `hyperparameters: optional DpoHyperparameters`81798180        The hyperparameters used for the DPO fine-tuning job.81818182        - `batch_size: optional "auto" or number`81838184          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.81858186          - `"auto"`81878188            - `"auto"`81898190          - `number`81918192        - `beta: optional "auto" or number`81938194          The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.81958196          - `"auto"`81978198            - `"auto"`81998200          - `number`82018202        - `learning_rate_multiplier: optional "auto" or number`82038204          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.82058206          - `"auto"`82078208            - `"auto"`82098210          - `number`82118212        - `n_epochs: optional "auto" or number`82138214          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.82158216          - `"auto"`82178218            - `"auto"`82198220          - `number`82218222    - `reinforcement: optional ReinforcementMethod`82238224      Configuration for the reinforcement fine-tuning method.82258226      - `grader: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`82278228        The grader used for the fine-tuning job.82298230        - `StringCheckGrader object { input, name, operation, 2 more }`82318232          A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.82338234          - `input: string`82358236            The input text. This may include template strings.82378238          - `name: string`82398240            The name of the grader.82418242          - `operation: "eq" or "ne" or "like" or "ilike"`82438244            The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.82458246            - `"eq"`82478248            - `"ne"`82498250            - `"like"`82518252            - `"ilike"`82538254          - `reference: string`82558256            The reference text. This may include template strings.82578258          - `type: "string_check"`82598260            The object type, which is always `string_check`.82618262            - `"string_check"`82638264        - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`82658266          A TextSimilarityGrader object which grades text based on similarity metrics.82678268          - `evaluation_metric: "cosine" or "fuzzy_match" or "bleu" or 8 more`82698270            The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,8271            `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,8272            or `rouge_l`.82738274            - `"cosine"`82758276            - `"fuzzy_match"`82778278            - `"bleu"`82798280            - `"gleu"`82818282            - `"meteor"`82838284            - `"rouge_1"`82858286            - `"rouge_2"`82878288            - `"rouge_3"`82898290            - `"rouge_4"`82918292            - `"rouge_5"`82938294            - `"rouge_l"`82958296          - `input: string`82978298            The text being graded.82998300          - `name: string`83018302            The name of the grader.83038304          - `reference: string`83058306            The text being graded against.83078308          - `type: "text_similarity"`83098310            The type of grader.83118312            - `"text_similarity"`83138314        - `PythonGrader object { name, source, type, image_tag }`83158316          A PythonGrader object that runs a python script on the input.83178318          - `name: string`83198320            The name of the grader.83218322          - `source: string`83238324            The source code of the python script.83258326          - `type: "python"`83278328            The object type, which is always `python`.83298330            - `"python"`83318332          - `image_tag: optional string`83338334            The image tag to use for the python script.83358336        - `ScoreModelGrader object { input, model, name, 3 more }`83378338          A ScoreModelGrader object that uses a model to assign a score to the input.83398340          - `input: array of object { content, role, type }`83418342            The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.83438344            - `content: string or ResponseInputText or object { text, type }  or 3 more`83458346              Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.83478348              - `TextInput = string`83498350                A text input to the model.83518352              - `ResponseInputText object { text, type, prompt_cache_breakpoint }`83538354                A text input to the model.83558356                - `text: string`83578358                  The text input to the model.83598360                - `type: "input_text"`83618362                  The type of the input item. Always `input_text`.83638364                  - `"input_text"`83658366                - `prompt_cache_breakpoint: optional object { mode }`83678368                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.83698370                  - `mode: "explicit"`83718372                    The breakpoint mode. Always `explicit`.83738374                    - `"explicit"`83758376              - `OutputText object { text, type }`83778378                A text output from the model.83798380                - `text: string`83818382                  The text output from the model.83838384                - `type: "output_text"`83858386                  The type of the output text. Always `output_text`.83878388                  - `"output_text"`83898390              - `InputImage object { image_url, type, detail }`83918392                An image input block used within EvalItem content arrays.83938394                - `image_url: string`83958396                  The URL of the image input.83978398                - `type: "input_image"`83998400                  The type of the image input. Always `input_image`.84018402                  - `"input_image"`84038404                - `detail: optional string`84058406                  The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.84078408              - `ResponseInputAudio object { input_audio, type }`84098410                An audio input to the model.84118412                - `input_audio: object { data, format }`84138414                  - `data: string`84158416                    Base64-encoded audio data.84178418                  - `format: "mp3" or "wav"`84198420                    The format of the audio data. Currently supported formats are `mp3` and8421                    `wav`.84228423                    - `"mp3"`84248425                    - `"wav"`84268427                - `type: "input_audio"`84288429                  The type of the input item. Always `input_audio`.84308431                  - `"input_audio"`84328433              - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`84348435                A list of inputs, each of which may be either an input text, output text, input8436                image, or input audio object.84378438                - `TextInput = string`84398440                  A text input to the model.84418442                - `ResponseInputText object { text, type, prompt_cache_breakpoint }`84438444                  A text input to the model.84458446                - `OutputText object { text, type }`84478448                  A text output from the model.84498450                  - `text: string`84518452                    The text output from the model.84538454                  - `type: "output_text"`84558456                    The type of the output text. Always `output_text`.84578458                    - `"output_text"`84598460                - `InputImage object { image_url, type, detail }`84618462                  An image input block used within EvalItem content arrays.84638464                  - `image_url: string`84658466                    The URL of the image input.84678468                  - `type: "input_image"`84698470                    The type of the image input. Always `input_image`.84718472                    - `"input_image"`84738474                  - `detail: optional string`84758476                    The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.84778478                - `ResponseInputAudio object { input_audio, type }`84798480                  An audio input to the model.84818482            - `role: "user" or "assistant" or "system" or "developer"`84838484              The role of the message input. One of `user`, `assistant`, `system`, or8485              `developer`.84868487              - `"user"`84888489              - `"assistant"`84908491              - `"system"`84928493              - `"developer"`84948495            - `type: optional "message"`84968497              The type of the message input. Always `message`.84988499              - `"message"`85008501          - `model: string`85028503            The model to use for the evaluation.85048505          - `name: string`85068507            The name of the grader.85088509          - `type: "score_model"`85108511            The object type, which is always `score_model`.85128513            - `"score_model"`85148515          - `range: optional array of number`85168517            The range of the score. Defaults to `[0, 1]`.85188519          - `sampling_params: optional object { max_completions_tokens, reasoning_effort, seed, 2 more }`85208521            The sampling parameters for the model.85228523            - `max_completions_tokens: optional number or null`85248525              The maximum number of tokens the grader model may generate in its response.85268527            - `reasoning_effort: optional ReasoningEffort or null`85288529              Constrains effort on reasoning for reasoning models. Currently supported8530              values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.8531              Reducing reasoning effort can result in faster responses and fewer tokens8532              used on reasoning in a response. Not all reasoning models support every8533              value. See the8534              [reasoning guide](/api/docs/guides/reasoning)8535              for model-specific support.85368537              - `"none"`85388539              - `"minimal"`85408541              - `"low"`85428543              - `"medium"`85448545              - `"high"`85468547              - `"xhigh"`85488549              - `"max"`85508551            - `seed: optional number or null`85528553              A seed value to initialize the randomness, during sampling.85548555            - `temperature: optional number or null`85568557              A higher temperature increases randomness in the outputs.85588559            - `top_p: optional number or null`85608561              An alternative to temperature for nucleus sampling; 1.0 includes all tokens.85628563        - `MultiGrader object { calculate_output, graders, name, type }`85648565          A MultiGrader object combines the output of multiple graders to produce a single score.85668567          - `calculate_output: string`85688569            A formula to calculate the output based on grader results.85708571          - `graders: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`85728573            A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.85748575            - `StringCheckGrader object { input, name, operation, 2 more }`85768577              A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.85788579            - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`85808581              A TextSimilarityGrader object which grades text based on similarity metrics.85828583            - `PythonGrader object { name, source, type, image_tag }`85848585              A PythonGrader object that runs a python script on the input.85868587            - `ScoreModelGrader object { input, model, name, 3 more }`85888589              A ScoreModelGrader object that uses a model to assign a score to the input.85908591            - `LabelModelGrader object { input, labels, model, 3 more }`85928593              A LabelModelGrader object which uses a model to assign labels to each item8594              in the evaluation.85958596              - `input: array of object { content, role, type }`85978598                - `content: string or ResponseInputText or object { text, type }  or 3 more`85998600                  Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.86018602                  - `TextInput = string`86038604                    A text input to the model.86058606                  - `ResponseInputText object { text, type, prompt_cache_breakpoint }`86078608                    A text input to the model.86098610                  - `OutputText object { text, type }`86118612                    A text output from the model.86138614                    - `text: string`86158616                      The text output from the model.86178618                    - `type: "output_text"`86198620                      The type of the output text. Always `output_text`.86218622                      - `"output_text"`86238624                  - `InputImage object { image_url, type, detail }`86258626                    An image input block used within EvalItem content arrays.86278628                    - `image_url: string`86298630                      The URL of the image input.86318632                    - `type: "input_image"`86338634                      The type of the image input. Always `input_image`.86358636                      - `"input_image"`86378638                    - `detail: optional string`86398640                      The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.86418642                  - `ResponseInputAudio object { input_audio, type }`86438644                    An audio input to the model.86458646                  - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`86478648                    A list of inputs, each of which may be either an input text, output text, input8649                    image, or input audio object.86508651                - `role: "user" or "assistant" or "system" or "developer"`86528653                  The role of the message input. One of `user`, `assistant`, `system`, or8654                  `developer`.86558656                  - `"user"`86578658                  - `"assistant"`86598660                  - `"system"`86618662                  - `"developer"`86638664                - `type: optional "message"`86658666                  The type of the message input. Always `message`.86678668                  - `"message"`86698670              - `labels: array of string`86718672                The labels to assign to each item in the evaluation.86738674              - `model: string`86758676                The model to use for the evaluation. Must support structured outputs.86778678              - `name: string`86798680                The name of the grader.86818682              - `passing_labels: array of string`86838684                The labels that indicate a passing result. Must be a subset of labels.86858686              - `type: "label_model"`86878688                The object type, which is always `label_model`.86898690                - `"label_model"`86918692          - `name: string`86938694            The name of the grader.86958696          - `type: "multi"`86978698            The object type, which is always `multi`.86998700            - `"multi"`87018702      - `hyperparameters: optional ReinforcementHyperparameters`87038704        The hyperparameters used for the reinforcement fine-tuning job.87058706        - `batch_size: optional "auto" or number`87078708          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.87098710          - `"auto"`87118712            - `"auto"`87138714          - `number`87158716        - `compute_multiplier: optional "auto" or number`87178718          Multiplier on amount of compute used for exploring search space during training.87198720          - `"auto"`87218722            - `"auto"`87238724          - `number`87258726        - `eval_interval: optional "auto" or number`87278728          The number of training steps between evaluation runs.87298730          - `"auto"`87318732            - `"auto"`87338734          - `number`87358736        - `eval_samples: optional "auto" or number`87378738          Number of evaluation samples to generate per training step.87398740          - `"auto"`87418742            - `"auto"`87438744          - `number`87458746        - `learning_rate_multiplier: optional "auto" or number`87478748          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.87498750          - `"auto"`87518752            - `"auto"`87538754          - `number`87558756        - `n_epochs: optional "auto" or number`87578758          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.87598760          - `"auto"`87618762            - `"auto"`87638764          - `number`87658766        - `reasoning_effort: optional "default" or "low" or "medium" or "high"`87678768          Level of reasoning effort.87698770          - `"default"`87718772          - `"low"`87738774          - `"medium"`87758776          - `"high"`87778778    - `supervised: optional SupervisedMethod`87798780      Configuration for the supervised fine-tuning method.87818782      - `hyperparameters: optional SupervisedHyperparameters`87838784        The hyperparameters used for the fine-tuning job.87858786        - `batch_size: optional "auto" or number`87878788          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.87898790          - `"auto"`87918792            - `"auto"`87938794          - `number`87958796        - `learning_rate_multiplier: optional "auto" or number`87978798          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.87998800          - `"auto"`88018802            - `"auto"`88038804          - `number`88058806        - `n_epochs: optional "auto" or number`88078808          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.88098810          - `"auto"`88118812            - `"auto"`88138814          - `number`88158816### Example88178818```http8819curl https://api.openai.com/v1/fine_tuning/jobs/$FINE_TUNING_JOB_ID/resume \8820    -X POST \8821    -H "Authorization: Bearer $OPENAI_API_KEY"8822```88238824#### Response88258826```json8827{8828  "id": "id",8829  "created_at": 0,8830  "error": {8831    "code": "code",8832    "message": "message",8833    "param": "param"8834  },8835  "fine_tuned_model": "fine_tuned_model",8836  "finished_at": 0,8837  "hyperparameters": {8838    "batch_size": "auto",8839    "learning_rate_multiplier": "auto",8840    "n_epochs": "auto"8841  },8842  "model": "model",8843  "object": "fine_tuning.job",8844  "organization_id": "organization_id",8845  "result_files": [8846    "file-abc123"8847  ],8848  "seed": 0,8849  "status": "validating_files",8850  "trained_tokens": 0,8851  "training_file": "training_file",8852  "validation_file": "validation_file",8853  "estimated_finish": 0,8854  "integrations": [8855    {8856      "type": "wandb",8857      "wandb": {8858        "project": "my-wandb-project",8859        "entity": "entity",8860        "name": "name",8861        "tags": [8862          "custom-tag"8863        ]8864      }8865    }8866  ],8867  "metadata": {8868    "foo": "string"8869  },8870  "method": {8871    "type": "supervised",8872    "dpo": {8873      "hyperparameters": {8874        "batch_size": "auto",8875        "beta": "auto",8876        "learning_rate_multiplier": "auto",8877        "n_epochs": "auto"8878      }8879    },8880    "reinforcement": {8881      "grader": {8882        "input": "input",8883        "name": "name",8884        "operation": "eq",8885        "reference": "reference",8886        "type": "string_check"8887      },8888      "hyperparameters": {8889        "batch_size": "auto",8890        "compute_multiplier": "auto",8891        "eval_interval": "auto",8892        "eval_samples": "auto",8893        "learning_rate_multiplier": "auto",8894        "n_epochs": "auto",8895        "reasoning_effort": "default"8896      }8897    },8898    "supervised": {8899      "hyperparameters": {8900        "batch_size": "auto",8901        "learning_rate_multiplier": "auto",8902        "n_epochs": "auto"8903      }8904    }8905  }8906}8907```89088909### Example89108911```http8912curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/resume \8913  -H "Authorization: Bearer $OPENAI_API_KEY"8914```89158916#### Response89178918```json8919{8920  "object": "fine_tuning.job",8921  "id": "ftjob-abc123",8922  "model": "gpt-4o-mini-2024-07-18",8923  "created_at": 1721764800,8924  "fine_tuned_model": null,8925  "organization_id": "org-123",8926  "result_files": [],8927  "status": "queued",8928  "validation_file": "file-abc123",8929  "training_file": "file-abc123"8930}8931```89328933## Retrieve fine-tuning job89348935**get** `/fine_tuning/jobs/{fine_tuning_job_id}`89368937Get info about a fine-tuning job.89388939[Learn more about fine-tuning](/api/docs/guides/model-optimization)89408941### Path Parameters89428943- `fine_tuning_job_id: string`89448945### Returns89468947- `FineTuningJob object { id, created_at, error, 16 more }`89488949  The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.89508951  - `id: string`89528953    The object identifier, which can be referenced in the API endpoints.89548955  - `created_at: number`89568957    The Unix timestamp (in seconds) for when the fine-tuning job was created.89588959  - `error: object { code, message, param }  or null`89608961    For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure.89628963    - `code: string`89648965      A machine-readable error code.89668967    - `message: string`89688969      A human-readable error message.89708971    - `param: string or null`89728973      The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific.89748975  - `fine_tuned_model: string or null`89768977    The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.89788979  - `finished_at: number or null`89808981    The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running.89828983  - `hyperparameters: object { batch_size, learning_rate_multiplier, n_epochs }`89848985    The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs.89868987    - `batch_size: optional "auto" or number or null`89888989      Number of examples in each batch. A larger batch size means that model parameters8990      are updated less frequently, but with lower variance.89918992      - `"auto"`89938994        - `"auto"`89958996      - `number`89978998    - `learning_rate_multiplier: optional "auto" or number`89999000      Scaling factor for the learning rate. A smaller learning rate may be useful to avoid9001      overfitting.90029003      - `"auto"`90049005        - `"auto"`90069007      - `number`90089009    - `n_epochs: optional "auto" or number`90109011      The number of epochs to train the model for. An epoch refers to one full cycle9012      through the training dataset.90139014      - `"auto"`90159016        - `"auto"`90179018      - `number`90199020  - `model: string`90219022    The base model that is being fine-tuned.90239024  - `object: "fine_tuning.job"`90259026    The object type, which is always "fine_tuning.job".90279028    - `"fine_tuning.job"`90299030  - `organization_id: string`90319032    The organization that owns the fine-tuning job.90339034  - `result_files: array of string`90359036    The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/api/reference/resources/files/methods/content).90379038  - `seed: number`90399040    The seed used for the fine-tuning job.90419042  - `status: "validating_files" or "queued" or "running" or 3 more`90439044    The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.90459046    - `"validating_files"`90479048    - `"queued"`90499050    - `"running"`90519052    - `"succeeded"`90539054    - `"failed"`90559056    - `"cancelled"`90579058  - `trained_tokens: number or null`90599060    The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.90619062  - `training_file: string`90639064    The file ID used for training. You can retrieve the training data with the [Files API](/api/reference/resources/files/methods/content).90659066  - `validation_file: string or null`90679068    The file ID used for validation. You can retrieve the validation results with the [Files API](/api/reference/resources/files/methods/content).90699070  - `estimated_finish: optional number or null`90719072    The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running.90739074  - `integrations: optional array of FineTuningJobWandbIntegrationObject or null`90759076    A list of integrations to enable for this fine-tuning job.90779078    - `type: "wandb"`90799080      The type of the integration being enabled for the fine-tuning job90819082      - `"wandb"`90839084    - `wandb: FineTuningJobWandbIntegration`90859086      The settings for your integration with Weights and Biases. This payload specifies the project that9087      metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags9088      to your run, and set a default entity (team, username, etc) to be associated with your run.90899090      - `project: string`90919092        The name of the project that the new run will be created under.90939094      - `entity: optional string or null`90959096        The entity to use for the run. This allows you to set the team or username of the WandB user that you would9097        like associated with the run. If not set, the default entity for the registered WandB API key is used.90989099      - `name: optional string or null`91009101        A display name to set for the run. If not set, we will use the Job ID as the name.91029103      - `tags: optional array of string`91049105        A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some9106        default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}".91079108  - `metadata: optional Metadata or null`91099110    Set of 16 key-value pairs that can be attached to an object. This can be9111    useful for storing additional information about the object in a structured9112    format, and querying for objects via API or the dashboard.91139114    Keys are strings with a maximum length of 64 characters. Values are strings9115    with a maximum length of 512 characters.91169117  - `method: optional object { type, dpo, reinforcement, supervised }`91189119    The method used for fine-tuning.91209121    - `type: "supervised" or "dpo" or "reinforcement"`91229123      The type of method. Is either `supervised`, `dpo`, or `reinforcement`.91249125      - `"supervised"`91269127      - `"dpo"`91289129      - `"reinforcement"`91309131    - `dpo: optional DpoMethod`91329133      Configuration for the DPO fine-tuning method.91349135      - `hyperparameters: optional DpoHyperparameters`91369137        The hyperparameters used for the DPO fine-tuning job.91389139        - `batch_size: optional "auto" or number`91409141          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.91429143          - `"auto"`91449145            - `"auto"`91469147          - `number`91489149        - `beta: optional "auto" or number`91509151          The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.91529153          - `"auto"`91549155            - `"auto"`91569157          - `number`91589159        - `learning_rate_multiplier: optional "auto" or number`91609161          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.91629163          - `"auto"`91649165            - `"auto"`91669167          - `number`91689169        - `n_epochs: optional "auto" or number`91709171          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.91729173          - `"auto"`91749175            - `"auto"`91769177          - `number`91789179    - `reinforcement: optional ReinforcementMethod`91809181      Configuration for the reinforcement fine-tuning method.91829183      - `grader: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`91849185        The grader used for the fine-tuning job.91869187        - `StringCheckGrader object { input, name, operation, 2 more }`91889189          A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.91909191          - `input: string`91929193            The input text. This may include template strings.91949195          - `name: string`91969197            The name of the grader.91989199          - `operation: "eq" or "ne" or "like" or "ilike"`92009201            The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.92029203            - `"eq"`92049205            - `"ne"`92069207            - `"like"`92089209            - `"ilike"`92109211          - `reference: string`92129213            The reference text. This may include template strings.92149215          - `type: "string_check"`92169217            The object type, which is always `string_check`.92189219            - `"string_check"`92209221        - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`92229223          A TextSimilarityGrader object which grades text based on similarity metrics.92249225          - `evaluation_metric: "cosine" or "fuzzy_match" or "bleu" or 8 more`92269227            The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,9228            `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,9229            or `rouge_l`.92309231            - `"cosine"`92329233            - `"fuzzy_match"`92349235            - `"bleu"`92369237            - `"gleu"`92389239            - `"meteor"`92409241            - `"rouge_1"`92429243            - `"rouge_2"`92449245            - `"rouge_3"`92469247            - `"rouge_4"`92489249            - `"rouge_5"`92509251            - `"rouge_l"`92529253          - `input: string`92549255            The text being graded.92569257          - `name: string`92589259            The name of the grader.92609261          - `reference: string`92629263            The text being graded against.92649265          - `type: "text_similarity"`92669267            The type of grader.92689269            - `"text_similarity"`92709271        - `PythonGrader object { name, source, type, image_tag }`92729273          A PythonGrader object that runs a python script on the input.92749275          - `name: string`92769277            The name of the grader.92789279          - `source: string`92809281            The source code of the python script.92829283          - `type: "python"`92849285            The object type, which is always `python`.92869287            - `"python"`92889289          - `image_tag: optional string`92909291            The image tag to use for the python script.92929293        - `ScoreModelGrader object { input, model, name, 3 more }`92949295          A ScoreModelGrader object that uses a model to assign a score to the input.92969297          - `input: array of object { content, role, type }`92989299            The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.93009301            - `content: string or ResponseInputText or object { text, type }  or 3 more`93029303              Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.93049305              - `TextInput = string`93069307                A text input to the model.93089309              - `ResponseInputText object { text, type, prompt_cache_breakpoint }`93109311                A text input to the model.93129313                - `text: string`93149315                  The text input to the model.93169317                - `type: "input_text"`93189319                  The type of the input item. Always `input_text`.93209321                  - `"input_text"`93229323                - `prompt_cache_breakpoint: optional object { mode }`93249325                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.93269327                  - `mode: "explicit"`93289329                    The breakpoint mode. Always `explicit`.93309331                    - `"explicit"`93329333              - `OutputText object { text, type }`93349335                A text output from the model.93369337                - `text: string`93389339                  The text output from the model.93409341                - `type: "output_text"`93429343                  The type of the output text. Always `output_text`.93449345                  - `"output_text"`93469347              - `InputImage object { image_url, type, detail }`93489349                An image input block used within EvalItem content arrays.93509351                - `image_url: string`93529353                  The URL of the image input.93549355                - `type: "input_image"`93569357                  The type of the image input. Always `input_image`.93589359                  - `"input_image"`93609361                - `detail: optional string`93629363                  The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.93649365              - `ResponseInputAudio object { input_audio, type }`93669367                An audio input to the model.93689369                - `input_audio: object { data, format }`93709371                  - `data: string`93729373                    Base64-encoded audio data.93749375                  - `format: "mp3" or "wav"`93769377                    The format of the audio data. Currently supported formats are `mp3` and9378                    `wav`.93799380                    - `"mp3"`93819382                    - `"wav"`93839384                - `type: "input_audio"`93859386                  The type of the input item. Always `input_audio`.93879388                  - `"input_audio"`93899390              - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`93919392                A list of inputs, each of which may be either an input text, output text, input9393                image, or input audio object.93949395                - `TextInput = string`93969397                  A text input to the model.93989399                - `ResponseInputText object { text, type, prompt_cache_breakpoint }`94009401                  A text input to the model.94029403                - `OutputText object { text, type }`94049405                  A text output from the model.94069407                  - `text: string`94089409                    The text output from the model.94109411                  - `type: "output_text"`94129413                    The type of the output text. Always `output_text`.94149415                    - `"output_text"`94169417                - `InputImage object { image_url, type, detail }`94189419                  An image input block used within EvalItem content arrays.94209421                  - `image_url: string`94229423                    The URL of the image input.94249425                  - `type: "input_image"`94269427                    The type of the image input. Always `input_image`.94289429                    - `"input_image"`94309431                  - `detail: optional string`94329433                    The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.94349435                - `ResponseInputAudio object { input_audio, type }`94369437                  An audio input to the model.94389439            - `role: "user" or "assistant" or "system" or "developer"`94409441              The role of the message input. One of `user`, `assistant`, `system`, or9442              `developer`.94439444              - `"user"`94459446              - `"assistant"`94479448              - `"system"`94499450              - `"developer"`94519452            - `type: optional "message"`94539454              The type of the message input. Always `message`.94559456              - `"message"`94579458          - `model: string`94599460            The model to use for the evaluation.94619462          - `name: string`94639464            The name of the grader.94659466          - `type: "score_model"`94679468            The object type, which is always `score_model`.94699470            - `"score_model"`94719472          - `range: optional array of number`94739474            The range of the score. Defaults to `[0, 1]`.94759476          - `sampling_params: optional object { max_completions_tokens, reasoning_effort, seed, 2 more }`94779478            The sampling parameters for the model.94799480            - `max_completions_tokens: optional number or null`94819482              The maximum number of tokens the grader model may generate in its response.94839484            - `reasoning_effort: optional ReasoningEffort or null`94859486              Constrains effort on reasoning for reasoning models. Currently supported9487              values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.9488              Reducing reasoning effort can result in faster responses and fewer tokens9489              used on reasoning in a response. Not all reasoning models support every9490              value. See the9491              [reasoning guide](/api/docs/guides/reasoning)9492              for model-specific support.94939494              - `"none"`94959496              - `"minimal"`94979498              - `"low"`94999500              - `"medium"`95019502              - `"high"`95039504              - `"xhigh"`95059506              - `"max"`95079508            - `seed: optional number or null`95099510              A seed value to initialize the randomness, during sampling.95119512            - `temperature: optional number or null`95139514              A higher temperature increases randomness in the outputs.95159516            - `top_p: optional number or null`95179518              An alternative to temperature for nucleus sampling; 1.0 includes all tokens.95199520        - `MultiGrader object { calculate_output, graders, name, type }`95219522          A MultiGrader object combines the output of multiple graders to produce a single score.95239524          - `calculate_output: string`95259526            A formula to calculate the output based on grader results.95279528          - `graders: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`95299530            A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.95319532            - `StringCheckGrader object { input, name, operation, 2 more }`95339534              A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.95359536            - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`95379538              A TextSimilarityGrader object which grades text based on similarity metrics.95399540            - `PythonGrader object { name, source, type, image_tag }`95419542              A PythonGrader object that runs a python script on the input.95439544            - `ScoreModelGrader object { input, model, name, 3 more }`95459546              A ScoreModelGrader object that uses a model to assign a score to the input.95479548            - `LabelModelGrader object { input, labels, model, 3 more }`95499550              A LabelModelGrader object which uses a model to assign labels to each item9551              in the evaluation.95529553              - `input: array of object { content, role, type }`95549555                - `content: string or ResponseInputText or object { text, type }  or 3 more`95569557                  Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.95589559                  - `TextInput = string`95609561                    A text input to the model.95629563                  - `ResponseInputText object { text, type, prompt_cache_breakpoint }`95649565                    A text input to the model.95669567                  - `OutputText object { text, type }`95689569                    A text output from the model.95709571                    - `text: string`95729573                      The text output from the model.95749575                    - `type: "output_text"`95769577                      The type of the output text. Always `output_text`.95789579                      - `"output_text"`95809581                  - `InputImage object { image_url, type, detail }`95829583                    An image input block used within EvalItem content arrays.95849585                    - `image_url: string`95869587                      The URL of the image input.95889589                    - `type: "input_image"`95909591                      The type of the image input. Always `input_image`.95929593                      - `"input_image"`95949595                    - `detail: optional string`95969597                      The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.95989599                  - `ResponseInputAudio object { input_audio, type }`96009601                    An audio input to the model.96029603                  - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`96049605                    A list of inputs, each of which may be either an input text, output text, input9606                    image, or input audio object.96079608                - `role: "user" or "assistant" or "system" or "developer"`96099610                  The role of the message input. One of `user`, `assistant`, `system`, or9611                  `developer`.96129613                  - `"user"`96149615                  - `"assistant"`96169617                  - `"system"`96189619                  - `"developer"`96209621                - `type: optional "message"`96229623                  The type of the message input. Always `message`.96249625                  - `"message"`96269627              - `labels: array of string`96289629                The labels to assign to each item in the evaluation.96309631              - `model: string`96329633                The model to use for the evaluation. Must support structured outputs.96349635              - `name: string`96369637                The name of the grader.96389639              - `passing_labels: array of string`96409641                The labels that indicate a passing result. Must be a subset of labels.96429643              - `type: "label_model"`96449645                The object type, which is always `label_model`.96469647                - `"label_model"`96489649          - `name: string`96509651            The name of the grader.96529653          - `type: "multi"`96549655            The object type, which is always `multi`.96569657            - `"multi"`96589659      - `hyperparameters: optional ReinforcementHyperparameters`96609661        The hyperparameters used for the reinforcement fine-tuning job.96629663        - `batch_size: optional "auto" or number`96649665          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.96669667          - `"auto"`96689669            - `"auto"`96709671          - `number`96729673        - `compute_multiplier: optional "auto" or number`96749675          Multiplier on amount of compute used for exploring search space during training.96769677          - `"auto"`96789679            - `"auto"`96809681          - `number`96829683        - `eval_interval: optional "auto" or number`96849685          The number of training steps between evaluation runs.96869687          - `"auto"`96889689            - `"auto"`96909691          - `number`96929693        - `eval_samples: optional "auto" or number`96949695          Number of evaluation samples to generate per training step.96969697          - `"auto"`96989699            - `"auto"`97009701          - `number`97029703        - `learning_rate_multiplier: optional "auto" or number`97049705          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.97069707          - `"auto"`97089709            - `"auto"`97109711          - `number`97129713        - `n_epochs: optional "auto" or number`97149715          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.97169717          - `"auto"`97189719            - `"auto"`97209721          - `number`97229723        - `reasoning_effort: optional "default" or "low" or "medium" or "high"`97249725          Level of reasoning effort.97269727          - `"default"`97289729          - `"low"`97309731          - `"medium"`97329733          - `"high"`97349735    - `supervised: optional SupervisedMethod`97369737      Configuration for the supervised fine-tuning method.97389739      - `hyperparameters: optional SupervisedHyperparameters`97409741        The hyperparameters used for the fine-tuning job.97429743        - `batch_size: optional "auto" or number`97449745          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.97469747          - `"auto"`97489749            - `"auto"`97509751          - `number`97529753        - `learning_rate_multiplier: optional "auto" or number`97549755          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.97569757          - `"auto"`97589759            - `"auto"`97609761          - `number`97629763        - `n_epochs: optional "auto" or number`97649765          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.97669767          - `"auto"`97689769            - `"auto"`97709771          - `number`97729773### Example97749775```http9776curl https://api.openai.com/v1/fine_tuning/jobs/$FINE_TUNING_JOB_ID \9777    -H "Authorization: Bearer $OPENAI_API_KEY"9778```97799780#### Response97819782```json9783{9784  "id": "id",9785  "created_at": 0,9786  "error": {9787    "code": "code",9788    "message": "message",9789    "param": "param"9790  },9791  "fine_tuned_model": "fine_tuned_model",9792  "finished_at": 0,9793  "hyperparameters": {9794    "batch_size": "auto",9795    "learning_rate_multiplier": "auto",9796    "n_epochs": "auto"9797  },9798  "model": "model",9799  "object": "fine_tuning.job",9800  "organization_id": "organization_id",9801  "result_files": [9802    "file-abc123"9803  ],9804  "seed": 0,9805  "status": "validating_files",9806  "trained_tokens": 0,9807  "training_file": "training_file",9808  "validation_file": "validation_file",9809  "estimated_finish": 0,9810  "integrations": [9811    {9812      "type": "wandb",9813      "wandb": {9814        "project": "my-wandb-project",9815        "entity": "entity",9816        "name": "name",9817        "tags": [9818          "custom-tag"9819        ]9820      }9821    }9822  ],9823  "metadata": {9824    "foo": "string"9825  },9826  "method": {9827    "type": "supervised",9828    "dpo": {9829      "hyperparameters": {9830        "batch_size": "auto",9831        "beta": "auto",9832        "learning_rate_multiplier": "auto",9833        "n_epochs": "auto"9834      }9835    },9836    "reinforcement": {9837      "grader": {9838        "input": "input",9839        "name": "name",9840        "operation": "eq",9841        "reference": "reference",9842        "type": "string_check"9843      },9844      "hyperparameters": {9845        "batch_size": "auto",9846        "compute_multiplier": "auto",9847        "eval_interval": "auto",9848        "eval_samples": "auto",9849        "learning_rate_multiplier": "auto",9850        "n_epochs": "auto",9851        "reasoning_effort": "default"9852      }9853    },9854    "supervised": {9855      "hyperparameters": {9856        "batch_size": "auto",9857        "learning_rate_multiplier": "auto",9858        "n_epochs": "auto"9859      }9860    }9861  }9862}9863```98649865### Example98669867```http9868curl https://api.openai.com/v1/fine_tuning/jobs/ft-AF1WoRqd3aJAHsqc9NY7iL8F \9869  -H "Authorization: Bearer $OPENAI_API_KEY"9870```98719872#### Response98739874```json9875{9876  "object": "fine_tuning.job",9877  "id": "ftjob-abc123",9878  "model": "davinci-002",9879  "created_at": 1692661014,9880  "finished_at": 1692661190,9881  "fine_tuned_model": "ft:davinci-002:my-org:custom_suffix:7q8mpxmy",9882  "organization_id": "org-123",9883  "result_files": [9884      "file-abc123"9885  ],9886  "status": "succeeded",9887  "validation_file": null,9888  "training_file": "file-abc123",9889  "hyperparameters": {9890      "n_epochs": 4,9891      "batch_size": 1,9892      "learning_rate_multiplier": 1.09893  },9894  "trained_tokens": 5768,9895  "integrations": [],9896  "seed": 0,9897  "estimated_finish": 0,9898  "method": {9899    "type": "supervised",9900    "supervised": {9901      "hyperparameters": {9902        "n_epochs": 4,9903        "batch_size": 1,9904        "learning_rate_multiplier": 1.09905      }9906    }9907  }9908}9909```99109911## Domain Types99129913### Fine Tuning Job99149915- `FineTuningJob object { id, created_at, error, 16 more }`99169917  The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.99189919  - `id: string`99209921    The object identifier, which can be referenced in the API endpoints.99229923  - `created_at: number`99249925    The Unix timestamp (in seconds) for when the fine-tuning job was created.99269927  - `error: object { code, message, param }  or null`99289929    For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure.99309931    - `code: string`99329933      A machine-readable error code.99349935    - `message: string`99369937      A human-readable error message.99389939    - `param: string or null`99409941      The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific.99429943  - `fine_tuned_model: string or null`99449945    The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running.99469947  - `finished_at: number or null`99489949    The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running.99509951  - `hyperparameters: object { batch_size, learning_rate_multiplier, n_epochs }`99529953    The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs.99549955    - `batch_size: optional "auto" or number or null`99569957      Number of examples in each batch. A larger batch size means that model parameters9958      are updated less frequently, but with lower variance.99599960      - `"auto"`99619962        - `"auto"`99639964      - `number`99659966    - `learning_rate_multiplier: optional "auto" or number`99679968      Scaling factor for the learning rate. A smaller learning rate may be useful to avoid9969      overfitting.99709971      - `"auto"`99729973        - `"auto"`99749975      - `number`99769977    - `n_epochs: optional "auto" or number`99789979      The number of epochs to train the model for. An epoch refers to one full cycle9980      through the training dataset.99819982      - `"auto"`99839984        - `"auto"`99859986      - `number`99879988  - `model: string`99899990    The base model that is being fine-tuned.99919992  - `object: "fine_tuning.job"`99939994    The object type, which is always "fine_tuning.job".99959996    - `"fine_tuning.job"`99979998  - `organization_id: string`999910000    The organization that owns the fine-tuning job.1000110002  - `result_files: array of string`1000310004    The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/api/reference/resources/files/methods/content).1000510006  - `seed: number`1000710008    The seed used for the fine-tuning job.1000910010  - `status: "validating_files" or "queued" or "running" or 3 more`1001110012    The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`.1001310014    - `"validating_files"`1001510016    - `"queued"`1001710018    - `"running"`1001910020    - `"succeeded"`1002110022    - `"failed"`1002310024    - `"cancelled"`1002510026  - `trained_tokens: number or null`1002710028    The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running.1002910030  - `training_file: string`1003110032    The file ID used for training. You can retrieve the training data with the [Files API](/api/reference/resources/files/methods/content).1003310034  - `validation_file: string or null`1003510036    The file ID used for validation. You can retrieve the validation results with the [Files API](/api/reference/resources/files/methods/content).1003710038  - `estimated_finish: optional number or null`1003910040    The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running.1004110042  - `integrations: optional array of FineTuningJobWandbIntegrationObject or null`1004310044    A list of integrations to enable for this fine-tuning job.1004510046    - `type: "wandb"`1004710048      The type of the integration being enabled for the fine-tuning job1004910050      - `"wandb"`1005110052    - `wandb: FineTuningJobWandbIntegration`1005310054      The settings for your integration with Weights and Biases. This payload specifies the project that10055      metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags10056      to your run, and set a default entity (team, username, etc) to be associated with your run.1005710058      - `project: string`1005910060        The name of the project that the new run will be created under.1006110062      - `entity: optional string or null`1006310064        The entity to use for the run. This allows you to set the team or username of the WandB user that you would10065        like associated with the run. If not set, the default entity for the registered WandB API key is used.1006610067      - `name: optional string or null`1006810069        A display name to set for the run. If not set, we will use the Job ID as the name.1007010071      - `tags: optional array of string`1007210073        A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some10074        default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}".1007510076  - `metadata: optional Metadata or null`1007710078    Set of 16 key-value pairs that can be attached to an object. This can be10079    useful for storing additional information about the object in a structured10080    format, and querying for objects via API or the dashboard.1008110082    Keys are strings with a maximum length of 64 characters. Values are strings10083    with a maximum length of 512 characters.1008410085  - `method: optional object { type, dpo, reinforcement, supervised }`1008610087    The method used for fine-tuning.1008810089    - `type: "supervised" or "dpo" or "reinforcement"`1009010091      The type of method. Is either `supervised`, `dpo`, or `reinforcement`.1009210093      - `"supervised"`1009410095      - `"dpo"`1009610097      - `"reinforcement"`1009810099    - `dpo: optional DpoMethod`1010010101      Configuration for the DPO fine-tuning method.1010210103      - `hyperparameters: optional DpoHyperparameters`1010410105        The hyperparameters used for the DPO fine-tuning job.1010610107        - `batch_size: optional "auto" or number`1010810109          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.1011010111          - `"auto"`1011210113            - `"auto"`1011410115          - `number`1011610117        - `beta: optional "auto" or number`1011810119          The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.1012010121          - `"auto"`1012210123            - `"auto"`1012410125          - `number`1012610127        - `learning_rate_multiplier: optional "auto" or number`1012810129          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.1013010131          - `"auto"`1013210133            - `"auto"`1013410135          - `number`1013610137        - `n_epochs: optional "auto" or number`1013810139          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.1014010141          - `"auto"`1014210143            - `"auto"`1014410145          - `number`1014610147    - `reinforcement: optional ReinforcementMethod`1014810149      Configuration for the reinforcement fine-tuning method.1015010151      - `grader: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`1015210153        The grader used for the fine-tuning job.1015410155        - `StringCheckGrader object { input, name, operation, 2 more }`1015610157          A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.1015810159          - `input: string`1016010161            The input text. This may include template strings.1016210163          - `name: string`1016410165            The name of the grader.1016610167          - `operation: "eq" or "ne" or "like" or "ilike"`1016810169            The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.1017010171            - `"eq"`1017210173            - `"ne"`1017410175            - `"like"`1017610177            - `"ilike"`1017810179          - `reference: string`1018010181            The reference text. This may include template strings.1018210183          - `type: "string_check"`1018410185            The object type, which is always `string_check`.1018610187            - `"string_check"`1018810189        - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`1019010191          A TextSimilarityGrader object which grades text based on similarity metrics.1019210193          - `evaluation_metric: "cosine" or "fuzzy_match" or "bleu" or 8 more`1019410195            The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,10196            `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,10197            or `rouge_l`.1019810199            - `"cosine"`1020010201            - `"fuzzy_match"`1020210203            - `"bleu"`1020410205            - `"gleu"`1020610207            - `"meteor"`1020810209            - `"rouge_1"`1021010211            - `"rouge_2"`1021210213            - `"rouge_3"`1021410215            - `"rouge_4"`1021610217            - `"rouge_5"`1021810219            - `"rouge_l"`1022010221          - `input: string`1022210223            The text being graded.1022410225          - `name: string`1022610227            The name of the grader.1022810229          - `reference: string`1023010231            The text being graded against.1023210233          - `type: "text_similarity"`1023410235            The type of grader.1023610237            - `"text_similarity"`1023810239        - `PythonGrader object { name, source, type, image_tag }`1024010241          A PythonGrader object that runs a python script on the input.1024210243          - `name: string`1024410245            The name of the grader.1024610247          - `source: string`1024810249            The source code of the python script.1025010251          - `type: "python"`1025210253            The object type, which is always `python`.1025410255            - `"python"`1025610257          - `image_tag: optional string`1025810259            The image tag to use for the python script.1026010261        - `ScoreModelGrader object { input, model, name, 3 more }`1026210263          A ScoreModelGrader object that uses a model to assign a score to the input.1026410265          - `input: array of object { content, role, type }`1026610267            The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.1026810269            - `content: string or ResponseInputText or object { text, type }  or 3 more`1027010271              Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.1027210273              - `TextInput = string`1027410275                A text input to the model.1027610277              - `ResponseInputText object { text, type, prompt_cache_breakpoint }`1027810279                A text input to the model.1028010281                - `text: string`1028210283                  The text input to the model.1028410285                - `type: "input_text"`1028610287                  The type of the input item. Always `input_text`.1028810289                  - `"input_text"`1029010291                - `prompt_cache_breakpoint: optional object { mode }`1029210293                  Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.1029410295                  - `mode: "explicit"`1029610297                    The breakpoint mode. Always `explicit`.1029810299                    - `"explicit"`1030010301              - `OutputText object { text, type }`1030210303                A text output from the model.1030410305                - `text: string`1030610307                  The text output from the model.1030810309                - `type: "output_text"`1031010311                  The type of the output text. Always `output_text`.1031210313                  - `"output_text"`1031410315              - `InputImage object { image_url, type, detail }`1031610317                An image input block used within EvalItem content arrays.1031810319                - `image_url: string`1032010321                  The URL of the image input.1032210323                - `type: "input_image"`1032410325                  The type of the image input. Always `input_image`.1032610327                  - `"input_image"`1032810329                - `detail: optional string`1033010331                  The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.1033210333              - `ResponseInputAudio object { input_audio, type }`1033410335                An audio input to the model.1033610337                - `input_audio: object { data, format }`1033810339                  - `data: string`1034010341                    Base64-encoded audio data.1034210343                  - `format: "mp3" or "wav"`1034410345                    The format of the audio data. Currently supported formats are `mp3` and10346                    `wav`.1034710348                    - `"mp3"`1034910350                    - `"wav"`1035110352                - `type: "input_audio"`1035310354                  The type of the input item. Always `input_audio`.1035510356                  - `"input_audio"`1035710358              - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`1035910360                A list of inputs, each of which may be either an input text, output text, input10361                image, or input audio object.1036210363                - `TextInput = string`1036410365                  A text input to the model.1036610367                - `ResponseInputText object { text, type, prompt_cache_breakpoint }`1036810369                  A text input to the model.1037010371                - `OutputText object { text, type }`1037210373                  A text output from the model.1037410375                  - `text: string`1037610377                    The text output from the model.1037810379                  - `type: "output_text"`1038010381                    The type of the output text. Always `output_text`.1038210383                    - `"output_text"`1038410385                - `InputImage object { image_url, type, detail }`1038610387                  An image input block used within EvalItem content arrays.1038810389                  - `image_url: string`1039010391                    The URL of the image input.1039210393                  - `type: "input_image"`1039410395                    The type of the image input. Always `input_image`.1039610397                    - `"input_image"`1039810399                  - `detail: optional string`1040010401                    The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.1040210403                - `ResponseInputAudio object { input_audio, type }`1040410405                  An audio input to the model.1040610407            - `role: "user" or "assistant" or "system" or "developer"`1040810409              The role of the message input. One of `user`, `assistant`, `system`, or10410              `developer`.1041110412              - `"user"`1041310414              - `"assistant"`1041510416              - `"system"`1041710418              - `"developer"`1041910420            - `type: optional "message"`1042110422              The type of the message input. Always `message`.1042310424              - `"message"`1042510426          - `model: string`1042710428            The model to use for the evaluation.1042910430          - `name: string`1043110432            The name of the grader.1043310434          - `type: "score_model"`1043510436            The object type, which is always `score_model`.1043710438            - `"score_model"`1043910440          - `range: optional array of number`1044110442            The range of the score. Defaults to `[0, 1]`.1044310444          - `sampling_params: optional object { max_completions_tokens, reasoning_effort, seed, 2 more }`1044510446            The sampling parameters for the model.1044710448            - `max_completions_tokens: optional number or null`1044910450              The maximum number of tokens the grader model may generate in its response.1045110452            - `reasoning_effort: optional ReasoningEffort or null`1045310454              Constrains effort on reasoning for reasoning models. Currently supported10455              values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.10456              Reducing reasoning effort can result in faster responses and fewer tokens10457              used on reasoning in a response. Not all reasoning models support every10458              value. See the10459              [reasoning guide](/api/docs/guides/reasoning)10460              for model-specific support.1046110462              - `"none"`1046310464              - `"minimal"`1046510466              - `"low"`1046710468              - `"medium"`1046910470              - `"high"`1047110472              - `"xhigh"`1047310474              - `"max"`1047510476            - `seed: optional number or null`1047710478              A seed value to initialize the randomness, during sampling.1047910480            - `temperature: optional number or null`1048110482              A higher temperature increases randomness in the outputs.1048310484            - `top_p: optional number or null`1048510486              An alternative to temperature for nucleus sampling; 1.0 includes all tokens.1048710488        - `MultiGrader object { calculate_output, graders, name, type }`1048910490          A MultiGrader object combines the output of multiple graders to produce a single score.1049110492          - `calculate_output: string`1049310494            A formula to calculate the output based on grader results.1049510496          - `graders: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`1049710498            A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.1049910500            - `StringCheckGrader object { input, name, operation, 2 more }`1050110502              A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.1050310504            - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`1050510506              A TextSimilarityGrader object which grades text based on similarity metrics.1050710508            - `PythonGrader object { name, source, type, image_tag }`1050910510              A PythonGrader object that runs a python script on the input.1051110512            - `ScoreModelGrader object { input, model, name, 3 more }`1051310514              A ScoreModelGrader object that uses a model to assign a score to the input.1051510516            - `LabelModelGrader object { input, labels, model, 3 more }`1051710518              A LabelModelGrader object which uses a model to assign labels to each item10519              in the evaluation.1052010521              - `input: array of object { content, role, type }`1052210523                - `content: string or ResponseInputText or object { text, type }  or 3 more`1052410525                  Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.1052610527                  - `TextInput = string`1052810529                    A text input to the model.1053010531                  - `ResponseInputText object { text, type, prompt_cache_breakpoint }`1053210533                    A text input to the model.1053410535                  - `OutputText object { text, type }`1053610537                    A text output from the model.1053810539                    - `text: string`1054010541                      The text output from the model.1054210543                    - `type: "output_text"`1054410545                      The type of the output text. Always `output_text`.1054610547                      - `"output_text"`1054810549                  - `InputImage object { image_url, type, detail }`1055010551                    An image input block used within EvalItem content arrays.1055210553                    - `image_url: string`1055410555                      The URL of the image input.1055610557                    - `type: "input_image"`1055810559                      The type of the image input. Always `input_image`.1056010561                      - `"input_image"`1056210563                    - `detail: optional string`1056410565                      The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.1056610567                  - `ResponseInputAudio object { input_audio, type }`1056810569                    An audio input to the model.1057010571                  - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`1057210573                    A list of inputs, each of which may be either an input text, output text, input10574                    image, or input audio object.1057510576                - `role: "user" or "assistant" or "system" or "developer"`1057710578                  The role of the message input. One of `user`, `assistant`, `system`, or10579                  `developer`.1058010581                  - `"user"`1058210583                  - `"assistant"`1058410585                  - `"system"`1058610587                  - `"developer"`1058810589                - `type: optional "message"`1059010591                  The type of the message input. Always `message`.1059210593                  - `"message"`1059410595              - `labels: array of string`1059610597                The labels to assign to each item in the evaluation.1059810599              - `model: string`1060010601                The model to use for the evaluation. Must support structured outputs.1060210603              - `name: string`1060410605                The name of the grader.1060610607              - `passing_labels: array of string`1060810609                The labels that indicate a passing result. Must be a subset of labels.1061010611              - `type: "label_model"`1061210613                The object type, which is always `label_model`.1061410615                - `"label_model"`1061610617          - `name: string`1061810619            The name of the grader.1062010621          - `type: "multi"`1062210623            The object type, which is always `multi`.1062410625            - `"multi"`1062610627      - `hyperparameters: optional ReinforcementHyperparameters`1062810629        The hyperparameters used for the reinforcement fine-tuning job.1063010631        - `batch_size: optional "auto" or number`1063210633          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.1063410635          - `"auto"`1063610637            - `"auto"`1063810639          - `number`1064010641        - `compute_multiplier: optional "auto" or number`1064210643          Multiplier on amount of compute used for exploring search space during training.1064410645          - `"auto"`1064610647            - `"auto"`1064810649          - `number`1065010651        - `eval_interval: optional "auto" or number`1065210653          The number of training steps between evaluation runs.1065410655          - `"auto"`1065610657            - `"auto"`1065810659          - `number`1066010661        - `eval_samples: optional "auto" or number`1066210663          Number of evaluation samples to generate per training step.1066410665          - `"auto"`1066610667            - `"auto"`1066810669          - `number`1067010671        - `learning_rate_multiplier: optional "auto" or number`1067210673          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.1067410675          - `"auto"`1067610677            - `"auto"`1067810679          - `number`1068010681        - `n_epochs: optional "auto" or number`1068210683          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.1068410685          - `"auto"`1068610687            - `"auto"`1068810689          - `number`1069010691        - `reasoning_effort: optional "default" or "low" or "medium" or "high"`1069210693          Level of reasoning effort.1069410695          - `"default"`1069610697          - `"low"`1069810699          - `"medium"`1070010701          - `"high"`1070210703    - `supervised: optional SupervisedMethod`1070410705      Configuration for the supervised fine-tuning method.1070610707      - `hyperparameters: optional SupervisedHyperparameters`1070810709        The hyperparameters used for the fine-tuning job.1071010711        - `batch_size: optional "auto" or number`1071210713          Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.1071410715          - `"auto"`1071610717            - `"auto"`1071810719          - `number`1072010721        - `learning_rate_multiplier: optional "auto" or number`1072210723          Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.1072410725          - `"auto"`1072610727            - `"auto"`1072810729          - `number`1073010731        - `n_epochs: optional "auto" or number`1073210733          The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.1073410735          - `"auto"`1073610737            - `"auto"`1073810739          - `number`1074010741### Fine Tuning Job Event1074210743- `FineTuningJobEvent object { id, created_at, level, 4 more }`1074410745  Fine-tuning job event object1074610747  - `id: string`1074810749    The object identifier.1075010751  - `created_at: number`1075210753    The Unix timestamp (in seconds) for when the fine-tuning job was created.1075410755  - `level: "info" or "warn" or "error"`1075610757    The log level of the event.1075810759    - `"info"`1076010761    - `"warn"`1076210763    - `"error"`1076410765  - `message: string`1076610767    The message of the event.1076810769  - `object: "fine_tuning.job.event"`1077010771    The object type, which is always "fine_tuning.job.event".1077210773    - `"fine_tuning.job.event"`1077410775  - `data: optional unknown`1077610777    The data associated with the event.1077810779  - `type: optional "message" or "metrics"`1078010781    The type of event.1078210783    - `"message"`1078410785    - `"metrics"`1078610787### Fine Tuning Job Wandb Integration1078810789- `FineTuningJobWandbIntegration object { project, entity, name, tags }`1079010791  The settings for your integration with Weights and Biases. This payload specifies the project that10792  metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags10793  to your run, and set a default entity (team, username, etc) to be associated with your run.1079410795  - `project: string`1079610797    The name of the project that the new run will be created under.1079810799  - `entity: optional string or null`1080010801    The entity to use for the run. This allows you to set the team or username of the WandB user that you would10802    like associated with the run. If not set, the default entity for the registered WandB API key is used.1080310804  - `name: optional string or null`1080510806    A display name to set for the run. If not set, we will use the Job ID as the name.1080710808  - `tags: optional array of string`1080910810    A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some10811    default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}".1081210813### Fine Tuning Job Wandb Integration Object1081410815- `FineTuningJobWandbIntegrationObject object { type, wandb }`1081610817  - `type: "wandb"`1081810819    The type of the integration being enabled for the fine-tuning job1082010821    - `"wandb"`1082210823  - `wandb: FineTuningJobWandbIntegration`1082410825    The settings for your integration with Weights and Biases. This payload specifies the project that10826    metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags10827    to your run, and set a default entity (team, username, etc) to be associated with your run.1082810829    - `project: string`1083010831      The name of the project that the new run will be created under.1083210833    - `entity: optional string or null`1083410835      The entity to use for the run. This allows you to set the team or username of the WandB user that you would10836      like associated with the run. If not set, the default entity for the registered WandB API key is used.1083710838    - `name: optional string or null`1083910840      A display name to set for the run. If not set, we will use the Job ID as the name.1084110842    - `tags: optional array of string`1084310844      A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some10845      default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}".1084610847# Checkpoints1084810849## List fine-tuning checkpoints1085010851**get** `/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints`1085210853List checkpoints for a fine-tuning job.1085410855### Path Parameters1085610857- `fine_tuning_job_id: string`1085810859### Query Parameters1086010861- `after: optional string`1086210863  Identifier for the last checkpoint ID from the previous pagination request.1086410865- `limit: optional number`1086610867  Number of checkpoints to retrieve.1086810869### Returns1087010871- `data: array of FineTuningJobCheckpoint`1087210873  - `id: string`1087410875    The checkpoint identifier, which can be referenced in the API endpoints.1087610877  - `created_at: number`1087810879    The Unix timestamp (in seconds) for when the checkpoint was created.1088010881  - `fine_tuned_model_checkpoint: string`1088210883    The name of the fine-tuned checkpoint model that is created.1088410885  - `fine_tuning_job_id: string`1088610887    The name of the fine-tuning job that this checkpoint was created from.1088810889  - `metrics: object { full_valid_loss, full_valid_mean_token_accuracy, step, 4 more }`1089010891    Metrics at the step number during the fine-tuning job.1089210893    - `full_valid_loss: optional number`1089410895    - `full_valid_mean_token_accuracy: optional number`1089610897    - `step: optional number`1089810899    - `train_loss: optional number`1090010901    - `train_mean_token_accuracy: optional number`1090210903    - `valid_loss: optional number`1090410905    - `valid_mean_token_accuracy: optional number`1090610907  - `object: "fine_tuning.job.checkpoint"`1090810909    The object type, which is always "fine_tuning.job.checkpoint".1091010911    - `"fine_tuning.job.checkpoint"`1091210913  - `step_number: number`1091410915    The step number that the checkpoint was created at.1091610917- `has_more: boolean`1091810919- `object: "list"`1092010921  - `"list"`1092210923- `first_id: optional string or null`1092410925- `last_id: optional string or null`1092610927### Example1092810929```http10930curl https://api.openai.com/v1/fine_tuning/jobs/$FINE_TUNING_JOB_ID/checkpoints \10931    -H "Authorization: Bearer $OPENAI_API_KEY"10932```1093310934#### Response1093510936```json10937{10938  "data": [10939    {10940      "id": "id",10941      "created_at": 0,10942      "fine_tuned_model_checkpoint": "fine_tuned_model_checkpoint",10943      "fine_tuning_job_id": "fine_tuning_job_id",10944      "metrics": {10945        "full_valid_loss": 0,10946        "full_valid_mean_token_accuracy": 0,10947        "step": 0,10948        "train_loss": 0,10949        "train_mean_token_accuracy": 0,10950        "valid_loss": 0,10951        "valid_mean_token_accuracy": 010952      },10953      "object": "fine_tuning.job.checkpoint",10954      "step_number": 010955    }10956  ],10957  "has_more": true,10958  "object": "list",10959  "first_id": "first_id",10960  "last_id": "last_id"10961}10962```1096310964### Example1096510966```http10967curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/checkpoints \10968  -H "Authorization: Bearer $OPENAI_API_KEY"10969```1097010971#### Response1097210973```json10974{10975  "object": "list",10976  "data": [10977    {10978      "object": "fine_tuning.job.checkpoint",10979      "id": "ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB",10980      "created_at": 1721764867,10981      "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:96olL566:ckpt-step-2000",10982      "metrics": {10983        "full_valid_loss": 0.134,10984        "full_valid_mean_token_accuracy": 0.87410985      },10986      "fine_tuning_job_id": "ftjob-abc123",10987      "step_number": 200010988    },10989    {10990      "object": "fine_tuning.job.checkpoint",10991      "id": "ftckpt_enQCFmOTGj3syEpYVhBRLTSy",10992      "created_at": 1721764800,10993      "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:7q8mpxmy:ckpt-step-1000",10994      "metrics": {10995        "full_valid_loss": 0.167,10996        "full_valid_mean_token_accuracy": 0.78110997      },10998      "fine_tuning_job_id": "ftjob-abc123",10999      "step_number": 100011000    }11001  ],11002  "first_id": "ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB",11003  "last_id": "ftckpt_enQCFmOTGj3syEpYVhBRLTSy",11004  "has_more": true11005}11006```1100711008## Domain Types1100911010### Fine Tuning Job Checkpoint1101111012- `FineTuningJobCheckpoint object { id, created_at, fine_tuned_model_checkpoint, 4 more }`1101311014  The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use.1101511016  - `id: string`1101711018    The checkpoint identifier, which can be referenced in the API endpoints.1101911020  - `created_at: number`1102111022    The Unix timestamp (in seconds) for when the checkpoint was created.1102311024  - `fine_tuned_model_checkpoint: string`1102511026    The name of the fine-tuned checkpoint model that is created.1102711028  - `fine_tuning_job_id: string`1102911030    The name of the fine-tuning job that this checkpoint was created from.1103111032  - `metrics: object { full_valid_loss, full_valid_mean_token_accuracy, step, 4 more }`1103311034    Metrics at the step number during the fine-tuning job.1103511036    - `full_valid_loss: optional number`1103711038    - `full_valid_mean_token_accuracy: optional number`1103911040    - `step: optional number`1104111042    - `train_loss: optional number`1104311044    - `train_mean_token_accuracy: optional number`1104511046    - `valid_loss: optional number`1104711048    - `valid_mean_token_accuracy: optional number`1104911050  - `object: "fine_tuning.job.checkpoint"`1105111052    The object type, which is always "fine_tuning.job.checkpoint".1105311054    - `"fine_tuning.job.checkpoint"`1105511056  - `step_number: number`1105711058    The step number that the checkpoint was created at.1105911060# Methods1106111062## Domain Types1106311064### Dpo Hyperparameters1106511066- `DpoHyperparameters object { batch_size, beta, learning_rate_multiplier, n_epochs }`1106711068  The hyperparameters used for the DPO fine-tuning job.1106911070  - `batch_size: optional "auto" or number`1107111072    Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.1107311074    - `"auto"`1107511076      - `"auto"`1107711078    - `number`1107911080  - `beta: optional "auto" or number`1108111082    The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.1108311084    - `"auto"`1108511086      - `"auto"`1108711088    - `number`1108911090  - `learning_rate_multiplier: optional "auto" or number`1109111092    Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.1109311094    - `"auto"`1109511096      - `"auto"`1109711098    - `number`1109911100  - `n_epochs: optional "auto" or number`1110111102    The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.1110311104    - `"auto"`1110511106      - `"auto"`1110711108    - `number`1110911110### Dpo Method1111111112- `DpoMethod object { hyperparameters }`1111311114  Configuration for the DPO fine-tuning method.1111511116  - `hyperparameters: optional DpoHyperparameters`1111711118    The hyperparameters used for the DPO fine-tuning job.1111911120    - `batch_size: optional "auto" or number`1112111122      Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.1112311124      - `"auto"`1112511126        - `"auto"`1112711128      - `number`1112911130    - `beta: optional "auto" or number`1113111132      The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.1113311134      - `"auto"`1113511136        - `"auto"`1113711138      - `number`1113911140    - `learning_rate_multiplier: optional "auto" or number`1114111142      Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.1114311144      - `"auto"`1114511146        - `"auto"`1114711148      - `number`1114911150    - `n_epochs: optional "auto" or number`1115111152      The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.1115311154      - `"auto"`1115511156        - `"auto"`1115711158      - `number`1115911160### Reinforcement Hyperparameters1116111162- `ReinforcementHyperparameters object { batch_size, compute_multiplier, eval_interval, 4 more }`1116311164  The hyperparameters used for the reinforcement fine-tuning job.1116511166  - `batch_size: optional "auto" or number`1116711168    Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.1116911170    - `"auto"`1117111172      - `"auto"`1117311174    - `number`1117511176  - `compute_multiplier: optional "auto" or number`1117711178    Multiplier on amount of compute used for exploring search space during training.1117911180    - `"auto"`1118111182      - `"auto"`1118311184    - `number`1118511186  - `eval_interval: optional "auto" or number`1118711188    The number of training steps between evaluation runs.1118911190    - `"auto"`1119111192      - `"auto"`1119311194    - `number`1119511196  - `eval_samples: optional "auto" or number`1119711198    Number of evaluation samples to generate per training step.1119911200    - `"auto"`1120111202      - `"auto"`1120311204    - `number`1120511206  - `learning_rate_multiplier: optional "auto" or number`1120711208    Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.1120911210    - `"auto"`1121111212      - `"auto"`1121311214    - `number`1121511216  - `n_epochs: optional "auto" or number`1121711218    The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.1121911220    - `"auto"`1122111222      - `"auto"`1122311224    - `number`1122511226  - `reasoning_effort: optional "default" or "low" or "medium" or "high"`1122711228    Level of reasoning effort.1122911230    - `"default"`1123111232    - `"low"`1123311234    - `"medium"`1123511236    - `"high"`1123711238### Reinforcement Method1123911240- `ReinforcementMethod object { grader, hyperparameters }`1124111242  Configuration for the reinforcement fine-tuning method.1124311244  - `grader: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`1124511246    The grader used for the fine-tuning job.1124711248    - `StringCheckGrader object { input, name, operation, 2 more }`1124911250      A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.1125111252      - `input: string`1125311254        The input text. This may include template strings.1125511256      - `name: string`1125711258        The name of the grader.1125911260      - `operation: "eq" or "ne" or "like" or "ilike"`1126111262        The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.1126311264        - `"eq"`1126511266        - `"ne"`1126711268        - `"like"`1126911270        - `"ilike"`1127111272      - `reference: string`1127311274        The reference text. This may include template strings.1127511276      - `type: "string_check"`1127711278        The object type, which is always `string_check`.1127911280        - `"string_check"`1128111282    - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`1128311284      A TextSimilarityGrader object which grades text based on similarity metrics.1128511286      - `evaluation_metric: "cosine" or "fuzzy_match" or "bleu" or 8 more`1128711288        The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,11289        `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,11290        or `rouge_l`.1129111292        - `"cosine"`1129311294        - `"fuzzy_match"`1129511296        - `"bleu"`1129711298        - `"gleu"`1129911300        - `"meteor"`1130111302        - `"rouge_1"`1130311304        - `"rouge_2"`1130511306        - `"rouge_3"`1130711308        - `"rouge_4"`1130911310        - `"rouge_5"`1131111312        - `"rouge_l"`1131311314      - `input: string`1131511316        The text being graded.1131711318      - `name: string`1131911320        The name of the grader.1132111322      - `reference: string`1132311324        The text being graded against.1132511326      - `type: "text_similarity"`1132711328        The type of grader.1132911330        - `"text_similarity"`1133111332    - `PythonGrader object { name, source, type, image_tag }`1133311334      A PythonGrader object that runs a python script on the input.1133511336      - `name: string`1133711338        The name of the grader.1133911340      - `source: string`1134111342        The source code of the python script.1134311344      - `type: "python"`1134511346        The object type, which is always `python`.1134711348        - `"python"`1134911350      - `image_tag: optional string`1135111352        The image tag to use for the python script.1135311354    - `ScoreModelGrader object { input, model, name, 3 more }`1135511356      A ScoreModelGrader object that uses a model to assign a score to the input.1135711358      - `input: array of object { content, role, type }`1135911360        The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.1136111362        - `content: string or ResponseInputText or object { text, type }  or 3 more`1136311364          Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.1136511366          - `TextInput = string`1136711368            A text input to the model.1136911370          - `ResponseInputText object { text, type, prompt_cache_breakpoint }`1137111372            A text input to the model.1137311374            - `text: string`1137511376              The text input to the model.1137711378            - `type: "input_text"`1137911380              The type of the input item. Always `input_text`.1138111382              - `"input_text"`1138311384            - `prompt_cache_breakpoint: optional object { mode }`1138511386              Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.1138711388              - `mode: "explicit"`1138911390                The breakpoint mode. Always `explicit`.1139111392                - `"explicit"`1139311394          - `OutputText object { text, type }`1139511396            A text output from the model.1139711398            - `text: string`1139911400              The text output from the model.1140111402            - `type: "output_text"`1140311404              The type of the output text. Always `output_text`.1140511406              - `"output_text"`1140711408          - `InputImage object { image_url, type, detail }`1140911410            An image input block used within EvalItem content arrays.1141111412            - `image_url: string`1141311414              The URL of the image input.1141511416            - `type: "input_image"`1141711418              The type of the image input. Always `input_image`.1141911420              - `"input_image"`1142111422            - `detail: optional string`1142311424              The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.1142511426          - `ResponseInputAudio object { input_audio, type }`1142711428            An audio input to the model.1142911430            - `input_audio: object { data, format }`1143111432              - `data: string`1143311434                Base64-encoded audio data.1143511436              - `format: "mp3" or "wav"`1143711438                The format of the audio data. Currently supported formats are `mp3` and11439                `wav`.1144011441                - `"mp3"`1144211443                - `"wav"`1144411445            - `type: "input_audio"`1144611447              The type of the input item. Always `input_audio`.1144811449              - `"input_audio"`1145011451          - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`1145211453            A list of inputs, each of which may be either an input text, output text, input11454            image, or input audio object.1145511456            - `TextInput = string`1145711458              A text input to the model.1145911460            - `ResponseInputText object { text, type, prompt_cache_breakpoint }`1146111462              A text input to the model.1146311464            - `OutputText object { text, type }`1146511466              A text output from the model.1146711468              - `text: string`1146911470                The text output from the model.1147111472              - `type: "output_text"`1147311474                The type of the output text. Always `output_text`.1147511476                - `"output_text"`1147711478            - `InputImage object { image_url, type, detail }`1147911480              An image input block used within EvalItem content arrays.1148111482              - `image_url: string`1148311484                The URL of the image input.1148511486              - `type: "input_image"`1148711488                The type of the image input. Always `input_image`.1148911490                - `"input_image"`1149111492              - `detail: optional string`1149311494                The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.1149511496            - `ResponseInputAudio object { input_audio, type }`1149711498              An audio input to the model.1149911500        - `role: "user" or "assistant" or "system" or "developer"`1150111502          The role of the message input. One of `user`, `assistant`, `system`, or11503          `developer`.1150411505          - `"user"`1150611507          - `"assistant"`1150811509          - `"system"`1151011511          - `"developer"`1151211513        - `type: optional "message"`1151411515          The type of the message input. Always `message`.1151611517          - `"message"`1151811519      - `model: string`1152011521        The model to use for the evaluation.1152211523      - `name: string`1152411525        The name of the grader.1152611527      - `type: "score_model"`1152811529        The object type, which is always `score_model`.1153011531        - `"score_model"`1153211533      - `range: optional array of number`1153411535        The range of the score. Defaults to `[0, 1]`.1153611537      - `sampling_params: optional object { max_completions_tokens, reasoning_effort, seed, 2 more }`1153811539        The sampling parameters for the model.1154011541        - `max_completions_tokens: optional number or null`1154211543          The maximum number of tokens the grader model may generate in its response.1154411545        - `reasoning_effort: optional ReasoningEffort or null`1154611547          Constrains effort on reasoning for reasoning models. Currently supported11548          values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.11549          Reducing reasoning effort can result in faster responses and fewer tokens11550          used on reasoning in a response. Not all reasoning models support every11551          value. See the11552          [reasoning guide](/api/docs/guides/reasoning)11553          for model-specific support.1155411555          - `"none"`1155611557          - `"minimal"`1155811559          - `"low"`1156011561          - `"medium"`1156211563          - `"high"`1156411565          - `"xhigh"`1156611567          - `"max"`1156811569        - `seed: optional number or null`1157011571          A seed value to initialize the randomness, during sampling.1157211573        - `temperature: optional number or null`1157411575          A higher temperature increases randomness in the outputs.1157611577        - `top_p: optional number or null`1157811579          An alternative to temperature for nucleus sampling; 1.0 includes all tokens.1158011581    - `MultiGrader object { calculate_output, graders, name, type }`1158211583      A MultiGrader object combines the output of multiple graders to produce a single score.1158411585      - `calculate_output: string`1158611587        A formula to calculate the output based on grader results.1158811589      - `graders: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`1159011591        A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.1159211593        - `StringCheckGrader object { input, name, operation, 2 more }`1159411595          A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.1159611597        - `TextSimilarityGrader object { evaluation_metric, input, name, 2 more }`1159811599          A TextSimilarityGrader object which grades text based on similarity metrics.1160011601        - `PythonGrader object { name, source, type, image_tag }`1160211603          A PythonGrader object that runs a python script on the input.1160411605        - `ScoreModelGrader object { input, model, name, 3 more }`1160611607          A ScoreModelGrader object that uses a model to assign a score to the input.1160811609        - `LabelModelGrader object { input, labels, model, 3 more }`1161011611          A LabelModelGrader object which uses a model to assign labels to each item11612          in the evaluation.1161311614          - `input: array of object { content, role, type }`1161511616            - `content: string or ResponseInputText or object { text, type }  or 3 more`1161711618              Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.1161911620              - `TextInput = string`1162111622                A text input to the model.1162311624              - `ResponseInputText object { text, type, prompt_cache_breakpoint }`1162511626                A text input to the model.1162711628              - `OutputText object { text, type }`1162911630                A text output from the model.1163111632                - `text: string`1163311634                  The text output from the model.1163511636                - `type: "output_text"`1163711638                  The type of the output text. Always `output_text`.1163911640                  - `"output_text"`1164111642              - `InputImage object { image_url, type, detail }`1164311644                An image input block used within EvalItem content arrays.1164511646                - `image_url: string`1164711648                  The URL of the image input.1164911650                - `type: "input_image"`1165111652                  The type of the image input. Always `input_image`.1165311654                  - `"input_image"`1165511656                - `detail: optional string`1165711658                  The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.1165911660              - `ResponseInputAudio object { input_audio, type }`1166111662                An audio input to the model.1166311664              - `GraderInputs = array of string or ResponseInputText or object { text, type }  or 2 more`1166511666                A list of inputs, each of which may be either an input text, output text, input11667                image, or input audio object.1166811669            - `role: "user" or "assistant" or "system" or "developer"`1167011671              The role of the message input. One of `user`, `assistant`, `system`, or11672              `developer`.1167311674              - `"user"`1167511676              - `"assistant"`1167711678              - `"system"`1167911680              - `"developer"`1168111682            - `type: optional "message"`1168311684              The type of the message input. Always `message`.1168511686              - `"message"`1168711688          - `labels: array of string`1168911690            The labels to assign to each item in the evaluation.1169111692          - `model: string`1169311694            The model to use for the evaluation. Must support structured outputs.1169511696          - `name: string`1169711698            The name of the grader.1169911700          - `passing_labels: array of string`1170111702            The labels that indicate a passing result. Must be a subset of labels.1170311704          - `type: "label_model"`1170511706            The object type, which is always `label_model`.1170711708            - `"label_model"`1170911710      - `name: string`1171111712        The name of the grader.1171311714      - `type: "multi"`1171511716        The object type, which is always `multi`.1171711718        - `"multi"`1171911720  - `hyperparameters: optional ReinforcementHyperparameters`1172111722    The hyperparameters used for the reinforcement fine-tuning job.1172311724    - `batch_size: optional "auto" or number`1172511726      Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.1172711728      - `"auto"`1172911730        - `"auto"`1173111732      - `number`1173311734    - `compute_multiplier: optional "auto" or number`1173511736      Multiplier on amount of compute used for exploring search space during training.1173711738      - `"auto"`1173911740        - `"auto"`1174111742      - `number`1174311744    - `eval_interval: optional "auto" or number`1174511746      The number of training steps between evaluation runs.1174711748      - `"auto"`1174911750        - `"auto"`1175111752      - `number`1175311754    - `eval_samples: optional "auto" or number`1175511756      Number of evaluation samples to generate per training step.1175711758      - `"auto"`1175911760        - `"auto"`1176111762      - `number`1176311764    - `learning_rate_multiplier: optional "auto" or number`1176511766      Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.1176711768      - `"auto"`1176911770        - `"auto"`1177111772      - `number`1177311774    - `n_epochs: optional "auto" or number`1177511776      The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.1177711778      - `"auto"`1177911780        - `"auto"`1178111782      - `number`1178311784    - `reasoning_effort: optional "default" or "low" or "medium" or "high"`1178511786      Level of reasoning effort.1178711788      - `"default"`1178911790      - `"low"`1179111792      - `"medium"`1179311794      - `"high"`1179511796### Supervised Hyperparameters1179711798- `SupervisedHyperparameters object { batch_size, learning_rate_multiplier, n_epochs }`1179911800  The hyperparameters used for the fine-tuning job.1180111802  - `batch_size: optional "auto" or number`1180311804    Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.1180511806    - `"auto"`1180711808      - `"auto"`1180911810    - `number`1181111812  - `learning_rate_multiplier: optional "auto" or number`1181311814    Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.1181511816    - `"auto"`1181711818      - `"auto"`1181911820    - `number`1182111822  - `n_epochs: optional "auto" or number`1182311824    The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.1182511826    - `"auto"`1182711828      - `"auto"`1182911830    - `number`1183111832### Supervised Method1183311834- `SupervisedMethod object { hyperparameters }`1183511836  Configuration for the supervised fine-tuning method.1183711838  - `hyperparameters: optional SupervisedHyperparameters`1183911840    The hyperparameters used for the fine-tuning job.1184111842    - `batch_size: optional "auto" or number`1184311844      Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.1184511846      - `"auto"`1184711848        - `"auto"`1184911850      - `number`1185111852    - `learning_rate_multiplier: optional "auto" or number`1185311854      Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.1185511856      - `"auto"`1185711858        - `"auto"`1185911860      - `number`1186111862    - `n_epochs: optional "auto" or number`1186311864      The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.1186511866      - `"auto"`1186711868        - `"auto"`1186911870      - `number`11871
Files main
Menu

Theme