Prototypr Docs Logo Docs

Generate API Endpoints Documentation

The Premium endpoint in this doc has been created to support organizations with programmatically exporting generative ui data from prototypr.ai.

As a prototypr.ai customer, it is important to provide you with easy access to your data in a format that you can use. One interesting use case for this ui data would be to use it to fine tune a model towards your own individual or company branded style. If you would like to learn more about how you can fine tune your own UI generation model, please check out this prototypr.ai article: Fine Tuning AI Models: A Practical Guide for Beginners.

If you are not a Premium customer or member, you can still access any code you generate from within the AI Studio application interface. Simply click on the code icon and the copy the code to your clipboard.

Generate Endpoints

As a Premium prototypr.ai customer or member, you have access to the following APIs:

  • Get Generative UI Data

    Export generative UI outputs in a structured format suitable for model fine-tuning and development.

More customer facing APIs will be available soon! If you have any feedback or feature requests about these APIs, please take the time to fill out this short survey.

Get Generative UI Data PREMIUM

Purpose

Enable developers to be able to export their generative ui's from AI Studio in a format that supports fine tuning. The parameters that developers should use in support of fine tuning include 'ui_description' (input) and 'ui_output'.

Type of Request: POST

URL: https://www.prototypr.ai/api/v1/generate/get-ui-data

Headers

  • Authorization: Bearer ${TOKEN}
  • Content-Type: application/json
  • Accept: application/json

Request Body

  • user_id: String

    This is your prototypr.ai user_id

  • workspace_id: String

    This is your prototypr.ai workspace_id

Python Request

import requests
import os
import json

url = "https://www.prototypr.ai/api/v1/generate/get-ui-data"
payload = {
    "user_id": "your_user_id",
    "workspace_id": "your_workspace_id",
}
headers = {
    "Authorization": "Bearer " + os.getenv("API_KEY"),
    "Content-Type": "application/json",
    "Accept": "application/json"
}

response = requests.post(url, data=json.dumps(payload), headers=headers)
print(response.json())

Sample Response

{ "data": {
    "generative_ui":
      {
        "02d983f22cac4e1876dcd543e6a075fa":
         {
             "ai_model": "o1-mini",
             "timestamp": "2024-10-31 12:12:12",
             "ui_collection": "#dashboard",
             "ui_description": "a dashboard for a mobile app...",
             "ui_output": "{PROTOTYPE OUTPUT GOES HERE}",
             "ui_title": "App Analytics Dashboard"
         }
      },
    "request_log":
      {
        "request_count": "1",
        "request_id": "8e4249ed56d44f545597c4bf8f16b649",
        "service": "get-ui-data"
      }
  }
}

Rate Limits and API Usage Stats

Currently there are rate limits of 25 requests/day across all API endpoints. This will grow over time as prototypr.ai adds more endpoints.

If you need more, please feel free to connect with Gareth Cull, who is the creator of prototypr.ai.

As part of this API Service, prototypr.ai provides usage stats so that you can see how often your api key is being used.