> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. # Export from Fern Definition to OpenAPI > Export Fern Definition to OpenAPI 3.1 format using the fern export command. Prevent vendor lock-in and convert your API definitions easily. Fern Definition isn't recommended for new customers and Fern isn't accepting feature requests for this format. It remains supported for existing users. To prevent lock-in to the Fern Definition format, you can export your API definition to OpenAPI 3.1 at any time [using the `fern export` command](/learn/cli-api-reference/cli-reference/general-commands#fern-export). The path argument is the **output file** to write. Use a `.yml` or `.json` extension to choose the format of the generated spec. #### terminal ```bash # Write the exported spec as YAML fern export path/to/openapi.yml # ...or as JSON fern export path/to/openapi.json ``` If you have multiple APIs defined in your `fern/apis/` folder, use `--api` to specify which API to export. #### terminal ```bash fern export --api public-api path/to/openapi.yml ``` > Export Fern Definition to OpenAPI 3.1 format using the fern export command. Prevent vendor lock-in and convert your API definitions easily.