API Documentation

Overview

The Ultimate File Conversion API allows you to convert files programmatically by sending a POST request with your file and parameters. Our API supports a wide range of conversion types including:

  • Model Conversions: TensorFlow SavedModel (ZIP) to ONNX, PyTorch (.pt) to ONNX/TFLite/TensorRT Engine/JSON, Keras (.h5) to TensorFlow SavedModel/TFLite/JSON/ONNX.
  • Data Conversions: CSV/Excel to JSON, JSON to CSV, YAML to JSON, JSON to YAML, Pickle to JSON, CSV/Excel to Parquet, HDF5 to CSV.
  • Document Conversions: Markdown to HTML, Jupyter Notebook (.ipynb) to HTML.
  • Media Conversions: Image Conversion, Video Conversion, Audio Conversion.

Note: For non-image conversions, files must be uploaded; URL input is allowed only for image conversion.

Authentication

To authenticate your requests, set your API key in the environment variable GOOGLE_API_KEY. This API key is required for all requests.

Example (using environment variable):

export GOOGLE_API_KEY=your_api_key_here

Endpoint

All file conversion requests should be sent to the following endpoint:

POST https://ultimateaiconverter.com/convert

Parameters

Your request must be sent as multipart/form-data with the following parameters:

  • model_file (file): The file to convert. For non-image conversions, URL input is disabled.
  • file_url (string): A URL pointing to an image file (only applicable when using Image Conversion). Data URLs are supported.
  • conversion_type (string): Specifies the conversion type. Supported conversion types include:
    • tf_to_onnx – TensorFlow SavedModel (ZIP) to ONNX
    • pt_to_onnx – PyTorch (.pt) to ONNX (requires dummy_input)
    • pt_to_tflite – PyTorch (.pt) to TFLite (requires dummy_input)
    • pt_to_engine – PyTorch (.pt) to TensorRT Engine (.engine) (requires dummy_input)
    • pt_to_json – PyTorch (.pt) to JSON
    • h5_to_savedmodel – Keras (.h5) to TensorFlow SavedModel
    • h5_to_tflite – Keras (.h5) to TFLite
    • h5_to_json – Keras (.h5) to JSON
    • h5_to_onxx – Keras (.h5) to ONNX
    • csv_to_json – CSV/Excel to JSON
    • json_to_csv – JSON to CSV
    • yaml_to_json – YAML to JSON
    • json_to_yaml – JSON to YAML
    • pickle_to_json – Pickle to JSON
    • csv_to_parquet – CSV/Excel to Parquet
    • hdf5_to_csv – HDF5 to CSV
    • md_to_html – Markdown to HTML
    • ipynb_to_html – Jupyter Notebook to HTML
    • image_conversion – Image Conversion
    • video_conversion – Video Conversion
    • audio_conversion – Audio Conversion
  • dummy_input (string): Required for pt_to_onnx, pt_to_tflite, pt_to_engine, and pt_to_json. Provide a comma-separated shape (e.g., 1,3,224,224).
  • target_format (string): Required for image_conversion. Specify the desired image format (e.g., JPEG, PNG, BMP, GIF, WEBP, TIFF, etc.).
  • target_video_format (string): Required for video_conversion. Specify the desired video format (e.g., MP4, AVI, MOV, MKV).
  • target_audio_format (string): Required for audio_conversion. Specify the desired audio format (e.g., MP3, WAV, FLAC, OGG, AAC).

Sample cURL Requests

Example 1: Convert a TensorFlow SavedModel (ZIP) to ONNX:

curl -X POST https://ultimateaiconverter.com/convert \
  -F "model_file=@/path/to/your/model.zip" \
  -F "conversion_type=tf_to_onnx"
        

Example 2: Convert a PyTorch model to ONNX:

curl -X POST https://ultimateaiconverter.com/convert \
  -F "model_file=@/path/to/your/model.pt" \
  -F "conversion_type=pt_to_onnx" \
  -F "dummy_input=1,3,224,224"
        

Example 3: Convert an image by URL (only for image conversion):

curl -X POST https://ultimateaiconverter.com/convert \
  -F "file_url=https://example.com/yourimage.png" \
  -F "conversion_type=image_conversion" \
  -F "target_format=JPEG"
        

Example 4: Convert an audio file (MP3 to WAV):

curl -X POST https://ultimateaiconverter.com/convert \
  -F "model_file=@/path/to/your/audio.mp3" \
  -F "conversion_type=audio_conversion" \
  -F "target_audio_format=wav"
        

FAQ

Question Answer
Do I need to provide an API key? Yes. Set your API key in the GOOGLE_API_KEY environment variable.
Can I convert files directly from a URL? URL input is only allowed for image conversion. For all other conversions, please upload your file.
What file formats are supported? Models: ZIP, .pt, .h5
Data: CSV, Excel (.xls, .xlsx), JSON, YAML, Pickle, HDF5
Documents: Markdown (.md), Jupyter Notebook (.ipynb), PDF, TXT
Images: JPEG, PNG, BMP, GIF, WEBP, TIFF, etc.
Media: Video (MP4, AVI, MOV, MKV), Audio (MP3, WAV, FLAC, OGG, AAC)
Which audio and video formats are supported? Audio: MP3, WAV, FLAC, OGG, AAC
Video: MP4, AVI, MOV, MKV
What are the file size limits? Image Conversion: Maximum 25 MB.
Video Conversion: Maximum 250 MB.

Additional Notes

  • The API endpoint expects a multipart/form-data POST request.
  • For best results, ensure your file is in the correct format as specified by the conversion type.
  • For image conversion, the maximum allowed file size is 25 MB. For video conversion, the limit is 250 MB.
  • If you encounter errors, please review the FAQ or contact support.
  • All conversions are processed on secure servers and temporary files are automatically cleaned up after each request.
Loading...