openapi: 3.0.0 info: title: OpenAI Assistants Fine Tuning API description: The Assistants API allows you to build AI assistants within your own applications. An Assistant has instructions and can leverage models, tools, and knowledge to respond to user queries. The Assistants API currently supports three types of tools - Code Interpreter, Retrieval, and Function calling. In the future, we plan to release more OpenAI-built tools, and allow you to provide your own tools on our platform. version: 2.0.0 termsOfService: https://openai.com/policies/terms-of-use contact: name: OpenAI Support url: https://help.openai.com/ license: name: MIT url: https://github.com/openai/openai-openapi/blob/master/LICENSE servers: - url: https://api.openai.com/v1 security: - ApiKeyAuth: [] tags: - name: Fine Tuning paths: /fine_tuning/jobs: post: operationId: createFineTuningJob tags: - Fine Tuning summary: 'OpenAI Creates a fine-tuning job which begins the process of creating a new model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about fine-tuning](/docs/guides/fine-tuning)' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateFineTuningJobRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/FineTuningJob' x-oaiMeta: name: Create fine-tuning job group: fine-tuning returns: A [fine-tuning.job](/docs/api-reference/fine-tuning/object) object. examples: - title: Default request: curl: "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-BK7bzQj3FfZFXr7DbL6xJwfo\",\n \"model\": \"gpt-3.5-turbo\"\n }'\n" python: "from openai import OpenAI\nclient = OpenAI()\n\nclient.fine_tuning.jobs.create(\n training_file=\"file-abc123\",\n model=\"gpt-3.5-turbo\"\n)\n" node.js: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.create({\n training_file: \"file-abc123\"\n });\n\n console.log(fineTune);\n}\n\nmain();\n" response: "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-3.5-turbo-0613\",\n \"created_at\": 1614807352,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n}\n" - title: Epochs request: curl: "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-abc123\",\n \"model\": \"gpt-3.5-turbo\",\n \"hyperparameters\": {\n \"n_epochs\": 2\n }\n }'\n" python: "from openai import OpenAI\nclient = OpenAI()\n\nclient.fine_tuning.jobs.create(\n training_file=\"file-abc123\",\n model=\"gpt-3.5-turbo\",\n hyperparameters={\n \"n_epochs\":2\n }\n)\n" node.js: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.create({\n training_file: \"file-abc123\",\n model: \"gpt-3.5-turbo\",\n hyperparameters: { n_epochs: 2 }\n });\n\n console.log(fineTune);\n}\n\nmain();\n" response: "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-3.5-turbo-0613\",\n \"created_at\": 1614807352,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\"n_epochs\": 2},\n}\n" - title: Validation file request: curl: "curl https://api.openai.com/v1/fine_tuning/jobs \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"training_file\": \"file-abc123\",\n \"validation_file\": \"file-abc123\",\n \"model\": \"gpt-3.5-turbo\"\n }'\n" python: "from openai import OpenAI\nclient = OpenAI()\n\nclient.fine_tuning.jobs.create(\n training_file=\"file-abc123\",\n validation_file=\"file-def456\",\n model=\"gpt-3.5-turbo\"\n)\n" node.js: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.create({\n training_file: \"file-abc123\",\n validation_file: \"file-abc123\"\n });\n\n console.log(fineTune);\n}\n\nmain();\n" response: "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-3.5-turbo-0613\",\n \"created_at\": 1614807352,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": \"file-abc123\",\n \"training_file\": \"file-abc123\",\n}\n" get: operationId: listPaginatedFineTuningJobs tags: - Fine Tuning summary: OpenAI List your organization's fine-tuning jobs parameters: - name: after in: query description: Identifier for the last job from the previous pagination request. required: false schema: type: string - name: limit in: query description: Number of fine-tuning jobs to retrieve. required: false schema: type: integer default: 20 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ListPaginatedFineTuningJobsResponse' x-oaiMeta: name: List fine-tuning jobs group: fine-tuning returns: A list of paginated [fine-tuning job](/docs/api-reference/fine-tuning/object) objects. examples: request: curl: "curl https://api.openai.com/v1/fine_tuning/jobs?limit=2 \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" python: 'from openai import OpenAI client = OpenAI() client.fine_tuning.jobs.list() ' node.js: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.fineTuning.jobs.list();\n\n for await (const fineTune of list) {\n console.log(fineTune);\n }\n}\n\nmain();" response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"fine_tuning.job.event\",\n \"id\": \"ft-event-TjX0lMfOniCZX64t9PUQT5hn\",\n \"created_at\": 1689813489,\n \"level\": \"warn\",\n \"message\": \"Fine tuning process stopping due to job cancellation\",\n \"data\": null,\n \"type\": \"message\"\n },\n { ... },\n { ... }\n ], \"has_more\": true\n}\n" /fine_tuning/jobs/{fine_tuning_job_id}: get: operationId: retrieveFineTuningJob tags: - Fine Tuning summary: 'OpenAI Get info about a fine-tuning job. [Learn more about fine-tuning](/docs/guides/fine-tuning)' parameters: - in: path name: fine_tuning_job_id required: true schema: type: string example: ft-AF1WoRqd3aJAHsqc9NY7iL8F description: 'The ID of the fine-tuning job. ' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/FineTuningJob' x-oaiMeta: name: Retrieve fine-tuning job group: fine-tuning returns: The [fine-tuning](/docs/api-reference/fine-tuning/object) object with the given ID. examples: request: curl: "curl https://api.openai.com/v1/fine_tuning/jobs/ft-AF1WoRqd3aJAHsqc9NY7iL8F \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" python: 'from openai import OpenAI client = OpenAI() client.fine_tuning.jobs.retrieve("ftjob-abc123") ' node.js: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.retrieve(\"ftjob-abc123\");\n\n console.log(fineTune);\n}\n\nmain();\n" response: "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"davinci-002\",\n \"created_at\": 1692661014,\n \"finished_at\": 1692661190,\n \"fine_tuned_model\": \"ft:davinci-002:my-org:custom_suffix:7q8mpxmy\",\n \"organization_id\": \"org-123\",\n \"result_files\": [\n \"file-abc123\"\n ],\n \"status\": \"succeeded\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\n \"n_epochs\": 4,\n },\n \"trained_tokens\": 5768\n}\n" /fine_tuning/jobs/{fine_tuning_job_id}/events: get: operationId: listFineTuningEvents tags: - Fine Tuning summary: OpenAI Get status updates for a fine-tuning job. parameters: - in: path name: fine_tuning_job_id required: true schema: type: string example: ft-AF1WoRqd3aJAHsqc9NY7iL8F description: 'The ID of the fine-tuning job to get events for. ' - name: after in: query description: Identifier for the last event from the previous pagination request. required: false schema: type: string - name: limit in: query description: Number of events to retrieve. required: false schema: type: integer default: 20 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ListFineTuningJobEventsResponse' x-oaiMeta: name: List fine-tuning events group: fine-tuning returns: A list of fine-tuning event objects. examples: request: curl: "curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/events \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" python: "from openai import OpenAI\nclient = OpenAI()\n\nclient.fine_tuning.jobs.list_events(\n fine_tuning_job_id=\"ftjob-abc123\",\n limit=2\n)\n" node.js: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const list = await openai.fineTuning.list_events(id=\"ftjob-abc123\", limit=2);\n\n for await (const fineTune of list) {\n console.log(fineTune);\n }\n}\n\nmain();" response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"fine_tuning.job.event\",\n \"id\": \"ft-event-ddTJfwuMVpfLXseO0Am0Gqjm\",\n \"created_at\": 1692407401,\n \"level\": \"info\",\n \"message\": \"Fine tuning job successfully completed\",\n \"data\": null,\n \"type\": \"message\"\n },\n {\n \"object\": \"fine_tuning.job.event\",\n \"id\": \"ft-event-tyiGuB72evQncpH87xe505Sv\",\n \"created_at\": 1692407400,\n \"level\": \"info\",\n \"message\": \"New fine-tuned model created: ft:gpt-3.5-turbo:openai::7p4lURel\",\n \"data\": null,\n \"type\": \"message\"\n }\n ],\n \"has_more\": true\n}\n" /fine_tuning/jobs/{fine_tuning_job_id}/cancel: post: operationId: cancelFineTuningJob tags: - Fine Tuning summary: OpenAI Immediately cancel a fine-tune job. parameters: - in: path name: fine_tuning_job_id required: true schema: type: string example: ft-AF1WoRqd3aJAHsqc9NY7iL8F description: 'The ID of the fine-tuning job to cancel. ' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/FineTuningJob' x-oaiMeta: name: Cancel fine-tuning group: fine-tuning returns: The cancelled [fine-tuning](/docs/api-reference/fine-tuning/object) object. examples: request: curl: "curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/cancel \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" python: 'from openai import OpenAI client = OpenAI() client.fine_tuning.jobs.cancel("ftjob-abc123") ' node.js: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.cancel(\"ftjob-abc123\");\n\n console.log(fineTune);\n}\nmain();" response: "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-3.5-turbo-0613\",\n \"created_at\": 1689376978,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"hyperparameters\": {\n \"n_epochs\": \"auto\"\n },\n \"status\": \"cancelled\",\n \"validation_file\": \"file-abc123\",\n \"training_file\": \"file-abc123\"\n}\n" /fine_tuning/alpha/graders/run: post: operationId: runGrader tags: - Fine Tuning summary: 'Run a grader. ' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RunGraderRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/RunGraderResponse' x-oaiMeta: name: Run grader beta: true group: graders examples: - title: Score text alignment request: curl: "curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"grader\": {\n \"type\": \"score_model\",\n \"name\": \"Example score model grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"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}}\"\n }\n ]\n }\n ],\n \"model\": \"gpt-5-mini\",\n \"sampling_params\": {\n \"temperature\": 1,\n \"top_p\": 1,\n \"seed\": 42\n }\n },\n \"item\": {\n \"reference_answer\": \"fuzzy wuzzy was a bear\"\n },\n \"model_sample\": \"fuzzy wuzzy was a bear\"\n }'\n" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.fine_tuning.alpha.graders.run(\n grader={\n \"input\": \"input\",\n \"name\": \"name\",\n \"operation\": \"eq\",\n \"reference\": \"reference\",\n \"type\": \"string_check\",\n },\n model_sample=\"model_sample\",\n)\nprint(response.metadata)" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nconst result = await openai.fineTuning.alpha.graders.run({\n grader: {\n type: \"score_model\",\n name: \"Example score model grader\",\n input: [\n {\n role: \"user\",\n content: [\n {\n type: \"input_text\",\n 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}}\",\n },\n ],\n },\n ],\n model: \"gpt-5-mini\",\n sampling_params: { temperature: 1, top_p: 1, seed: 42 },\n },\n item: { reference_answer: \"fuzzy wuzzy was a bear\" },\n model_sample: \"fuzzy wuzzy was a bear\",\n});\nconsole.log(result);\n" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.fineTuning.alpha.graders.run({\n grader: {\n input: 'input',\n name: 'name',\n operation: 'eq',\n reference: 'reference',\n type: 'string_check',\n },\n model_sample: 'model_sample',\n});\n\nconsole.log(response.metadata);" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{\n\t\tGrader: openai.FineTuningAlphaGraderRunParamsGraderUnion{\n\t\t\tOfStringCheck: &openai.StringCheckGraderParam{\n\t\t\t\tInput: \"input\",\n\t\t\t\tName: \"name\",\n\t\t\t\tOperation: openai.StringCheckGraderOperationEq,\n\t\t\t\tReference: \"reference\",\n\t\t\t},\n\t\t},\n\t\tModelSample: \"model_sample\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Metadata)\n}\n" java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.alpha.graders.GraderRunParams;\nimport com.openai.models.finetuning.alpha.graders.GraderRunResponse;\nimport com.openai.models.graders.gradermodels.StringCheckGrader;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GraderRunParams params = GraderRunParams.builder()\n .grader(StringCheckGrader.builder()\n .input(\"input\")\n .name(\"name\")\n .operation(StringCheckGrader.Operation.EQ)\n .reference(\"reference\")\n .build())\n .modelSample(\"model_sample\")\n .build();\n GraderRunResponse response = client.fineTuning().alpha().graders().run(params);\n }\n}" ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.fine_tuning.alpha.graders.run(\n grader: {input: \"input\", name: \"name\", operation: :eq, reference: \"reference\", type: :string_check},\n model_sample: \"model_sample\"\n)\n\nputs(response)" response: "{\n \"reward\": 1.0,\n \"metadata\": {\n \"name\": \"Example score model grader\",\n \"type\": \"score_model\",\n \"errors\": {\n \"formula_parse_error\": false,\n \"sample_parse_error\": false,\n \"truncated_observation_error\": false,\n \"unresponsive_reward_error\": false,\n \"invalid_variable_error\": false,\n \"other_error\": false,\n \"python_grader_server_error\": false,\n \"python_grader_server_error_type\": null,\n \"python_grader_runtime_error\": false,\n \"python_grader_runtime_error_details\": null,\n \"model_grader_server_error\": false,\n \"model_grader_refusal_error\": false,\n \"model_grader_parse_error\": false,\n \"model_grader_server_error_details\": null\n },\n \"execution_time\": 4.365238428115845,\n \"scores\": {},\n \"token_usage\": {\n \"prompt_tokens\": 190,\n \"total_tokens\": 324,\n \"completion_tokens\": 134,\n \"cached_tokens\": 0\n },\n \"sampled_model_name\": \"gpt-4o-2024-08-06\"\n },\n \"sub_rewards\": {},\n \"model_grader_token_usage_per_model\": {\n \"gpt-4o-2024-08-06\": {\n \"prompt_tokens\": 190,\n \"total_tokens\": 324,\n \"completion_tokens\": 134,\n \"cached_tokens\": 0\n }\n }\n}\n" - title: Score an image caption request: curl: "curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"grader\": {\n \"type\": \"score_model\",\n \"name\": \"Image caption grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": \"Score how well the provided caption matches the image on a 0-1 scale. Only return the score.\\n\\nCaption: {{sample.output_text}}\"\n },\n {\n \"type\": \"input_image\",\n \"image_url\": \"https://example.com/dog-catching-ball.png\",\n \"file_id\": null,\n \"detail\": \"high\"\n }\n ]\n }\n ],\n \"model\": \"gpt-5-mini\",\n \"sampling_params\": {\n \"temperature\": 0.2\n }\n },\n \"item\": {\n \"expected_caption\": \"A golden retriever jumps to catch a tennis ball\"\n },\n \"model_sample\": \"A dog leaps to grab a tennis ball mid-air\"\n }'\n" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.fineTuning.alpha.graders.run({\n grader: {\n input: 'input',\n name: 'name',\n operation: 'eq',\n reference: 'reference',\n type: 'string_check',\n },\n model_sample: 'model_sample',\n});\n\nconsole.log(response.metadata);" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.fine_tuning.alpha.graders.run(\n grader={\n \"input\": \"input\",\n \"name\": \"name\",\n \"operation\": \"eq\",\n \"reference\": \"reference\",\n \"type\": \"string_check\",\n },\n model_sample=\"model_sample\",\n)\nprint(response.metadata)" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{\n\t\tGrader: openai.FineTuningAlphaGraderRunParamsGraderUnion{\n\t\t\tOfStringCheck: &openai.StringCheckGraderParam{\n\t\t\t\tInput: \"input\",\n\t\t\t\tName: \"name\",\n\t\t\t\tOperation: openai.StringCheckGraderOperationEq,\n\t\t\t\tReference: \"reference\",\n\t\t\t},\n\t\t},\n\t\tModelSample: \"model_sample\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Metadata)\n}\n" java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.alpha.graders.GraderRunParams;\nimport com.openai.models.finetuning.alpha.graders.GraderRunResponse;\nimport com.openai.models.graders.gradermodels.StringCheckGrader;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GraderRunParams params = GraderRunParams.builder()\n .grader(StringCheckGrader.builder()\n .input(\"input\")\n .name(\"name\")\n .operation(StringCheckGrader.Operation.EQ)\n .reference(\"reference\")\n .build())\n .modelSample(\"model_sample\")\n .build();\n GraderRunResponse response = client.fineTuning().alpha().graders().run(params);\n }\n}" ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.fine_tuning.alpha.graders.run(\n grader: {input: \"input\", name: \"name\", operation: :eq, reference: \"reference\", type: :string_check},\n model_sample: \"model_sample\"\n)\n\nputs(response)" - title: Score an audio response request: curl: "curl -X POST https://api.openai.com/v1/fine_tuning/alpha/graders/run \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -d '{\n \"grader\": {\n \"type\": \"score_model\",\n \"name\": \"Audio clarity grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": \"Listen to the clip and return a confidence score from 0 to 1 that the speaker said: {{item.target_phrase}}\"\n },\n {\n \"type\": \"input_audio\",\n \"input_audio\": {\n \"data\": \"{{item.audio_clip_b64}}\",\n \"format\": \"mp3\"\n }\n }\n ]\n }\n ],\n \"model\": \"gpt-audio\",\n \"sampling_params\": {\n \"temperature\": 0.2,\n \"top_p\": 1,\n \"seed\": 123\n }\n },\n \"item\": {\n \"target_phrase\": \"Please deliver the package on Tuesday\",\n \"audio_clip_b64\": \"\"\n },\n \"model_sample\": \"Please deliver the package on Tuesday\"\n }'\n" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.fineTuning.alpha.graders.run({\n grader: {\n input: 'input',\n name: 'name',\n operation: 'eq',\n reference: 'reference',\n type: 'string_check',\n },\n model_sample: 'model_sample',\n});\n\nconsole.log(response.metadata);" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.fine_tuning.alpha.graders.run(\n grader={\n \"input\": \"input\",\n \"name\": \"name\",\n \"operation\": \"eq\",\n \"reference\": \"reference\",\n \"type\": \"string_check\",\n },\n model_sample=\"model_sample\",\n)\nprint(response.metadata)" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.FineTuning.Alpha.Graders.Run(context.TODO(), openai.FineTuningAlphaGraderRunParams{\n\t\tGrader: openai.FineTuningAlphaGraderRunParamsGraderUnion{\n\t\t\tOfStringCheck: &openai.StringCheckGraderParam{\n\t\t\t\tInput: \"input\",\n\t\t\t\tName: \"name\",\n\t\t\t\tOperation: openai.StringCheckGraderOperationEq,\n\t\t\t\tReference: \"reference\",\n\t\t\t},\n\t\t},\n\t\tModelSample: \"model_sample\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Metadata)\n}\n" java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.alpha.graders.GraderRunParams;\nimport com.openai.models.finetuning.alpha.graders.GraderRunResponse;\nimport com.openai.models.graders.gradermodels.StringCheckGrader;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GraderRunParams params = GraderRunParams.builder()\n .grader(StringCheckGrader.builder()\n .input(\"input\")\n .name(\"name\")\n .operation(StringCheckGrader.Operation.EQ)\n .reference(\"reference\")\n .build())\n .modelSample(\"model_sample\")\n .build();\n GraderRunResponse response = client.fineTuning().alpha().graders().run(params);\n }\n}" ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.fine_tuning.alpha.graders.run(\n grader: {input: \"input\", name: \"name\", operation: :eq, reference: \"reference\", type: :string_check},\n model_sample: \"model_sample\"\n)\n\nputs(response)" /fine_tuning/alpha/graders/validate: post: operationId: validateGrader tags: - Fine Tuning summary: 'Validate a grader. ' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ValidateGraderRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ValidateGraderResponse' x-oaiMeta: name: Validate grader beta: true group: graders examples: request: curl: "curl https://api.openai.com/v1/fine_tuning/alpha/graders/validate \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"grader\": {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n }\n }'\n" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.fineTuning.alpha.graders.validate({\n grader: {\n input: 'input',\n name: 'name',\n operation: 'eq',\n reference: 'reference',\n type: 'string_check',\n },\n});\n\nconsole.log(response.grader);" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nresponse = client.fine_tuning.alpha.graders.validate(\n grader={\n \"input\": \"input\",\n \"name\": \"name\",\n \"operation\": \"eq\",\n \"reference\": \"reference\",\n \"type\": \"string_check\",\n },\n)\nprint(response.grader)" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.FineTuning.Alpha.Graders.Validate(context.TODO(), openai.FineTuningAlphaGraderValidateParams{\n\t\tGrader: openai.FineTuningAlphaGraderValidateParamsGraderUnion{\n\t\t\tOfStringCheckGrader: &openai.StringCheckGraderParam{\n\t\t\t\tInput: \"input\",\n\t\t\t\tName: \"name\",\n\t\t\t\tOperation: openai.StringCheckGraderOperationEq,\n\t\t\t\tReference: \"reference\",\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Grader)\n}\n" java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.alpha.graders.GraderValidateParams;\nimport com.openai.models.finetuning.alpha.graders.GraderValidateResponse;\nimport com.openai.models.graders.gradermodels.StringCheckGrader;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n GraderValidateParams params = GraderValidateParams.builder()\n .grader(StringCheckGrader.builder()\n .input(\"input\")\n .name(\"name\")\n .operation(StringCheckGrader.Operation.EQ)\n .reference(\"reference\")\n .build())\n .build();\n GraderValidateResponse response = client.fineTuning().alpha().graders().validate(params);\n }\n}" ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\nresponse = openai.fine_tuning.alpha.graders.validate(\n grader: {input: \"input\", name: \"name\", operation: :eq, reference: \"reference\", type: :string_check}\n)\n\nputs(response)" response: "{\n \"grader\": {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n }\n}\n" /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions: get: operationId: listFineTuningCheckpointPermissions tags: - Fine Tuning summary: '**NOTE:** This endpoint requires an [admin API key](../admin-api-keys). Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint. ' parameters: - in: path name: fine_tuned_model_checkpoint required: true schema: type: string example: ft-AF1WoRqd3aJAHsqc9NY7iL8F description: 'The ID of the fine-tuned model checkpoint to get permissions for. ' - name: project_id in: query description: The ID of the project to get permissions for. required: false schema: type: string - name: after in: query description: Identifier for the last permission ID from the previous pagination request. required: false schema: type: string - name: limit in: query description: Number of permissions to retrieve. required: false schema: type: integer default: 10 - name: order in: query description: The order in which to retrieve permissions. required: false schema: type: string enum: - ascending - descending default: descending responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ListFineTuningCheckpointPermissionResponse' x-oaiMeta: name: List checkpoint permissions group: fine-tuning examples: request: curl: "curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst permission = await client.fineTuning.checkpoints.permissions.retrieve(\n 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',\n);\n\nconsole.log(permission.first_id);" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npermission = client.fine_tuning.checkpoints.permissions.retrieve(\n fine_tuned_model_checkpoint=\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\nprint(permission.first_id)" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpermission, err := client.FineTuning.Checkpoints.Permissions.Get(\n\t\tcontext.TODO(),\n\t\t\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n\t\topenai.FineTuningCheckpointPermissionGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", permission.FirstID)\n}\n" java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionRetrieveParams;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n PermissionRetrieveResponse permission = client.fineTuning().checkpoints().permissions().retrieve(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(api_key: "My API Key") permission = openai.fine_tuning.checkpoints.permissions.retrieve("ft-AF1WoRqd3aJAHsqc9NY7iL8F") puts(permission)' response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1721764867,\n \"project_id\": \"proj_abGMw1llN8IrBb6SvvY5A1iH\"\n },\n {\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_enQCFmOTGj3syEpYVhBRLTSy\",\n \"created_at\": 1721764800,\n \"project_id\": \"proj_iqGMw1llN8IrBb6SvvY5A1oF\"\n },\n ],\n \"first_id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"last_id\": \"cp_enQCFmOTGj3syEpYVhBRLTSy\",\n \"has_more\": false\n}\n" post: operationId: createFineTuningCheckpointPermission tags: - Fine Tuning summary: '**NOTE:** Calling this endpoint requires an [admin API key](../admin-api-keys). This enables organization owners to share fine-tuned models with other projects in their organization. ' parameters: - in: path name: fine_tuned_model_checkpoint required: true schema: type: string example: ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd description: 'The ID of the fine-tuned model checkpoint to create a permission for. ' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateFineTuningCheckpointPermissionRequest' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ListFineTuningCheckpointPermissionResponse' x-oaiMeta: name: Create checkpoint permissions group: fine-tuning examples: request: curl: "curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n -d '{\"project_ids\": [\"proj_abGMw1llN8IrBb6SvvY5A1iH\"]}'\n" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const permissionCreateResponse of client.fineTuning.checkpoints.permissions.create(\n 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd',\n { project_ids: ['string'] },\n)) {\n console.log(permissionCreateResponse.id);\n}" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.fine_tuning.checkpoints.permissions.create(\n fine_tuned_model_checkpoint=\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n project_ids=[\"string\"],\n)\npage = page.data[0]\nprint(page.id)" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.FineTuning.Checkpoints.Permissions.New(\n\t\tcontext.TODO(),\n\t\t\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n\t\topenai.FineTuningCheckpointPermissionNewParams{\n\t\t\tProjectIDs: []string{\"string\"},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n" java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionCreatePage;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n PermissionCreateParams params = PermissionCreateParams.builder()\n .fineTunedModelCheckpoint(\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\")\n .addProjectId(\"string\")\n .build();\n PermissionCreatePage page = client.fineTuning().checkpoints().permissions().create(params);\n }\n}" ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npage = openai.fine_tuning.checkpoints.permissions.create(\n \"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n project_ids: [\"string\"]\n)\n\nputs(page)" response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1721764867,\n \"project_id\": \"proj_abGMw1llN8IrBb6SvvY5A1iH\"\n }\n ],\n \"first_id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"last_id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"has_more\": false\n}\n" /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}: delete: operationId: deleteFineTuningCheckpointPermission tags: - Fine Tuning summary: '**NOTE:** This endpoint requires an [admin API key](../admin-api-keys). Organization owners can use this endpoint to delete a permission for a fine-tuned model checkpoint. ' parameters: - in: path name: fine_tuned_model_checkpoint required: true schema: type: string example: ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd description: 'The ID of the fine-tuned model checkpoint to delete a permission for. ' - in: path name: permission_id required: true schema: type: string example: cp_zc4Q7MP6XxulcVzj4MZdwsAB description: 'The ID of the fine-tuned model checkpoint permission to delete. ' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/DeleteFineTuningCheckpointPermissionResponse' x-oaiMeta: name: Delete checkpoint permission group: fine-tuning examples: request: curl: "curl https://api.openai.com/v1/fine_tuning/checkpoints/ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd/permissions/cp_zc4Q7MP6XxulcVzj4MZdwsAB \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst permission = await client.fineTuning.checkpoints.permissions.delete(\n 'cp_zc4Q7MP6XxulcVzj4MZdwsAB',\n { fine_tuned_model_checkpoint: 'ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd' },\n);\n\nconsole.log(permission.id);" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npermission = client.fine_tuning.checkpoints.permissions.delete(\n permission_id=\"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n fine_tuned_model_checkpoint=\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n)\nprint(permission.id)" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpermission, err := client.FineTuning.Checkpoints.Permissions.Delete(\n\t\tcontext.TODO(),\n\t\t\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\",\n\t\t\"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", permission.ID)\n}\n" java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionDeleteParams;\nimport com.openai.models.finetuning.checkpoints.permissions.PermissionDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n PermissionDeleteParams params = PermissionDeleteParams.builder()\n .fineTunedModelCheckpoint(\"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\")\n .permissionId(\"cp_zc4Q7MP6XxulcVzj4MZdwsAB\")\n .build();\n PermissionDeleteResponse permission = client.fineTuning().checkpoints().permissions().delete(params);\n }\n}" ruby: "require \"openai\"\n\nopenai = OpenAI::Client.new(api_key: \"My API Key\")\n\npermission = openai.fine_tuning.checkpoints.permissions.delete(\n \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n fine_tuned_model_checkpoint: \"ft:gpt-4o-mini-2024-07-18:org:weather:B7R9VjQd\"\n)\n\nputs(permission)" response: "{\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"deleted\": true\n}\n" /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints: get: operationId: listFineTuningJobCheckpoints tags: - Fine Tuning summary: 'List checkpoints for a fine-tuning job. ' parameters: - in: path name: fine_tuning_job_id required: true schema: type: string example: ft-AF1WoRqd3aJAHsqc9NY7iL8F description: 'The ID of the fine-tuning job to get checkpoints for. ' - name: after in: query description: Identifier for the last checkpoint ID from the previous pagination request. required: false schema: type: string - name: limit in: query description: Number of checkpoints to retrieve. required: false schema: type: integer default: 10 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ListFineTuningJobCheckpointsResponse' x-oaiMeta: name: List fine-tuning checkpoints group: fine-tuning examples: request: curl: "curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/checkpoints \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fineTuningJobCheckpoint of client.fineTuning.jobs.checkpoints.list(\n 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',\n)) {\n console.log(fineTuningJobCheckpoint.id);\n}" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\npage = client.fine_tuning.jobs.checkpoints.list(\n fine_tuning_job_id=\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\npage = page.data[0]\nprint(page.id)" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.FineTuning.Jobs.Checkpoints.List(\n\t\tcontext.TODO(),\n\t\t\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n\t\topenai.FineTuningJobCheckpointListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n" java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.checkpoints.CheckpointListPage;\nimport com.openai.models.finetuning.jobs.checkpoints.CheckpointListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n CheckpointListPage page = client.fineTuning().jobs().checkpoints().list(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(api_key: "My API Key") page = openai.fine_tuning.jobs.checkpoints.list("ft-AF1WoRqd3aJAHsqc9NY7iL8F") puts(page)' response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1721764867,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:96olL566:ckpt-step-2000\",\n \"metrics\": {\n \"full_valid_loss\": 0.134,\n \"full_valid_mean_token_accuracy\": 0.874\n },\n \"fine_tuning_job_id\": \"ftjob-abc123\",\n \"step_number\": 2000\n },\n {\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_enQCFmOTGj3syEpYVhBRLTSy\",\n \"created_at\": 1721764800,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:7q8mpxmy:ckpt-step-1000\",\n \"metrics\": {\n \"full_valid_loss\": 0.167,\n \"full_valid_mean_token_accuracy\": 0.781\n },\n \"fine_tuning_job_id\": \"ftjob-abc123\",\n \"step_number\": 1000\n }\n ],\n \"first_id\": \"ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"last_id\": \"ftckpt_enQCFmOTGj3syEpYVhBRLTSy\",\n \"has_more\": true\n}\n" /fine_tuning/jobs/{fine_tuning_job_id}/pause: post: operationId: pauseFineTuningJob tags: - Fine Tuning summary: 'Pause a fine-tune job. ' parameters: - in: path name: fine_tuning_job_id required: true schema: type: string example: ft-AF1WoRqd3aJAHsqc9NY7iL8F description: 'The ID of the fine-tuning job to pause. ' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/FineTuningJob_2' x-oaiMeta: name: Pause fine-tuning group: fine-tuning examples: request: curl: "curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/pause \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.pause(\n \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\nprint(fine_tuning_job.id)" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.pause(\"ftjob-abc123\");\n\n console.log(fineTune);\n}\nmain();" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.pause('ft-AF1WoRqd3aJAHsqc9NY7iL8F');\n\nconsole.log(fineTuningJob.id);" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.Pause(context.TODO(), \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", fineTuningJob.ID)\n}\n" java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobPauseParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FineTuningJob fineTuningJob = client.fineTuning().jobs().pause(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(api_key: "My API Key") fine_tuning_job = openai.fine_tuning.jobs.pause("ft-AF1WoRqd3aJAHsqc9NY7iL8F") puts(fine_tuning_job)' response: "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"paused\",\n \"validation_file\": \"file-abc123\",\n \"training_file\": \"file-abc123\"\n}\n" /fine_tuning/jobs/{fine_tuning_job_id}/resume: post: operationId: resumeFineTuningJob tags: - Fine Tuning summary: 'Resume a fine-tune job. ' parameters: - in: path name: fine_tuning_job_id required: true schema: type: string example: ft-AF1WoRqd3aJAHsqc9NY7iL8F description: 'The ID of the fine-tuning job to resume. ' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/FineTuningJob_2' x-oaiMeta: name: Resume fine-tuning group: fine-tuning examples: request: curl: "curl -X POST https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/resume \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n" python: "import os\nfrom openai import OpenAI\n\nclient = OpenAI(\n api_key=os.environ.get(\"OPENAI_API_KEY\"), # This is the default and can be omitted\n)\nfine_tuning_job = client.fine_tuning.jobs.resume(\n \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\",\n)\nprint(fine_tuning_job.id)" javascript: "import OpenAI from \"openai\";\n\nconst openai = new OpenAI();\n\nasync function main() {\n const fineTune = await openai.fineTuning.jobs.resume(\"ftjob-abc123\");\n\n console.log(fineTune);\n}\nmain();" node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\nconst fineTuningJob = await client.fineTuning.jobs.resume('ft-AF1WoRqd3aJAHsqc9NY7iL8F');\n\nconsole.log(fineTuningJob.id);" go: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openai/openai-go\"\n\t\"github.com/openai/openai-go/option\"\n)\n\nfunc main() {\n\tclient := openai.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tfineTuningJob, err := client.FineTuning.Jobs.Resume(context.TODO(), \"ft-AF1WoRqd3aJAHsqc9NY7iL8F\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", fineTuningJob.ID)\n}\n" java: "package com.openai.example;\n\nimport com.openai.client.OpenAIClient;\nimport com.openai.client.okhttp.OpenAIOkHttpClient;\nimport com.openai.models.finetuning.jobs.FineTuningJob;\nimport com.openai.models.finetuning.jobs.JobResumeParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n OpenAIClient client = OpenAIOkHttpClient.fromEnv();\n\n FineTuningJob fineTuningJob = client.fineTuning().jobs().resume(\"ft-AF1WoRqd3aJAHsqc9NY7iL8F\");\n }\n}" ruby: 'require "openai" openai = OpenAI::Client.new(api_key: "My API Key") fine_tuning_job = openai.fine_tuning.jobs.resume("ft-AF1WoRqd3aJAHsqc9NY7iL8F") puts(fine_tuning_job)' response: "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"created_at\": 1721764800,\n \"fine_tuned_model\": null,\n \"organization_id\": \"org-123\",\n \"result_files\": [],\n \"status\": \"queued\",\n \"validation_file\": \"file-abc123\",\n \"training_file\": \"file-abc123\"\n}\n" components: schemas: FineTuningJobCheckpoint: type: object title: FineTuningJobCheckpoint description: 'The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use. ' properties: id: type: string description: The checkpoint identifier, which can be referenced in the API endpoints. created_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the checkpoint was created. fine_tuned_model_checkpoint: type: string description: The name of the fine-tuned checkpoint model that is created. step_number: type: integer description: The step number that the checkpoint was created at. metrics: type: object description: Metrics at the step number during the fine-tuning job. properties: step: type: number train_loss: type: number train_mean_token_accuracy: type: number valid_loss: type: number valid_mean_token_accuracy: type: number full_valid_loss: type: number full_valid_mean_token_accuracy: type: number fine_tuning_job_id: type: string description: The name of the fine-tuning job that this checkpoint was created from. object: type: string description: The object type, which is always "fine_tuning.job.checkpoint". enum: - fine_tuning.job.checkpoint x-stainless-const: true required: - created_at - fine_tuning_job_id - fine_tuned_model_checkpoint - id - metrics - object - step_number x-oaiMeta: name: The fine-tuning job checkpoint object example: "{\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P\",\n \"created_at\": 1712211699,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88\",\n \"fine_tuning_job_id\": \"ftjob-fpbNQ3H1GrMehXRf8cO97xTN\",\n \"metrics\": {\n \"step\": 88,\n \"train_loss\": 0.478,\n \"train_mean_token_accuracy\": 0.924,\n \"valid_loss\": 10.112,\n \"valid_mean_token_accuracy\": 0.145,\n \"full_valid_loss\": 0.567,\n \"full_valid_mean_token_accuracy\": 0.944\n },\n \"step_number\": 88\n}\n" InputTextContent: properties: type: type: string enum: - input_text description: The type of the input item. Always `input_text`. default: input_text x-stainless-const: true text: type: string description: The text input to the model. type: object required: - type - text title: Input text description: A text input to the model. ListFineTuningJobCheckpointsResponse: type: object properties: data: type: array items: $ref: '#/components/schemas/FineTuningJobCheckpoint' object: type: string enum: - list x-stainless-const: true first_id: anyOf: - type: string - type: 'null' last_id: anyOf: - type: string - type: 'null' has_more: type: boolean required: - object - data - has_more EvalItemContentOutputText: type: object title: Output text description: 'A text output from the model. ' properties: type: type: string description: 'The type of the output text. Always `output_text`. ' enum: - output_text x-stainless-const: true text: type: string description: 'The text output from the model. ' required: - type - text FineTuningJob_2: type: object title: FineTuningJob description: 'The `fine_tuning.job` object represents a fine-tuning job that has been created through the API. ' properties: id: type: string description: The object identifier, which can be referenced in the API endpoints. created_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the fine-tuning job was created. error: anyOf: - type: object description: For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure. properties: code: type: string description: A machine-readable error code. message: type: string description: A human-readable error message. param: anyOf: - type: string description: The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific. - type: 'null' required: - code - message - param - type: 'null' fine_tuned_model: anyOf: - type: string description: The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running. - type: 'null' finished_at: anyOf: - type: integer format: unixtime description: 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. - type: 'null' hyperparameters: type: object description: The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs. properties: batch_size: anyOf: - description: 'Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: integer minimum: 1 maximum: 256 default: auto - type: 'null' learning_rate_multiplier: description: 'Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: number minimum: 0 exclusiveMinimum: true default: auto n_epochs: description: 'The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: integer minimum: 1 maximum: 50 default: auto model: type: string description: The base model that is being fine-tuned. object: type: string description: The object type, which is always "fine_tuning.job". enum: - fine_tuning.job x-stainless-const: true organization_id: type: string description: The organization that owns the fine-tuning job. result_files: type: array description: The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents). items: type: string example: file-abc123 status: type: string description: The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. enum: - validating_files - queued - running - succeeded - failed - cancelled trained_tokens: anyOf: - type: integer description: 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. - type: 'null' training_file: type: string description: The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents). validation_file: anyOf: - type: string description: The file ID used for validation. You can retrieve the validation results with the [Files API](/docs/api-reference/files/retrieve-contents). - type: 'null' integrations: anyOf: - type: array description: A list of integrations to enable for this fine-tuning job. maxItems: 5 items: oneOf: - $ref: '#/components/schemas/FineTuningIntegration' - type: 'null' seed: type: integer description: The seed used for the fine-tuning job. estimated_finish: anyOf: - type: integer format: unixtime description: 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. - type: 'null' method: $ref: '#/components/schemas/FineTuneMethod' metadata: $ref: '#/components/schemas/Metadata' required: - created_at - error - finished_at - fine_tuned_model - hyperparameters - id - model - object - organization_id - result_files - status - trained_tokens - training_file - validation_file - seed x-oaiMeta: name: The fine-tuning job object example: "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"davinci-002\",\n \"created_at\": 1692661014,\n \"finished_at\": 1692661190,\n \"fine_tuned_model\": \"ft:davinci-002:my-org:custom_suffix:7q8mpxmy\",\n \"organization_id\": \"org-123\",\n \"result_files\": [\n \"file-abc123\"\n ],\n \"status\": \"succeeded\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n },\n \"trained_tokens\": 5768,\n \"integrations\": [],\n \"seed\": 0,\n \"estimated_finish\": 0,\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n }\n }\n },\n \"metadata\": {\n \"key\": \"value\"\n }\n}\n" FineTuneSupervisedMethod: type: object description: Configuration for the supervised fine-tuning method. properties: hyperparameters: $ref: '#/components/schemas/FineTuneSupervisedHyperparameters' FineTuneMethod: type: object description: The method used for fine-tuning. properties: type: type: string description: The type of method. Is either `supervised`, `dpo`, or `reinforcement`. enum: - supervised - dpo - reinforcement supervised: $ref: '#/components/schemas/FineTuneSupervisedMethod' dpo: $ref: '#/components/schemas/FineTuneDPOMethod' reinforcement: $ref: '#/components/schemas/FineTuneReinforcementMethod' required: - type EvalItemInputImage: title: Input image description: An image input block used within EvalItem content arrays. type: object properties: type: type: string description: 'The type of the image input. Always `input_image`. ' enum: - input_image x-stainless-const: true image_url: type: string format: uri description: 'The URL of the image input. ' detail: type: string description: 'The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. ' required: - type - image_url ListPaginatedFineTuningJobsResponse: type: object properties: data: type: array items: $ref: '#/components/schemas/FineTuningJob' has_more: type: boolean object: type: string enum: - list required: - object - data - has_more ListFineTuningCheckpointPermissionResponse: type: object properties: data: type: array items: $ref: '#/components/schemas/FineTuningCheckpointPermission' object: type: string enum: - list x-stainless-const: true first_id: anyOf: - type: string - type: 'null' last_id: anyOf: - type: string - type: 'null' has_more: type: boolean required: - object - data - has_more ValidateGraderResponse: type: object title: ValidateGraderResponse properties: grader: type: object description: The grader used for the fine-tuning job. oneOf: - $ref: '#/components/schemas/GraderStringCheck' - $ref: '#/components/schemas/GraderTextSimilarity' - $ref: '#/components/schemas/GraderPython' - $ref: '#/components/schemas/GraderScoreModel' - $ref: '#/components/schemas/GraderMulti' GraderStringCheck: type: object title: StringCheckGrader description: 'A StringCheckGrader object that performs a string comparison between input and reference using a specified operation. ' properties: type: type: string enum: - string_check description: The object type, which is always `string_check`. x-stainless-const: true name: type: string description: The name of the grader. input: type: string description: The input text. This may include template strings. reference: type: string description: The reference text. This may include template strings. operation: type: string enum: - eq - ne - like - ilike description: The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`. required: - type - name - input - reference - operation x-oaiMeta: name: String Check Grader group: graders example: "{\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n}\n" ReasoningEffort: anyOf: - type: string enum: - none - minimal - low - medium - high - xhigh default: medium description: 'Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1. - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`. - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - `xhigh` is supported for all models after `gpt-5.1-codex-max`. ' - type: 'null' FineTuneReinforcementHyperparameters: type: object description: The hyperparameters used for the reinforcement fine-tuning job. properties: batch_size: description: 'Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: integer minimum: 1 maximum: 256 default: auto learning_rate_multiplier: description: 'Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: number minimum: 0 exclusiveMinimum: true default: auto n_epochs: description: 'The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: integer minimum: 1 maximum: 50 default: auto reasoning_effort: description: 'Level of reasoning effort. ' type: string enum: - default - low - medium - high default: default compute_multiplier: description: 'Multiplier on amount of compute used for exploring search space during training. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: number minimum: 1.0e-05 maximum: 10 exclusiveMinimum: true default: auto eval_interval: description: 'The number of training steps between evaluation runs. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: integer minimum: 1 default: auto eval_samples: description: 'Number of evaluation samples to generate per training step. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: integer minimum: 1 default: auto CreateFineTuningCheckpointPermissionRequest: type: object additionalProperties: false properties: project_ids: type: array description: The project identifiers to grant access to. items: type: string required: - project_ids FineTuneReinforcementMethod: type: object description: Configuration for the reinforcement fine-tuning method. properties: grader: type: object description: The grader used for the fine-tuning job. oneOf: - $ref: '#/components/schemas/GraderStringCheck' - $ref: '#/components/schemas/GraderTextSimilarity' - $ref: '#/components/schemas/GraderPython' - $ref: '#/components/schemas/GraderScoreModel' - $ref: '#/components/schemas/GraderMulti' hyperparameters: $ref: '#/components/schemas/FineTuneReinforcementHyperparameters' required: - grader EvalItemContentItem: title: Eval content item description: 'A single content item: input text, output text, input image, or input audio. ' oneOf: - $ref: '#/components/schemas/EvalItemContentText' - $ref: '#/components/schemas/InputTextContent' - $ref: '#/components/schemas/EvalItemContentOutputText' - $ref: '#/components/schemas/EvalItemInputImage' - $ref: '#/components/schemas/InputAudio' CreateFineTuningJobRequest: type: object properties: model: description: 'The name of the model to fine-tune. You can select one of the [supported models](/docs/guides/fine-tuning#which-models-can-be-fine-tuned). ' example: gpt-4o-mini anyOf: - type: string - type: string enum: - babbage-002 - davinci-002 - gpt-3.5-turbo - gpt-4o-mini x-oaiTypeLabel: string training_file: description: 'The ID of an uploaded file that contains training data. See [upload file](/docs/api-reference/files/create) for how to upload a file. Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`. The contents of the file should differ depending on if the model uses the [chat](/docs/api-reference/fine-tuning/chat-input), [completions](/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](/docs/api-reference/fine-tuning/preference-input) format. See the [fine-tuning guide](/docs/guides/model-optimization) for more details. ' type: string example: file-abc123 hyperparameters: type: object description: 'The hyperparameters used for the fine-tuning job. This value is now deprecated in favor of `method`, and should be passed in under the `method` parameter. ' properties: batch_size: description: 'Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: integer minimum: 1 maximum: 256 default: auto learning_rate_multiplier: description: 'Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: number minimum: 0 exclusiveMinimum: true default: auto n_epochs: description: 'The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: integer minimum: 1 maximum: 50 default: auto deprecated: true suffix: description: 'A string of up to 64 characters that will be added to your fine-tuned model name. For example, a `suffix` of "custom-model-name" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`. ' type: string minLength: 1 maxLength: 64 default: null nullable: true validation_file: description: 'The ID of an uploaded file that contains validation data. If you provide this file, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in the fine-tuning results file. The same data should not be present in both train and validation files. Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`. See the [fine-tuning guide](/docs/guides/model-optimization) for more details. ' type: string nullable: true example: file-abc123 integrations: type: array description: A list of integrations to enable for your fine-tuning job. nullable: true items: type: object required: - type - wandb properties: type: description: 'The type of integration to enable. Currently, only "wandb" (Weights and Biases) is supported. ' oneOf: - type: string enum: - wandb x-stainless-const: true wandb: type: object description: 'The settings for your integration with Weights and Biases. This payload specifies the project that metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags to your run, and set a default entity (team, username, etc) to be associated with your run. ' required: - project properties: project: description: 'The name of the project that the new run will be created under. ' type: string example: my-wandb-project name: description: 'A display name to set for the run. If not set, we will use the Job ID as the name. ' nullable: true type: string entity: description: 'The entity to use for the run. This allows you to set the team or username of the WandB user that you would like associated with the run. If not set, the default entity for the registered WandB API key is used. ' nullable: true type: string tags: description: 'A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}". ' type: array items: type: string example: custom-tag seed: description: '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. If a seed is not specified, one will be generated for you. ' type: integer nullable: true minimum: 0 maximum: 2147483647 example: 42 method: $ref: '#/components/schemas/FineTuneMethod' metadata: $ref: '#/components/schemas/Metadata' required: - model - training_file EvalItemContentText: type: string title: Text input description: 'A text input to the model. ' RunGraderRequest: type: object title: RunGraderRequest properties: grader: type: object description: The grader used for the fine-tuning job. oneOf: - $ref: '#/components/schemas/GraderStringCheck' - $ref: '#/components/schemas/GraderTextSimilarity' - $ref: '#/components/schemas/GraderPython' - $ref: '#/components/schemas/GraderScoreModel' - $ref: '#/components/schemas/GraderMulti' item: type: object description: "The dataset item provided to the grader. This will be used to populate \nthe `item` namespace. See [the guide](/docs/guides/graders) for more details. \n" model_sample: type: string description: "The model sample to be evaluated. This value will be used to populate \nthe `sample` namespace. See [the guide](/docs/guides/graders) for more details.\nThe `output_json` variable will be populated if the model sample is a \nvalid JSON string.\n \n" required: - grader - model_sample ValidateGraderRequest: type: object title: ValidateGraderRequest properties: grader: type: object description: The grader used for the fine-tuning job. oneOf: - $ref: '#/components/schemas/GraderStringCheck' - $ref: '#/components/schemas/GraderTextSimilarity' - $ref: '#/components/schemas/GraderPython' - $ref: '#/components/schemas/GraderScoreModel' - $ref: '#/components/schemas/GraderMulti' required: - grader FineTuneSupervisedHyperparameters: type: object description: The hyperparameters used for the fine-tuning job. properties: batch_size: description: 'Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: integer minimum: 1 maximum: 256 default: auto learning_rate_multiplier: description: 'Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: number minimum: 0 exclusiveMinimum: true default: auto n_epochs: description: 'The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: integer minimum: 1 maximum: 50 default: auto FineTuningCheckpointPermission: type: object title: FineTuningCheckpointPermission description: 'The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint. ' properties: id: type: string description: The permission identifier, which can be referenced in the API endpoints. created_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the permission was created. project_id: type: string description: The project identifier that the permission is for. object: type: string description: The object type, which is always "checkpoint.permission". enum: - checkpoint.permission x-stainless-const: true required: - created_at - id - object - project_id x-oaiMeta: name: The fine-tuned model checkpoint permission object example: "{\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1712211699,\n \"project_id\": \"proj_abGMw1llN8IrBb6SvvY5A1iH\"\n}\n" GraderTextSimilarity: type: object title: TextSimilarityGrader description: 'A TextSimilarityGrader object which grades text based on similarity metrics. ' properties: type: type: string enum: - text_similarity default: text_similarity description: The type of grader. x-stainless-const: true name: type: string description: The name of the grader. input: type: string description: The text being graded. reference: type: string description: The text being graded against. evaluation_metric: type: string enum: - cosine - fuzzy_match - bleu - gleu - meteor - rouge_1 - rouge_2 - rouge_3 - rouge_4 - rouge_5 - rouge_l description: "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, \n`gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, \nor `rouge_l`.\n" required: - type - name - input - reference - evaluation_metric x-oaiMeta: name: Text Similarity Grader group: graders example: "{\n \"type\": \"text_similarity\",\n \"name\": \"Example text similarity grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"evaluation_metric\": \"fuzzy_match\"\n}\n" GraderLabelModel: type: object title: LabelModelGrader description: 'A LabelModelGrader object which uses a model to assign labels to each item in the evaluation. ' properties: type: description: The object type, which is always `label_model`. type: string enum: - label_model x-stainless-const: true name: type: string description: The name of the grader. model: type: string description: The model to use for the evaluation. Must support structured outputs. input: type: array items: $ref: '#/components/schemas/EvalItem' labels: type: array items: type: string description: The labels to assign to each item in the evaluation. passing_labels: type: array items: type: string description: The labels that indicate a passing result. Must be a subset of labels. required: - type - model - input - passing_labels - labels - name x-oaiMeta: name: Label Model Grader group: graders example: "{\n \"name\": \"First label grader\",\n \"type\": \"label_model\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"input\": [\n {\n \"type\": \"message\",\n \"role\": \"system\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Classify the sentiment of the following statement as one of positive, neutral, or negative\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Statement: {{item.response}}\"\n }\n }\n ],\n \"passing_labels\": [\n \"positive\"\n ],\n \"labels\": [\n \"positive\",\n \"neutral\",\n \"negative\"\n ]\n}\n" Metadata: anyOf: - type: object description: 'Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. ' additionalProperties: type: string x-oaiTypeLabel: map - type: 'null' EvalItemContentArray: type: array title: An array of Input text, Output text, Input image, and Input audio description: 'A list of inputs, each of which may be either an input text, output text, input image, or input audio object. ' items: $ref: '#/components/schemas/EvalItemContentItem' GraderPython: type: object title: PythonGrader description: 'A PythonGrader object that runs a python script on the input. ' properties: type: type: string enum: - python description: The object type, which is always `python`. x-stainless-const: true name: type: string description: The name of the grader. source: type: string description: The source code of the python script. image_tag: type: string description: The image tag to use for the python script. required: - type - name - source x-oaiMeta: name: Python Grader group: graders example: "{\n \"type\": \"python\",\n \"name\": \"Example python grader\",\n \"image_tag\": \"2025-05-08\",\n \"source\": \"\"\"\ndef grade(sample: dict, item: dict) -> float:\n \\\"\"\"\n Returns 1.0 if `output_text` equals `label`, otherwise 0.0.\n \\\"\"\"\n output = sample.get(\"output_text\")\n label = item.get(\"label\")\n return 1.0 if output == label else 0.0\n\"\"\",\n}\n" FineTuneDPOHyperparameters: type: object description: The hyperparameters used for the DPO fine-tuning job. properties: beta: description: 'The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: number minimum: 0 maximum: 2 exclusiveMinimum: true default: auto batch_size: description: 'Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: integer minimum: 1 maximum: 256 default: auto learning_rate_multiplier: description: 'Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: number minimum: 0 exclusiveMinimum: true default: auto n_epochs: description: 'The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. ' oneOf: - type: string enum: - auto x-stainless-const: true - type: integer minimum: 1 maximum: 50 default: auto FineTuningIntegration: type: object title: Fine-Tuning Job Integration required: - type - wandb properties: type: type: string description: The type of the integration being enabled for the fine-tuning job enum: - wandb x-stainless-const: true wandb: type: object description: 'The settings for your integration with Weights and Biases. This payload specifies the project that metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags to your run, and set a default entity (team, username, etc) to be associated with your run. ' required: - project properties: project: description: 'The name of the project that the new run will be created under. ' type: string example: my-wandb-project name: anyOf: - description: 'A display name to set for the run. If not set, we will use the Job ID as the name. ' type: string - type: 'null' entity: anyOf: - description: 'The entity to use for the run. This allows you to set the team or username of the WandB user that you would like associated with the run. If not set, the default entity for the registered WandB API key is used. ' type: string - type: 'null' tags: description: 'A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}". ' type: array items: type: string example: custom-tag ListFineTuningJobEventsResponse: type: object properties: data: type: array items: $ref: '#/components/schemas/FineTuningJobEvent' object: type: string enum: - list required: - object - data EvalItemContent: title: Eval content description: '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. ' oneOf: - $ref: '#/components/schemas/EvalItemContentItem' - $ref: '#/components/schemas/EvalItemContentArray' FineTuningJob: type: object title: FineTuningJob description: 'The `fine_tuning.job` object represents a fine-tuning job that has been created through the API. ' properties: id: type: string description: The object identifier, which can be referenced in the API endpoints. created_at: type: integer description: The Unix timestamp (in seconds) for when the fine-tuning job was created. error: type: object nullable: true description: For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure. properties: code: type: string description: A machine-readable error code. message: type: string description: A human-readable error message. param: type: string description: The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific. nullable: true required: - code - message - param fine_tuned_model: type: string nullable: true description: The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running. finished_at: type: integer nullable: true description: 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. hyperparameters: type: object description: The hyperparameters used for the fine-tuning job. See the [fine-tuning guide](/docs/guides/fine-tuning) for more details. properties: n_epochs: oneOf: - type: string enum: - auto - type: integer minimum: 1 maximum: 50 default: auto description: 'The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. "auto" decides the optimal number of epochs based on the size of the dataset. If setting the number manually, we support any number between 1 and 50 epochs.' required: - n_epochs model: type: string description: The base model that is being fine-tuned. object: type: string description: The object type, which is always "fine_tuning.job". enum: - fine_tuning.job organization_id: type: string description: The organization that owns the fine-tuning job. result_files: type: array description: The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](/docs/api-reference/files/retrieve-contents). items: type: string example: file-abc123 status: type: string description: The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. enum: - validating_files - queued - running - succeeded - failed - cancelled trained_tokens: type: integer nullable: true description: 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. training_file: type: string description: The file ID used for training. You can retrieve the training data with the [Files API](/docs/api-reference/files/retrieve-contents). validation_file: type: string nullable: true description: The file ID used for validation. You can retrieve the validation results with the [Files API](/docs/api-reference/files/retrieve-contents). required: - created_at - error - finished_at - fine_tuned_model - hyperparameters - id - model - object - organization_id - result_files - status - trained_tokens - training_file - validation_file x-oaiMeta: name: The fine-tuning job object example: "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"davinci-002\",\n \"created_at\": 1692661014,\n \"finished_at\": 1692661190,\n \"fine_tuned_model\": \"ft:davinci-002:my-org:custom_suffix:7q8mpxmy\",\n \"organization_id\": \"org-123\",\n \"result_files\": [\n \"file-abc123\"\n ],\n \"status\": \"succeeded\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\n \"n_epochs\": 4,\n },\n \"trained_tokens\": 5768\n}\n" EvalItem: type: object title: Eval message object description: 'A message input to the model with a role indicating instruction following hierarchy. Instructions given with the `developer` or `system` role take precedence over instructions given with the `user` role. Messages with the `assistant` role are presumed to have been generated by the model in previous interactions. ' properties: role: type: string description: 'The role of the message input. One of `user`, `assistant`, `system`, or `developer`. ' enum: - user - assistant - system - developer content: $ref: '#/components/schemas/EvalItemContent' type: type: string description: 'The type of the message input. Always `message`. ' enum: - message x-stainless-const: true required: - role - content InputAudio: type: object title: Input audio description: 'An audio input to the model. ' properties: type: type: string description: 'The type of the input item. Always `input_audio`. ' enum: - input_audio x-stainless-const: true input_audio: type: object properties: data: type: string description: 'Base64-encoded audio data. ' format: type: string description: 'The format of the audio data. Currently supported formats are `mp3` and `wav`. ' enum: - mp3 - wav required: - data - format required: - type - input_audio FineTuningJobEvent: type: object description: Fine-tuning job event object properties: object: type: string description: The object type, which is always "fine_tuning.job.event". enum: - fine_tuning.job.event x-stainless-const: true id: type: string description: The object identifier. created_at: type: integer format: unixtime description: The Unix timestamp (in seconds) for when the fine-tuning job was created. level: type: string description: The log level of the event. enum: - info - warn - error message: type: string description: The message of the event. type: type: string description: The type of event. enum: - message - metrics data: type: object description: The data associated with the event. required: - id - object - created_at - level - message x-oaiMeta: name: The fine-tuning job event object example: "{\n \"object\": \"fine_tuning.job.event\",\n \"id\": \"ftevent-abc123\"\n \"created_at\": 1677610602,\n \"level\": \"info\",\n \"message\": \"Created fine-tuning job\",\n \"data\": {},\n \"type\": \"message\"\n}\n" GraderMulti: type: object title: MultiGrader description: A MultiGrader object combines the output of multiple graders to produce a single score. properties: type: type: string enum: - multi default: multi description: The object type, which is always `multi`. x-stainless-const: true name: type: string description: The name of the grader. graders: oneOf: - $ref: '#/components/schemas/GraderStringCheck' - $ref: '#/components/schemas/GraderTextSimilarity' - $ref: '#/components/schemas/GraderPython' - $ref: '#/components/schemas/GraderScoreModel' - $ref: '#/components/schemas/GraderLabelModel' calculate_output: type: string description: A formula to calculate the output based on grader results. required: - name - type - graders - calculate_output x-oaiMeta: name: Multi Grader group: graders example: "{\n \"type\": \"multi\",\n \"name\": \"example multi grader\",\n \"graders\": [\n {\n \"type\": \"text_similarity\",\n \"name\": \"example text similarity grader\",\n \"input\": \"The graded text\",\n \"reference\": \"The reference text\",\n \"evaluation_metric\": \"fuzzy_match\"\n },\n {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n }\n ],\n \"calculate_output\": \"0.5 * text_similarity_score + 0.5 * string_check_score)\"\n}\n" RunGraderResponse: type: object properties: reward: type: number metadata: type: object properties: name: type: string type: type: string errors: type: object properties: formula_parse_error: type: boolean sample_parse_error: type: boolean truncated_observation_error: type: boolean unresponsive_reward_error: type: boolean invalid_variable_error: type: boolean other_error: type: boolean python_grader_server_error: type: boolean python_grader_server_error_type: anyOf: - type: string - type: 'null' python_grader_runtime_error: type: boolean python_grader_runtime_error_details: anyOf: - type: string - type: 'null' model_grader_server_error: type: boolean model_grader_refusal_error: type: boolean model_grader_parse_error: type: boolean model_grader_server_error_details: anyOf: - type: string - type: 'null' required: - formula_parse_error - sample_parse_error - truncated_observation_error - unresponsive_reward_error - invalid_variable_error - other_error - python_grader_server_error - python_grader_server_error_type - python_grader_runtime_error - python_grader_runtime_error_details - model_grader_server_error - model_grader_refusal_error - model_grader_parse_error - model_grader_server_error_details execution_time: type: number scores: type: object additionalProperties: {} token_usage: anyOf: - type: integer - type: 'null' sampled_model_name: anyOf: - type: string - type: 'null' required: - name - type - errors - execution_time - scores - token_usage - sampled_model_name sub_rewards: type: object additionalProperties: {} model_grader_token_usage_per_model: type: object additionalProperties: {} required: - reward - metadata - sub_rewards - model_grader_token_usage_per_model FineTuneDPOMethod: type: object description: Configuration for the DPO fine-tuning method. properties: hyperparameters: $ref: '#/components/schemas/FineTuneDPOHyperparameters' GraderScoreModel: type: object title: ScoreModelGrader description: 'A ScoreModelGrader object that uses a model to assign a score to the input. ' properties: type: type: string enum: - score_model description: The object type, which is always `score_model`. x-stainless-const: true name: type: string description: The name of the grader. model: type: string description: The model to use for the evaluation. sampling_params: type: object description: The sampling parameters for the model. properties: seed: anyOf: - type: integer description: 'A seed value to initialize the randomness, during sampling. ' - type: 'null' top_p: anyOf: - type: number default: 1 example: 1 description: 'An alternative to temperature for nucleus sampling; 1.0 includes all tokens. ' - type: 'null' temperature: anyOf: - type: number description: 'A higher temperature increases randomness in the outputs. ' - type: 'null' max_completions_tokens: anyOf: - type: integer minimum: 1 description: 'The maximum number of tokens the grader model may generate in its response. ' - type: 'null' reasoning_effort: $ref: '#/components/schemas/ReasoningEffort' input: type: array items: $ref: '#/components/schemas/EvalItem' description: 'The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings. ' range: type: array items: type: number min_items: 2 max_items: 2 description: The range of the score. Defaults to `[0, 1]`. required: - type - name - input - model x-oaiMeta: name: Score Model Grader group: graders example: "{\n \"type\": \"score_model\",\n \"name\": \"Example score model grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": (\n \"Score how close the reference answer is to the model answer. Score 1.0 if they are the same and 0.0 if they are different.\"\n \" Return just a floating point score\\n\\n\"\n \" Reference answer: {{item.label}}\\n\\n\"\n \" Model answer: {{sample.output_text}}\"\n )\n },\n {\n \"type\": \"input_image\",\n \"image_url\": \"https://example.com/reference.png\",\n \"file_id\": null,\n \"detail\": \"auto\"\n }\n ],\n }\n ],\n \"model\": \"gpt-5-mini\",\n \"sampling_params\": {\n \"temperature\": 1,\n \"top_p\": 1,\n \"seed\": 42,\n \"max_completions_tokens\": 32768,\n \"reasoning_effort\": \"medium\"\n },\n}\n" DeleteFineTuningCheckpointPermissionResponse: type: object properties: id: type: string description: The ID of the fine-tuned model checkpoint permission that was deleted. object: type: string description: The object type, which is always "checkpoint.permission". enum: - checkpoint.permission x-stainless-const: true deleted: type: boolean description: Whether the fine-tuned model checkpoint permission was successfully deleted. required: - id - object - deleted securitySchemes: ApiKeyAuth: type: http scheme: bearer x-oaiMeta: groups: - id: audio title: Audio description: 'Learn how to turn audio into text or text into audio. Related guide: [Speech to text](/docs/guides/speech-to-text) ' sections: - type: endpoint key: createSpeech path: createSpeech - type: endpoint key: createTranscription path: createTranscription - type: endpoint key: createTranslation path: createTranslation - id: chat title: Chat description: 'Given a list of messages comprising a conversation, the model will return a response. Related guide: [Chat Completions](/docs/guides/text-generation) ' sections: - type: endpoint key: createChatCompletion path: create - type: object key: CreateChatCompletionResponse path: object - type: object key: CreateChatCompletionStreamResponse path: streaming - id: embeddings title: Embeddings description: 'Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. Related guide: [Embeddings](/docs/guides/embeddings) ' sections: - type: endpoint key: createEmbedding path: create - type: object key: Embedding path: object - id: fine-tuning title: Fine-tuning description: 'Manage fine-tuning jobs to tailor a model to your specific training data. Related guide: [Fine-tune models](/docs/guides/fine-tuning) ' sections: - type: endpoint key: createFineTuningJob path: create - type: endpoint key: listPaginatedFineTuningJobs path: list - type: endpoint key: listFineTuningEvents path: list-events - type: endpoint key: retrieveFineTuningJob path: retrieve - type: endpoint key: cancelFineTuningJob path: cancel - type: object key: FineTuningJob path: object - type: object key: FineTuningJobEvent path: event-object - id: files title: Files description: 'Files are used to upload documents that can be used with features like [Assistants](/docs/api-reference/assistants) and [Fine-tuning](/docs/api-reference/fine-tuning). ' sections: - type: endpoint key: createFile path: create - type: endpoint key: listFiles path: list - type: endpoint key: retrieveFile path: retrieve - type: endpoint key: deleteFile path: delete - type: endpoint key: downloadFile path: retrieve-contents - type: object key: OpenAIFile path: object - id: images title: Images description: 'Given a prompt and/or an input image, the model will generate a new image. Related guide: [Image generation](/docs/guides/images) ' sections: - type: endpoint key: createImage path: create - type: endpoint key: createImageEdit path: createEdit - type: endpoint key: createImageVariation path: createVariation - type: object key: Image path: object - id: models title: Models description: 'List and describe the various models available in the API. You can refer to the [Models](/docs/models) documentation to understand what models are available and the differences between them. ' sections: - type: endpoint key: listModels path: list - type: endpoint key: retrieveModel path: retrieve - type: endpoint key: deleteModel path: delete - type: object key: Model path: object - id: moderations title: Moderations description: 'Given a input text, outputs if the model classifies it as violating OpenAI''s content policy. Related guide: [Moderations](/docs/guides/moderation) ' sections: - type: endpoint key: createModeration path: create - type: object key: CreateModerationResponse path: object - id: assistants title: Assistants beta: true description: 'Build assistants that can call models and use tools to perform tasks. [Get started with the Assistants API](/docs/assistants) ' sections: - type: endpoint key: createAssistant path: createAssistant - type: endpoint key: createAssistantFile path: createAssistantFile - type: endpoint key: listAssistants path: listAssistants - type: endpoint key: listAssistantFiles path: listAssistantFiles - type: endpoint key: getAssistant path: getAssistant - type: endpoint key: getAssistantFile path: getAssistantFile - type: endpoint key: modifyAssistant path: modifyAssistant - type: endpoint key: deleteAssistant path: deleteAssistant - type: endpoint key: deleteAssistantFile path: deleteAssistantFile - type: object key: AssistantObject path: object - type: object key: AssistantFileObject path: file-object - id: threads title: Threads beta: true description: 'Create threads that assistants can interact with. Related guide: [Assistants](/docs/assistants/overview) ' sections: - type: endpoint key: createThread path: createThread - type: endpoint key: getThread path: getThread - type: endpoint key: modifyThread path: modifyThread - type: endpoint key: deleteThread path: deleteThread - type: object key: ThreadObject path: object - id: messages title: Messages beta: true description: 'Create messages within threads Related guide: [Assistants](/docs/assistants/overview) ' sections: - type: endpoint key: createMessage path: createMessage - type: endpoint key: listMessages path: listMessages - type: endpoint key: listMessageFiles path: listMessageFiles - type: endpoint key: getMessage path: getMessage - type: endpoint key: getMessageFile path: getMessageFile - type: endpoint key: modifyMessage path: modifyMessage - type: object key: MessageObject path: object - type: object key: MessageFileObject path: file-object - id: runs title: Runs beta: true description: 'Represents an execution run on a thread. Related guide: [Assistants](/docs/assistants/overview) ' sections: - type: endpoint key: createRun path: createRun - type: endpoint key: createThreadAndRun path: createThreadAndRun - type: endpoint key: listRuns path: listRuns - type: endpoint key: listRunSteps path: listRunSteps - type: endpoint key: getRun path: getRun - type: endpoint key: getRunStep path: getRunStep - type: endpoint key: modifyRun path: modifyRun - type: endpoint key: submitToolOuputsToRun path: submitToolOutputs - type: endpoint key: cancelRun path: cancelRun - type: object key: RunObject path: object - type: object key: RunStepObject path: step-object - id: completions title: Completions legacy: true description: 'Given a prompt, the model will return one or more predicted completions along with the probabilities of alternative tokens at each position. Most developer should use our [Chat Completions API](/docs/guides/text-generation/text-generation-models) to leverage our best and newest models. Most models that support the legacy Completions endpoint [will be shut off on January 4th, 2024](/docs/deprecations/2023-07-06-gpt-and-embeddings). ' sections: - type: endpoint key: createCompletion path: create - type: object key: CreateCompletionResponse path: object